Free Cheat-test Samples and Demo Questions Download
Adobe exams Adobe
Apple exams Apple
Avaya exams Avaya
Check Point exams Check Point
Cisco exams Cisco
Citrix exams Citrix
CIW exams CIW
CompTIA exams CompTIA
CWNP exams CWNP
EC-Council exams EC-Council
EMC exams EMC
Exin exams Exin
Fortinet exams Fortinet
GIAC exams GIAC
Hitachi exams Hitachi
HP exams HP
IBM exams IBM
Isaca exams Isaca
ISC exams ISC
ISEB exams ISEB
Juniper exams Juniper
LPI exams LPI
McAfee exams McAfee
Microsoft exams Microsoft
Oracle exams Oracle
PMI exams PMI
Riverbed exams Riverbed
SNIA exams SAP
Sun exams SAS
Symantec exams Symantec
VMware exams VMware
All certification exams

Microsoft 70-502(VB) Exam - Cheat-Test.com

Free 70-502(VB) Sample Questions:

Q: 1 You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You create a window for the application.
You need to ensure that the following requirements are met:
An array of strings is displayed by using a ListBox control in a two-column format.
The data in the ListBox control flows from left to right and from top to bottom.
What should you do?
A. Use a ListBox control defined in the following manner. <ListBox Name="myList"> <ListBox.ItemsPanel>
<ItemsPanelTemplate> <UniformGrid Columns="2"/> </ItemsPanelTemplate> </ListBox.ItemsPanel></ListBox> Use the following VB.net code to associate the array of strings to the ListBox control. myList.ItemsSource = arrayOfString
B. Use a ListBox control defined in the following manner. <ListBox Name="myList"> <ListBox.ItemsPanel>
<ItemsPanelTemplate> <StackPanel />
</ItemsPanelTemplate> </ListBox.ItemsPanel></ListBox> Use the following vb.net code to associate the array of strings to the ListBox control.
myList.ItemsSource = arrayOfString
C. Use a ListBox control defined in the following manner. <ListBox Name="myList"> <ListBox.ItemsPanel>
<ItemsPanelTemplate> <WrapPanel />
</ItemsPanelTemplate> </ListBox.ItemsPanel></ListBox> Use the following vb.net code to associate the array of strings to the ListBox control.
myListView.ItemsSource = arrayOfString
D. Use a ListBox control defined in the following manner. <ListBox Name="myList"> <ListBox.ItemsPanel>
<ItemsPanelTemplate> <Grid>
<Grid.ColumnDefinitions> <ColumnDefinition /> <ColumnDefinition /> </Grid.ColumnDefinitions> </Grid>
</ItemsPanelTemplate>
</ListBox.ItemsPanel></ListBox> Use the following vb.net code to associate the array of strings to the ListBox
control. myList.ItemsSource = arrayOfString
Answer: A

Q: 2 You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You plan to add a Button control and a StatusBar control to a window.
You need to ensure that the two controls meet the following requirements:
The StatusBar control sticks to the lower edge of the window.
The Button control has the minimum required size to display its content.
Which XAML code fragment should you use?
A. <DockPanel> <StatusBar DockPanel.Dock="Bottom">Information</StatusBar>
<Button>OK</Button></DockPanel>
B. <StackPanel> <Button>OK</Button> <StatusBar>Information</StatusBar></StackPanel>
C. <WrapPanel Orientation="Vertical"> <Button>OK</Button>
<StatusBar>Information</StatusBar></WrapPanel>
D. <DockPanel LastChildFill="False" > <WrapPanel DockPanel.Dock="Top" > <Button>OK</Button>
</WrapPanel> <StatusBar
DockPanel.Dock="Bottom">Information</StatusBar></DockPanel>
Answer: D

Q: 3 You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You write the following code segment (Line numbers are included for reference only).
01 Dim content As Object
02 Dim fileName As String = "theFile"
03 Using xamlFile As New FileStream(fileName ".xaml", _
04 FileMode.Open, FileAccess.Read)
06 content = TryCast(XamlReader.Load(xamlFile), Object)
07 End Using
08 Using container As Package = Package.Open(fileName ".xps", _
09 FileMode.Create)
10
11 End Using
You need to ensure that the following requirements are met:
The application converts an existing flow document into an XPS document.
The XPS document is generated by using the flow document format.
The XPS document has the minimum possible size.
Which code segment should you insert at line 10?
A. Using xpsDoc As New XpsDocument(container, _ CompressionOption.SuperFast) Dim rsm As
XpsSerializationManager = New _
System.Windows.Xps.XpsSerializationManager(New _ XpsPackagingPolicy(xpsDoc), False)
rsm.SaveAsXaml(paginator)End Using
B. Using xpsDoc As New XpsDocument(container, _ CompressionOption.SuperFast) Dim rsm As New
XpsSerializationManager(New _ XpsPackagingPolicy(xpsDoc),
False) rsm.Commit()End Using
C. Using xpsDoc As New XpsDocument(container, _ CompressionOption.Maximum) Dim rsm As New
XpsSerializationManager(New _ XpsPackagingPolicy(xpsDoc),
False) Dim paginator As DocumentPaginator = (CType(content, _
IDocumentPaginatorSource)).DocumentPaginator rsm.SaveAsXaml(paginator)End Using
D. Using xpsDoc As New XpsDocument(container, _ CompressionOption.SuperFast) Dim rsm As New
XpsSerializationManager(New _ XpsPackagingPolicy(xpsDoc),
False) Dim paginator As DocumentPaginator = (CType(content, _
IDocumentPaginatorSource)).DocumentPaginator rsm.SaveAsXaml(paginator)End Using
Answer: C

Q: 4 You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5. You add a window that displays a Button control. You need to ensure that the Button control displays an ellipse that occupies the entire button control area. Which code fragment should you use?
A. <Button MinHeight="20"> <VisualBrush> <VisualBrush.Visual> <Ellipse Width="12.5" Height="25" />
</VisualBrush.Visual> </VisualBrush></Button>
B. <Button MinHeight="20"> <Button.Background> <VisualBrush> <VisualBrush.Visual> <Ellipse
Width="12.5" Height="25" /> </VisualBrush.Visual>
</VisualBrush> </Button.Background></Button>
C. <Button MinHeight="20"> <GeometryDrawing> <GeometryDrawing.Pen> <Pen Thickness="1"
Brush="Black" /> </GeometryDrawing.Pen>
<GeometryDrawing.Geometry> <EllipseGeometry RadiusX="12.5" RadiusY="25" />
</GeometryDrawing.Geometry> </GeometryDrawing></Button>
D. <Button MinHeight="50"> <Button.Background> <DrawingBrush> <DrawingBrush.Drawing>
<GeometryDrawing> <GeometryDrawing.Pen>
<Pen Thickness="1" Brush="Black" /> </GeometryDrawing.Pen> <GeometryDrawing.Geometry>
<EllipseGeometry RadiusX="12.5"
RadiusY="25" /> </GeometryDrawing.Geometry> </GeometryDrawing> </DrawingBrush.Drawing>
</DrawingBrush>
</Button.Background></Button>
Answer: D

Q: 5 You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You plan to use the application to preview video files.
You write the following XAML code fragment.
01 <Window x:Class="myClass" xmlns=
"http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="myWindow" Height="300" Width="300">
02 <StackPanel Background="Black">
03
04 <StackPanel HorizontalAlignment="Center"
Orientation="Horizontal">
05 <Button Name="btnPlay" Margin="10" Content="Play" />
06 </StackPanel>
07
08 </StackPanel>
09 </Window>
You need to ensure that the application plays only the first 10 seconds of a video that you want to
preview.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
A. Insert the following XAML fragment at line 03. <MediaElement Name="myMediaElement" Stretch="Fill"
/>
B. Insert the following XAML fragment at line 03. <MediaElement Name="myMediaElement"
Source="MediaFileSelected.wmv" Stretch="Fill" />
C. Create the following method in the code-behind file. Public Sub PlayMedia(ByVal sender As Object,
_ByVal args As RoutedEventArgs)
myMediaElement.Play()End Sub
D. Insert the following XAML fragment at line 07. <StackPanel.Triggers> <EventTrigger
RoutedEvent="Button.Click" SourceName="btnPlay">
<EventTrigger.Actions> <BeginStoryboard Name= "myBegin"> <Storyboard SlipBehavior="Slip">
<MediaTimeline Source="MediaFileSelected.wmv"
Storyboard.TargetName="myMediaElement" BeginTime="0:0:0" Duration="0:0:10" /> </Storyboard>
</BeginStoryboard>
</EventTrigger.Actions> </EventTrigger></StackPanel.Triggers>
E. Insert the following XAML fragment at line 07. <StackPanel.Triggers> <EventTrigger
RoutedEvent="Button.Click" SourceName="btnPlay">
<EventTrigger.Actions> <BeginStoryboard Name= "myBegin"> <Storyboard SlipBehavior="Slip">
<MediaTimeline
Storyboard.TargetName="myMediaElement" BeginTime="0:0:0" Duration="0:0:10" /> </Storyboard>
</BeginStoryboard>
</EventTrigger.Actions> </EventTrigger></StackPanel.Triggers>
Answer: A, D

Q: 6 You have created a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5. The application, named EnterpriseApplication.exe, runs over the network.
You add the WindowSize parameter and the WindowPosition parameter to the Settings.settings file by
using the designer at the User Scope Level. The dimensions and position of the window are read from the user configuration file.
The application must retain the original window size and position for users executing the application.
You need to ensure that the following requirements are met:
The window dimensions for each user are saved in the user configuration file.
User settings persist when a user exits the application.
Which configuration setting should you use?
A. Private Sub OnClosing(ByVal sender As Object, ByVal e _As
System.ComponentModel.CancelEventArgs)My.Settings.Default.WindowPosition = New Point(Me.Left,
Me.Top)My.Settings.Default.WindowSize = New Size(Me.Width, Me.Height)My.Settings.Default.Save()End
Sub
B. Private Sub OnClosing(ByVal sender As Object, ByVal e As
_System.ComponentModel.CancelEventArgs)Dim appKey As RegistryKey =
_Registry.CurrentUser.CreateSubKey("Software\EnterpriseApplication")Dim settingsKey As RegistryKey =
_appKey.CreateSubKey("WindowSettings")Dim
windowPositionKey As RegistryKey = _settingsKey.CreateSubKey("WindowPosition")Dim windowSizeKey
As RegistryKey =
_settingsKey.CreateSubKey("WindowSize")windowPositionKey.SetValue("X",
Me.Left)windowPositionKey.SetValue("Y", Me.Top)windowSizeKey.SetValue("Width",
Me.Width)windowSizeKey.SetValue("Height", Me.Height)End Sub
C. Private Sub OnClosing(ByVal sender As Object, ByVal e As
_System.ComponentModel.CancelEventArgs)Dim doc As New
System.Xml.XmlDocument()doc.Load("EnterpriseApplication.exe.config")Dim nodePosition As
System.Xml.XmlNode =
_doc.SelectSingleNode("//setting[@name='WindowPosition']")nodePosition.ChildNodes(0).InnerText =
String.Format("{0},{1}", _Me.Left, Me.Top)Dim nodeSize
As System.Xml.XmlNode =
_doc.SelectSingleNode("//setting[@name='WindowSize']")nodeSize.ChildNodes(0).InnerText =
String.Format("{0},{1}", _Me.Width,
Me.Height)doc.Save("UserConfigDistractor2.exe.config")End Sub
D. Private Sub Window_Closing(ByVal sender As Object, ByVal e As _
System.ComponentModel.CancelEventArgs)Dim sw As New
StreamWriter("EnterpriseApplication.exe.config",
True)sw.WriteLine("<EnterpriseApplication.Properties.Settings>")sw.WriteLine("<setting
name=""WindowSize"" serializeAs=""String"">")sw.WriteLine(String.Format("<value>{0},{1}</value>",
Me.Width,
_Me.Height))sw.WriteLine("</setting>")sw.WriteLine("<setting name=""WindowPosition""
_serializeAs=""String"">")sw.WriteLine(String.Format("<value>{0},{1}</value>", Me.Left,
_Me.Top))sw.WriteLine("</setting>")sw.WriteLine("</UserConfigProblem.Properties.Settings>")sw.Close()End
Sub
Answer: A

Q: 7 You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You add a CommandBinding element to the Window element. The command has a keyboard gesture
CTRL+H. The Window contains the following MenuItem control.
<MenuItem Header="Highlight Content"
Command="local:CustomCommands.Highlight" />
You need to ensure that the MenuItem control is disabled and the command is not executable when the
focus shifts to a TextBox control that does not contain any text.
What should you do?
A. Set the IsEnabled property for the MenuItem control in the GotFocus event handler for the TextBox
controls.
B. Set the CanExecute property of the command to Highlight_CanExecute. Add the following method to the
code-behind file for the window. Private Sub
Highlight_CanExecute(ByVal sender As Object, _ ByVal e As CanExecuteRoutedEventArgs) Dim txtBox As
TextBox = CType(sender, TextBox) e.CanExecute =
(txtBox.Text.Length > 0)End Sub
C. Set the CanExecute property of the command to Highlight_CanExecute. Add the following method to the
code-behind file for the window. Private Sub
Highlight_CanExecute(ByVal sender As Object, _ ByVal e As CanExecuteRoutedEventArgs) Dim txtBox As
TextBox txtBox = CType(e.Source, TextBox)
e.CanExecute = (txtBox.Text.Length > 0)End Sub
D. Set the CanExecute property of the command to Highlight_CanExecute. Add the following method to the
code-behind file for the window. Private Sub
Highlight_CanExecute(ByVal sender As Object, _ ByVal e As CanExecuteRoutedEventArgs) Dim Menu As
MenuItem = CType(e.Source, MenuItem) Dim txtBox As
TextBox = CType(Menu.CommandTarget, TextBox) Menu.IsEnabled = (txtBox.Text.Length > 0)End Sub
Answer: C

Q: 8 You plan to create an application by using Microsoft .NET Framework 3.5 and Microsoft Visual Studio 2008.
You need to ensure that the application meets the following requirements:
The entire application user interface is designed by using XAML.
The application runs by default under the FullTrust permission set on the client computer.
Which type of application should you use?
A. Windows Service application
B. Windows Forms application
C. Windows Presentation Foundation application
D. Windows Presentation Foundation Browser application
Answer: C

Q: 9 You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
The application defines a BrowserWindow class. Each instance of the BrowserWindow class allows the user to browse a Web site in a separate window. When a new browser window is opened, the user is redirected to a predefined URL.
You write the following code segment.
01 Private Sub OpenNewWindow(ByVal sender As Object, _
02 ByVal e As RoutedEventArgs)
03 Dim newWindowThread As New Thread(New _
04 ThreadStart(AddressOf NewThreadProc))
05
06 newWindowThread.Start()
07 End Sub
08 Private Sub NewThreadProc()
09
10 End Sub
You need to ensure that the following requirements are met:
The main window of the application is not blocked when an additional browser window is created.
The application completes execution when the main window of the application is closed.
What should you do?
A. Insert the following code segment at line 05.
newWindowThread.SetApartmentState(ApartmentState.STA)newWindowThread.IsBackground = True Insert
the following code segment at line 09. Dim newWindow As New BrowserWindow()newWindow.Show()Dim app
As New Application()app.Run(newWindow)
B. Insert the following code segment at line 05. newWindowThread.IsBackground = True Insert the following
code segment at line 09.
newWindowThread.SetApartmentState(ApartmentState.STA)Dim newWindow As New
BrowserWindow()newWindow.Show()Dim app As New
Application()app.Run(newWindow)
C. Insert the following code segment at line 05.
newWindowThread.SetApartmentState(ApartmentState.STA)newWindowThread.IsBackground = False Insert
the following code segment at line 09. Dim newWindow As New
BrowserWindow()System.Windows.Threading.Dispatcher.Run()newWindow.Show()
D. Insert the following code segment at line 05.
newWindowThread.SetApartmentState(ApartmentState.STA)newWindowThread.IsBackground = True Insert
the following code segment at line 09. Dim newWindow As New
BrowserWindow()newWindow.Show()System.Windows.Threading.Dispatcher.Run()
Answer: D

Q: 10 You are creating a Windows Presentation Foundation browser application by using Microsoft .NET Framework 3.5.
The application contains a PageFunction class named CustomerPage.
You need to ensure that the CustomerPage page function can perform the following tasks:
Accept a customer ID in the form of a string.
Allow the user to update customer information on the page.
Return an instance of a Customer object with the updated information.
Which class definition should you use?
A. Partial Public Class CustomerPage Inherits PageFunction(Of String) Public Sub New(ByVal CustomerID As String) ... End SubEnd Class
B. Partial Public Class CustomerPage Inherits PageFunction(Of Customer) Public Sub New(ByVal CustomerID As String) ... End SubEnd Class
C. Partial Public Class CustomerPage Inherits PageFunction(Of String) Public Sub New() ... End Sub Private
Function ReturnCustomer(ByVal customerID As
String) _ As Customer ... End FunctionEnd Class
D. Partial Public Class CustomerPage Inherits PageFunction(Of Customer) Public Sub New() ... End Sub
Private Function ReturnCustomer(ByVal customerID As String) _ As Customer ... End FunctionEnd Class
Answer: B

Q: 11 You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5. The application contains a custom event handler. You need to ensure that the custom event handler always executes when the event occurs, even if the Handled property is set to true. What should you do?
A. Set the HandledEventsToo property to true in the event definition code segment.
B. Set the HandledEventsToo property to false in the event definition code segment.
C. Set the HandledEventsToo property to true in the event definition XAML code fragment.
D. Set the HandledEventsToo property to false in the event definition XAML code fragment.
Answer: A

Q: 12 You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You write the following code segment (Line numbers are included for reference only).
01 Dim content As Object
02 Dim fileName As String = "theFile"
03 Using xamlFile As New FileStream(fileName ".xaml", _
04 FileMode.Open, FileAccess.Read)
06 content = TryCast(XamlReader.Load(xamlFile), Object)
07 End Using
08 Using container As Package = Package.Open(fileName ".xps", _
09 FileMode.Create)
10
11 End Using
You need to ensure that the following requirements are met:
The application converts an existing flow document into an XPS document.
The XPS document is generated by using the flow document format.
The XPS document has the minimum possible size.
Which code segment should you insert at line 10?
A. Using xpsDoc As New XpsDocument(container, _ CompressionOption.SuperFast) Dim rsm As
XpsSerializationManager = New _
System.Windows.Xps.XpsSerializationManager(New _ XpsPackagingPolicy(xpsDoc), False)
rsm.SaveAsXaml(paginator)End Using
B. Using xpsDoc As New XpsDocument(container, _ CompressionOption.SuperFast) Dim rsm As New
XpsSerializationManager(New _ XpsPackagingPolicy(xpsDoc),
False) rsm.Commit()End Using
C. Using xpsDoc As New XpsDocument(container, _ CompressionOption.Maximum) Dim rsm As New
XpsSerializationManager(New _ XpsPackagingPolicy(xpsDoc),
False) Dim paginator As DocumentPaginator = (CType(content, _
IDocumentPaginatorSource)).DocumentPaginator rsm.SaveAsXaml(paginator)End Using
D. Using xpsDoc As New XpsDocument(container, _ CompressionOption.SuperFast) Dim rsm As New
XpsSerializationManager(New _ XpsPackagingPolicy(xpsDoc),
False) Dim paginator As DocumentPaginator = (CType(content, _
IDocumentPaginatorSource)).DocumentPaginator rsm.SaveAsXaml(paginator)End Using
Answer: C

Q: 13 You are creating a Windows Presentation Foundation application.
You create a window for the application. The application contains an audio file named
AudioFileToPlay.wav.
You need to ensure that the following requirements are met:
The audio file is played each time you click the client area of the window.
The window provides optimal performance when the audio file is being played.
What should you do?
A. Add the following XAML line of code to the window. <MediaElement Source="AudioFileToPlay.wav" />
B. Add the following code segment to the window constructor method in the code-behind file. Dim player As
New SoundPlayer()player.SoundLocation = "AudioFileToPlay.wav"player.Play()
C. Add the following code segment to the window MouseDown method in the code-behind file. Dim player
As New MediaElement()player.Source = New
Uri("AudioFileToPlay.wav", UriKind.Relative)player.LoadedBehavior = MediaState.Manualplayer.Play()
D. Add the following XAML code fragment to the window. <Window.Triggers> <EventTrigger
RoutedEvent="Window.MouseDown"> <EventTrigger.Actions>
<SoundPlayerAction Source="AudioFileToPlay.wav"/> </EventTrigger.Actions>
</EventTrigger></Window.Triggers>
Answer: D

Q: 14 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?
A. Dim uri As New Uri("/Data/song.mp3", UriKind.Relative)Dim sri As StreamResourceInfo =
Application.GetContentStream(uri)Dim stream As Stream = sri.Stream
B. Dim uri As New Uri("/Data/song.mp3", UriKind.Relative)Dim sri As StreamResourceInfo =
Application.LoadComponent(uri)Dim stream As Stream = sri.Stream
C. Dim uri As New Uri("/Data/song.mp3", UriKind.Relative)Dim sri As StreamResourceInfo =
Application.GetRemoteStream(uri)Dim stream As Stream = sri.Stream
D. Dim uri As New Uri("/Data/song.mp3", UriKind.Relative)Dim sri As StreamResourceInfo =
Application.GetResourceStream(uri)Dim stream As Stream = sri.Stream
Answer: D

Q: 15 You create a form by using Windows Presentation Foundation and Microsoft .NET Framework 3.5. The form contains a status bar. You plan to add a ProgressBar control to the status bar. You need to ensure that the ProgressBar control displays the progress of a task for which you cannot predict the completion time. Which code segment should you use?
A. progbar.IsIndeterminate = True
B. progbar.IsIndeterminate = False
C. progbar.HasAnimatedProperties = True
D. progbar.HasAnimatedProperties = False
Answer: A

Q: 16 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?
A. Protected Sub OnTextInput(ByVal sender As Object, _ByVal e As RoutedEventArgs)Dim service As
AnnotationService = _AnnotationService.GetService(fdpv)If
service Is Nothing ThenAnnotationStream = New FileStream("annotations.xml", _FileMode.Open,
FileAccess.ReadWrite)service = New
AnnotationService(fdpv)Dim store As AnnotationStore = _New
XmlStreamStore(AnnotationStream)service.Enable(store)End IfEnd SubPrivate Sub
OnClosing(ByVal sender As Object, _ByVal e As System.ComponentModel.CancelEventArgs)Dim service As
AnnotationService =
_AnnotationService.GetService(fdpv)If Not service Is Nothing AndAlso service.IsEnabled
Thenservice.Store.Flush()service.Disable()AnnotationStream.Close()End
IfEnd Sub
B. Protected Sub OnLoaded(ByVal sender As Object, _ByVal e As RoutedEventArgs)Dim service As
AnnotationService = _AnnotationService.GetService(fdpv)If
service Is Nothing ThenAnnotationStream = New FileStream("annotations.xml", _FileMode.Open,
FileAccess.ReadWrite)service = New
AnnotationService(fdpv)End IfEnd SubPrivate Sub OnClosing(ByVal sender As Object, _ByVal e As
System.ComponentModel.CancelEventArgs)Dim service As
AnnotationService = _AnnotationService.GetService(fdpv)If Not service Is Nothing AndAlso service.IsEnabled
Thenservice.Store.Flush()service.Disable()AnnotationStream.Close()End IfEnd Sub
C. Protected Sub OnLoaded(ByVal sender As Object, _ByVal e As RoutedEventArgs)Dim service As
AnnotationService = _AnnotationService.GetService(fdpv)If
service Is Nothing ThenAnnotationStream = New FileStream("annotations.xml", _FileMode.Open,
FileAccess.ReadWrite)service = New
AnnotationService(fdpv)Dim store As AnnotationStore = New
_XmlStreamStore(AnnotationStream)service.Enable(store)End IfEnd SubPrivate Sub
OnClosing(ByVal sender As Object, _ByVal e As System.ComponentModel.CancelEventArgs)Dim service As
AnnotationService =
_AnnotationService.GetService(fdpv)If Not service Is Nothing AndAlso service.IsEnabled
Thenservice.Store.Flush()service.Disable()AnnotationStream.Close()End
IfEnd Sub
D. Protected Sub OnLoaded(ByVal sender As Object, _ByVal e As RoutedEventArgs)Dim service As
AnnotationService = _AnnotationService.GetService(fdpv)If
service Is Nothing ThenAnnotationStream = New FileStream("annotations.xml", _FileMode.Open,
FileAccess.ReadWrite)service = New
AnnotationService(fdpv)Dim store As AnnotationStore = New
_XmlStreamStore(AnnotationStream)service.Enable(store)End IfEnd SubPrivate Sub
OnClosing(ByVal sender As Object, _ByVal e As System.ComponentModel.CancelEventArgs)Dim service As
AnnotationService =
_AnnotationService.GetService(fdpv)If Not service Is Nothing AndAlso service.IsEnabled
Thenservice.Disable()AnnotationStream.Close()End IfEnd Sub
Answer: C

Q: 17 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?
A. <OrthographicCamera Position="0,0,2" LookDirection="0,2,-1" />
B. <OrthographicCamera Position="0,0,2" LookDirection="0,0,-1" />
C. <PerspectiveCamera Position="0,0,2" LookDirection="0,2,-1" FieldOfView="60" />
D. <PerspectiveCamera Position="0,0,2" LookDirection="0,0,-1" FieldOfView="60" />
Answer: B

Q: 18 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?
A. <Image Source="imageToDisplay.jpg" Stretch="None" />
B. <Image Source="imageToDisplay.jpg" Stretch="Fill" />
C. <Image Source="imageToDisplay.jpg" Stretch="Uniform" />
D. <Image Source="imageToDisplay.jpg" Stretch="UniformToFill" />
Answer: C

Q: 19 You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
The application will display articles that contain photographs, geometric figures, and other rich content.
You plan to format the articles in flow documents.
You need to select a XAML element that provides the following functionality by default:
Searches the content of any article.
Views any article in single-page and multiple-page layouts.
Adjusts the font size of the content.
What should you do?
A. Encapsulate the articles in a <RichTextBox></RichTextBox> XAML element.
B. Encapsulate the articles in a <FlowDocumentReader></FlowDocumentReader> XAML element.
C. Encapsulate the articles in a <FlowDocumentPageViewer></FlowDocumentPageViewer> XAML element.
D. Encapsulate the articles in a <FlowDocumentScrollViewer></FlowDocumentScrollViewer> XAML element.
Answer: B

Q: 20 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?
A. <Rectangle.RenderTransform> <TranslateTransform X="45" Y="45" /></Rectangle.RenderTransform>
B. <RectangleGeometry.Transform> <RotateTransform CenterX="40" CenterY="70" Angle="45" /></RectangleGeometry.Transform>
C. <Rectangle.RenderTransform> <SkewTransform CenterX="25" CenterY="25" AngleX="0" AngleY="45" /></Rectangle.RenderTransform>
D. <Rectangle.RenderTransform> <ScaleTransform CenterX="0" CenterY="0" ScaleX="45" ScaleY="45" /></Rectangle.RenderTransform>
Answer: B


© 2014 Cheat-Test.com, All Rights Reserved