protected override void InitializePropertiesForViewing() { if (ExpressionElementBlock != null) { ExpressionElementBlock.Children.ToList().ForEach(x => { x.PropertyChanged -= OnViewModelPropertyChangedUI; if (x is CompositeElement) { (x as CompositeElement).Children.CollectionChanged -= OnViewModelCollectionChangedUI; } }); } if (this is ICaseRuleOverviewStepViewModel || !IsWizardMode) { if (InnerItem.PredicateVisualTreeSerialized == null) { ExpressionElementBlock = new CaseRuleExpressionBlock(this); } else { ExpressionElementBlock = SerializationUtil.Deserialize <TypedExpressionElementBase>(InnerItem.PredicateVisualTreeSerialized); ExpressionElementBlock.InitializeAfterDeserialized(this); } SetHandlers(ExpressionElementBlock); OnPropertyChanged("ExpressionElementBlock"); } }
protected virtual void InitializeExpressionElementBlock() { // Should be override in derived classes to setup ExpressionElementBlock if IsWizardMode == true OnUIThread(() => { if (string.IsNullOrEmpty(InnerItem.PredicateVisualTreeSerialized)) { throw new NotImplementedException(); // PredicateVisualTreeSerialized should be not null } ExpressionElementBlock = SerializationUtil.Deserialize <TypedExpressionElementBase>(InnerItem.PredicateVisualTreeSerialized); ExpressionElementBlock.InitializeAfterDeserialized(this); OnPropertyChanged("ExpressionElementBlock"); }); }
protected virtual void InitializeExpressionElementBlock() { OnUIThread(() => { if (InnerItem.PredicateVisualTreeSerialized == null) { ExpressionElementBlock = new PriceListAssignmentExpression(this); } else { ExpressionElementBlock = SerializationUtil.Deserialize <TypedExpressionElementBase>(InnerItem.PredicateVisualTreeSerialized); ExpressionElementBlock.InitializeAfterDeserialized(this); } OnPropertyChanged("ExpressionElementBlock"); }); }
protected override void InitializePropertiesForViewing() { if (this is IDisplayTemplateConditionsStepViewModel || !IsWizardMode) { OnUIThread(() => { if (InnerItem.PredicateVisualTreeSerialized == null) { ExpressionElementBlock = new DisplayTemplateExpressionBlock(this); } else { ExpressionElementBlock = SerializationUtil.Deserialize <TypedExpressionElementBase>( InnerItem.PredicateVisualTreeSerialized); ExpressionElementBlock.InitializeAfterDeserialized(this); } ((DisplayTemplateExpressionBlock)ExpressionElementBlock).InitializeAvailableExpressions( (TargetTypes)InnerItem.TargetType); OnPropertyChanged("ExpressionElementBlock"); }); } }