Unabridged Pass4sure Microsoft 70-511 PDF Dumps Free Download (171-180)

QUESTION 171
You use Microsoft .NET Framework to create a Windows Presentation Foundation (WPF) application. You create a window that contains a Button control and a MenuItem control. Both controls are labeled "Add sugar." The Command properties of the Button and MenuItem controls are set to the same RoutedCommand named AddSugarCommand.
You write the following code segment.
Private Sub CanAddSugar(sender As Object, e As CanExecuteRoutedEventArgs) …
End Sub
You need to ensure that when the CanAddSugar method sets e.CanExecute to false, the MenuItem and Button controls are disabled.
What should you do?

A.    Create an event handler for the CanExecuteChanged event of the AddSugarCommand command.
Call the CanAddSugar method from within the event handler.
B.    Inherit the AddSugarCommand from the RoutedUICommand class instead of the RoutedCommand class.
Call the CanAddSugar method from within the constructor of the AddSugarCommand command.
C.    Add a CommandBinding object to the CommandBinding property of the MenuItem control.
Set the CanExecute property of the CommandBinding object to the CanAddSugar method.
D.    Add a CommandBinding object to the CommandBindings property of the window.
Set the Command property of CommandBinding to the AddSugarCommand command.
Set the CanExecute property of the CommandBinding object to the CanAddSugar method.

Answer: D

QUESTION 172
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)
1721
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?

A.    < MediaElement Source="media\ numbers.wmv " Name=" myMediaElement " Width="450" Height="250"
LoadedBehavior ="Play" UnloadedBehavior ="Stop" Stretch=’Till,,/>
B.    < MediaElement Source="media\ numbers.wmv " Name=" myMediaElement " Width="450" Height="250"
LoadedBehavior ="Manual" UnloadedBehavior -"Stop" Stretch?quot;Fil";>;
C.    < MediaPlayer Source="media\ numbers.wmv " Name=" myMediaElement " Width=,f450" Height="250"
LoadedBehavior ="Play" UnloadedBehavior ="Stop" Stretch="FillM/>
D.    < MediaPlayer Source="media\ numbers.wmv " Name=" myMediaElement " Width="450" Height="250"
LoadedBehavior ="Manual" UnloadedBehavior ="Stop" Stretch="Fill"/>

Answer: B

QUESTION 173
You are developing a Windows Presentation Foundation (WPF) application. You configure PresentationTraceSource to track errors in a bound TextBox control in the application. You need to choose the window that the Trace information is sent to.
Which Visual Studio window should you select?

A.    Autos
B.    Immediate
C.    Locals
D.    Output

Answer: D

QUESTION 174
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
You discover that when the application runs, a user control is not rendered correctly. You need to find out the user interface (UI) element of the window that is causing the rendering problem.
What should you do?

A.    Use the Local Window.
B.    Use the WPF Visualizer.
C.    Generate a trace log by using IntelliTrace.
D.    Set a breakpoint at the control. Run the application.

Answer: A

QUESTION 175
You create a Microsoft Windows Installer file for a Windows Presentation Foundation (WPF) application that requires Microsoft .NET Framework 4. You need to ensure that the installation starts only if .NET Framework 4 is already installed on the computer. What should you do?

A.    Use a custom action.
B.    Set the MinVersion property to .NET Framework 4.
C.    Set the Version property of Windows Installer to .NET Framework 4.
D.    Set the Version property of the Launch Condition to .NET Framework 4.

Answer: D

QUESTION 176
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You use the ClickOnce deployment methodology to distribute the application. You need to store application-specific data along with read/write permissions without requiring elevated permissions for the application. Where should you store the application data?

A.    In isolated storage
B.    On the database server
C.    In the ClickOnce data directory
D.    in the App.config file of the application

Answer: A

QUESTION 177
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?

A.    AutomationElementIdentifier
B.    AutomationPeer
C.    Keyboard
D.    UICues

Answer: B

QUESTION 178
You are developing a Windows Presentation Foundation (WPF) application with the following class. (Line numbers are included for reference only.)
1781
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?

A.    Insert the following code at line 15.
Not ifyPropertyChanged("Data")
B.    Insert the following code at line 17.
NotifyPropertyChanged("Data")
C.    Insert the following code at line 15.
NotifyPropertyChanged(value)
D.    insert the following line at line 17.
NotifyPropertyChanged(value)

Answer: C

QUESTION 179
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application named MyApp.exe. You use Microsoft Windows Installer to package the application.
You create an icon file named Application.ico.
You need to associate Application.ico with MyApp.exe when MyApp.exe is deployed.
What should you do?

A.    Use the File Types Editor tool.
B.    Rename the icon file to MyApp.exe.ico.
C.    Set the AddRemoveProgramsIcon property to Application.ico.
D.    Use the File System Editor tool to set the Icon property to Application.ico.

Answer: D

QUESTION 180
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.)
1801
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?

A.    <HierarchicalDataTemplate x:Key="OrderTemplate" DataType="Order"
ItemTeinplate="{StaticResource OrderDetailTemplate} "> <TextBlock Text="{Binding Path=.}" />
</HierarchicalDataTemplate>
B.    <HierarchicalDataTemplate x:Key="OrderTemplate"
ItemsSource="{Binding Path=OrderDetails}"
ItemTemplate="{StaticResource OrderDetailTemplate}"> <TextBlock Text="{Binding Path=.}" />
</HierarchicalDataTemplate>
C.    <HierarchicalDataTemplate x : Key== "Order Temp late" ItertisSource="{ Binding Path=orders>"
ItemTemplate="{StaticResource OrderDetailTemplate}"> <TextBlock Text="{Binding Path=.}" />
</HierarchicalDataTemplate>
D.    <HierarchicalDataTemplate x:Key="OrderTemplate"
ItemsSource="{Binding Path=orders}" DataType="Order"> <TextBlock Text="{Binding Path=.}" />
</HierarchicalDataTemplate>

Answer: B

Unabridged Pass4sure Microsoft 70-511 PDF Dumps Free Download