public override void OnNavigatedTo(INavigationParameters parameters) { base.OnNavigatedTo(parameters); SelectedSortOptionItem = QueuePlaylist.DefaultSortOption; Observable.Merge( IsEnableGroupingByTitleSimulality.ToUnit(), this.ObserveProperty(x => x.SelectedSortOptionItem, isPushCurrentValueAtFirst: false).ToUnit() ) .Subscribe(sort => ResetList()) .AddTo(_navigationDisposables); _messenger.Register <PlaylistItemRemovedMessage, PlaylistId>(this, QueuePlaylist.Id, (r, m) => { foreach (var item in m.Value.RemovedItems) { var remove = ItemsView.Cast <IVideoContent>().FirstOrDefault(x => x.VideoId == item.VideoId); ItemsView.Remove(remove); } }); _messenger.Register <PlaylistItemAddedMessage, PlaylistId>(this, QueuePlaylist.Id, (r, m) => { ItemsView.Clear(); ItemsView.Refresh(); }); }
public override void Dispose() { if (ItemsView?.Source is IncrementalLoadingCollection <IIncrementalSource <ITEM_VM>, ITEM_VM> oldItems) { DisposeItemsView(ItemsView); ItemsView.Source = new List <ITEM_VM>(); ItemsView.Clear(); ItemsView = null; OnPropertyChanged(nameof(ItemsView)); } base.Dispose(); }