Which code segment should you use?
You create a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
The application tracks stock prices in real time. You need to bind a label to the Price property of the Stock class. You also need to ensure that the label reflects any change in the Price property.
Which code segment should you use?
Which two tasks should you perform?
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
The XAML page for the application will display employee information from an XML file. The following code fragment is an excerpt from the XML file.
<Employee>
<Manager FirstName="Adam" LastName="Barr" Photo="E1.jpg"/>
<Engineer FirstName="Mu" LastName="Han" Photo="E2.jpg"/>
…
</Employee>
The file is exposed as a resource named employees.
You add the following templates under the Window.Resources element.
<DataTemplate x:Key="Manager">
<Image Source="{Binding XPath=@Photo}" Height="50"/>
</DataTemplate>
<DataTemplate x:Key="Engineer">
<Image Source="{Binding XPath=@Photo}" Height="40"/>
</DataTemplate>
You need to ensure that the selection of templates is dependent on the XML element being rendered.
Which two tasks should you perform? (Each correct answer presents part of the solution.)
Which code segments should you insert at lines 03 and 05?
You are creating Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
The application has a TreeView class that builds the directory tree for a given directory. You write the following class that represents a directory.
class Folder
{
public readonly string Name
{
get { … ;}
}
public readonly List<Folder> Subfolders
{
get { … ;}
}
}
You write the following code segment.
(Line numbers are included for reference only.)
01 TreeView tree = new TreeView() ;
02 Folder folder = new Folder("C:");
03
04 FrameworkElementFactory labelFactory = new FrameworkElementFactory(typeof(TextBlock)) ;
05
06 template.VisualTree = labelFactory ;
07 tree.ItemTemplate = template;
08 tree.ItemsSource = folder.Subfolders;
You need to ensure that the TreeView class displays nodes that correspond to the child folders of the C: drive.
Which code segments should you insert at lines 03 and 05?
Which event should you implement?
You create a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You deploy the application on client computers by using the ClickOnce technology. You need to ensure that the application downloads an assembly to a client computer only if the assembly is required.
Which event should you implement?
Which command should you use?
Your team is creating a Windows Presentation Foundation (WPF) application by using Microsoft .NET Framework 3.5.
You plan to deploy the application by using the ClickOnce technology. You need to ensure that the application can be used even when network access is unavailable.
Which command should you use?
Which XAML code fragment should you use?
You create a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
The application includes a window that displays a rectangle.
You need to transform the rectangle by rotating it 45 degrees.
Which XAML code fragment should you use?
Which code fragment should you use?
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You create a window for the application. You add an image to the window.
You need to ensure that the following requirements are met:
* The image is scaled to completely fit the client area of the window.
* The image aspect ratio is preserved.
* The entire image is displayed within the window.
Which code fragment should you use?
Which XAML code fragment should you use?
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You add a window that displays three-dimensional graphics.
You need to create a camera that meets the following requirements:
* It displays a graphic by excluding the Z-dimension.
* It focuses directly on the front portion of the graphic.
Which XAML code fragment should you use?
Which code segment should you use?
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
The application will display documents by using an instance of the FlowDocumentPageViewer class. The instance is named fdpv.
Users can highlight and annotate the content of the documents. You need to ensure that annotations made to a document are saved and rendered when the document is displayed again.
Which code segment should you use?
Which code segment should you use?
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
Your project contains a folder named Data. You add a .MP3 file named song.mp3 in the Data folder.
You set the Build Action property of the application to Resource. You need to access the .MP3 file from one of the application classes.
Which code segment should you use?