From e2f029893e0234be91f51f3455aee1dfb0f5b0fa Mon Sep 17 00:00:00 2001 From: Daniel Pichler Date: Sat, 12 Oct 2024 17:19:38 +0200 Subject: [PATCH] GotoAsync Variante --- Jugenddienst Stunden/ViewModels/StundenViewModel.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Jugenddienst Stunden/ViewModels/StundenViewModel.cs b/Jugenddienst Stunden/ViewModels/StundenViewModel.cs index cc9225c..4ff0685 100644 --- a/Jugenddienst Stunden/ViewModels/StundenViewModel.cs +++ b/Jugenddienst Stunden/ViewModels/StundenViewModel.cs @@ -11,7 +11,7 @@ using System.Globalization; using System; -namespace Jugenddienst_Stunden.ViewModels; +namespace Jugenddienst_Stunden.ViewModels; internal class StundenViewModel : ObservableObject, IQueryAttributable { public string Name => AppInfo.Name; public string Surname => AppInfo.VersionString; @@ -119,7 +119,7 @@ internal class StundenViewModel : ObservableObject, IQueryAttributable { public static string apiKey = Preferences.Default.Get("apiKey", ""); public StundenViewModel() { - + _hour = new Types.Hours(); LoadDataCommand = new AsyncRelayCommand(LoadData); @@ -139,9 +139,11 @@ internal class StundenViewModel : ObservableObject, IQueryAttributable { } private async Task SelectEntryAsync(DayTime entry) { - if (entry != null && entry.id != null) - await Shell.Current.GoToAsync($"{nameof(Views.StundePage)}?load={entry.id}"); - else AlertEvent?.Invoke(this, "Auswahl enthält keine Daten"); + if (entry != null && entry.id != null) { + var navigationParameters = new Dictionary {{ "load", entry.id }}; + //await Shell.Current.GoToAsync($"{nameof(Views.StundePage)}?load={entry.id}"); + await Shell.Current.GoToAsync($"{nameof(Views.StundePage)}", navigationParameters); + } else AlertEvent?.Invoke(this, "Auswahl enthält keine Daten"); }