Example #1
0
        /// <summary>
        ///     Creates a new instance of the <see cref="LayerPropertyKeyframe{T}" /> class
        /// </summary>
        /// <param name="value">The value of the keyframe</param>
        /// <param name="position">The position of this keyframe in the timeline</param>
        /// <param name="easingFunction">The easing function applied on the value of the keyframe</param>
        /// <param name="layerProperty">The layer property this keyframe is applied to</param>
        public LayerPropertyKeyframe(T value, TimeSpan position, Easings.Functions easingFunction, LayerProperty <T> layerProperty)
        {
            _position = position;

            Value          = value;
            LayerProperty  = layerProperty;
            EasingFunction = easingFunction;
        }
Example #2
0
        internal DataBinding(LayerProperty <TLayerProperty> layerProperty, DataBindingEntity entity)
        {
            LayerProperty = layerProperty;
            Entity        = entity;

            // Load will add children so be initialized before that
            Load();
            ApplyDataBindingMode();
        }
Example #3
0
 internal DataBindingRegistration(LayerProperty <TLayerProperty> layerProperty, DataBindingConverter <TLayerProperty, TProperty> converter,
                                  Func <TProperty> getter, Action <TProperty> setter, string displayName)
 {
     LayerProperty = layerProperty ?? throw new ArgumentNullException(nameof(layerProperty));
     Converter     = converter ?? throw new ArgumentNullException(nameof(converter));
     Getter        = getter ?? throw new ArgumentNullException(nameof(getter));
     Setter        = setter ?? throw new ArgumentNullException(nameof(setter));
     DisplayName   = displayName ?? throw new ArgumentNullException(nameof(displayName));
 }
Example #4
0
        /// <inheritdoc />
        public void ClearDataBinding()
        {
            if (DataBinding == null)
            {
                return;
            }

            // The related entity is left behind, just in case the data binding is added back later
            LayerProperty.DisableDataBinding(DataBinding);
        }
Example #5
0
        internal DataBindingRegistration(LayerProperty <TLayerProperty> layerProperty,
                                         DataBindingConverter <TLayerProperty, TProperty> converter,
                                         Expression <Func <TLayerProperty, TProperty> > propertyExpression)
        {
            LayerProperty      = layerProperty ?? throw new ArgumentNullException(nameof(layerProperty));
            Converter          = converter ?? throw new ArgumentNullException(nameof(converter));
            PropertyExpression = propertyExpression ?? throw new ArgumentNullException(nameof(propertyExpression));

            if (propertyExpression.Body is MemberExpression memberExpression)
            {
                Member = memberExpression.Member;
            }
        }
Example #6
0
        /// <inheritdoc />
        public void Load()
        {
            if (_disposed)
            {
                throw new ObjectDisposedException("DataBinding");
            }

            // General
            DataBindingRegistration <TLayerProperty, TProperty> registration = LayerProperty.GetDataBindingRegistration <TProperty>(Entity.TargetExpression);

            if (registration != null)
            {
                ApplyRegistration(registration);
            }

            EasingTime     = Entity.EasingTime;
            EasingFunction = (Easings.Functions)Entity.EasingFunction;

            DataBindingMode?.Load();
        }
 public LayerPropertyEventArgs(LayerProperty <T> layerProperty)
 {
     LayerProperty = layerProperty;
 }