I have the following DataTemplate :
<DataTemplate>
<Grid>
<1-- Content -->
</Grid>
</DataTempalte>
I want to place an adorner on top of the content of the Grid.
How can I do that?
The adorner I want to use is another Grid.
Can we do this in pure XAML only?
Thanks
I have made very good experience with the following code:
http://www.codeproject.com/Articles/54472/Defining-WPF-Adorners-in-XAML
After adding some classes to your code base you are able to define Adorners in Xaml like so:
<local:AdornedControl x:Name="adornedControl" HorizontalAlignment="Center" VerticalAlignment="Center"
HorizontalAdornerPlacement="Outside" VerticalAdornerPlacement="Outside" IsAdornerVisible="True"
IsMouseOverShowEnabled="False">
<local:AdornedControl.AdornerContent>
<Canvas x:Name="adornerCanvas" HorizontalAlignment="Center" VerticalAlignment="Center">
<Thumb Canvas.Top="-5" Canvas.Left="-5" />
<Thumb Canvas.Bottom="-5" Canvas.Left="-5" />
<Thumb Canvas.Top="-5" Canvas.Right="-5" />
<Thumb Canvas.Bottom="-5" Canvas.Right="-5" />
</Canvas>
</local:AdornedControl.AdornerContent>
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