Class BindingUtils
Class that stores methods used to operate on data bindings.
Inheritance
Inherited Members
Namespace: Syncfusion.Windows.Shared
Assembly: Syncfusion.Shared.Wpf.dll
Syntax
public static class BindingUtils
Fields
EnableBindingErrorsProperty
Property to Enable or Disable DataBinding Errors.
Declaration
public static readonly DependencyProperty EnableBindingErrorsProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Methods
GetEnableBindingErrors(DependencyObject)
Gets EnableBindingErrors for given object.
Declaration
public static bool GetEnableBindingErrors(DependencyObject obj)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | obj | Given object. |
Returns
Type |
---|
System.Boolean |
SetBinding(DependencyObject, Object, DependencyProperty, Object)
Creates and associates a new instance of System.Windows.Data.BindingExpressionBase with the specified binding target property.
Declaration
public static BindingExpressionBase SetBinding(DependencyObject target, object source, DependencyProperty dp, object propertyPath)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | target | The binding target of the binding. |
System.Object | source | Source of the data for the binding. |
System.Windows.DependencyProperty | dp | The target property of the binding. |
System.Object | propertyPath | Path (can be DependencyProperty, or just string with property name) to the source property. |
Returns
Type | Description |
---|---|
System.Windows.Data.BindingExpressionBase | A new instance of System.Windows.Data.BindingExpressionBase. |
SetBinding(DependencyObject, Object, DependencyProperty, Object, BindingMode)
Creates and associates a new instance of System.Windows.Data.BindingExpressionBase with the specified binding target property.
Declaration
public static BindingExpressionBase SetBinding(DependencyObject target, object source, DependencyProperty dp, object propertyPath, BindingMode mode)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | target | The binding target of the binding. |
System.Object | source | Source of the data for the binding. |
System.Windows.DependencyProperty | dp | The target property of the binding. |
System.Object | propertyPath | Path (can be DependencyProperty, or just string with property name) to the source property. |
System.Windows.Data.BindingMode | mode | Binding mode. |
Returns
Type | Description |
---|---|
System.Windows.Data.BindingExpressionBase | A new instance of System.Windows.Data.BindingExpressionBase. |
SetBinding(DependencyObject, Object, DependencyProperty, Object, BindingMode, IValueConverter)
Creates and associates a new instance of System.Windows.Data.BindingExpressionBase with the specified binding target property.
Declaration
public static BindingExpressionBase SetBinding(DependencyObject target, object source, DependencyProperty dp, object propertyPath, BindingMode mode, IValueConverter converter)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | target | The binding target of the binding. |
System.Object | source | Source of the data for the binding. |
System.Windows.DependencyProperty | dp | The target property of the binding. |
System.Object | propertyPath | Path (can be DependencyProperty, or just string with property name) to the source property. |
System.Windows.Data.BindingMode | mode | Binding mode |
System.Windows.Data.IValueConverter | converter | Binding converter. |
Returns
Type | Description |
---|---|
System.Windows.Data.BindingExpressionBase | A new instance of System.Windows.Data.BindingExpressionBase. |
SetBindingToVisualChild(FrameworkElement, Type, Object, DependencyProperty, Object)
Enumerates all element visual children of the specified type and sets binding for the specified property.
Declaration
public static void SetBindingToVisualChild(FrameworkElement rootelement, Type typeChild, object source, DependencyProperty dp, object sourcePropertyName)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.FrameworkElement | rootelement | Specifies root element of the visual tree to inspect. |
System.Type | typeChild | Specifies type of the visual children to add binding to. |
System.Object | source | Specifies source of the binding. |
System.Windows.DependencyProperty | dp | Specifies dependency property on the children to be binded. |
System.Object | sourcePropertyName | Specifies dependency property on the source to create binding to. |
SetEnableBindingErrors(DependencyObject, Boolean)
Sets EnableBindingErrors for given object.
Declaration
public static void SetEnableBindingErrors(DependencyObject obj, bool value)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | obj | Given object |
System.Boolean | value | Given value |
SetRelativeBinding(DependencyObject, DependencyProperty, Type, Object)
Sets the relative binding.
Declaration
public static BindingExpressionBase SetRelativeBinding(DependencyObject target, DependencyProperty dp, Type sourceType, object sourceProperty)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | target | The target. |
System.Windows.DependencyProperty | dp | The dependency property. |
System.Type | sourceType | Type of the source. |
System.Object | sourceProperty | The source property. |
Returns
Type | Description |
---|---|
System.Windows.Data.BindingExpressionBase | Returns relative binding reference |
SetRelativeBinding(DependencyObject, DependencyProperty, Type, Object, BindingMode)
Sets the relative binding.
Declaration
public static BindingExpressionBase SetRelativeBinding(DependencyObject target, DependencyProperty dp, Type sourceType, object sourceProperty, BindingMode mode)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | target | The target. |
System.Windows.DependencyProperty | dp | The dependency property. |
System.Type | sourceType | Type of the source. |
System.Object | sourceProperty | The source property. |
System.Windows.Data.BindingMode | mode | The binding mode. |
Returns
Type | Description |
---|---|
System.Windows.Data.BindingExpressionBase | Returns relative binding reference |
SetRelativeBinding(DependencyObject, DependencyProperty, Type, Object, BindingMode, Int32)
Creates and associates a new instance of System.Windows.Data.BindingExpressionBase with the specified relative binding target property.
Declaration
public static BindingExpressionBase SetRelativeBinding(DependencyObject target, DependencyProperty dp, Type sourceType, object sourceProperty, BindingMode mode, int ancestorLevel)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | target | The binding target of the binding. |
System.Windows.DependencyProperty | dp | The target property of the binding. |
System.Type | sourceType | Type of the source (to be found among the ancestors) of the data for the binding. |
System.Object | sourceProperty | Path (can be System.Windows.DependencyProperty, or just string with property name) to the source property. |
System.Windows.Data.BindingMode | mode | Binding mode. |
System.Int32 | ancestorLevel | Ancestor level, should be greater or equal to 1. |
Returns
Type | Description |
---|---|
System.Windows.Data.BindingExpressionBase | A new instance of System.Windows.Data.BindingExpressionBase. |
SetTemplatedParentBinding(DependencyObject, DependencyProperty, Object, BindingMode)
Creates and associates a new instance of System.Windows.Data.BindingExpressionBase with the specified template parent property.
Declaration
public static BindingExpressionBase SetTemplatedParentBinding(DependencyObject target, DependencyProperty dp, object sourceProperty, BindingMode mode)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | target | The binding target. |
System.Windows.DependencyProperty | dp | The target property of the binding. |
System.Object | sourceProperty | Source of the data for the binding. |
System.Windows.Data.BindingMode | mode | Binding mode. |
Returns
Type | Description |
---|---|
System.Windows.Data.BindingExpressionBase | A new instance of System.Windows.Data.BindingExpressionBase. |