如何在推送通知中发送ShellTileData实例?

时间:2013-03-06 09:46:09

标签: windows windows-phone-7 windows-phone-8 windows-phone live-tile

我想发送一个IconicTileData实例作为推送通知 但是我没有连接下一个代码片段并将其作为请求提交,而是想发送一个IconicTileData(派生自ShellTileData)而不必连接字符串。

<?xml version="1.0" encoding="utf-8"?>
<wp:Notification xmlns:wp="WPNotification" Version="2.0">
  <wp:Tile Id="[Tile ID]" Template="IconicTile">
    <wp:SmallIconImage [Action="Clear"]>[small Tile size URI]</wp:SmallIconImage>
    <wp:IconImage Action="Clear">[medium/wide Tile size URI]</wp:IconImage>
    <wp:WideContent1 Action="Clear">[1st row of content]</wp:WideContent1>
    <wp:WideContent2 Action="Clear">[2nd row of content]</wp:WideContent2>
    <wp:WideContent3 Action="Clear">[3rd row of content]</wp:WideContent3>
    <wp:Count Action="Clear">[count]</wp:Count>
    <wp:Title Action="Clear">[title]</wp:Title>
    <wp:BackgroundColor Action="Clear">[hex ARGB format color]</wp:BackgroundColor>
  </wp:Tile>
</wp:Notification>

我只想写那个:

IconicTileData TileData = new IconicTileData()
{
   Title = "[title]",
   Count = [count],
   WideContent1 = "[1st row of content]",
   WideContent2 = "[2nd row of content]",
   WideContent3 = "[3rd row of content]",
   SmallIconImage = [small Tile size URI],
   IconImage = [medium/wide Tile size URI],
   BackgroundColor = [.NET color type of Tile]
};

谢谢!

0 个答案:

没有答案