单项选择题
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
You add a property named ServiceContext to a control.
You need the value of ServiceContext to flow to the child controls exactly like the value of the DataContext property of the FrameworkElement class.
What should you do? ()
A. Inherit the control class from the DependencyObject class.
B. Register a dependency property. In the options settings of the property metadata, specify the Inherits option.
C. Declare a new property. In the get and set methods of the new property, create an instance of the TraversalRequest class.
D. Declare a new property. In the get method of the new property call VisualTreeHelper.GetParent. In the set method of the new property, call VisualTreeHelper.GetChild.
相关考题
-
单项选择题
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You create a custom control named Wheel. You need to ensure that the Speed property of Wheel can be animated. What should you do?()
A. Inherit the DependencyObject class.
B. Declare the Speed property as a dependency property.
C. Declare an animation of the Speed property from within the code-behind file.
D. Implement the System.Windows.Media.Animation.IAnimatable interface with the Wheel class. -
单项选择题
You use Microsoft .NET Framework 4 to create a Windows application that can execute on client computers that run Windows Vista. You are creating a User Account Control (UAC) application manifest for the application. You need to ensure that users who are members of the local Administrators group do not receive a UAC prompt when the application executes. Which code fragment should you use? ()
A.
B.
C.
D. -
单项选择题
You use Microsoft .NET Framework 4 to create a Windows Forms application. The application includes a RichTextBox control and a ListBox control. The ListBox control is populated with a list of valid file names. The application allows users to drag a ListBox item to the RichTextBox control. You need to provide a visual indication that a file that is dragged can be dropped on the RichTextBox control. What should you do?()
A. Use a DoubleAnimation class.
B. Use a Storyboard animation class.
C. Use the DragDropEffects enumeration.
D. Use the DragAction enumeration.
