I'm a little new to C#
and WPF
, so forgive me if this is an uninformed question. I'd like to know if it is possible to layer something on top of a region of a dockPanel
. So, for example, say I have something like:
<theme:obligatory DockPanel.Dock="Top"
x:Name="name" ClipToBounds="False"
SnapsToDevicePixels="False" />
I'd like to know if it is possible to layer something on top of this region, either within the same .xaml or via a different class. I'd like to layer text, if that makes any difference.
Thanks!
In WPF, all XAML defined lower in the page will be rendered on top of the controls that are defined higher in the page. So to overlay anything, just declare it at the bottom of your page. Try this:
<Grid>
<DockPanel />
<Rectangle Fill="Red" Margin="250,100,50,200" />
</Grid>
In this example, the Rectangle
will appear to float above the DockPanel
. Adjust the Margin
to place it wherever you want.