【问题标题】:WPF Create Rectangle Tags on Image from DataBindingWPF 从 DataBinding 在图像上创建矩形标签
【发布时间】: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


    【解决方案1】:

    好吧,我最终使用了一个带有 ItemResources 的画布来解决这个问题。

    【讨论】:

      猜你喜欢
      • 2020-01-09
      • 2014-05-13
      • 1970-01-01
      • 1970-01-01
      • 2019-08-17
      • 1970-01-01
      • 2016-07-02
      • 2015-06-29
      • 1970-01-01
      相关资源
      最近更新 更多