Microsoft TS: Windows Applications Development with Microsoft .NET Framework 4 (70-511) Free Practice Test
Question 1
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
The application has multiple data entry windows. Each window contains controls that allow the user to type different addresses for shipping and mailing. All addresses have the same format.
You need to ensure that you can reuse the controls.
What should you create?
The application has multiple data entry windows. Each window contains controls that allow the user to type different addresses for shipping and mailing. All addresses have the same format.
You need to ensure that you can reuse the controls.
What should you create?
Correct Answer: A
Question 2
You have a method named Method1. Method1 accepts a string parameter named param1. Method1 performs a complex operation on param1.
You load an array of strings to a variable named array 1. The array contains 1,000 items.
You need to ensure that other methods that call Method1 can use multiple processor cores when they execute.
Which code segment should you use?
You load an array of strings to a variable named array 1. The array contains 1,000 items.
You need to ensure that other methods that call Method1 can use multiple processor cores when they execute.
Which code segment should you use?
Correct Answer: B
Question 3
You use Microsoft .NET Framework 4 to create a Windows Presentation Framework (WPF) application.
You plan to create a custom control that contains four text input fields. Each of the text input fields within the control will contain a label.
You need to ensure that the text input fields within the control can be validated by using a regular expression Validator.
Which class should you inherit from?
You plan to create a custom control that contains four text input fields. Each of the text input fields within the control will contain a label.
You need to ensure that the text input fields within the control can be validated by using a regular expression Validator.
Which class should you inherit from?
Correct Answer: D
Question 4
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: D
Question 5
You are developing a Windows Presentation Foundation (WPF) application.
You are implementing a test strategy for the application.
You need to ensure that the test class can repeat user input.
From which base class should the test class inherit?
You are implementing a test strategy for the application.
You need to ensure that the test class can repeat user input.
From which base class should the test class inherit?
Correct Answer: C
Question 6
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
You add a ListBox control to the application. The ListBox control is data-bound to an instance of a custom collection class of the Product objects named ProductList.
You need to ensure that changes to ProductList are automatically reflected in the ListBox control.
What should you do?
You add a ListBox control to the application. The ListBox control is data-bound to an instance of a custom collection class of the Product objects named ProductList.
You need to ensure that changes to ProductList are automatically reflected in the ListBox control.
What should you do?
Correct Answer: D
Question 7
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.
void playCommand_Executed(object sender, RoutedEventArgs e) {
mediaElementl.Play();
} 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.
void playCommand_Executed(object sender, RoutedEventArgs e) {
mediaElementl.Play();
} 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: B
Question 8
You are developing a Windows Presentation Foundation (WPF) application with the following class. (Line numbers are included for reference only

The UI is not being updated when the Data property is set.
You need to ensure that the DisplayData class correctly updates the UI when the Data property is set.
What should you do?

The UI is not being updated when the Data property is set.
You need to ensure that the DisplayData class correctly updates the UI when the Data property is set.
What should you do?
Correct Answer: D
Question 9
You are developing a Windows Presentation Foundation (WPF) application. This application will be used to display customer data to customer service representatives.
Phone numbers are stored as ten-digit numbers in the database. The markup is as follows.
<TextBlock Text="{Binding Path=PhoneNumber,
ConvertersStaticResource PhoneFormatConverter}}" />
You need to ensure that phone numbers are displayed in the following format: (###) ### ####
Which markup segment should you use?
Phone numbers are stored as ten-digit numbers in the database. The markup is as follows.
<TextBlock Text="{Binding Path=PhoneNumber,
ConvertersStaticResource PhoneFormatConverter}}" />
You need to ensure that phone numbers are displayed in the following format: (###) ### ####
Which markup segment should you use?
Correct Answer: D
Question 10
You are developing a Windows Presentation Foundation (WPF) application. The application contains a converter named DateOutputConverter that formats dates.
The window is defined as follows. (Line numbers are included for reference only.)

The window must display the OrderDate value found in shippedOrder. The text box must display the OrderDate formatted by the DateOutputConverter.
You need to ensure that the OrderDate is displayed and formatted correctly.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
The window is defined as follows. (Line numbers are included for reference only.)

The window must display the OrderDate value found in shippedOrder. The text box must display the OrderDate formatted by the DateOutputConverter.
You need to ensure that the OrderDate is displayed and formatted correctly.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
Correct Answer: A,D
Question 11
You are developing a user control for a Windows Presentation Foundation (WPF) application.
The user control contains a button. Both the user control and the hosting control must receive the button click event.
You need to ensure that the user control responds to the button click event before the hosting control responds to the event.
What should you do?
The user control contains a button. Both the user control and the hosting control must receive the button click event.
You need to ensure that the user control responds to the button click event before the hosting control responds to the event.
What should you do?
Correct Answer: B
Question 12
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a
Windows Presentation Foundation (WPF) application.
You write the following code fragment.
< TextBox Text="{Binding Path=StringMember} " / >
You need to ensure that the StringMember property of the data-bound object is updated
immediately when the user types in the TextBox control.
Which binding expression should you use?
Windows Presentation Foundation (WPF) application.
You write the following code fragment.
< TextBox Text="{Binding Path=StringMember} " / >
You need to ensure that the StringMember property of the data-bound object is updated
immediately when the user types in the TextBox control.
Which binding expression should you use?
Correct Answer: D
Question 13
You are developing a Windows Presentation Foundation (WPF) application that displays pricing and inventory Information.
A list box's ItemsSource property has decimal and string types. Decimals represent price and strings represent messages such as "Discontinued"
The following markup is defined as follows. (Line numbers are included for reference only.)

You need to ensure that data templates are used to format the strings without changes and the decimals as currency.
Which markup segment should you insert at line 05?
A list box's ItemsSource property has decimal and string types. Decimals represent price and strings represent messages such as "Discontinued"
The following markup is defined as follows. (Line numbers are included for reference only.)

You need to ensure that data templates are used to format the strings without changes and the decimals as currency.
Which markup segment should you insert at line 05?
Correct Answer: A