单项选择题
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;
相关考题
-
单项选择题
You are developing a Windows Forms application that contains a DataGridView control. The DataGridView capture the customers name, address, and phone number. You have been asked to provide data validation in a DataGridView to prevent users from leaving the.. You need to ensure that users cannot tab out of the name field without entering data What should you do ?()
A. Validate the name field in the CellValidating event. Set e.Cancel = true if the name field is
B. Validate the name field in the CellErrorTextChanged event. Get e.RowIndex if the name field ..
C. Validate the name field in the CellEnter event. Set the focus on the name field if the name ...
D. Validate the name field in the CancelRowEdit event. Set the focus on the name field if the name ... -
单项选择题
You use Microsoft .NET Framework 4 to create an application. The application performs resource-intensive calculations that consist of multiple layers of nested looping. The application will be deployed to servers that contain varying hardware configurations. You need to ensure that the application utilizes CPU resources on the server in the most efficient manner. You want to achieve this goal by using the minimum amount of code. What should you do?()
A. Use multiple System.Threading.Thread objects.
B. Use the background worker process (BWP).
C. Use the Thread.BeginInvoke method.
D. Use the Parallel.For method. -
单项选择题
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows Presentation Framework (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? ()
A. Move CustomerNameBrush to the App.xaml file.
B. Inherit from myPage in all additional pages that use CustomerNameBrush.
C. Add a reference to myPage to all additional pages that use CustomerNameBrush.
D. Bind controls that need CustomerNameBrush to myPage.Resources.CustomerNameBrush.
