简体   繁体   English

Universal Apps Live Tiles

[英]Universal Apps Live Tiles

I have reached the stage in my universal windows app where I would like to create a live tile. 我已经在通用Windows应用程序中达到了要创建活动图块的阶段。

The articles I have read suggest that you should create a BackgroundTask in a separate assembly to keep the footprint small, so I have created a new portable class library for this purpose. 我读过的文章建议您应该在单独的程序集中创建BackgroundTask,以使占用的空间较小,因此我为此创建了一个新的可移植类库。

There are a number of templates available for your live tile, some are not supported on windows phone and some are not supported on windows store apps. 有许多适用于您的活动图块的模板,Windows Phone不支持某些模板,Windows Store应用程序不支持某些模板。

The problem I have is, if I want to create different live tiles for windows phone and windows store platforms, I cannot tell which platform it is running on because the portable class library I have created don't have anyway of identifying this. 我遇到的问题是,如果我想为Windows Phone和Windows Store平台创建不同的实时磁贴,则无法确定它在哪个平台上运行,因为我创建的可移植类库始终无法识别出这一点。

Is there a better way of doing this? 有更好的方法吗?

经过深思熟虑后,我决定最好的答案是创建两个版本的BackgroundTask,一个用于Windows Phone,一个用于Windows Store,然后在运行主应用程序时注册正确的版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM