【发布时间】:2011-02-05 21:23:28
【问题描述】:
所以我试图显示在我的应用程序路径之外的图像。我只有一个相对图像路径,例如“images/background.png”,但我的图像在其他地方,我可能想在运行时选择该基本位置,以便绑定映射到正确的文件夹。如“e:\data\images\background.png”或“e:\data\theme\images\background.png”
<Image Source="{Binding Path=ImagePathWithRelativePath}"/>
有没有什么方法可以在 XAML 中指定这些图像的基本目录或代码?
【问题讨论】:
标签: c# wpf binding path relative-path