33 lines
706 B
C#
33 lines
706 B
C#
using Avalonia.Controls;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Lagerprogramm.Views;
|
|
|
|
public partial class ConfirmDialog : Window
|
|
{
|
|
public ConfirmDialog()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public static async Task<bool> Show(Window owner, string message)
|
|
{
|
|
var dialog = new ConfirmDialog
|
|
{
|
|
MessageText = { Text = message }
|
|
};
|
|
var result = await dialog.ShowDialog<bool>(owner);
|
|
return result;
|
|
}
|
|
|
|
private void OnYes(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
|
|
{
|
|
Close(true);
|
|
}
|
|
|
|
private void OnNo(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
|
|
{
|
|
Close(false);
|
|
}
|
|
}
|