sa/Stars Assistant/ViewModels/MainWindowViewModel.cs
2024-09-23 22:40:18 +02:00

46 lines
1.1 KiB
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
{
[Reactive]
private string _dbPath;
[Reactive]
private BuColViewModel? _buColViewModel = new();
public MainWindowViewModel()
{
InitializeCommands();
using var db = Locator.Current.GetService<StarsDatabase>()!;
DbPath = Path.GetFullPath(db.DbPath);
this.WhenActivated((CompositeDisposable disposables) =>
{
// /* handle activation */
// Disposable
// .Create(() => { /* handle deactivation */ })
// .DisposeWith(disposables);
});
}
[ReactiveCommand]
private void New()
{
this.Log().Info("New button hit");
}
[ReactiveCommand]
private void Open()
{
this.Log().Info("Open button hit");
}
}