我正在创建一个TileNotification
以在应用程序的磁贴上显示最后编辑的项目。这样做时,我想将图块的背景设置为项目封面图像。我正在创建TileContent
这样的:
TileContent content = new TileContent()
{
Visual = new TileVisual()
{
TileMedium = new TileBinding()
{
Content = new TileBindingContentAdaptive()
{
BackgroundImage = new TileBackgroundImage()
{
Source = new TileImageSource("ms-appx:///Assets/Images/MainPageBackground.jpg"),
Overlay = 10
},
Children =
{
new TileText()
{
Text = DataModel.Instance.CurrentProject.Title,
Align = TileTextAlign.Left
}
}
}
}
}
};
问题在于,设置Source
属性的唯一方法似乎是使用TileImageSource
,它仅接受字符串。而且由于项目的封面图像存储在其中,ApplicationData.Current.LocalFolder...
所以我不能只给它一个字符串。有什么方法可以从实际图像而不是字符串设置图像源?
经过更多搜索后,我发现了这种方法。
您可以使用“ ms-appdata:/// Local”前缀来获取文件。就我而言:
$“ ms-appdata:/// local / Projects / {ProjectName} /Slides/0.gif”。
然后可以将其作为来源上交。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句