Advanced "caption" properties
Another thing that is not very clear is the contents of some properties that we are used to contains only text. If the property of a GUI element is of type Object, it is very likely that you can, instead of just setting the text, add a panel of your need that includes a set of controls.
An example of this is the MenuItem, where the Header
property (which normally just contains text) can contain a set of gui elements wrapped in a panel control (or just one gui element if you need just one).
Also note the Icon
property on the MenuItem. This normally contains an Image element, but this also can contain anything!
<MenuItem Name="MyMenuItem" Click="MyMenuItem_Click">
<MenuItem.Icon>
<Button Click="Button1_Click">i</Button>
</MenuItem.Icon>
<MenuItem.Header>
<StackPanel Orientation="Horizontal" >
<Label>My text</Label>
<Button Click="Button2_Click">ClickMe!</Button>
</StackPanel>
</MenuItem.Header>
</MenuItem>