0

我们创建了一个 tile 快捷方式,类似于将 IE 快捷方式固定在屏幕上。我们已经通过代码做到了这一点。我们希望图像应该出现在此图块上。我们如何将图像添加到这样的快捷方式拼贴中。我们首先在 Windows 7 桌面模式下运行 exe,然后使用 shell 脚本使 pin 到屏幕事件单击。该磁贴类似于固定在桌面上的任何 Internet 地址

4

1 回答 1

1

请参阅此示例应用程序...

实现此目标所需的基本代码如下...

Uri logo = new Uri("ms-appx:///Assets/squareTile-sdk.png"); 
Uri smallLogo = new Uri("ms-appx:///Assets/smallTile-sdk.png"); 
string tileActivationArguments = MainPage.logoSecondaryTileId + " WasPinnedAt=" + DateTime.Now.ToLocalTime().ToString(); 
SecondaryTile secondaryTile = new SecondaryTile(MainPage.logoSecondaryTileId, 
   "Title text shown on the tile", 
   "Name of the tile the user sees when searching for the tile", 
   tileActivationArguments, 
   TileOptions.ShowNameOnLogo, 
   logo); 
secondaryTile.ForegroundText = ForegroundText.Dark; 
secondaryTile.SmallLogo = smallLogo; 
bool isPinned = await await secondaryTile.RequestCreateAsync();
于 2012-11-07T13:12:26.403 回答