WPF Create Rectangle Tags on Image from DataBinding
- by Noah
I'm trying to add image tags to a WPF image and I'm not having much luck. I'd like to do it through databinding if at all possible. Can I set a resource with a DataTemplate to take care of this?
Here's what I've been playing with to no avail:
<Image Margin="25,4,14,46"
Name="MainImage"
Stretch="Uniform"
MouseDown="MainImage_MouseDown"
Grid.Row="1"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Source="{Binding Path=FileName}"
>
<Image.Resources>
<DataTemplate DataType="{x:Type capp:CAPMeta}">
<Label Content="{Binding Path=TagText}">
</Label>
</DataTemplate>
</Image.Resources>
</Image>
Thanks!