【问题标题】:Value Converter Without Binding On Image Source不绑定图像源的值转换器
【发布时间】:2010-11-22 23:10:56
【问题描述】:

我需要通过值转换器获取图像的路径。但是我找不到任何使用没有绑定的值转换器的例子。

我希望按照以下方式做一些事情:

<Image source="{Value=Image1, Converter={ImageConverter}}" />

然后图像转换器将检查图像文件夹并返回正确的文件路径。

【问题讨论】:

    标签: wpf image binding converter


    【解决方案1】:

    为什么不像这样使用Binding

    <Image Source="{Binding ., Converter={StaticResource ImageConverter}, ConverterParameter=Image1}"/>
    

    这还不够吗?

    【讨论】:

      猜你喜欢
      • 2011-06-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-28
      • 2015-09-25
      • 2019-09-29
      • 1970-01-01
      相关资源
      最近更新 更多