niusouti.com

单选题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

题目
单选题
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: Creates a text-changed event handler named Audit_TextChanged for the txtInput control. Executes Audit_TextChanged even when specific handlers mark the event as handled. Which code segment should you add to the constructor of the user control?()
A

txtInput.TextChanged+=Audit_TextChanged;

B

AddHandler(TextBox.TextChangedEvent, new  RoutedEventHandler(Audit_TextChanged), true);

C

EventManager.RegisterClassHandler(typeof(TextBox),  TextBox.TextChangedEvent, new  RoutedEventHandler(Audit_TextChanged), true);

D

EventManager.RegisterClassHandler(typeof(TextBox),  TextBox.TextChangedEvent, new  RoutedEventHandler (Audit_TextChanged), false);


相似考题
参考答案和解析
正确答案: D
解析: 暂无解析
更多“单选题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”相关问题
  • 第1题:

    You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You need to ensure that the application meets the following requirements: Displays a menu that is specific to the control selected by the user. Displays the menu next to the control. Which control should you use? ()

    • A、 Menu
    • B、 PopUp
    • C、 ListBox
    • D、 ContextMenu

    正确答案:D

  • 第2题:

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

    • A、 { Binding Path=Data/Name, FallbackValue='N/A' }
    • B、 { Binding Path=Data.Name, FallbackValue='N/A' }
    • C、 { Binding Path=Data/Name, TargetNullValue='N/A' } 
    • D、 { Binding Path=Data.Name, TargetNullValue='N/A' }

    正确答案:A

  • 第3题:

    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.

    正确答案:B

  • 第4题:

    You are developing a user control for Windows Presentation Foundation (WPF) application. The user control contains a button. Both the user control and the hosting control must receive the button click event. You need to ensure that the user control responsd to the button click event before hosting control responds to the event. What should you do ?()

    • A、 Use a bubbling routed event. In the button click event handler, set the Handled property to True
    • B、 Use a bubbling routed event. In the button click event handler, set the Handled property to False
    • C、 Use a standard Microsoft .NET event. Set Handled property to true.
    • D、 Use a tunneling routed event. Set the handled property to false.

    正确答案:B

  • 第5题:

    You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You add a ListBox control to the application. The ListBox control is data-bound to an instance of a custom collection class of the Product objects named ProductList. You need to ensure that changes to ProductList are automatically reflected in the ListBox control. What should you do? ()

    • A、  Implement the INotifyPropertyChanged interface in the Product class.
    • B、  Implement the IQueryable<Product> interface in the ProductList class.
    • C、  Extend the DependencyObject class in the Product class.
    • D、 Extend the ObservableCollection<Product> class in the ProductList class.

    正确答案:D

  • 第6题:

    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: Creates a text-changed event handler named Audit_TextChanged for the txtInput control. Executes Audit_TextChanged even when specific handlers mark the event as handled. Which code segment should you add to the constructor of the user control?()

    • A、txtInput.TextChanged+=Audit_TextChanged;
    • B、AddHandler(TextBox.TextChangedEvent, new  RoutedEventHandler(Audit_TextChanged), true);
    • C、EventManager.RegisterClassHandler(typeof(TextBox),  TextBox.TextChangedEvent, new  RoutedEventHandler(Audit_TextChanged), true);
    • D、EventManager.RegisterClassHandler(typeof(TextBox),  TextBox.TextChangedEvent, new  RoutedEventHandler (Audit_TextChanged), false);

    正确答案:B

  • 第7题:

    单选题
    You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You add a ListBox control to the application. The ListBox control is data-bound to an instance of a custom collection class of the Product objects named ProductList. You need to ensure that changes to ProductList are automatically reflected in the ListBox control. What should you do? ()
    A

      Implement the INotifyPropertyChanged interface in the Product class.

    B

      Implement the IQueryable<Product> interface in the ProductList class.

    C

      Extend the DependencyObject class in the Product class.

    D

     Extend the ObservableCollection<Product> class in the ProductList class.


    正确答案: C
    解析: 暂无解析

  • 第8题:

    单选题
    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: Creates a text-changed event handler named Audit_TextChanged for the txtInput control. Executes Audit_TextChanged even when specific handlers mark the event as handled. Which code segment should you add to the constructor of the user control?()
    A

    txtInput.TextChanged+=Audit_TextChanged;

    B

    AddHandler(TextBox.TextChangedEvent, new  RoutedEventHandler(Audit_TextChanged), true);

    C

    EventManager.RegisterClassHandler(typeof(TextBox),  TextBox.TextChangedEvent, new  RoutedEventHandler(Audit_TextChanged), true);

    D

    EventManager.RegisterClassHandler(typeof(TextBox),  TextBox.TextChangedEvent, new  RoutedEventHandler (Audit_TextChanged), false);


    正确答案: C
    解析: 暂无解析

  • 第9题:

    单选题
    You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. The application includes a function that is triggered by filling out a form and by clicking a button. Currently, the application is tested manually. You need to create an automated and iterative process to test the application. What should you do?()
    A

     Use IntelliTrace.

    B

     Use UISpy.exe to extract the user interface (UI) information. Then, use MSTest.exe.

    C

     Use classes in the System.Windows.Automation and System.Windows.Automation.Text namespaces.

    D

     Use the Action Recording methodology to record the user interface (UI) actions. Then, use MSTest.exe.


    正确答案: A
    解析: 暂无解析

  • 第10题:

    单选题
    You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. The application has multiple data entry windows. Each window contains controls that allow the user to type different addresses for shipping and mailing. All addresses have the same format. You need to ensure that you can reuse the controls. What should you create?()
    A

     a user control

    B

     a data template

    C

     a control template

    D

     a control that inherits the Canvas class


    正确答案: B
    解析: 暂无解析

  • 第11题:

    单选题
    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?()
    A

     FlowDocument 

    B

     FlowDocumentReader

    C

     FlowDocumentPageViewer

    D

     FlowDocumentScrollViewer


    正确答案: C
    解析: 暂无解析

  • 第12题:

    单选题
    You are developing a Windows Presentation Foundation (WPF) application. You need to use XAML to create a custom control that contains two Button controls. From which base class should you inherit? ()
    A

     FrameworkElement

    B

     UIElement

    C

     UserControl

    D

     Button


    正确答案: B
    解析: 暂无解析

  • 第13题:

    You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. The application has multiple data entry windows. Each window contains controls that allow the user to type different addresses for shipping and mailing. All addresses have the same format. You need to ensure that you can reuse the controls. What should you create?()

    • A、 a user control
    • B、 a data template
    • C、 a control template
    • D、 a control that inherits the Canvas class

    正确答案:A

  • 第14题:

    You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. The application includes a function that is triggered by filling out a form and by clicking a button. Currently, the application is tested manually. You need to create an automated and iterative process to test the application. What should you do?()

    • A、 Use IntelliTrace.
    • B、 Use UISpy.exe to extract the user interface (UI) information. Then, use MSTest.exe.
    • C、 Use classes in the System.Windows.Automation and System.Windows.Automation.Text namespaces.
    • D、 Use the Action Recording methodology to record the user interface (UI) actions. Then, use MSTest.exe.

    正确答案:C

  • 第15题:

    You are developing a Windows Presentation Foundation (WPF) application. You need to use XAML to create a custom control that contains two Button controls. From which base class should you inherit? ()

    • A、 FrameworkElement
    • B、 UIElement
    • C、 UserControl
    • D、 Button

    正确答案:C

  • 第16题:

    You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. The application contains a ListBox control named lbxItems that is data-bound to a collection of objects. Each object has a DisplayValue property. You add a Button control to the application. You need to ensure that the Content property of the Button control is data-bound to the DisplayValue property of the selected item of lbxItems. Which binding expression should you use?()

    • A、 { Binding ElementName=lbxItems, Source=SelectedItem, Path=DisplayValue }
    • B、 { Binding Source=lbxItems, ElementName=SelectedItem, Path=DisplayValue }
    • C、 { Binding ElementName=lbxItems, Path=SelectedItem.DisplayValue }
    • D、 { Binding Source=lbxItems, Path=SelectedItem.DisplayValue }

    正确答案:C

  • 第17题:

    You use Microsoft .NET Framework 4 to create a Windows Presentation Framework (WPF) application. You plan to create a custom control that contains four text input fields. Each of the text input fields within the control will contain a label. You need to ensure that the text input fields within the control can be validated by using a regular expression validator. Which class should you inherit from?()

    • A、 TextBox
    • B、 TextElement
    • C、 UIElement
    • D、 UserControl

    正确答案:D

  • 第18题:

    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.

    正确答案:A,C

  • 第19题:

    单选题
    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?()
    A

     { Binding Path=Data/Name, FallbackValue='N/A' }

    B

     { Binding Path=Data.Name, FallbackValue='N/A' }

    C

     { Binding Path=Data/Name, TargetNullValue='N/A' } 

    D

     { Binding Path=Data.Name, TargetNullValue='N/A' }


    正确答案: C
    解析: 暂无解析

  • 第20题:

    单选题
    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.


    正确答案: D
    解析: 暂无解析

  • 第21题:

    单选题
    You use Microsoft .NET Framework 4 to create a Windows Presentation Framework (WPF) application. You plan to create a custom control that contains four text input fields. Each of the text input fields within the control will contain a label. You need to ensure that the text input fields within the control can be validated by using a regular expression validator. Which class should you inherit from?()
    A

     TextBox

    B

     TextElement

    C

     UIElement

    D

     UserControl


    正确答案: D
    解析: 暂无解析

  • 第22题:

    单选题
    You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You need to ensure that the application meets the following requirements: Displays a menu that is specific to the control selected by the user. Displays the menu next to the control. Which control should you use? ()
    A

     Menu

    B

     PopUp

    C

     ListBox

    D

     ContextMenu


    正确答案: C
    解析: 暂无解析

  • 第23题:

    多选题
    You use Microsoft .NET Framework 4 to create a custom Windows Presentation Foundation (WPF) application. Your environment includes several WPF applications. The applications use the same logo and style configuration as part of a corporate standard. You need to ensure that the existing applications can be updated to use the same logo and style settings without recompiling. Which two actions should you perform?()
    A

     Mark the resource as an embedded resource in each application. 

    B

     Create a resource in an XAML file that contains the logo and style configurations.

    C

     Create a resource in a custom control that contains the logo and style configurations.

    D

     Add the resource as a ResourceDictionary in the MergedDictionaries collection of each application.

    E

     Use ResourceManager to read the content of the resource. Manually assign the style configurations included in the resource file to the appropriate control in each application.


    正确答案: A,D
    解析: 暂无解析

  • 第24题:

    单选题
    You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application that displays an image. You need to ensure that users can stretch and scale the image. Which control should you use?()
    A

     Frame

    B

     Slider

    C

     Viewbox

    D

     ScrollViewer


    正确答案: B
    解析: 暂无解析