コード例 #1
0
ファイル: MainPage.xaml.cs プロジェクト: huangyt39/UWP
        public MainPage()
        {
            this.InitializeComponent();

            this.ViewModel = new ItemListViewModels();

            DispatcherTimer timer = new DispatcherTimer();

            timer.Interval = TimeSpan.FromSeconds(4);
            timer.Tick    += (x, y) =>
            {
                var updater = TileUpdateManager.CreateTileUpdaterForApplication();
                TileNotification notification;

                var item = ViewModel.AllItems.ElementAt(ItemIndex);

                var xmlDoc = TileService.CreateTiles(new PrimaryTile(item.title, item.detail, item.date));

                notification = new TileNotification(xmlDoc);
                updater.Update(notification);

                ItemIndex = (ItemIndex + 1) % ViewModel.AllItems.Count;
            };
            timer.Start();
        }
コード例 #2
0
ファイル: View.cs プロジェクト: kevinli36/Calendar
        private void UpdatePrimaryTile(string title, string detail)
        {
            var xmlDoc  = TileService.CreateTiles(new PrimaryTile(title, detail));
            var updater = TileUpdateManager.CreateTileUpdaterForApplication();
            TileNotification notification = new TileNotification(xmlDoc);

            updater.Update(notification);
        }
コード例 #3
0
ファイル: MainPage.xaml.cs プロジェクト: yaoxh6/uwp
        private void UpdatePrimaryTile(string input, string input2)
        {
            var xmlDoc = TileService.CreateTiles(new PrimaryTile(input, input2));

            var updater = TileUpdateManager.CreateTileUpdaterForApplication();
            TileNotification notification = new TileNotification(xmlDoc);

            updater.Update(notification);
        }
コード例 #4
0
        private void UpdatePrimaryTile(object sender, RoutedEventArgs e)
        {
            XmlDocument xmlDoc = TileService.CreateTiles(new PrimaryTile());

            TileUpdater      updater      = TileUpdateManager.CreateTileUpdaterForApplication();
            TileNotification notification = new TileNotification(xmlDoc);

            updater.Update(notification);
        }
コード例 #5
0
        private void UpdatePrimaryTile(object sender, Windows.UI.Xaml.RoutedEventArgs e)
        {
            var xmlDoc = TileService.CreateTiles(new PrimaryTile());

            var updater = TileUpdateManager.CreateTileUpdaterForApplication();
            TileNotification notification = new TileNotification(xmlDoc);

            updater.Update(notification);
        }
コード例 #6
0
ファイル: MainPage.xaml.cs プロジェクト: Gongzq5/MOSAD_UWP
        private void UpdatePrimaryTile(object sender, RoutedEventArgs e)
        {
            var updater = TileUpdateManager.CreateTileUpdaterForApplication();

            updater.Clear();
            updater.EnableNotificationQueue(true);
            for (int i = 0; i < VM.Collection.Count; i++)
            {
                var xmlDoc = TileService.CreateTiles(new PrimaryTile(VM.Collection[i].DueDate.Date.Date.ToString().Substring(0, VM.Collection[i].DueDate.Date.Date.ToString().LastIndexOf(" ")), VM.Collection[i].Title, VM.Collection[i].Description));
                TileNotification notification = new TileNotification(xmlDoc);
                updater.Update(notification);
            }
        }
コード例 #7
0
        private void UpdateTile(ThreadPoolTimer timer)
        {
            if (ViewModels.AllItems.Count != 0)
            {
                Debug.WriteLine(ViewModels.AllItems[tile_index].Description);
                var xmlDoc = TileService.CreateTiles(ViewModels.AllItems[tile_index]);

                var updater = TileUpdateManager.CreateTileUpdaterForApplication();
                TileNotification notification = new TileNotification(xmlDoc);
                updater.Update(notification);
                if (++tile_index == ViewModels.AllItems.Count)
                {
                    tile_index = 0;
                }
            }
        }
コード例 #8
0
        public static void Tile()
        {
            var updater = TileUpdateManager.CreateTileUpdaterForApplication();

            updater.EnableNotificationQueueForSquare150x150(true);
            updater.EnableNotificationQueueForSquare310x310(true);
            updater.EnableNotificationQueueForWide310x150(true);
            updater.EnableNotificationQueue(true);
            int count = 0;

            updater.Clear();
            foreach (var n in ViewModels.TodoItemViewModel.GetInstance().AllItems)
            {
                Windows.Data.Xml.Dom.XmlDocument doc = new Windows.Data.Xml.Dom.XmlDocument();
                doc = TileService.CreateTiles(n);
                TileNotification tileNotification = new TileNotification(doc);
                updater.Update(tileNotification);
                if (count++ == 5)
                {
                    break;
                }
            }
        }
コード例 #9
0
        private void UpdateTile()
        {
            System.Threading.Tasks.Task task = new System.Threading.Tasks.Task(() => {
                var updater = TileUpdateManager.CreateTileUpdaterForApplication();
                updater.EnableNotificationQueue(true);
                updater.Clear();

                List <ListItem> item_list = conn.Query <ListItem>("select * from ListItem");
                int itemCount             = 0;

                foreach (var item in item_list)
                {
                    XmlDocument tileXml = TileService.CreateTiles(item);
                    updater.Update(new TileNotification(tileXml));
                    itemCount++;
                    if (itemCount >= 5)
                    {
                        break;
                    }
                }
                TileService.SetBadgeCountOnTile(item_list.Count);
            });
            task.Start();
        }