Esempio n. 1
0
        public SmartViewBlockViewModel(SmartViewViewModelBase parent)
        {
            this.parent = parent;

            this.rules = new ObservableCollection <SmartViewRuleViewModel>();

            this.addRuleCommand = new RelayCommand(this.AddRuleExecute);
        }
Esempio n. 2
0
        public SmartViewViewModelTracker(SmartViewViewModelBase viewmodel)
        {
            if (viewmodel == null)
            {
                throw new ArgumentNullException(nameof(viewmodel));
            }

            this.viewmodel = viewmodel;
            this.viewmodel.PropertyChanged          += this.OnPropertyChanged;
            this.viewmodel.Blocks.CollectionChanged += this.OnCollectionChanged;
            foreach (var block in this.viewmodel.Blocks)
            {
                block.PropertyChanged         += this.OnPropertyChanged;
                block.Rules.CollectionChanged += this.OnCollectionChanged;
                foreach (var rule in block.Rules)
                {
                    rule.PropertyChanged += this.OnPropertyChanged;
                }
            }
        }