Panels.
<StackPanel>
<Image ... />
<Label ... />
</StackPanel>
Also see <WrapPanel>
, <DockPanel>
, <Grid>
, <Canvas>
, etc.
You'll run into that error if you do something like:
<Window ... >
<Image ... />
<Label ... /> <!-- Won't work -->
</Window>
This is because many controls in WPF are ContentControls
, like Window
, and these sorts of controls can only have one child. To have more than one child, use a Panel
.
GreenReign
2009-07-15 09:18:18