Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Can you draw the logical tree created by this XAML?
<Window Name="MainWindow">
 <Window.ContextMenu>
  <ContextMenu>
   <MenuItem Header="Item1" />
   <MenuItem Header="Item2" />
  </ContextMenu>
 </Window.ContextMenu>
 <StackPanel Name="LayoutRoot">
  <Label>Say Something</Label>
  <Button>Do Something</Button>
 </StackPanel>
</Window>
In the XAML markup above, find examples of attribute, property and collection syntax.
You have to do three things to make sure that the CLR can connect XAML and the code-behind. Can you pick them from the list below?
Call the Connect() method in the class constructor.
Make sure both files exist in the same namespace.
Set the Name property of objects in code.
Set the Class attribute of the XAML root element.
Give XAML elements and variables in the code the same name.