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?
A. RoutedCommand playCommand = new RoutedCommand(); playCommand.CanExecuteChanged += new EventHandler(playCommand_Executed); this.CommandBindings.Add(new CommandBinding(playCommand));You are developing a Windows Presentation Foundation (WPF) application that plays video clips. The markup is as follows.

You need to ensure that the current running time of the video is automatically updated and displayed in CurrentRunTime. What should you do?
A. Register for the myMediaTimeline Changed event and add the following line in the event handler. CurrentRunTime.Text = myMediaElement.Clock.ToString()You are developing a Windows Presentation Foundation (WPF) application. The main window of the application is defined by the following markup.
Quarter K/TextBlock>
Quarter 2
50000
150000
When the application is run, it appears as follows.

You need to ensure that the TextBlock control with the contents "Products Shipped" is horizontally centered on the Grid control. Which markup segment should you add to the TextBlock control?
A. GridVleu.ColumnCollection="l, 2"You have an App.xaml file that contains the following markup:

You need to create a TextBlock named txtBlock1 that uses PageTitleStyle. Which code should you use?
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
You add a property named ServiceContext to a control.
You need the value of ServiceContext to flow to the child controls exactly like the value of the DataContext property of the FrameworkElement class.
What should you do?
A. Inherit the control class from the Dependency-Object class.You are developing a Windows Presentation Foundation (WPF) application. The application contains the following code in the code-behind file for an application window.
(Line numbers are included for reference only.)
01 StackPanel stack = new StackPanel () ;
02 Content = stack;
03 for (int i=0; i<10; i++)
04 {
05 Button btn = new Buttonf();
06 btn.Name = ((char) ('A' + i)) .ToString ();
07 btn.Content = btn.Name + "says 'Click me' "; 08
09 }
You need to ensure that all of the Button controls that are defined in this code segment appear in the application window.
Which code segment should you insert at line 08?
A. stack.Children.Add(btn);You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
You add a TreeView control to show the hierarchical structure of orders and order details. Each order contains an ObservableCollection named OrderDetails.
You write the following code fragment. (Line numbers are included for reference only.)

You need to ensure that the TreeView control meets the following requirements:

Each order is shown as a TreeView node.

The order nodes have order detail nodes as children.

The order detail nodes have no children. Which code fragment should you insert at line 07?
Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only Microsoft exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your 70-511 exam preparations and Microsoft certification application, do not hesitate to visit our Vcedump.com to find your solutions here.