sa/Stars Assistant/ViewModels/MainWindowViewModel.cs

38 lines
942 B
C#
Raw Normal View History

2024-09-22 20:12:46 +00:00

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;
using Splat;
using StarsAssistant.Model;
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-23 19:28:33 +00:00
[Reactive]
private string _dbPath;
[Reactive]
private BuColViewModel? _buColViewModel = new();
2024-09-14 16:47:59 +00:00
public MainWindowViewModel()
{
using var db = Locator.Current.GetService<StarsDatabase>()!;
2024-09-23 19:28:33 +00:00
DbPath = Path.GetFullPath(db.DbPath);
2024-09-14 16:47:59 +00:00
this.WhenActivated((CompositeDisposable disposables) =>
{
// /* handle activation */
// Disposable
// .Create(() => { /* handle deactivation */ })
// .DisposeWith(disposables);
});
2024-09-22 20:12:46 +00:00
}
2024-09-14 16:47:59 +00:00
2024-09-22 20:12:46 +00:00
2024-07-23 07:40:10 +00:00
}