diff --git a/Stars Assistant/ViewModels/BuColViewModel.cs b/Stars Assistant/ViewModels/BuColViewModel.cs new file mode 100644 index 0000000..5009287 --- /dev/null +++ b/Stars Assistant/ViewModels/BuColViewModel.cs @@ -0,0 +1,27 @@ +using System.Collections.ObjectModel; +using System.Reactive.Disposables; +using System.Reactive.Linq; + +using ReactiveUI; +using ReactiveUI.SourceGenerators; +using Splat; + +namespace StarsAssistant.ViewModels; + +public partial class BuColViewModel : ViewModelBase, IActivatableViewModel +{ + public ViewModelActivator Activator { get; } = new ViewModelActivator(); + + public BuColViewModel() + { + this.WhenActivated((CompositeDisposable disposables) => + { + // /* handle activation */ + // Disposable + // .Create(() => { /* handle deactivation */ }) + // .DisposeWith(disposables); + }); + } + + public ObservableCollection Planets { get; } = PlanetViewModel.LoadAll(); +} diff --git a/Stars Assistant/ViewModels/MainWindowViewModel.cs b/Stars Assistant/ViewModels/MainWindowViewModel.cs index fbed864..4e6184f 100644 --- a/Stars Assistant/ViewModels/MainWindowViewModel.cs +++ b/Stars Assistant/ViewModels/MainWindowViewModel.cs @@ -1,4 +1,4 @@ -using System.Collections.ObjectModel; + using System.Reactive.Disposables; using System.Reactive.Linq; using ReactiveUI; @@ -28,8 +28,8 @@ public partial class MainWindowViewModel : ViewModelBase, IActivatableViewModel // .Create(() => { /* handle deactivation */ }) // .DisposeWith(disposables); }); - } + } - public ObservableCollection Planets { get; } = PlanetViewModel.LoadAll(); + } diff --git a/Stars Assistant/Views/BuColView.axaml b/Stars Assistant/Views/BuColView.axaml new file mode 100644 index 0000000..809c530 --- /dev/null +++ b/Stars Assistant/Views/BuColView.axaml @@ -0,0 +1,23 @@ + + + + + + + + + + + diff --git a/Stars Assistant/Views/BuColView.axaml.cs b/Stars Assistant/Views/BuColView.axaml.cs new file mode 100644 index 0000000..246a676 --- /dev/null +++ b/Stars Assistant/Views/BuColView.axaml.cs @@ -0,0 +1,25 @@ +using System.Reactive.Disposables; +using Avalonia; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; +using Avalonia.ReactiveUI; +using ReactiveUI; +using StarsAssistant.ViewModels; + +namespace StarsAssistant.Views; + +public partial class BuColView : ReactiveUserControl +{ + public BuColView() + { + /* + this.WhenActivated(disposables => + { + }); + */ + + this.ViewModel = new BuColViewModel(); + + InitializeComponent(); + } +} \ No newline at end of file diff --git a/Stars Assistant/Views/MainWindow.axaml b/Stars Assistant/Views/MainWindow.axaml index bcaadb7..2185686 100644 --- a/Stars Assistant/Views/MainWindow.axaml +++ b/Stars Assistant/Views/MainWindow.axaml @@ -1,8 +1,9 @@ - - - - - - - + +