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 _playerPlanetsView; public ReadOnlyObservableCollection PlayerPlanets => _playerPlanetsView; public BuColViewModel() { var PlanetManager = Locator.Current.GetService()!; PlanetManager.__test__Init(); PlanetManager.PlayerPlanetsSource .ObserveOn(RxApp.MainThreadScheduler) .Bind(out _playerPlanetsView) .DisposeMany() .Subscribe(); this.WhenActivated((CompositeDisposable disposables) => { // /* handle activation */ // Disposable // .Create(() => { /* handle deactivation */ }) // .DisposeWith(disposables); }); } }