Microsoft TS: Windows Applications Development with Microsoft .NET Framework 4 - 070-511 Exam Practice Test
You are developing a Windows Presentation Foundation (WPF) application.
The application is bound to a data source.
You need to ensure that the style of controls is bound to values retrieved from the data source.
What should you do?
The application is bound to a data source.
You need to ensure that the style of controls is bound to values retrieved from the data source.
What should you do?
Correct Answer: C
Vote an answer
You are developing an XBAP application for your company intranet. During several development iterations, you manually copy the working executable, application, and deployment manifest files to the test Web server. You create an HTML file that has a hyperlink to the deployment manifest that you use for testing. During the next iteration, you enhance the XBAP application by making changes to the application.
When you use the hyperlink to the deployment manifest to test the deployment, you do not see the changes.
You need to ensure that the changes you make are visible when you test the deployment from your machine.
What should you do?
When you use the hyperlink to the deployment manifest to test the deployment, you do not see the changes.
You need to ensure that the changes you make are visible when you test the deployment from your machine.
What should you do?
Correct Answer: D
Vote an answer
You are developing a Windows Presentation Foundation (WPF) application.
You build a dictionary that implements INotifyPropertyChanged. You want to use an indexer to bind to the UI. The relevantimplementation of the dictionary is as follows. (Line numbers are included for reference only.)

You need to ensure that the PropertyChanged event is triggered so that the UI is updated if you modify the collection using theindexer.
Which code should you insert at line 17?
You build a dictionary that implements INotifyPropertyChanged. You want to use an indexer to bind to the UI. The relevantimplementation of the dictionary is as follows. (Line numbers are included for reference only.)

You need to ensure that the PropertyChanged event is triggered so that the UI is updated if you modify the collection using theindexer.
Which code should you insert at line 17?
Correct Answer: B
Vote an answer
You are developing a Windows Presentation Foundation (WPF) application.
The application contains stylized body text and heading test. The heading text is a slight variation of the body text.
You need to ensure that if the body text changes, the heading text automatically inherits those changes.
What should you do?
The application contains stylized body text and heading test. The heading text is a slight variation of the body text.
You need to ensure that if the body text changes, the heading text automatically inherits those changes.
What should you do?
Correct Answer: A
Vote an answer
You are developing a Windows Presentation Foundation (WPF) application.
You need to display HTML content from a Web page on the WPF form.
What should you do?
You need to display HTML content from a Web page on the WPF form.
What should you do?
Correct Answer: C
Vote an answer
You are developing a Windows Presentation Foundation (WPF) application. You use the following markup segment to add a Button control to the design surface of the MainWindow.xaml file.

You add the following code segment to the code-behind file for MainWindow.

The application will be deployed in an environment that requires alternate key mappings.
You need to remove the CTRL+ C input gesture and replace it with the ALT+ C input
gesture.
What should you do?


You add the following code segment to the code-behind file for MainWindow.

The application will be deployed in an environment that requires alternate key mappings.
You need to remove the CTRL+ C input gesture and replace it with the ALT+ C input
gesture.
What should you do?

Correct Answer: A
Vote an answer
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. The application contains the following code fragment.
<StackPanel>
<TextBlock Style="{StaticResource HyStyle)">Hello World</TextBlock>
<Button Style="{StaticResource HyStyle}">Ok</Button>
</StackPonel>
You need to define a style that applies the following properties to the text in the StackPanel object:
- FontSize = 32
- FontWeight = Bold
Which code fragment should you use?
<StackPanel>
<TextBlock Style="{StaticResource HyStyle)">Hello World</TextBlock>
<Button Style="{StaticResource HyStyle}">Ok</Button>
</StackPonel>
You need to define a style that applies the following properties to the text in the StackPanel object:
- FontSize = 32
- FontWeight = Bold
Which code fragment should you use?
Correct Answer: A
Vote an answer
You are developing a Windows Presentation Foundation (WPF) application. A TextBlock control has DataContext bound to a static resource named Book. The ToolTip attribute of TextBlock displays the full book titles.
You create a converter named TrimTitleConverter to shorten the book titles to three words in the Text attribute of the TextBox. You add the converter to the Resources section of the MainWindow.xaml file as follows. (Line numbers are included for reference only.)

You need to ensure that the shortened book titles appear only in the Text attribute of TextBlock.
Which markup segment should you use to replace lines 06 through 09?
You create a converter named TrimTitleConverter to shorten the book titles to three words in the Text attribute of the TextBox. You add the converter to the Resources section of the MainWindow.xaml file as follows. (Line numbers are included for reference only.)

You need to ensure that the shortened book titles appear only in the Text attribute of TextBlock.
Which markup segment should you use to replace lines 06 through 09?
Correct Answer: B
Vote an answer
You are developing a Windows Presentation Foundation (WPF) application. All of the application styles are in a file named Themes.dll. You have the following markup segment.
<Border Style="{StaticResource BlueBackground)" Height="100" Width="200"> </Border>
BlueBackground is defined in a XAML file named BlueTheme.xaml. The XAML markup is compiled into the Themes.dll file.
You need to ensure that the XAML file is referenced so that the application can apply the settings in the BlueBackground style.
What should you do?
<Border Style="{StaticResource BlueBackground)" Height="100" Width="200"> </Border>
BlueBackground is defined in a XAML file named BlueTheme.xaml. The XAML markup is compiled into the Themes.dll file.
You need to ensure that the XAML file is referenced so that the application can apply the settings in the BlueBackground style.
What should you do?
Correct Answer: C
Vote an answer
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
The application uses the drag-and-drop functionality.
You need to identify which enumeration member must be used to meet the following requirements:
---
Ensure that the data from the drag source can be copied. Ensure that the data from the drag source can be moved. Ensure that the target can be scrolled while you are dragging.
Which enumeration member should you identify?
The application uses the drag-and-drop functionality.
You need to identify which enumeration member must be used to meet the following requirements:
---
Ensure that the data from the drag source can be copied. Ensure that the data from the drag source can be moved. Ensure that the target can be scrolled while you are dragging.
Which enumeration member should you identify?
Correct Answer: C
Vote an answer
You are developing a Windows Presentation Foundation (WPF) application.
You build a dictionary that implements INotifyPropertyChanged. You want to use an indexer to bind to the UI. The relevantimplementation of the dictionary is as follows. (Line numbers are included for reference only.)

You need to ensure that the PropertyChanged event is triggered so that the UI is updated if you modify the collection using theindexer.
Which code should you insert at line 17?

You build a dictionary that implements INotifyPropertyChanged. You want to use an indexer to bind to the UI. The relevantimplementation of the dictionary is as follows. (Line numbers are included for reference only.)

You need to ensure that the PropertyChanged event is triggered so that the UI is updated if you modify the collection using theindexer.
Which code should you insert at line 17?

Correct Answer: B
Vote an answer
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
You write the following code fragment.
<StackPanel TextBox.PceviewTextInput="StackPanel_PreviewTextInput">
<TextBox Name="TxtBoxA"/>
<TextBox Name="TxtBoxB"/>
<TextBox Naroe="TxtBoxC"/>
</StackPanel>
You create an event handler named StackPanel_PreviewTextInput. You also have a collection of strings named Keywords.
You need to ensure that TxtBoxA and TxtBoxB do not contain any of the strings in the Keywords collections.
Which code segment should you use?
You write the following code fragment.
<StackPanel TextBox.PceviewTextInput="StackPanel_PreviewTextInput">
<TextBox Name="TxtBoxA"/>
<TextBox Name="TxtBoxB"/>
<TextBox Naroe="TxtBoxC"/>
</StackPanel>
You create an event handler named StackPanel_PreviewTextInput. You also have a collection of strings named Keywords.
You need to ensure that TxtBoxA and TxtBoxB do not contain any of the strings in the Keywords collections.
Which code segment should you use?
Correct Answer: C
Vote an answer
You are developing a Windows Presentation Foundation (WPF) application.
The application's main window lists a series of controls horizontally until a control reaches the edge of the window. At that point, the series of controls continues on a new line. You need to ensure that this layout persists when the user changes the size of the window. What should you do?
The application's main window lists a series of controls horizontally until a control reaches the edge of the window. At that point, the series of controls continues on a new line. You need to ensure that this layout persists when the user changes the size of the window. What should you do?
Correct Answer: C
Vote an answer
You are developing a Windows Presentation Foundation (WPF) application to play audio files. You add a MediaElement control named mediaElementl and a Button control named btnPlayAudio to the design surface. The MediaElement control Source attribute is set to an audio file. The LoadedBehavior attribute is set to Manual.
You add the following code to the main window.
Sub playCoinroand_Executed (ByVal sender As Object,
ByVal e As RoutedEventArgs)
MediaElenient 1.Play ()
End Sub
You set the command of the button to MediaCommands.Play.
You need to ensure that the application will play the audio file when the button is pressed.
What should you add to the constructor of the main window?
You add the following code to the main window.
Sub playCoinroand_Executed (ByVal sender As Object,
ByVal e As RoutedEventArgs)
MediaElenient 1.Play ()
End Sub
You set the command of the button to MediaCommands.Play.
You need to ensure that the application will play the audio file when the button is pressed.
What should you add to the constructor of the main window?
Correct Answer: A
Vote an answer