Move to ReactiveUI

This commit is contained in:
Torben Nehmer 2024-09-13 21:09:33 +02:00
parent fa82a4fbb3
commit 17f890cb9f
2 changed files with 8 additions and 7 deletions

View File

@ -1,12 +1,11 @@
using System.Collections.ObjectModel;
using ReactiveUI;
namespace StarsAssistant.ViewModels;
public partial class MainWindowViewModel : ViewModelBase
public partial class MainWindowViewModel : ViewModelBase, IActivatableViewModel
{
#pragma warning disable CA1822 // Mark members as static
public string Greeting => "Welcome to Stars Assistant!";
#pragma warning restore CA1822 // Mark members as static
public ViewModelActivator Activator { get; } = new ViewModelActivator();
public ObservableCollection<PlanetViewModel> Planets { get; } = PlanetViewModel.LoadAll();

View File

@ -1,14 +1,16 @@
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.ReactiveUI;
using System.Diagnostics;
using System;
using StarsAssistant.ViewModels;
using Avalonia.Markup.Xaml;
namespace StarsAssistant.Views;
public partial class MainWindow : Window
public partial class MainWindow : ReactiveWindow<MainWindowViewModel>
{
public MainWindow()
{
InitializeComponent();
AvaloniaXamlLoader.Load(this);
}
}