37 lines
1 KiB
C#
37 lines
1 KiB
C#
using System.Reactive.Disposables;
|
|
using Avalonia.ReactiveUI;
|
|
using pgLabII.ViewModels;
|
|
using ReactiveUI;
|
|
|
|
namespace pgLabII.Views;
|
|
|
|
public partial class EditServerConfigurationWindow : ReactiveWindow<EditServerConfigurationWindow>
|
|
{
|
|
private readonly EditServerConfigurationViewModel _viewModel;
|
|
public EditServerConfigurationWindow()
|
|
: this(null)
|
|
{
|
|
}
|
|
|
|
public EditServerConfigurationWindow(EditServerConfigurationViewModel? viewModel)
|
|
{
|
|
InitializeComponent();
|
|
|
|
DataContext = _viewModel = viewModel ?? new EditServerConfigurationViewModel(
|
|
new(new()));
|
|
|
|
this.WhenActivated(disposables =>
|
|
{
|
|
// Subscribe to the CloseInteraction
|
|
_viewModel!.CloseInteraction.RegisterHandler(interaction =>
|
|
{
|
|
//DialogResult = interaction.Input; // true/false/null
|
|
Close();
|
|
interaction.SetOutput(true);
|
|
}).DisposeWith(disposables);
|
|
});
|
|
}
|
|
|
|
public bool New { get; set; }
|
|
}
|
|
|