[]
        
(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)
Public Shared Sub SetBinding(Of T)(target As FrameworkElement, dp As DependencyProperty, source As T, expr As Expression(Of Func(Of T, Object)))
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)
Public Shared Sub SetBinding(Of T)(target As FrameworkElement, dp As DependencyProperty, source As T, expr As Expression(Of Func(Of T, Object)), converter As IValueConverter)
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