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

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

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

正确答案:C

第2题:

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

第3题:

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.

正确答案:B,D

第4题:

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

第5题:

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

第6题:

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You create a Button control for the application. You need to ensure that the application meets the following requirements: When the mouse pointer is over the Button control, the background color of the button is set to red and the Button control appears bigger. When the mouse pointer is not over the Button control, the button returns to its original state. What should you do?()

  • A、 Create a template. Declare a VisualState element in the template.
  • B、 Create a StoryBoard animation. Add an EventTrigger class to the Button control that begins the StoryBoard animation.
  • C、 Create a ScaleTransform class. Bind the ScaleX and ScaleY properties of the Button control to the Background property by using a custom value converter.
  • D、 Add a method named ChangeAppearance in the code-behind file. Subscribe the ChangeAppearance method to the MouseEnter event of the Button control.

正确答案:A

第7题:

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

第8题:

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

正确答案:B

第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.

正确答案:C

第10题:

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

更多相关问题