Best WPF Objective Questions and Answers
Best WPF Objective Questions and Answers
Best WPF Objective Questions and Answers
1) The TextBox control shows a default context menu with options to Cut, Copy and Paste. Can we override this context menu by
defining our own in the TextBox control?
A. True
B. False
Ans: A
2) Can we store the ContextMenu in Resource so that we can reuse it for various control on a form?
A. True
B. False
Ans: A
3) In WPF Padding controls how much extra space gets placed around the inside edges of the element.
A. True
B. False
Ans: A
4) Visibility (defined on UIElement) might sound like a strange property to talk about in the context of layout, but it is indeed
relevant. An element’s Visibility property actually isn’t Boolean, but rather a three-state System.Windows.Visibility
enumeration. One of Its value is “Collapsed” What is the meaning of this value
A. The element is invisible yet still participates in layout.
B. The element is invisible and does not participate in layout
C. The element gets rendered and participates in layout.
D. None of the above
Ans: B
5) BAML can’t be decompiled back into XAML
A. True
B. False
Ans: B
6) the .NET Framework 4.0 introduces a handful of new features for the XAML language. This second generation of the XAML
language is referred to as
A. XAML2006
B. XAML2008
C. XAML2009
D. None of these
Ans: C
8.WPF separates the appearance of an user interface from its behavior. The appearance is generally specified in the_______.
A. HTML
B. XAML
C. XML
D. XSLT
Ans: B
16. Development is more efficient because designers can implement an application’s appearance simultaneously with developers
who are implementing the application’s behavior.True or false?
A. True
B. False
Ans: A
19. Child controls are virtualized and arranged on a single line that is either horizontally or vertically oriented. Is true about?
A. DockPanel
B. VirtualizingStackPanel
C. WrapPanel
D. StackPanel
Ans: B
20. Child controls are positioned in left-to-right order and wrapped to the next line when there are more controls on the current
line than space allows.Is true about?
A. WrapPanel
B. StackPanel
C. VirtualizingStackPanel
D. DockPanel
Ans: A
21.In DockPanel Child controls are aligned to the edges of the panel.True or False?>
A. True
B. False
Ans: A
22.Which of the following is not WPF model(used to create a new control/custom control)?
A. User Control Model
B. Control Model
C. Framework Element Model
D. Element Model
Ans: D
23.One of the primary architectural philosophies used in building WPF was a preference for properties over methods or events.
A. True
B. False
Ans: A
25._______class provides the GetChildren, GetParent, and FindLogicalNode methods for logical tree traversal.
A. LogicalTreeHelper
B. VisualTreeHelper
C. AbstractTreeHelper
D. a & b
Ans:A
26. ________ is a DependencyProperty instance, which is obtained as a return value when registering a dependency property,
and then stored as a static member of a class.
A. Dependency property
B. Dependency property identifier
C. CLR “wrapper”
D. None of above
Ans: B
27. Windows Presentation Foundation (WPF) introduces _______ events that can invoke handlers that exist on various listeners
in the element tree of an application.
A. routed
B. bubbled
C. child
D. None of above
Ans: A
33. x:Null specifies null as a value for a property and can be used either for attributes or property element values.True or False?
A. True
B. False
Ans: A
34.__________provides a value for a property by deferring that value to be a run-time reference to a resource.
A. StaticResource
B. DynamicResource
C. RelativeSource
D. Binding
Ans: B
35.___________provides a value for a property by substituting the value of an already defined resource.
A. StaticResource
B. DynamicResource
C. RelativeSource
D. Binding
Ans: A
36.____________provides source information for a Binding that can navigate several possible relationships in the run-time object
tree.
A. StaticResource
B. DynamicResource
C. RelativeSource
D. Binding
Ans: C
37._________provides a data bound value for a property, using the data context that applies to the parent object at run time.
A. StaticResource
B. DynamicResource
C. RelativeSource
D. Binding
Ans: D
44. Which layout control would be the best choice for a user interface that requires evenly spaced controls laid out?
A. Grid
B. Canvas
C. UniformGrid
D. EvenlyGrid
Ans: C
47. Which object can be used share the variable across pages in WPF?
A. Application
B. Session
C. Cookies
D. Viewstate
Ans: A
49. How you can set a working mnemonic key for a label?
A. Set the Target property to the target control. Precede the letter for the mnemonic key with an underscore symbol in the Content
property of the Label control.
B. You must place both the Label control and the Target property in the same container.
C. Set the Mnemonic Key property on the Label control.
D. None
Ans: A