diff --git a/Stars Assistant/ViewModels/MainWindowViewModel.cs b/Stars Assistant/ViewModels/MainWindowViewModel.cs index 4e6184f..1eaf568 100644 --- a/Stars Assistant/ViewModels/MainWindowViewModel.cs +++ b/Stars Assistant/ViewModels/MainWindowViewModel.cs @@ -12,14 +12,16 @@ public partial class MainWindowViewModel : ViewModelBase, IActivatableViewModel { public ViewModelActivator Activator { get; } = new ViewModelActivator(); - [ObservableAsProperty] - private string _dbPath = ""; + [Reactive] + private string _dbPath; + + [Reactive] + private BuColViewModel? _buColViewModel = new(); public MainWindowViewModel() { using var db = Locator.Current.GetService()!; - _dbPathHelper = Observable.Return(Path.GetFullPath(db.DbPath)) - .ToProperty(this, x => x.DbPath); + DbPath = Path.GetFullPath(db.DbPath); this.WhenActivated((CompositeDisposable disposables) => { diff --git a/Stars Assistant/Views/BuColView.axaml.cs b/Stars Assistant/Views/BuColView.axaml.cs index 246a676..d6afd39 100644 --- a/Stars Assistant/Views/BuColView.axaml.cs +++ b/Stars Assistant/Views/BuColView.axaml.cs @@ -1,3 +1,4 @@ +using System.ComponentModel.DataAnnotations; using System.Reactive.Disposables; using Avalonia; using Avalonia.Controls; @@ -12,13 +13,9 @@ public partial class BuColView : ReactiveUserControl { public BuColView() { - /* this.WhenActivated(disposables => { }); - */ - - this.ViewModel = new BuColViewModel(); InitializeComponent(); } diff --git a/Stars Assistant/Views/MainWindow.axaml b/Stars Assistant/Views/MainWindow.axaml index 2185686..b007376 100644 --- a/Stars Assistant/Views/MainWindow.axaml +++ b/Stars Assistant/Views/MainWindow.axaml @@ -26,7 +26,8 @@ - +