sa/Stars Assistant/ViewModels/MainWindowViewModel.cs

44 lines
1.0 KiB
C#
Raw Permalink Normal View History

2024-09-23 20:40:18 +00:00
using System.Reactive.Disposables;
2024-09-14 16:47:59 +00:00
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-23 20:40:18 +00:00
public partial class MainWindowViewModel : ViewModelBase
2024-07-23 07:40:10 +00:00
{
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-23 20:40:18 +00:00
[ReactiveCommand]
private void New()
{
this.Log().Info("New button hit");
}
2024-09-23 20:40:18 +00:00
[ReactiveCommand]
private void Open()
{
this.Log().Info("Open button hit");
}
2024-07-23 07:40:10 +00:00
}