如何在Windows Phone 8.1中以编程方式创建磁贴? [英] How to programatically create a tile in Windows Phone 8.1?

查看:82
本文介绍了如何在Windows Phone 8.1中以编程方式创建磁贴?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows Phone 8中,我可以使用以下命令创建Shell Tile:

In Windows Phone 8 I was able to create a Shell Tile with the following:

StandardTileData newTileData = new StandardTileData
{
    BackgroundImage = new Uri("/Images/my_tile_medium.png", UriKind.Relative),
    Title = "My Tile Title",
    BackTitle = "My Tile Back",
    BackBackgroundImage = new Uri("/Images/my_tile_medium_back.png", UriKind.Relative),
};

ShellTile.Create(MyAppPages.MainPage("Name=MyAppTile"), newTileData);

这在Windows Phone 8.1中不再起作用.如何使用Windows Phone 8.1以编程方式创建图块

This no longer works in Windows Phone 8.1. How can I programatically create a tile with Windows Phone 8.1

推荐答案

在WP8.1运行时中,您可以使用

In WP8.1 Runtime you can use SecondaryTile, for example:

SecondaryTile tileData = new SecondaryTile()
{
    TileId = "MyTileID",
    DisplayName = "MyTilesTitle",
    Arguments = "Some arguments"
};
tileData.VisualElements.Square150x150Logo = new Uri("uri to image");
tileData.VisualElements.ShowNameOnSquare150x150Logo = true;
await tileData.RequestCreateAsync();

一些指南,您也可以在MSDN上找到此处.

Some guide you can also find here at MSDN.

这篇关于如何在Windows Phone 8.1中以编程方式创建磁贴?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆