mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
34 lines
693 B
C#
34 lines
693 B
C#
using System.ComponentModel;
|
|
using Artemis.UI.Shared;
|
|
using Avalonia;
|
|
using Avalonia.Markup.Xaml;
|
|
|
|
namespace Artemis.UI.Screens.Scripting;
|
|
|
|
public partial class ScriptsDialogView : ReactiveAppWindow<ScriptsDialogViewModel>
|
|
{
|
|
private bool _canClose;
|
|
|
|
public ScriptsDialogView()
|
|
{
|
|
InitializeComponent();
|
|
#if DEBUG
|
|
this.AttachDevTools();
|
|
#endif
|
|
Closing += OnClosing;
|
|
}
|
|
|
|
private async void OnClosing(object? sender, CancelEventArgs e)
|
|
{
|
|
if (_canClose)
|
|
return;
|
|
|
|
e.Cancel = true;
|
|
if (ViewModel == null || await ViewModel.CanClose())
|
|
{
|
|
_canClose = true;
|
|
Close();
|
|
}
|
|
}
|
|
|
|
} |