views:

30

answers:

2

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!

A: 

Well, I ended up using a canvas with ItemResources containing bound text to resolve this issue.

Noah
A: 

Could you share your code ?

I want to do something similar... Image tagging but with zoom and pan...

Thank you very much,

K.

Kev