示例#1
0
        private static void UpdateTile(TileViewModel viewModel)
        {
            var updater = TileUpdateManager.CreateTileUpdaterForApplication();

            updater.EnableNotificationQueue(false);
            updater.Clear();
            updater.Update(new TileNotification(BuildTileXml(viewModel)));
        }
示例#2
0
        private static XmlDocument BuildTileXml(TileViewModel viewModel)
        {
            var tileXml = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquare150x150Text01);

            SetElementInnerText(tileXml, 0, FormatTitle(viewModel.StartTime, viewModel.UsualEndTime));
            SetElementInnerText(tileXml, 1, FormatEndTime(viewModel.EndTime, viewModel.Hours));
            SetElementInnerText(tileXml, 2, FormatEndTime(viewModel.NextEndTime, viewModel.NextHours));
            SetElementInnerText(tileXml, 3, "Updated " + DateTime.Now.ToString("HH:mm"));
            return(tileXml);
        }