コード例 #1
0
        private void SetBadgeCountOnTileandSim()
        {
            // Get the toast history from Notification Center
            var toasts = ToastNotificationManager.History.GetHistory();

            if (toasts != null)
            {
                var count = toasts.Count();

                // Sync up the count on the tile
                TileServices.SetBadgeCountOnTile(count);

                //...and on our simulation on the UI
                this.TileSimulationBadgeCount = count;
            }
        }
コード例 #2
0
        public override async void OnNavigatedTo(string parameter, NavigationMode mode, Dictionary <string, object> state)
        {
            Debug.WriteLine("In DetailPageViewModel OnNavigatedTo");
            _repository = Repositories.MessageItemRepository.GetInstance();
            await LoadRuntimeDataAsync(parameter);

            // Since we are viewing this item, set its status to 'Read'
            this.MessageItem.IsRead = true;
            await _repository.UpdateAsync(this.MessageItem);

            // Also remove it from the Action Center if it is there
            ToastNotificationManager.History.Remove(parameter);

            // Set the Badge count on the tile
            var toasts = ToastNotificationManager.History.GetHistory();

            if (toasts != null)
            {
                var count = toasts.Count();
                // Sync up the count on the tile
                TileServices.SetBadgeCountOnTile(count);
            }
        }