このようなものを使用して、BackgroundColor プロパティを含むアプリケーション タイルのすべてのプロパティを設定できます。
//REFERENCE: http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207009(v=vs.105).aspx
// Set all the properties of the Application Tile.
private void SetApplicationTile()
{
// Application Tile is always the first Tile, even if it is not pinned to Start.
ShellTile TileToFind = ShellTile.ActiveTiles.First();
// Application should always be found
if (TileToFind != null)
{
IconicTileData TileData = new IconicTileData()
{
Title = "My App title",
WideContent1 = "New Wide Content 1",
WideContent2 = "New Wide Content 2",
WideContent3 = "New Wide Content 3",
//Count = 2,
//BackgroundColor = Colors.Blue,
//BackgroundColor = new Color { A = 255, R = 200, G = 148, B = 255 },
//BackgroundColor = Color.FromArgb(255, 200, 148, 55),
//BackgroundColor = (Color)Application.Current.Resources["PhoneAccentColor"],
BackgroundColor = HexToColor("#FF7A3B3F"),
IconImage = new Uri("Assets/Tiles/IconicTileMediumLarge.png", UriKind.Relative),
SmallIconImage = new Uri("Assets/Tiles/IconicTileSmall.png", UriKind.Relative),
};
// Update the Application Tile
TileToFind.Update(TileData);
}
}
public static Color HexToColor(string hex)
{
return Color.FromArgb(
Convert.ToByte(hex.Substring(1, 2), 16),
Convert.ToByte(hex.Substring(3, 2), 16),
Convert.ToByte(hex.Substring(5, 2), 16),
Convert.ToByte(hex.Substring(7, 2), 16)
);
}
重要な注意点
BackgroundColor プロパティの A パラメータを 255 に設定しない場合、カスタムの背景色は表示されず、代わりにデフォルトのテーマ カラーが表示されます。