Windows phone 7 定制贝壳砖

Windows phone 7 定制贝壳砖,windows-phone-7,live-tile,Windows Phone 7,Live Tile,有没有办法创建一个自定义ShellTile,在开始时显示(在用户锁定我们的应用程序之后)?我想重新调整计数编号(标签)的大小和位置,但我找不到方法 您不能更改标题或计数器的位置或样式,但可以生成要显示在平铺上的图像,例如: WriteableBitmap bitmap = new WriteableBitmap(173, 173); TextBlock textBlock = new TextBlock(); textBlock.TextWrapping = TextWrapping.Wrap

有没有办法创建一个自定义ShellTile,在开始时显示(在用户锁定我们的应用程序之后)?我想重新调整计数编号(标签)的大小和位置,但我找不到方法

您不能更改标题或计数器的位置或样式,但可以生成要显示在平铺上的图像,例如:

WriteableBitmap bitmap = new WriteableBitmap(173, 173);

TextBlock textBlock = new TextBlock();
textBlock.TextWrapping = TextWrapping.Wrap;
textBlock.Foreground = new SolidColorBrush(Colors.White);
textBlock.FontSize = 22.0;
textBlock.Margin = new Thickness(12.0, 8.0, 8.0, 45.0);
textBlock.Text = "Lorem ipsum";
textBlock.HorizontalAlignment = HorizontalAlignment.Stretch;
textBlock.VerticalAlignment = VerticalAlignment.Stretch;

Grid layoutRoot = new Grid();
layoutRoot.Background = (Brush)App.Current.Resources["PhoneAccentBrush"];
layoutRoot.Width = 173.0;
layoutRoot.Height = 173.0;
layoutRoot.Children.Add(textBlock);

layoutRoot.Measure(new Size(173, 173));
layoutRoot.Arrange(new Rect(0, 0, 173, 173));
layoutRoot.UpdateLayout();
bitmap.Render(layoutRoot, null);
bitmap.Invalidate();

using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication())
{
    string fileName = "/Shared/ShellContent/BackgroundImage.jpg";
    using (Stream fileStream = storage.CreateFile(fileName))
    {
        bitmap.SaveJpeg(fileStream, 173, 173, 0, 100);
    }
}

StandardTileData tileData = new StandardTileData
{
    BackgroundImage = new Uri("isostore:"/Shared/ShellContent/BackgroundImage.jpg, UriKind.Absolute),
    Title = "Lorem Ipsum,
};

ShellTile.Create(new Uri("/MainPage.xaml", UriKind.Relative), tileData);

您不能更改标题或计数器的位置或样式,但可以生成要显示在平铺上的图像,例如:

WriteableBitmap bitmap = new WriteableBitmap(173, 173);

TextBlock textBlock = new TextBlock();
textBlock.TextWrapping = TextWrapping.Wrap;
textBlock.Foreground = new SolidColorBrush(Colors.White);
textBlock.FontSize = 22.0;
textBlock.Margin = new Thickness(12.0, 8.0, 8.0, 45.0);
textBlock.Text = "Lorem ipsum";
textBlock.HorizontalAlignment = HorizontalAlignment.Stretch;
textBlock.VerticalAlignment = VerticalAlignment.Stretch;

Grid layoutRoot = new Grid();
layoutRoot.Background = (Brush)App.Current.Resources["PhoneAccentBrush"];
layoutRoot.Width = 173.0;
layoutRoot.Height = 173.0;
layoutRoot.Children.Add(textBlock);

layoutRoot.Measure(new Size(173, 173));
layoutRoot.Arrange(new Rect(0, 0, 173, 173));
layoutRoot.UpdateLayout();
bitmap.Render(layoutRoot, null);
bitmap.Invalidate();

using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication())
{
    string fileName = "/Shared/ShellContent/BackgroundImage.jpg";
    using (Stream fileStream = storage.CreateFile(fileName))
    {
        bitmap.SaveJpeg(fileStream, 173, 173, 0, 100);
    }
}

StandardTileData tileData = new StandardTileData
{
    BackgroundImage = new Uri("isostore:"/Shared/ShellContent/BackgroundImage.jpg, UriKind.Absolute),
    Title = "Lorem Ipsum,
};

ShellTile.Create(new Uri("/MainPage.xaml", UriKind.Relative), tileData);