sa/Stars Assistant/Views/MainWindow.axaml.cs
2024-09-23 22:40:18 +02:00

31 lines
844 B
C#

using Avalonia.Controls;
using Avalonia.ReactiveUI;
using System.Diagnostics;
using System;
using StarsAssistant.ViewModels;
using Avalonia.Markup.Xaml;
using ReactiveUI;
using System.Reactive.Disposables;
namespace StarsAssistant.Views;
public partial class MainWindow : ReactiveWindow<MainWindowViewModel>
{
public MainWindow()
{
InitializeComponent();
this.WhenActivated(disposables =>
{
this.OneWayBind(ViewModel, vm => vm.DbPath, v => v.DbPath.Text)
.DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.NewCommand, v => v.NewButton)
.DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.OpenCommand, v => v.OpenButton)
.DisposeWith(disposables);
});
}
}