Beispiel #1
0
 /// <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();
 }
Beispiel #2
0
        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;
            }
        }
Beispiel #3
0
 internal DataBindingCondition(ConditionalDataBinding <TLayerProperty, TProperty> conditionalDataBinding, DataBindingConditionEntity entity)
 {
     ConditionalDataBinding = conditionalDataBinding ?? throw new ArgumentNullException(nameof(conditionalDataBinding));
     Entity = entity;
     Load();
 }