Refactor StundePage to MVVM with DI
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user