sa/Stars Assistant/ViewModels/MainWindowViewModel.cs

38 lines
942 B
C#

using System.Reactive.Disposables;
using System.Reactive.Linq;
using ReactiveUI;
using ReactiveUI.SourceGenerators;
using Splat;
using StarsAssistant.Model;
namespace StarsAssistant.ViewModels;
public partial class MainWindowViewModel : ViewModelBase, IActivatableViewModel
{
public ViewModelActivator Activator { get; } = new ViewModelActivator();
[Reactive]
private string _dbPath;
[Reactive]
private BuColViewModel? _buColViewModel = new();
public MainWindowViewModel()
{
using var db = Locator.Current.GetService<StarsDatabase>()!;
DbPath = Path.GetFullPath(db.DbPath);
this.WhenActivated((CompositeDisposable disposables) =>
{
// /* handle activation */
// Disposable
// .Create(() => { /* handle deactivation */ })
// .DisposeWith(disposables);
});
}
}