Ejemplo n.º 1
0
 private static void InitLiveTitleState(TileUpdater updater)
 {
     updater.EnableNotificationQueueForWide310x150(true);
     updater.EnableNotificationQueueForSquare150x150(true);
     updater.EnableNotificationQueueForSquare310x310(true);
     updater.EnableNotificationQueue(true);
     updater.Clear();
 }
Ejemplo n.º 2
0
 private void InitTileUpdater()
 {
     if (_tileUpdater == null)
     {
         _tileUpdater = TileUpdateManager.CreateTileUpdaterForApplication();
         _tileUpdater.EnableNotificationQueueForWide310x150(true);
         _tileUpdater.EnableNotificationQueueForSquare150x150(true);
         _tileUpdater.EnableNotificationQueueForSquare310x310(true);
         _tileUpdater.EnableNotificationQueue(true);
     }
 }
Ejemplo n.º 3
0
        public async void UpdateTiles(List <Videolist> collection)
        {
            if (updater == null)
            {
                updater = TileUpdateManager.CreateTileUpdaterForApplication();
            }
            updater.EnableNotificationQueueForWide310x150(true);
            updater.EnableNotificationQueueForSquare150x150(true);
            updater.EnableNotificationQueueForSquare310x310(true);
            updater.EnableNotificationQueue(true);

            foreach (var model in collection)
            {
                try
                {
                    var pcFolder = await ApplicationData.Current.LocalFolder.CreateFolderAsync(CacheConfig.Instance.PCSplashScreenImageCacheRelativePath, CreationCollisionOption.OpenIfExists);

                    var fileName = EyeSight.Encrypt.MD5Core.Instance.ComputeMD5(model.coverForDetail);
                    var file     = await pcFolder.TryGetItemAsync(fileName);

                    string xmlStr = null;

                    if (file != null)
                    {
                        xmlStr =
                            "<tile version='3'>"
                            + "<visual>"
                            + "<binding template='TileMedium' branding='name'>"
                            + "<image placement='peek' src='" + file.Path + "'/>"
                            + "<text hint-wrap='true'>" + model.title + "</text>"
                            + "</binding>"

                            + "<binding template='TileWide' branding='name'>"
                            + "<image placement='peek' src='" + file.Path + "'/>"
                            + "<text hint-wrap='true'>" + model.title + "</text>"
                            + "<text hint-style='captionsubtle' hint-wrap='true'>" + model.description + "</text>"
                            + "</binding>"

                            + "<binding template='TileLarge' branding='name'>"
                            + "<image placement='peek' src='" + file.Path + "'/>"
                            + "<text hint-wrap='true'>" + model.title + "</text>"
                            + "<text hint-style='captionsubtle' hint-wrap='true'>" + model.description + "</text>"
                            + "</binding>"
                            + "</visual>"
                            + "</tile>";
                    }
                    else
                    {
                        xmlStr =
                            "<tile version='3'>"
                            + "<visual>"
                            + "<binding template='TileMedium' branding='name'>"
                            + "<text hint-wrap='true'>" + model.title + "</text>"
                            + "</binding>"

                            + "<binding template='TileWide' branding='name'>"
                            + "<text hint-wrap='true'>" + model.title + "</text>"
                            + "<text hint-style='captionsubtle' hint-wrap='true'>" + model.description + "</text>"
                            + "</binding>"

                            + "<binding template='TileLarge' branding='name'>"
                            + "<text hint-wrap='true'>" + model.title + "</text>"
                            + "<text hint-style='captionsubtle' hint-wrap='true'>" + model.description + "</text>"
                            + "</binding>"
                            + "</visual>"
                            + "</tile>";
                    }

                    if (doc == null)
                    {
                        doc = new XmlDocument();
                    }

                    doc.LoadXml(xmlStr.Replace("&", "-"));

                    updater.Update(new TileNotification(doc));
                }
                catch (Exception ex)
                {
                    string s = ex.ToString();
                }
            }
        }