public override void OnApplyTemplate() { var selector = this.Template.Resources["propertytemplateSelector"] as DataTemplateSelector; Content ??= new ContentControl { ContentTemplateSelector = selector }; interactiveList = this.GetTemplateChild("Main_InteractiveList") as InteractiveList; //this.SelectChanges<string>(nameof(Group)).Subscribe(a => //{ // interactiveList.Group = a; //}); var objects = SelectChanges <IEnumerable>(nameof(ItemsSource)) .Where(a => a != null) .Select(its => its.MakeObservable()) .Switch(); var(collectionViewModel, disposable) = (Group == null) ? InteractiveCollectionFactory.Build( objects, getkeyObservable: Observable.Return(new Func <object, object>(a => Guid.NewGuid())), isCheckableObervable: Observable.Return(false), filter: Observable.Return(new DefaultFilter())) : InteractiveCollectionFactory.BuildGroup( objects, getkeyObservable: Observable.Return(new Func <object, object>(a => Guid.NewGuid())), filter: Observable.Return(new DefaultFilter()), groupParameter: this.SelectChanges <string>(nameof(Group))); //isCheckableObervable: Observable.Return(false), interactiveList.InteractiveCollectionBase = collectionViewModel; collectionViewModel.Items.MakeObservable().Subscribe(a => { }); collectionViewModel.SelectSelected() .CombineLatest( SelectChanges <IValueConverter>(nameof(DataConverter)).StartWith(default(IValueConverter)), SelectChanges <string>(nameof(DataKey)).StartWith(default(string)), (a, b, c) => (a, b, c)) .ObserveOnDispatcher() .Subscribe(a => { var c = a.a; if (a.b != null) { c = a.b.Convert(c, default, default, default);
private IObservable <InteractiveCollectionBase <object> > BuildGroup(IObservable <string> key) { //var UI = new DispatcherScheduler(Application.Current.Dispatcher); return(Observable.Return(InteractiveCollectionFactory.BuildGroup( DataSubject.SelectMany(v => v.Cast <object>()), key.Select(_ => GetKeyFunc(_)), FilterSubject, DeletedSubject.WithLatestFrom(IsRemovableSubject.DistinctUntilChanged(), (d, r) => r ? d : null).Where(v => v != null), ClearedSubject, deleteableObervable: IsRemovableSubject, doubleClickToCheck: DoubleClickToCheckSubject, groupParameter: GroupSubject ).collectionBase)); }