/// <summary> /// Creates a new instance of the <see cref="DataBindingCondition{TLayerProperty,TProperty}" /> class /// </summary> /// <param name="conditionalDataBinding">The conditional data binding this condition is applied too</param> internal DataBindingCondition(ConditionalDataBinding <TLayerProperty, TProperty> conditionalDataBinding) { ConditionalDataBinding = conditionalDataBinding ?? throw new ArgumentNullException(nameof(conditionalDataBinding)); Order = conditionalDataBinding.Conditions.Count + 1; Condition = new DataModelConditionGroup(null); Entity = new DataBindingConditionEntity(); Save(); }
private void ApplyDataBindingMode() { DataBindingMode?.Dispose(); DataBindingMode = null; switch (Entity.DataBindingMode) { case DirectDataBindingEntity directDataBindingEntity: DataBindingMode = new DirectDataBinding <TLayerProperty, TProperty>(this, directDataBindingEntity); break; case ConditionalDataBindingEntity conditionalDataBindingEntity: DataBindingMode = new ConditionalDataBinding <TLayerProperty, TProperty>(this, conditionalDataBindingEntity); break; } }
internal DataBindingCondition(ConditionalDataBinding <TLayerProperty, TProperty> conditionalDataBinding, DataBindingConditionEntity entity) { ConditionalDataBinding = conditionalDataBinding ?? throw new ArgumentNullException(nameof(conditionalDataBinding)); Entity = entity; Load(); }