wpf:图像不是资源时如何使用相对路径的图像

时间:2017-04-10 03:41:53

标签: c# wpf xaml

我有一个动态加载的xaml文件:

XamlReader.load("a.xaml")

它包含BitmapImage资源:

<ResourceDictionary>
   <BitmapImage x:Key = "some" UriSource = "someFile.png" />
</ResourceDictionary>

someFile.pnga.xaml的路径相同,但它不是Resource。然后当负载VS暗示:

  

找不到文件someFile.png。

0 个答案:

没有答案