You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using Avalonia.Controls;
|
|
|
|
|
using Avalonia.Markup.Xaml;
|
|
|
|
|
using ReactiveUI.Avalonia;
|
|
|
|
|
using AuroraDesk.Presentation.ViewModels;
|
|
|
|
|
using ReactiveUI;
|
|
|
|
|
|
|
|
|
|
namespace AuroraDesk.Presentation.Views.Dialogs;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 关闭确认对话框
|
|
|
|
|
/// </summary>
|
|
|
|
|
public partial class CloseConfirmDialog : ReactiveWindow<CloseConfirmViewModel>
|
|
|
|
|
{
|
|
|
|
|
public CloseConfirmDialog()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
SetupButtons();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public CloseConfirmDialog(CloseConfirmViewModel viewModel) : this()
|
|
|
|
|
{
|
|
|
|
|
ViewModel = viewModel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void InitializeComponent()
|
|
|
|
|
{
|
|
|
|
|
AvaloniaXamlLoader.Load(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void SetupButtons()
|
|
|
|
|
{
|
|
|
|
|
var confirmButton = this.FindControl<Button>("ConfirmButton");
|
|
|
|
|
var cancelButton = this.FindControl<Button>("CancelButton");
|
|
|
|
|
|
|
|
|
|
if (confirmButton != null)
|
|
|
|
|
{
|
|
|
|
|
confirmButton.Click += (s, e) => Close(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (cancelButton != null)
|
|
|
|
|
{
|
|
|
|
|
cancelButton.Click += (s, e) => Close(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|