I started to make some thing in WPF and I have a question. I think the answer might be easy and even obvious, but somehow...
I have two controls on a form enclosed by a grid. I want two position the second control above the first one (it's transparent). Coming from WinForms development that isn't that hard, so it won't be in WPF. But I don't get the point...
Sascha
Either the Grid
and Canvas
controls would do what you wanted.
For most cases I'd recommend using the Grid
to overlay elements, as you can also control how they resize easily. They'll stack in the order you define them (last defined at the top).
Try something like this:
<Grid>
<Rectangle Fill="Blue"/>
<Ellipse Fill="Red"/>
</Grid>
BTW - learning XAML is much easier to do in an interactive tool like Kaxaml.
If I am getting you correctly , just put the control in the reverse order inside the Grid. The order determines the Z-Index of the control
<Grid>
<c:ControlFirst/>
<c:ControlSecond/>
</Grid>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With