Beispiel #1
0
        /// <summary>
        /// Copies a binding.
        /// </summary>
        /// <param name="bindingToCopy">The binding to copy.</param>
        public static Binding CopyBinding(this Binding bindingToCopy)
        {
            var copy = new Binding();

            foreach (var propertyName in BindingPropertiesToCopy)
            {
                var propertyValue = bindingToCopy.GetProperty<object>(propertyName);
                if (propertyValue != null)
                    copy.SetProperty(propertyName, propertyValue);
            }

            return copy;
        }