单项选择题

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;


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题

You are developing a Windows Forms application that contains a DataGridView control. The DataGridView capture the customer's 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 ...

3.单项选择题

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.

7.单项选择题

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?()

A. [UserScopedSetting()] [DefaultSettingValue("Please enter your setting.")]
B. [UserScopedSetting()] [SettingsDescription("Description: Please enter your setting.")]
C. [ApplicationScopedSetting()] [DefaultSettingValue("Please enter your setting.")]
D. [ApplicationScopedSetting()] [SettingsDescription("Description: Please enter your setting.")]

9.单项选择题

You use Microsoft .NET Framework 4 to create a Windows Forms application. 
You plan to use a Windows Presentation Foundation (WPF) control of the UserControl1 type hosted in an
ElementHost control named elementHost1. 
You write the following code segment. (Line numbers are included for reference only.)

You need to ensure that the application changes the background color of the hosted control when the background color of the form changes.  
Which code segment should you insert at line 05?()

A. elementHost1.PropertyMap.Remove("BackColor");   elementHost1.PropertyMap.Add("BackColor", new PropertyTranslator(OnBackColorChange));
B. elementHost1.PropertyMap.Remove("Background");   elementHost1.PropertyMap.Add("Background", new PropertyTranslator(OnBackColorChange));
C. elementHost1.PropertyMap.Add("BackColor", new PropertyTranslator(OnBackColorChange));   elementHost1.PropertyMap.Apply("BackColor");
D. elementHost1.PropertyMap.Add("Background", new PropertyTranslator(OnBackColorChange));   elementHost1.PropertyMap.Apply("Background");

最新试题

You are developing a Windows Presentation Foundation (WPF) application that display pricing and inventory.List box's ItemsSource property has decimal and string types. Decimals represent price and strings represents the folowing markup is defined as follows.You need to ensure that data templates are used to format the strings without changes and the decimals as ..Which markup segment should you insert at line 05 ?()

题型:单项选择题

You are developing a Windows Presentation Foundation (WPF) application.You need to display HTML content from a Web Page on the WPF form. What should you do?()

题型:单项选择题

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 toWhich Visual Studio window should you select ?()

题型:单项选择题

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?()

题型:单项选择题

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

题型:单项选择题

You are developing a Windows Presentation Foundation (WPF) applicationThe application is for commercial use and requires a valid license key to be entered. You create a project type of Class Library code to validate license keysYou need to ensure that the user enters a valid license key during installation of the software.Which deployment should reference the class library?()

题型:单项选择题

Which of the following examples of the pack URI syntax accesses a file named myImage.jpg in a folder named MyFolder in another assembly named myAssembly? ()

题型:单项选择题

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 Presentation Foundation (WPF) application. You create a WPF window in the application.  You add the following code segment to the application. public class ViewModel { public CollectionView Data { get; set; } }public class BusinessObject { public string Name { get; set; } }The DataContext property of the window is set to an instance of the ViewModel class.  The Data property of the ViewModel instance is initialized with a collection of BusinessObject objects. You add a TextBox control to the Window. You need to bind the Text property of the TextBox control to the Name property of the current item of the CollectionView of the DataContext object.  You also need to ensure that when a binding error occurs, the Text property of the TextBox control is set to N/A . Which binding expression should you use?()

题型:单项选择题

You have definded a style in app.xamlYou want to use this style in your application in code behind.How can you achieve this? ()

题型:单项选择题