Refactor: Remove GlobalVar and replace with IAppSettings; restructure affected infrastructure, services, and view models for dependency injection.
This commit is contained in:
@@ -28,24 +28,13 @@ public partial class StundenPage : ContentPage {
|
||||
vm.AlertEvent += Vm_AlertEvent;
|
||||
vm.InfoEvent += Vm_InfoEvent;
|
||||
|
||||
// Navigation NICHT im CTOR ausführen (Shell/Navigation-Stack ist hier oft noch nicht ?ready?)
|
||||
// if (!CheckLogin()) {
|
||||
// NavigateToTargetPage();
|
||||
// }
|
||||
}
|
||||
|
||||
private void Vm_AlertEvent(object? sender, string e) {
|
||||
MainThread.BeginInvokeOnMainThread(async () => { await DisplayAlert("Fehler:", e, "OK"); });
|
||||
}
|
||||
|
||||
//private void Vm_InfoEvent(object? sender, string e) {
|
||||
// DisplayAlert("Information:", e, "OK");
|
||||
//}
|
||||
//private void Vm_InfoEvent(object? sender, string e) {
|
||||
// MainThread.BeginInvokeOnMainThread(async () => {
|
||||
// await DisplayAlert("Information:", e, "OK");
|
||||
// });
|
||||
//}
|
||||
|
||||
private void Vm_InfoEvent(object? sender, string e) {
|
||||
MainThread.BeginInvokeOnMainThread(async () => {
|
||||
CancellationTokenSource cts = new CancellationTokenSource();
|
||||
@@ -76,9 +65,6 @@ public partial class StundenPage : ContentPage {
|
||||
return Preferences.Default.Get("apiKey", "") != "";
|
||||
}
|
||||
|
||||
// private async void NavigateToTargetPage() {
|
||||
// await Navigation.PushAsync(new LoginPage());
|
||||
// }
|
||||
|
||||
private Task NavigateToTargetPage() {
|
||||
// Shell-Navigation statt Navigation.PushAsync
|
||||
|
||||
Reference in New Issue
Block a user