[]
        
(Showing Draft Content)

C1.WPF.Extensions.SetBinding

SetBinding Method

SetBinding<T>(FrameworkElement, DependencyProperty, T, Expression<Func<T, object>>)

Sets the binding if the dependency property has not been set previously and the style of the element don't set the property.

Declaration
public static void SetBinding<T>(this FrameworkElement target, DependencyProperty dp, T source, Expression<Func<T, object>> expr)
Parameters
Type Name Description
FrameworkElement target

The target.

DependencyProperty dp

The dependency property which will be set.

T source

The source.

Expression<Func<T, object>> expr

Expression that returns a property of the source object.

Type Parameters
Name Description
T

Type of the source

SetBinding<T>(FrameworkElement, DependencyProperty, T, Expression<Func<T, object>>, IValueConverter)

Sets the binding if the dependency property has not been set previously and the style of the element don't set the property.

Declaration
public static void SetBinding<T>(this FrameworkElement target, DependencyProperty dp, T source, Expression<Func<T, object>> expr, IValueConverter converter)
Parameters
Type Name Description
FrameworkElement target

The target.

DependencyProperty dp

The dependency property which will be set.

T source

The source.

Expression<Func<T, object>> expr

Expression that returns a property of the source object.

IValueConverter converter

The converter that will be applied to the created binding object.

Type Parameters
Name Description
T

Type of the source