Refactor StundePage to MVVM with DI

This commit is contained in:
2025-12-25 09:19:32 +01:00
parent 8da8734065
commit 15856d0dd0
5 changed files with 26 additions and 54 deletions

View File

@@ -13,14 +13,13 @@ public partial class StundePage : ContentPage {
/// <summary>
/// CTOR
/// </summary>
public StundePage() {
public StundePage(StundeViewModel vm) {
InitializeComponent();
if (BindingContext is StundeViewModel vm) {
vm.AlertEvent += Vm_AlertEvent;
vm.InfoEvent += Vm_InfoEvent;
vm.ConfirmEvent += ShowConfirm;
}
BindingContext = vm;
vm.AlertEvent += Vm_AlertEvent;
vm.InfoEvent += Vm_InfoEvent;
vm.ConfirmEvent += ShowConfirm;
}
private void Vm_AlertEvent(object? sender, string e) {