sa/Stars Assistant/ViewModels/MainWindowViewModel.cs

34 lines
1.0 KiB
C#
Raw Normal View History

using System.Collections.ObjectModel;
2024-09-14 16:47:59 +00:00
using System.Reactive.Disposables;
using System.Reactive.Linq;
2024-09-13 19:09:33 +00:00
using ReactiveUI;
2024-09-14 16:47:59 +00:00
using ReactiveUI.SourceGenerators;
2024-07-23 07:40:10 +00:00
2024-08-15 19:46:43 +00:00
namespace StarsAssistant.ViewModels;
2024-09-13 19:09:33 +00:00
public partial class MainWindowViewModel : ViewModelBase, IActivatableViewModel
2024-07-23 07:40:10 +00:00
{
2024-09-13 19:09:33 +00:00
public ViewModelActivator Activator { get; } = new ViewModelActivator();
2024-09-14 16:47:59 +00:00
[ObservableAsProperty]
private string _welcomeMessage;
public MainWindowViewModel()
{
_welcomeMessage = "Lorem Ipsum";
_welcomeMessageHelper = Observable.Return("Dolor sit amet")
.ToProperty(this, x => x.WelcomeMessage);
this.WhenActivated((CompositeDisposable disposables) =>
{
// /* handle activation */
// Disposable
// .Create(() => { /* handle deactivation */ })
// .DisposeWith(disposables);
});
}
public ObservableCollection<PlanetViewModel> Planets { get; } = PlanetViewModel.LoadAll();
2024-07-23 07:40:10 +00:00
}