我正在尝试创建一个界面,用户可以在其中创建流到应用程序磁贴、“辅助”磁贴和/或“第三”磁贴的数据。但是,发生的情况是,当我更新三个图块中的一个时,所有图块都使用相同的数据流进行更新...这是实时图块存在的限制,还是我遗漏了什么?
这是我正在尝试做的一个片段......
ShellTile tile = null;
StandardTileData tileData = null;
switch (tileInfo.type)
{
case "Application":
tile = ShellTile.ActiveTiles.First();
tileData = new StandardTileData
{
BackBackgroundImage = new Uri(isoStoreTileImage, UriKind.Absolute)
};
// If the file already exists, update it.
if (tile != null)
{
tile.Update(tileData);
}
break;
case "Secondary":
tile = ShellTile.ActiveTiles.FirstOrDefault(x => x.NavigationUri.ToString().Contains("Secondary"));
tileData = new StandardTileData
{
BackgroundImage = new Uri(isoStoreTileImage, UriKind.Absolute)
};
// If the file already exists, update it.
if (tile != null)
{
tile.Update(tileData);
}
else
{
// Otherwise, create a new tile.
ShellTile.Create(new Uri(tileInfo.uri, UriKind.Relative), tileData);
}
break;
case "Tertiary":
tile = ShellTile.ActiveTiles.FirstOrDefault(x => x.NavigationUri.ToString().Contains("Tertiary"));
tileData = new StandardTileData
{
BackgroundImage = new Uri(isoStoreTileImage, UriKind.Absolute)
};
// If the file already exists, update it.
if (tile != null)
{
tile.Update(tileData);
}
else
{
// Otherwise, create a new tile.
ShellTile.Create(new Uri(tileInfo.uri, UriKind.Relative), tileData);
}
break;
}