windows-phone-8 - Windows Phone 8 自定义动态磁贴

标签 windows-phone-8 live-tile

我创建了一个应用程序,其中包含我自己的自定义动态磁贴。
创建了三种尺寸的动态磁贴用户控件,但这里只添加了一种尺寸(参见代码),我需要为其他两种尺寸(中型和小型磁贴)添加相同的尺寸。

这是来源 - Custom Live Tile

下面是 Wide Tile 的代码...

Dispatcher.BeginInvoke(() =>
   {
       // Render the new tile image
       RenderImageLibrary.WideTileControl wtc = 
            new RenderImageLibrary.WideTileControl(tempMain, descr, loc);
       wtc.SaveJpegComplete += async (s, args) =>
       {
           try
           {
              if (args.Success)
              {
                 // Set the tile image URI - "isostore:/" is important! Note that the control already
                 // puts the image into /Shared/ShellContent which is where tile images in the local folder must be
                 Uri tileImageUri = new Uri("isostore:/" + args.ImageFileName, UriKind.RelativeOrAbsolute);
                 Debug.WriteLine(tileImageUri.ToString());

                 // Set the tile image
                 FlipTileData ftd = new FlipTileData();
                 ftd.WideBackgroundImage = tileImageUri;

                 ShellTile.ActiveTiles.First().Update(ftd);
              }
              else
              {
                 Debug.WriteLine(args.Exception.ToString());
              }
           }
           catch (Exception ex)
           {
              Debug.WriteLine(ex.ToString());
           }
       };
       wtc.BeginSaveJpeg();
   });

最佳答案

你可以使用

ftd.BackgroundImage = tileImageUri; ftd.SmallBackgroundImage = tileImageUri;

更多关于FlipTileData的信息可以引用http://msdn.microsoft.com/en-us/library/windowsphone/develop/microsoft.phone.shell.fliptiledata

关于windows-phone-8 - Windows Phone 8 自定义动态磁贴,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22985637/

相关文章:

c# - Windows Phone 8.1 动态磁贴自定义品牌?

c# - 如何改变录制声音的音调?

html - Windows Phone 中的固定宽度视口(viewport)

c# - 防止后台任务更新 LiveTile

windows-phone - Windows Phone 动态磁贴

c# - Windows Phone 8.1 - 检查主/应用磁贴是否固定到开始屏幕

windows-phone-8 - 如何创建具有自定义布局的 WP8 动态磁贴?

c# - 如何在 Windows Phone 8 中始终显示数字键盘?

android - window.open 链接不会在 Windows Phone 8 的 cordova 应用程序中打开

c# - VS 2015-WP8- "A specified communication resource (port) is already in use by another application."