单项选择题

You create a Windows client application by using Windows Presentation Foundation (WPF). 
The application contains the following code fragment.

You need to assign lbDetails to use the detail data template when btnDetails is clicked. 
Which code segment should you write for the click event handler for btnDetails?()

A. lbDetails.ItemsPanel.FindName("detail",lbDetails);
B. var tmpl = (ControlTemplate)FindResource("detail");    lbDetails.Template = tmpl; 
C. var tmpl = (DataTemplate)FindName("detail");    lbDetails.ItemTemplate = tmpl;
D. var tmpl = (DataTemplate)FindResource("detail");    lbDetails.ItemTemplate=tmpl;


您可能感兴趣的试卷

你可能感兴趣的试题

2.单项选择题

You use Microsoft .NET Framework 4 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 void CanAddSugar (object sender, CanExecuteRoutedEventArgs e) { ... }
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.

3.多项选择题

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.  
The application contains a composite user control that includes a TextBox control named txtInput.  
The user control will be hosted in a window and will have handlers for the text-changed event of txtInput. 
You need to ensure that the application meets the following requirements: 
AddHandler(TextBox.TextChangedEvent, new RoutedEventHandler(Audit_TextChanged), true);
Which of the following statments are TRUE ?()

A. A text-changed event handler, named Audit_TextChanged, was Created for the txtInput control.
B. Audit_TextChanged will stop running because the event is marked as handled by certain event handlers. 
C. Even through the event is marked handled by certain event handlers, Audit_TextChanged  will still run.
D. Audit_TextChanged will continue to run until the event is marked as handled.

最新试题

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. The application has a window named MainWindow that has a StackPanel control named sp as the root element. You want to create a Button control that contains a TextBlock control with the "Save" Text property. You need to create the control dynamically and add the control to sp. Which code segment should you write in the constructor of the MainWindow class?()

题型:单项选择题

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows PresentationFramework (WPF) application. You have a page named myPage that contains the following code fragment. You need to ensure that other pages in your application can use CustomerNameBrush.  What should you do? ()

题型:单项选择题

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You need to ensure that users can view content in a book-reading format that displays two pages at a time. Which control should you use?()

题型:单项选择题

You are developing WPF application for managing student information... btnSort and a DataGrid control named dgStudents on the design surface of the MainWindow.xaml properties : FirstName and LastName. You create the following code segment in the constructor of...The DataGrid control displays the list of students unsorted.You need to ensure that the list of students is sorted by last name.Which code segment should you add to the click event handler of the Button control?()

题型:单项选择题

You use Microsoft .NET Framework 4 to create a Windows Forms application.You write the following code segment. (Line numbers are included for reference only.)01sealed class FormSettings :You need to ensure that the first time each user opens the application, a text field displays the following message: "Please enter your setting."Which code segment should you insert at line 03?()

题型:单项选择题

You are developing a Windows Presentation Foundation (WPF) application. All of the application styles are in the file name Themes.dllYou have the followiing markup segment.BlueBackground is defined in a XAML file named BlueTheme.xaml. The XAML markup is compiled into the Themes.dll file.You need to ensure that the XAML file is referenced so that the application can apply the settings in the BlueBackground style.()

题型:单项选择题

Where can you check the value of a dependency property? ()

题型:单项选择题

You create a Windows client application by using Windows Presentation Foundation (WPF). The application contains the following code fragment. You need to assign lbDetails to use the detail data template when btnDetails is clicked. Which code segment should you write for the click event handler for btnDetails?()

题型:单项选择题

You are developing a Windows Presentation Foundation (WPF) application for a travel reservation systemYou need to ensure that users can select a range of travel dates.What should you do ?()

题型:单项选择题

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 ..What should you do ?() 

题型:单项选择题