Files
Ursa.Avalonia/demo/Ursa.Demo/Views/MainWindow.axaml.cs
2025-03-27 23:36:32 +08:00

21 lines
619 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System.Threading.Tasks;
using Ursa.Controls;
namespace Ursa.Demo.Views;
public partial class MainWindow : UrsaWindow
{
public WindowNotificationManager? NotificationManager { get; set; }
public MainWindow()
{
InitializeComponent();
NotificationManager = new WindowNotificationManager(this) { MaxItems = 3 };
}
protected override async Task<bool> CanClose()
{
var result = await MessageBox.ShowOverlayAsync("Are you sure you want to exit?\n您确定要退出吗", "Exit", button: MessageBoxButton.YesNo);
return result == MessageBoxResult.Yes;
}
}