protected async override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); BadgeHelper.ClearBadge().Set(); ApplicationData.Current.LocalSettings.Values[RawNotificationTask.GetCountKey()] = 0; if (this.initialized) { return; } this.initialized = true; if (!string.IsNullOrWhiteSpace(App.ChannelError)) { StatusText.Text = App.ChannelError; ChannelBox.Text = "N/A"; } else { StatusText.Text = "Channel retrieved."; ChannelBox.Text = App.Channel.Uri; App.Channel.PushNotificationReceived += this.ChannelPushNotificationReceived; await this.ConfigureBackgroundTask(); Remote.Text = RemoteText; } }
private async void ClearBadge_OnClick(object sender, RoutedEventArgs e) { BadgeHelper.ClearBadge().Set(); var dialog = new MessageDialog("The badge was cleared."); await dialog.ShowAsync(); this.Frame.GoBack(); }