Class BindingGroup
A BindingGroup manages a collection of bindings, and provides services for item-level and cross-binding validation.
public class BindingGroup : DependencyObject, IBaseObject, IDisposableObject, IDisposable
- Inheritance
-
BindingGroup
- Implements
- Extension Methods
Constructors
- BindingGroup()
Initializes a new instance of the BindingGroup class.
Properties
- BindingExpressions
The collection of binding expressions belonging to this BindingGroup.
- CanRestoreValues
CanRestoreValues returns True if the binding group can restore each of its sources (during CancelEdit()) to the state they had at the time of the most recent BeginEdit(). This depends on whether the current sources provide a suitable mechanism to implement the rollback, such as IEditableObject.
- HasValidationError
Return true if the BindingGroup has any validation errors.
- IsDirty
Return true if the BindingGroup has proposed values that have not yet been written to their respective source properties.
- Items
The collection of items used as sources in the bindings owned by this BindingGroup. Each item appears only once, even if it is used by several bindings.
- Name
The name of this BindingGroup. A binding can elect to join this group by declaring its BindingGroupName to match the name of the group.
- NotifyOnValidationError
When NotifyOnValidationError is set to True, the binding group will raise a Validation.ValidationError event when its validation state changes.
- Owner
The DependencyObject that owns this BindingGroup
- SharesProposedValues
Enables (or disables) the sharing of proposed values.
- ValidatesOnNotifyDataError
When ValidatesOnNotifyDataError is true, the binding group will listen to the ErrorsChanged event on each item that implements INotifyDataErrorInfo and report entity-level validation errors.
- ValidationErrors
ValidationErrors returns the validation errors currently arising from this binding group, or null if there are no errors.
- ValidationRules
The validation rules belonging to a BindingGroup are run during the process of updating the source values of the bindings. Each rule indicates where in that process it should run.
Methods
- BeginEdit()
Begin an editing transaction. For each source that supports it, the binding group asks the source to save its state, for possible restoration during CancelEdit().
- CancelEdit()
Cancel an editing transaction. For each source that supports it, the binding group asks the source to restore itself to the state saved at the most recent BeginEdit(). Then the binding group updates all targets with values from their respective sources, discarding any "dirty" values held in the targets.
- CommitEdit()
End an editing transaction. The binding group attempts to update all its sources with the proposed new values held in the target UI elements. All validation rules are run, at the times requested by the rules.
- GetValue(object, string)
Find the binding that uses the given item and property, and return the value appropriate to the current validation step.
- TryGetValue(object, string, out object)
Find the binding that uses the given item and property, and return the value appropriate to the current validation step.
- UpdateSources()
Run the validation process up to the UpdatedValue step. This runs all validation rules marked as RawProposedValue or ConvertedProposedValue, updates the sources with new values, and runs rules marked as Updatedvalue.
- ValidateWithoutUpdate()
Run the validation process up to the ConvertedProposedValue step. This runs all validation rules marked as RawProposedValue or ConvertedProposedValue, but does not update any sources with new values.