【发布时间】:2015-09-23 08:53:32
【问题描述】:
有没有办法为 windows phone 的图像源设置默认路径?一些明显的变化?
我想写<Image Source="img1.png" /> 而不是<Image Source="Assets/Images/img1.png" />
实际上,此功能对 xamarin 开发人员非常有用。现在我需要在 xamarin studio 中创建这么一大段代码:
<Image>
<Image.Source>
<OnPlatform x:TypeArguments="ImageSource">
<OnPlatform.iOS>
<FileImageSource File="img1.png"/>
</OnPlatform.iOS>
<OnPlatform.Android>
<FileImageSource File="img1.png"/>
</OnPlatform.Android>
<OnPlatform.WinPhone>
<FileImageSource File="Assets/Images/img1.png"/>
</OnPlatform.WinPhone>
</OnPlatform>
</Image.Source>
</Image>
我的目标是把这段代码变成<Image Source="img1.png"/>
【问题讨论】:
标签: wpf xaml windows-phone-8 xamarin windows-phone-8.1