1.
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
You add a custom command as a resource. The key of the command is saveCommand. You write the following code fragment. (Line numbers are included for reference only.)
01.
02.
03.
06.

You need to ensure that saveCommand is executed when the user clicks the Button control. What should you do?
2.
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?
3.
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?
4.
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
You write the following code fragment. (Line numbers are included for reference only.)
01.
02. 03. Width="60" Canvas.Left="100" Canvas.Top="100">
04.
05.

06.

You need to rotate the rectangle by 45 degrees by using its upper-left corner as the axis. Which code
fragment should you insert at line 04?
5.
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
The application has a window with a canvas element. You need to draw a black line that has rounded edges at each end. Which code fragment should you use?
6.
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
You write the following code fragment. (Line numbers are included for reference only.)
01. 02. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
03. x:Class="MyCompany.MediaConrols" >
04.
05. Orientation="Horizontal">
06.
07.
08. MouseDown="OnMouseDownPlayMedia" Margin="5" />
09.
10. MouseDown="OnMouseDownPauseMedia" Margin="5" />
11.
12. MouseDown="OnMouseDownStopMedia" Margin="5" />
13.

14.

15.

You need to ensure that a video file begins to play only when a user clicks Play. Which code fragment should you insert at line 06?
7.
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application that displays a high-resolution graphic image named Image1.jpg. You need to limit the width of the image to 200 pixels. You also need to preserve the aspect ratio of the image. Which code fragment should you use?
8.
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
You write the following code fragment. (Line numbers are included for reference only.)
01.
02.
03. 04. TargetType="{x:Type Button}"
05. x:Key="btn">
06.
07.

08.

09.
14.

You need to ensure that both Button controls display the "Save" text. Which code fragment should you insert at
line 06?
9.
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
You create a Button control for the application. You need to ensure that the application meets the following requirements:
When the mouse pointer is over the Button control, the background color of the button is set to red and the Button control appears bigger.
When the mouse pointer is not over the Button control, the button returns to its original state.
What should you do?
10.
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
The application contains a set of Button controls. You need to ensure that a button is highlighted when the mouse pointer is located over a button that contains no content. Which code fragment should you use?