Ejemplo n.º 1
0
        /// <summary>
        /// 更新磁贴
        /// </summary>
        private void Update(string title, string date)
        {
            TileUpdater updater = TileUpdateManager.CreateTileUpdaterForApplication();
            XmlDocument xml     = new XmlDocument();

            xml.LoadXml(File.ReadAllText("Tile.xml"));
            XmlNodeList texts  = xml.GetElementsByTagName("text");
            XmlNodeList images = xml.GetElementsByTagName("image");

            foreach (IXmlNode text in texts)
            {
                if (text.InnerText == "Title")
                {
                    text.InnerText = title;
                }
                if (text.InnerText == "Date")
                {
                    text.InnerText = date;
                }
            }
            var notification = new TileNotification(xml);

            updater.EnableNotificationQueue(true);
            updater.Update(notification);
        }
Ejemplo n.º 2
0
        public static void CreateLogoNotifications()
        {
            TileUpdater notifier = TileUpdateManager.CreateTileUpdaterForApplication();

            if (notifier.Setting == NotificationSetting.Enabled)
            {
                notifier.EnableNotificationQueue(true);

                var MainSquareTemplate = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquareImage);
                MainSquareTemplate.GetElementsByTagName("image")[0].Attributes[1].NodeValue = "ms-appx:///Assets/Logo.png";
                var squareNode = MainSquareTemplate.CreateAttribute("branding");
                squareNode.Value = "name";  //none|logo|name
                MainSquareTemplate.GetElementsByTagName("binding")[0].Attributes.SetNamedItem(squareNode);

                var MainWideTemplate = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWideImage);
                MainWideTemplate.GetElementsByTagName("image")[0].Attributes[1].NodeValue = "ms-appx:///Assets/WideLogo.png";
                var wideNode = MainWideTemplate.CreateAttribute("branding");
                wideNode.Value = "none";
                MainWideTemplate.GetElementsByTagName("binding")[0].Attributes.SetNamedItem(wideNode);

                var Mainnode = MainWideTemplate.ImportNode(MainSquareTemplate.GetElementsByTagName("binding").Item(0), true);
                MainWideTemplate.GetElementsByTagName("visual").Item(0).AppendChild(Mainnode);
                var MaintileNotification = new TileNotification(MainWideTemplate);
                notifier.Update(MaintileNotification);
            }
        }
Ejemplo n.º 3
0
        public static void CreateTile(Post post)
        {
            TileUpdater updater = TileUpdateManager.CreateTileUpdaterForApplication();

            updater.EnableNotificationQueue(true);
            updater.Clear();

            var tileLarge = TileContentFactory.CreateTileWide310x150PeekImage01();

            tileLarge.Image.Src = "ms-appx:///Assets/WideLogo.scale-240.png";
            string title = post.Title;

            //if (title.Length > 13)
            //{
            //    title = title.Substring(0, 12) + "…";
            //}
            tileLarge.TextBodyWrap.Text = post.Summary;
            tileLarge.TextHeading.Text  = title;

            var tileSmall = TileContentFactory.CreateTileSquare150x150PeekImageAndText02();

            tileSmall.Image.Src         = "ms-appx:///Assets/Logo.scale-240.png";
            tileSmall.TextHeading.Text  = post.BlogApp;
            tileSmall.TextBodyWrap.Text = post.Title;

            tileLarge.Square150x150Content = tileSmall;
            TileUpdateManager.CreateTileUpdaterForApplication().Update(tileLarge.CreateNotification());
        }
Ejemplo n.º 4
0
        private void enqueueTileWith(Model.Notification notification)
        {
            XmlDocument xml = new XmlDocument();

            xml.LoadXml(File.ReadAllText(Path.Combine(Package.Current.InstalledLocation.Path, "Views", "tile.xml")));
            XmlNodeList texts = xml.GetElementsByTagName("text");

            // for each tile size
            for (int index = 0; index < texts.Count; ++index)
            {
                switch (index % 3)
                {
                case 0:
                    texts[index].InnerText = notification.sender;
                    break;

                case 1:
                    texts[index].InnerText = Helpers.ISOStringConverter.toReadableString(notification.time);
                    break;

                case 2:
                    texts[index].InnerText = notification.content;
                    break;

                default:
                    break;
                }
            }
            XmlNodeList      images           = xml.GetElementsByTagName("image");
            TileNotification tileNotification = new TileNotification(xml);
            TileUpdater      updater          = TileUpdateManager.CreateTileUpdaterForApplication();

            updater.EnableNotificationQueue(true);
            updater.Update(tileNotification);
        }
Ejemplo n.º 5
0
        internal static async Task UpdateTile(IDisposable CanvasDevice, BookItem Book, string TileId)
        {
            TileUpdater Updater = TileUpdateManager.CreateTileUpdaterForSecondaryTile(TileId);

            Updater.EnableNotificationQueue(true);
            Updater.Clear();

            StringResources stx = StringResources.Load("Message");

            XmlDocument Template150 = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquare150x150Text01);

            Template150.GetElementsByTagName("text").First().AppendChild(Template150.CreateTextNode(stx.Str("NewContent")));
            Updater.Update(new TileNotification(Template150));

            XmlDocument Template71 = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquare71x71Image);
            IXmlNode    ImgSrc     = Template71.GetElementsByTagName("image")
                                     .FirstOrDefault()?.Attributes
                                     .FirstOrDefault(x => x.NodeName == "src");

            string SmallTile = await Image.LiveTileBadgeImage(CanvasDevice, Book, 150, 150, "\uEDAD");

            if (!string.IsNullOrEmpty(SmallTile))
            {
                ImgSrc.NodeValue = SmallTile;
                Updater.Update(new TileNotification(Template71));
            }
        }
Ejemplo n.º 6
0
        // Initialize the app's tiles on the Start page. There are three different sizes of tiles users can
        // choose from.
        private void InitializeTiles()
        {
            tileUpdater = TileUpdateManager.CreateTileUpdaterForApplication();
            var mediumSquareTile = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquare150x150PeekImageAndText01);
            var largeSquareTile  = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquare310x310ImageAndText02);
            var wideTile         = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWide310x150PeekImage02);

            tileUpdater.EnableNotificationQueue(true);

            mediumSquareTile.GetElementsByTagName("text")[0].InnerText = "TicTacToe";
            largeSquareTile.GetElementsByTagName("text")[0].InnerText  = "TicTacToe";
            wideTile.GetElementsByTagName("text")[0].InnerText         = "TicTacToe";

            var node1 = wideTile.ImportNode(mediumSquareTile.GetElementsByTagName("binding")[0], true);

            wideTile.GetElementsByTagName("visual")[0].AppendChild(node1);

            var node2 = wideTile.ImportNode(largeSquareTile.GetElementsByTagName("binding")[0], true);

            wideTile.GetElementsByTagName("visual")[0].AppendChild(node2);

            var testNotification = new TileNotification(wideTile);

            testNotification.Tag = "Test";
            tileUpdater.Update(testNotification);

            badgeUpdater = BadgeUpdateManager.CreateBadgeUpdaterForApplication();
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Sets up a periodic tile update that shows 5 recently played and popular game images from the Steamflix API.
        /// </summary>
        private void SetupPeriodicTileUpdate()
        {
            try
            {
                TileUpdater tileUpdateManager = null;

                // IoT Core doesn't support tile updates
                tileUpdateManager = TileUpdateManager.CreateTileUpdaterForApplication();

                var steamId = GetSteamId();
                var uris    = new List <Uri>
                {
                    new Uri($"{_steamflixTileApiUrl}/0/{steamId}"),
                    new Uri($"{_steamflixTileApiUrl}/1/{steamId}"),
                    new Uri($"{_steamflixTileApiUrl}/2/{steamId}"),
                    new Uri($"{_steamflixTileApiUrl}/3/{steamId}"),
                    new Uri($"{_steamflixTileApiUrl}/4/{steamId}")
                };

                tileUpdateManager.EnableNotificationQueue(true);
                tileUpdateManager.StartPeriodicUpdateBatch(uris, PeriodicUpdateRecurrence.TwelveHours);
            }
            catch
            {
                return;
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Setup for the TileUpdater
        /// </summary>
        /// <returns></returns>
        private static TileUpdater SetupUpdater()
        {
            TileUpdater tileUpdater = TileUpdateManager.CreateTileUpdaterForApplication();

            tileUpdater.EnableNotificationQueue(true);
            xmlDocument = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWideText09);
            return(tileUpdater);
        }
Ejemplo n.º 9
0
        public MainPage()
        {
            InitializeComponent();

            _tileUpdater = TileUpdateManager.CreateTileUpdaterForApplication();
            _tileUpdater.Clear();
            _tileUpdater.EnableNotificationQueue(false);
        }
Ejemplo n.º 10
0
 private static void InitLiveTitleState(TileUpdater updater)
 {
     updater.EnableNotificationQueueForWide310x150(true);
     updater.EnableNotificationQueueForSquare150x150(true);
     updater.EnableNotificationQueueForSquare310x310(true);
     updater.EnableNotificationQueue(true);
     updater.Clear();
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Initialises a new instance of the Skycap.Notifications.EmailTileNotification class.
 /// </summary>
 static EmailTileNotification()
 {
     // If tile updater is not initialised
     if (_tileUpdater == null)
     {
         _tileUpdater = TileUpdateManager.CreateTileUpdaterForApplication();
         _tileUpdater.EnableNotificationQueue(true);
     }
 }
Ejemplo n.º 12
0
 private void InitTileUpdater()
 {
     if (_tileUpdater == null)
     {
         _tileUpdater = TileUpdateManager.CreateTileUpdaterForApplication();
         _tileUpdater.EnableNotificationQueueForWide310x150(true);
         _tileUpdater.EnableNotificationQueueForSquare150x150(true);
         _tileUpdater.EnableNotificationQueueForSquare310x310(true);
         _tileUpdater.EnableNotificationQueue(true);
     }
 }
Ejemplo n.º 13
0
        private void Update()
        {
            _tileUpdater.EnableNotificationQueue(true);
            _tileUpdater.Clear();

            foreach (var message in _currentUnreads.Take(5))
            {
                var tileContent = NotificationUtils.CreateTileNotificationForMessage(message);
                _tileUpdater.Update(tileContent);
            }
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Setup the tile updater
        /// </summary>
        public static void Init()
        {
            if (DeviceHelper.IsXbox)
            {
                return;
            }

            // Setup the tile updaters
            TileUpdater = TileUpdateManager.CreateTileUpdaterForApplication("App");
            TileUpdater.EnableNotificationQueue(true);
        }
Ejemplo n.º 15
0
        // 启动一个“轮询服务端获取数据,然后更新 Tile 通知”的任务
        private void btnStartPeriodicUpdate_Click(object sender, RoutedEventArgs e)
        {
            // 启动一个循环更新 Tile 通知的任务,并指定 Tile 通知的数据源和轮询周期
            TileUpdater tileUpdater = TileUpdateManager.CreateTileUpdaterForSecondaryTile(TILEID);

            tileUpdater.EnableNotificationQueue(true); // 启用 tile 的队列功能(最多可容纳 5 个 tile)

            // 马上请求服务端获取数据,然后 45 分钟之后再次获取数据,最后再每半个小时获取一次数据
            tileUpdater.StartPeriodicUpdate(new Uri("http://localhost:44914/api/TileContent", UriKind.Absolute), DateTimeOffset.UtcNow.AddMinutes(45), PeriodicUpdateRecurrence.HalfHour);

            // Tile 通知的数据源示例请参见 WebApi/Controllers/TileContentController.cs
        }
Ejemplo n.º 16
0
        public void Run(IBackgroundTaskInstance taskInstance)
        {
            BackgroundTaskDeferral deferral = taskInstance.GetDeferral();

            tileUpdater = TileUpdateManager.CreateTileUpdaterForApplication();
            tileUpdater.EnableNotificationQueue(true);
            AddTileNotification("Hey Everyone... Whats up", "tag1");
            AddTileNotification("Come see the new coffee shops", "tag2");
            AddTileNotification("I need caffine", "tag3");
            AddTileNotification("I drink coffee therfore I live", "tag4");
            AddTileNotification("Caffine Drip please", "tag5");
            GetData(); deferral.Complete();
        }
Ejemplo n.º 17
0
        public static void run(List <Site> sites)
        {
            XmlDocument doc = new XmlDocument();

            doc.LoadXml(File.ReadAllText("Assets/Tile.xml"));
            TileUpdater updater = TileUpdateManager.CreateTileUpdaterForApplication();

            updater.Clear();
            TileNotification titleNotification = new TileNotification(doc);

            updater.Update(titleNotification);
            sites.ForEach(site => updater.Update(changeSite(doc, site)));
            updater.EnableNotificationQueue(true);
        }
Ejemplo n.º 18
0
        /// <summary>
        /// Create the application tile
        /// </summary>
        public async Task CreateAsync()
        {
            TileUpdater updater = TileUpdateManager.CreateTileUpdaterForApplication();

            updater.EnableNotificationQueue(true);

            // Clear tile notifications
            updater.Clear();

            // Add new notifications
            updater.Update(await AddConferencesToTileAsync());
            updater.Update(await AddNewsToTileAsync());
            updater.Update(await AddShowsToTileAsync());
            updater.Update(await AddNewsToTileAsync());
        }
Ejemplo n.º 19
0
        /// <summary>
        /// Updates the tiles.
        /// </summary>
        public static void UpdateTile()
        {
            TileUpdater theTile = TileUpdateManager.CreateTileUpdaterForApplication();

            theTile.EnableNotificationQueue(true);

            TileContent content = GenerateTileContent(DV.MediaDV.GetRandomFromCollection(null).DeRef);

            theTile.Update(new TileNotification(content.GetXml()));

            content = GenerateTileContent(DV.MediaDV.GetRandomFromCollection(null).DeRef);
            theTile.Update(new TileNotification(content.GetXml()));

            content = GenerateTileContent(DV.MediaDV.GetRandomFromCollection(null).DeRef);
            theTile.Update(new TileNotification(content.GetXml()));
        }
        /// <summary>
        /// Update the pin tile of a visit.
        /// </summary>
        /// <param name="visitItem">Visit item</param>
        /// <param name="tile">Tile</param>
        public async void UpdatePinTile(VisitItem visitItem, SecondaryTile tile)
        {
            try
            {
                tileUpdater = TileUpdateManager.CreateTileUpdaterForSecondaryTile(tile.TileId);
                tileUpdater.Clear();
                tileUpdater.EnableNotificationQueue(true);

                await CreateTile(visitItem, IMAGE_FILENAME + tile.TileId + IMAGE_FORMAT);

                CreateImageTile(visitItem, IMAGE_FILENAME + tile.TileId + IMAGE_FORMAT);
            }
            catch (Exception)
            {
            }
        }
Ejemplo n.º 21
0
 private void UpdateTile(IList <string> UserInfo)
 {
     try
     {
         updater.EnableNotificationQueue(true);
         updater.Clear();
         foreach (string iter_string in UserInfo)
         {
             updater.Update(new TileNotification(AddToDoc(iter_string)));
         }
     }
     catch (Exception)
     {
         // ignored
     }
 }
        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            TileUpdater tileUpdate = TileUpdateManager.CreateTileUpdaterForApplication();

            tileUpdate.EnableNotificationQueue(true);
            tileUpdate.Clear();
#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = true;
            }
#endif
            SQLiteService.LoadDatabase();

            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (e.PrelaunchActivated == false)
            {
                if (rootFrame.Content == null)
                {
                    // When the navigation stack isn't restored navigate to the first page,
                    // configuring the new page by passing required information as a navigation
                    // parameter
                    rootFrame.Navigate(typeof(MainPage), e.Arguments);
                }
                // Ensure the current window is active
                Window.Current.Activate();
            }
        }
Ejemplo n.º 23
0
        // 更新所有的 SecondaryTile 通知
        private async void btnUpdateSecondaryTile_Click(object sender, RoutedEventArgs e)
        {
            IReadOnlyList <SecondaryTile> secondaryTileList = await SecondaryTile.FindAllAsync();

            foreach (var secondaryTile in secondaryTileList)
            {
                // 用于描述 tile 通知的 xml 字符串
                string tileXml = $@"
                <tile>
                    <visual>
                        <binding template='TileSmall'>
                            <text>Small(小){DateTime.Now.ToString("HH:mm:ss")}</text>
                        </binding>
                        <binding template='TileMedium'>
                            <text>Medium(中){DateTime.Now.ToString("HH:mm:ss")}</text>
                        </binding>
                        <binding template='TileWide'>
                            <text>Wide(宽){DateTime.Now.ToString("HH:mm:ss")}</text>
                        </binding>
                        <binding template='TileLarge'>
                            <text>Large(大){DateTime.Now.ToString("HH:mm:ss")}</text>
                        </binding>
                    </visual>
                </tile>";

                // 将 xml 字符串转换为 Windows.Data.Xml.Dom.XmlDocument 对象
                XmlDocument tileDoc = new XmlDocument();
                tileDoc.LoadXml(tileXml);
                // 获取此 tile 的 xml
                // lblMsg.Text = tileDoc.GetXml();

                // 实例化 TileNotification 对象
                TileNotification tileNotification = new TileNotification(tileDoc);
                DateTimeOffset   expirationTime   = DateTimeOffset.UtcNow.AddSeconds(30);
                tileNotification.ExpirationTime = expirationTime; // 30 秒后清除这个 tile

                // 将指定的 TileNotification 对象更新到 secondary tile
                TileUpdater tileUpdater = TileUpdateManager.CreateTileUpdaterForSecondaryTile(secondaryTile.TileId);
                tileUpdater.EnableNotificationQueue(true); // 启用 tile 的队列功能(最多可容纳 5 个 tile)
                tileUpdater.Update(tileNotification);


                // 更新此 SecondaryTile 对象的相关信息
                secondaryTile.Arguments = $"Arguments(TileId: {secondaryTile.TileId}){DateTime.Now.ToString("HH:mm:ss")}";
                bool success = await secondaryTile.UpdateAsync();
            }
        }
Ejemplo n.º 24
0
        public static void CreateSecondTileNotifications(string tileId, string imageUri, string text, string subText)
        {
            TileUpdater notifier = TileUpdateManager.CreateTileUpdaterForSecondaryTile(tileId);

            if (notifier.Setting == NotificationSetting.Enabled)
            {
                notifier.EnableNotificationQueue(true);

                var SquareTemplate = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquarePeekImageAndText03);
                SquareTemplate.GetElementsByTagName("image")[0].Attributes[1].NodeValue = imageUri;
                SquareTemplate.GetElementsByTagName("text")[0].AppendChild(SquareTemplate.CreateTextNode(text));
                SquareTemplate.GetElementsByTagName("text")[1].AppendChild(SquareTemplate.CreateTextNode(subText));

                var tileNotification = new TileNotification(SquareTemplate);
                notifier.Update(tileNotification);
            }
        }
        /// <summary>
        /// Update the main tile with next visits.
        /// </summary>
        /// <param name="visits">Visits collection.</param>
        public async void UpdateMainTile(IList <Visit> visits)
        {
            if (visits.Any())
            {
                tileUpdater = TileUpdateManager.CreateTileUpdaterForApplication();
                tileUpdater.Clear();
                tileUpdater.EnableNotificationQueue(true);
                var i = 0;

                foreach (var visit in visits)
                {
                    var visitItem = new VisitItem(visit, 0);

                    await CreateTile(visitItem, string.Format("mainTile_{0}.jpg", i.ToString()));

                    i++;
                }
            }
        }
Ejemplo n.º 26
0
        public void ClearTileStatus(string Id)
        {
            XParameter TileParam = XReg.Parameter(Id);

            if (TileParam == null)
            {
                return;
            }

            string TileId = TileParam.GetValue("tileId");

            try
            {
                TileUpdater Updater = TileUpdateManager.CreateTileUpdaterForSecondaryTile(TileId);
                Updater.Clear();
                Updater.EnableNotificationQueue(false);
            }
            catch (Exception) { }
        }
Ejemplo n.º 27
0
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            tileUpdate = GetTileUpdater();
            tileUpdate.EnableNotificationQueue(true);
            tileUpdate.Clear();

            Frame rootFrame = Window.Current.Content as Frame;

            Windows.UI.Core.SystemNavigationManager.GetForCurrentView().BackRequested += BackRequested;

            // 不要在窗口已包含内容时重复应用程序初始化,
            // 只需确保窗口处于活动状态
            if (rootFrame == null)
            {
                // 创建要充当导航上下文的框架,并导航到第一页
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: 从之前挂起的应用程序加载状态
                }

                // 将框架放在当前窗口中
                Window.Current.Content = rootFrame;
            }

            if (e.PrelaunchActivated == false)
            {
                if (rootFrame.Content == null)
                {
                    // 当导航堆栈尚未还原时,导航到第一页,
                    // 并通过将所需信息作为导航参数传入来配置
                    // 参数
                    rootFrame.Navigate(typeof(LoginPage), e.Arguments);
                }
                // 确保当前窗口处于活动状态
                Window.Current.Activate();
                rootFrame.Navigated += OnNavigated;
            }
        }
Ejemplo n.º 28
0
        /// <summary>
        /// Opdaterer applikationstile med nyheder til finansstyring.
        /// </summary>
        /// <param name="nyheder">Nyheder til finansstyring.</param>
        private static void UpdateTile(IEnumerable <INyhedModel> nyheder)
        {
            if (nyheder == null)
            {
                throw new ArgumentNullException(nameof(nyheder));
            }

            TileUpdater tileUpdater = TileUpdateManager.CreateTileUpdaterForApplication();

            tileUpdater.EnableNotificationQueue(true);
            tileUpdater.Clear();
            foreach (IGrouping <DateTime, INyhedModel> nyhedsgruppe in nyheder.Where(m => string.IsNullOrEmpty(m.Nyhedsinformation) == false).OrderByDescending(m => m.Nyhedsudgivelsestidspunkt.Date).Take(5).GroupBy(m => m.Nyhedsudgivelsestidspunkt.Date))
            {
                foreach (INyhedModel nyhed in nyhedsgruppe.OrderByDescending(m => m.Nyhedsaktualitet))
                {
                    tileUpdater.Update(UpdateTile(nyhed, TileTemplateType.TileSquare150x150Text04));
                    tileUpdater.Update(UpdateTile(nyhed, TileTemplateType.TileWide310x150BlockAndText02));
                }
            }
        }
Ejemplo n.º 29
0
        /// <summary>
        /// Método que configura a URL das live tiles do aplicativo.
        /// </summary>
        public static void CreateTile()
        {
            var uris = new List <Uri>();

            for (int i = 0; i < 5; i++)
            {
                uris.Add(new Uri("http://" + backendUrl + "notifications/tiles/tile.php" + finalUrl + "&tile=" + i));
            }

            TileUpdater LiveTileUpdater = TileUpdateManager.CreateTileUpdaterForApplication();

            LiveTileUpdater.Clear();
            LiveTileUpdater.EnableNotificationQueue(true);
            LiveTileUpdater.StartPeriodicUpdateBatch(uris, PeriodicUpdateRecurrence.Daily);

            BadgeUpdater BadgeUpdater = BadgeUpdateManager.CreateBadgeUpdaterForApplication();

            BadgeUpdater.Clear();
            BadgeUpdater.StartPeriodicUpdate(new Uri("http://" + backendUrl + "notifications/tiles/badge.php" + finalUrl), PeriodicUpdateRecurrence.Daily);
        }
Ejemplo n.º 30
0
        public void UpdateSecondaryTile(string tileID, string backtitle, string backcontent)
        {
            if (string.IsNullOrEmpty(tileID) || string.IsNullOrEmpty(backcontent))
            {
                return;
            }
            if (!SecondaryTile.Exists(tileID))
            {
                return;
            }
            var tileContent = TileContentFactory.CreateTileSquare150x150PeekImageAndText02();

            tileContent.TextHeading.Text  = backtitle;
            tileContent.TextBodyWrap.Text = backcontent;
            tileContent.Image.Src         = "ms-appx:///Assets/Tile150x150.png";
            var         tileNotification = tileContent.CreateNotification();
            TileUpdater updater          = TileUpdateManager.CreateTileUpdaterForSecondaryTile(tileID);

            updater.EnableNotificationQueue(false);
            updater.Update(tileNotification);
        }