Move to ReactiveUI
This commit is contained in:
parent
fa82a4fbb3
commit
17f890cb9f
@ -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();
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user