protected async Task MyOnNavigatedTo() { try { if (IsMainPage() && (AppConfig.AppUpdate == UpdateVersion.NotSet || AppConfig.AppUpdate == UpdateVersion.V1_4) && !popUpNewVersion.IsOpen) { this.IsEnabled = false; ApplicationBar.IsVisible = false; PopUpNewVersion(); popUpNewVersion.IsOpen = true; } } catch (Exception ex) { GA.LogException(ex); ClearPopUpError(); } var updatedFeeds = await _feedManager.LoadAsync(); if (updatedFeeds != null && updatedFeeds.Count > 0) { var message = FeedHelper.BuildUpdateStatus(updatedFeeds); var count = updatedFeeds.Count > AppConfig.MAX_NEW_UPDATE_MESSENGER_WAIT ? AppConfig.MAX_NEW_UPDATE_MESSENGER_WAIT : updatedFeeds.Count; Messenger.ShowToast(message, miliSecondsUntilHidden: count * 2000); } }
private async Task LoadDownloadedFeeds() { this.SetProgressIndicator(message: "đang cập nhật tin đã tải ngầm..."); var updatedFeeds = await _feedManager.LoadDownloadedFeeds(); this.SetProgressIndicator(false); if (updatedFeeds != null && updatedFeeds.Count > 0) { var message = FeedHelper.BuildUpdateStatus(updatedFeeds); int count = updatedFeeds.OrderByDescending(f => f.Value).Take(AppConfig.MAX_NEW_FEED_UPDATED_SHOW).Count(); Messenger.ShowToast(message, miliSecondsUntilHidden: count * 1500); StandardTileData tile = new StandardTileData() { Count = 0, BackBackgroundImage = new Uri("IDontExist", UriKind.Relative), BackContent = string.Empty, BackTitle = string.Empty }; ShellTile appTile = ShellTile.ActiveTiles.First(); if (appTile != null) { appTile.Update(tile); } } }