private async Task NavigateToBoardCatalog(BoardCatalogNavigationTarget target) { var profile = NetworkProfileHelper.CurrentProfile; if (profile.WarningCatalog) { var dialog = new MessageDialog("Открыть каталог треда? Это может привести к большому расходу трафика.", "Внимание!") { Commands = { new UICommand("Да", async command => { await DoNavigateToBoardCatalog(target); }), new UICommand("Нет")} }; dialog.CancelCommandIndex = 1; dialog.DefaultCommandIndex = 0; await dialog.ShowAsync(); } else { await DoNavigateToBoardCatalog(target); } }
private async Task DoNavigateToBoardCatalog(BoardCatalogNavigationTarget target) { var nkey1 = target.Link?.GetNavigationKey(); if (nkey1 != null) { var nkey = ServiceLocator.Current.GetServiceOrThrow<INavigationKeyService>().Serialize(nkey1); if (nkey != null) { Shell.HamburgerMenu.NavigationService.Navigate(typeof(CatalogPage), nkey); Shell.HamburgerMenu.NavigationService.ClearCache(true); } } else { throw new ArgumentException("Невозможно получить ключ навигации", nameof(target)); } }