What should you do?
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?
Which code fragment should you insert at line 06?
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<StackPanel>
02<StackPanel.Resources>
03<ControlTemplate
04TargetType=”{x:Type Button}”
05x:Key=”btn”>
06 07</ControlTemplate>
08</StackPanel.Resources>
09<Button Content=”Save” 10Template=”{StaticResource btn}” />
11<Button Template=”{StaticResource btn}”>
12<TextBox Text=”Save” />
13</Button>
14</StackPanel>
You need to ensure that both Button controls display the “Save” text.
Which code fragment should you insert at line 06?
Which code fragment should you use?
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?
Which code fragment should you insert at line 06?
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<Page xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation”
02xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”
03x:Class=”MyCompany.MediaConrols” >
04<StackPanel Background=”Black”>
05<StackPanel HorizontalAlignment=”Center” Width=”450″ Orientation=”Horizontal”>
06
07<!– Play button. –>
08<Image Source=”images\UI_play.gif” MouseDown=”OnMouseDownPlayMedia” Margin=”5″ />
09<!– Pause button. –>
10<Image Source=”images\UI_pause.gif” MouseDown=”OnMouseDownPauseMedia” Margin=”5″ />
11<!– Stop button. –>
12<Image Source=”images\UI_stop.gif” MouseDown=”OnMouseDownStopMedia” Margin=”5″ />
13</StackPanel>
14</StackPanel>
15</Page>
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?
Which code fragment should you use?
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?
Which code fragment should you insert at line 04?
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<Canvas>
02<Rectangle Stroke=”Red” StrokeThickness=”5″ Height=”60″
03Width=”60″ Canvas.Left=”100″ Canvas.Top=”100″>
04
05</Rectangle>
06</Canvas>
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?
What should you create?
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?
Which class should you inherit from?
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?
What should you do?
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<Canvas>
02
03<Button>
04
05</Button>
06</Canvas>
You need to ensure that saveCommand is executed when the user clicks the Button control.
What should you do?
What should you do?
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
You create a game where a ball drops from the top to the bottom of a window.
You plan to create a single animation for the game.
You need to ensure that the animation shows the ball bounce.
What should you do?