Ejemplo n.º 1
0
 private async Task DoNavigate(PageNavigationTargetBase target)
 {
     if (target == null) throw new ArgumentNullException(nameof(target));
     if (target is BoardInfoNavigationTarget)
     {
         await NavigateToBoardInfo((BoardInfoNavigationTarget)target);
         return;
     }
     if (target is BoardPageNavigationTarget)
     {
         await NavigateToBoardPage((BoardPageNavigationTarget)target);
         return;
     }
     if (target is BoardCatalogNavigationTarget)
     {
         await NavigateToBoardCatalog((BoardCatalogNavigationTarget)target);
         return;
     }
     if (target is ThreadNavigationTarget)
     {
         await NavigateToThread((ThreadNavigationTarget)target);
         return;
     }
     if (target is MediaNavigationTarget)
     {
         await DoNavigateToMedia((MediaNavigationTarget)target);
         return;
     }
     if (target is PostingNavigationTarget)
     {
         await NavigateToPosting((PostingNavigationTarget)target);
         return;
     }
     throw new ArgumentException($"Неизвестный тип цели навигации \"{target.GetType().FullName}\"", nameof(target));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Произвести навигацию.
 /// </summary>
 /// <param name="target"></param>
 /// <param name="reportError">Показать ошибку.</param>
 public void Navigate(PageNavigationTargetBase target, bool reportError = true)
 {
     AppHelpers.DispatchAction(async () =>
     {
         await DoNavigate(target);
     }, reportError, 0);
 }