Move to ReactiveUI
This commit is contained in:
parent
fa82a4fbb3
commit
17f890cb9f
@ -1,12 +1,11 @@
|
|||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
|
using ReactiveUI;
|
||||||
|
|
||||||
namespace StarsAssistant.ViewModels;
|
namespace StarsAssistant.ViewModels;
|
||||||
|
|
||||||
public partial class MainWindowViewModel : ViewModelBase
|
public partial class MainWindowViewModel : ViewModelBase, IActivatableViewModel
|
||||||
{
|
{
|
||||||
#pragma warning disable CA1822 // Mark members as static
|
public ViewModelActivator Activator { get; } = new ViewModelActivator();
|
||||||
public string Greeting => "Welcome to Stars Assistant!";
|
|
||||||
#pragma warning restore CA1822 // Mark members as static
|
|
||||||
|
|
||||||
public ObservableCollection<PlanetViewModel> Planets { get; } = PlanetViewModel.LoadAll();
|
public ObservableCollection<PlanetViewModel> Planets { get; } = PlanetViewModel.LoadAll();
|
||||||
|
|
||||||
|
@ -1,14 +1,16 @@
|
|||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Interactivity;
|
using Avalonia.ReactiveUI;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System;
|
using System;
|
||||||
|
using StarsAssistant.ViewModels;
|
||||||
|
using Avalonia.Markup.Xaml;
|
||||||
|
|
||||||
namespace StarsAssistant.Views;
|
namespace StarsAssistant.Views;
|
||||||
|
|
||||||
public partial class MainWindow : Window
|
public partial class MainWindow : ReactiveWindow<MainWindowViewModel>
|
||||||
{
|
{
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
AvaloniaXamlLoader.Load(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user