nerdexam
Microsoft

70-511 · Question #50

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You add a TreeView control to show the hierarchical structure of orders and order details. Each…

The correct answer is B. <HierarchicalDataTemplate x:Key="OrderTemplate". See the full explanation below for the reasoning.

Question

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You add a TreeView control to show the hierarchical structure of orders and order details. Each order contains an ObservableCollection named OrderDetails. You write the following code fragment. (Line numbers are included for reference only.) You need to ensure that the TreeView control meets the following requirements:

  • Each order is shown as a TreeView node.
  • The order nodes have order detail nodes as children.
  • The order detail nodes have no children.

Which code fragment should you insert at line 07?

Options

  • A<HierarchicalDataTemplate x:Key="OrderTemplate" DataType="Order"
  • B<HierarchicalDataTemplate x:Key="OrderTemplate"
  • C<HierarchicalDataTemplate x:Key="OrderTemplate"
  • D<HierarchicalDataTemplate x:Key="OrderTemplate"

How the community answered

(32 responses)
  • A
    9% (3)
  • B
    75% (24)
  • C
    3% (1)
  • D
    13% (4)

Community Discussion

No community discussion yet for this question.

Full 70-511 Practice