Intermediate, add dynamic data, not yet w/o errors/warnings

This commit is contained in:
2024-09-25 22:27:35 +02:00
parent cafa45bed3
commit a394918064
4 changed files with 56 additions and 5 deletions

View File

@ -1,17 +1,31 @@
using System.Collections.ObjectModel;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using DynamicData;
using ReactiveUI;
using ReactiveUI.SourceGenerators;
using Splat;
using StarsAssistant.Model;
using StarsAssistant.Services;
namespace StarsAssistant.ViewModels;
public partial class BuColViewModel : ViewModelBase
{
private readonly ReadOnlyObservableCollection<PlayerPlanetViewModel> _playerPlanetsView;
public ReadOnlyObservableCollection<PlayerPlanetViewModel> PlayerPlanets => _playerPlanetsView;
public BuColViewModel()
{
var PlanetManager = Locator.Current.GetService<PlanetManager>()!;
PlanetManager.__test__Init();
PlanetManager.PlayerPlanetsSource
.ObserveOn(RxApp.MainThreadScheduler)
.Bind(out _playerPlanetsView)
.DisposeMany()
.Subscribe();
this.WhenActivated((CompositeDisposable disposables) =>
{
// /* handle activation */
@ -21,5 +35,4 @@ public partial class BuColViewModel : ViewModelBase
});
}
public ObservableCollection<PlayerPlanetViewModel> Planets { get; } = PlanetViewModel.LoadAll();
}