I have a need to reproduce this CSS in WPF/XAML:
<div style="position: relative;">
<div style="position: absolute; top: 0; left: 0;">Foo bar</div>
<div style="position: absolute; top: 0; left: 0;">Foo bar</div>
</div>
In essence, I need to have two elements positioned on top of each other within their container.
So far I have:
<StackPanel>
<TextBlock Text="Foo bar">
<TextBlock Margin="0,-16,0,0" Text="Foo bar">
</StackPanel>
The problem with above is that it does not scale. I don’t want to hard code any margin figures.
Place then on the same cell of a grid:
Note: Since there’s no
RowDefinitionsorColumnDefinitionsspecified, the grid have a default 1 row / 1 column. Since the elements don’t have the propertyGrid.RoworGrid.Columnset, they are placed on the 0,0 cell