PrepAway - Latest Free Exam Questions & Answers

Category: 70-502

Exam 70-502: TS: Microsoft .NET Framework 3.5, Windows Presentation Foundation Application Development

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 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 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?


Page 7 of 9« First...56789