sa/Stars Assistant/Views/MainWindow.axaml.cs

33 lines
903 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()
{
this.WhenActivated(
disposables => {
this.OneWayBind(ViewModel,
viewModel => viewModel.Planets,
view => view.PlanetsGrid.ItemsSource)
.DisposeWith(disposables);
this.OneWayBind(ViewModel,
vm => vm.WelcomeMessage,
v => v.WelcomeText.Text)
.DisposeWith(disposables);
}
);
InitializeComponent();
}
}