Confirm Delete
This commit is contained in:
@@ -1,13 +1,30 @@
|
||||
using Jugenddienst_Stunden.Types;
|
||||
using System.ComponentModel;
|
||||
using Jugenddienst_Stunden.ViewModels;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace Jugenddienst_Stunden.Views;
|
||||
|
||||
public partial class StundePage : ContentPage
|
||||
{
|
||||
public partial class StundePage : ContentPage {
|
||||
|
||||
public StundePage()
|
||||
{
|
||||
public ICommand DeleteConfirmCommand { get; }
|
||||
|
||||
public StundePage() {
|
||||
InitializeComponent();
|
||||
|
||||
if (BindingContext is StundeViewModel vm) {
|
||||
//vm.AlertEvent += Vm_AlertEvent;
|
||||
//vm.InfoEvent += Vm_InfoEvent;
|
||||
vm.ConfirmEvent += ShowConfirm;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void Vm_AlertEvent(object? sender, string e) {
|
||||
DisplayAlert("Fehler:", e, "OK");
|
||||
}
|
||||
|
||||
|
||||
private async Task<bool> ShowConfirm(string title, string message) {
|
||||
return await DisplayAlert(title, message, "Passt!", "Na, nor decht nit.");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user