PrepAway - Latest Free Exam Questions & Answers

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?

PrepAway - Latest Free Exam Questions & Answers

A.
<MediaElement Source=”media\numbers.wmv” Name=”myMediaElement” Width=”450″ Height=”250″
LoadedBehavior=”Play” UnloadedBehavior=”Stop” Stretch=”Fill”/>

B.
<MediaElement Source=”media\numbers.wmv” Name=”myMediaElement” Width=”450″ Height=”250″
LoadedBehavior=”Manual” UnloadedBehavior=”Stop” Stretch=”Fill”/>

C.
<MediaPlayer Source=”media\numbers.wmv” Name=”myMediaElement” Width=”450″ Height=”250″
LoadedBehavior=”Play” UnloadedBehavior=”Stop” Stretch=”Fill”/>

D.
<MediaPlayer Source=”media\numbers.wmv” Name=”myMediaElement” Width=”450″ Height=”250″
LoadedBehavior=”Manual” UnloadedBehavior=”Stop” Stretch=”Fill”/>


Leave a Reply