Example #1
0
        /// <inheritdoc />
        public void Dispose()
        {
            _disposed = true;

            Registration.DataBinding = null;
            DataBindingMode?.Dispose();
        }
Example #2
0
        /// <summary>
        ///     Releases the unmanaged resources used by the object and optionally releases the managed resources.
        /// </summary>
        /// <param name="disposing">
        ///     <see langword="true" /> to release both managed and unmanaged resources;
        ///     <see langword="false" /> to release only unmanaged resources.
        /// </param>
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                _disposed = true;

                if (Registration != null)
                {
                    Registration.DataBinding = null;
                }
                DataBindingMode?.Dispose();
            }
        }
Example #3
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;
            }
        }