UpdateSources Method
Collapse the table of content
Expand the table of content

BindingGroup::UpdateSources Method ()

 

Runs the converter on the binding and the ValidationRule objects that have the ValidationStep property set to RawProposedValue, ConvertedProposedValue, or UpdatedValue and saves the values of the targets to the source objects if all the validation rules succeed.

Namespace:   System.Windows.Data
Assembly:  PresentationFramework (in PresentationFramework.dll)

public:
bool UpdateSources()

Return Value

Type: System::Boolean

true if all validation rules succeed; otherwise, false.

This method updates the source if every ValidationRule succeeds, but it does not cause the sources to commit the pending changes and end the edit transaction. That is, if the source object implements IEditableObject. Calling this method does not cause EndEdit to be called. Use the CommitEdit method to have the sources commit the pending changes.

The following example is part of an application that prompts the user to enter multiple customers and assign a sales representative to each customer. The application checks that the sales representative and the customer belong to the same region. The example calls UpdateSources to validate the bindings and save the values to the source if all the validation rules succeed.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.0
Return to top
Show:
© 2016 Microsoft