【发布时间】:2010-06-13 15:38:57
【问题描述】:
我正在尝试将图像标签添加到 WPF 图像中,但运气不佳。如果可能的话,我想通过数据绑定来做到这一点。我可以使用 DataTemplate 设置资源来处理这个问题吗?
这是我一直在玩但无济于事的东西:
<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>
谢谢!
【问题讨论】:
标签: wpf .net-3.5 data-binding photo-tagging