Beispiel #1
0
        public SearchViewModel(TreeViewModelBase parent, SearchInfo model)
            : base(parent)
        {
            this.Model = model;

            this.Name       = model.ObserveProperty(n => n.Name).ToReactiveProperty().AddTo(_disposable);
            this.IsSelected = new ReactiveProperty <bool>().AddTo(_disposable);
            this.IsExpanded = model.ToReactivePropertyAsSynchronized(n => n.IsExpanded).AddTo(_disposable);
            this.Children   = model.Children.ToReadOnlyReactiveCollection(n => new SearchViewModel(this, n)).AddTo(_disposable);
            this.IsUpdated  = model.ToReactivePropertyAsSynchronized(n => n.IsUpdated).AddTo(_disposable);
            this.Count      = new ReactiveProperty <int>(0).AddTo(_disposable);
        }