Added Slop
This commit is contained in:
32
Views/ConfirmDialog.axaml.cs
Normal file
32
Views/ConfirmDialog.axaml.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user