SharesProposedValues Property

BindingGroup.SharesProposedValues Property

.NET Framework 4.6 and 4.5

Gets or sets a value that indicates whether the BindingGroup reuses target values that have not been committed to the source.

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

public bool SharesProposedValues { get; set; }

Property Value

Type: System.Boolean

true if the BindingGroup reuses target values that have not been committed to the source; otherwise, false. The default is false.

A proposed value is a value that has been changed on the target of a binding, but has not been committed to the source. For example, suppose that there is a two-way binding on a TextBox and the UpdateSourceTrigger property is set to Explicit. If the user changes the value of the TextBox, the proposed value is the value that is in the TextBox before it is committed to source.

When SharesProposedValues is true, the BindingGroup uses the proposed value when one binding leaves the BindingGroup and another Binding with the same source joins the BindingGroup. For example, suppose that an application enables a user to edit multiple fields and update the source object by clicking a button. When a field is not being edited, the application displays it in a TextBlock. When the user begins to edit a field, the application replaces the TextBlock with a TextBox. When the user finishes editing that field, the application replaces the TextBox with a TextBlock. Because the source is not updated until the user clicks the button, there must be a way for the TextBlock to display the proposed value. By setting SharesProposedValues to true, the application will display the user's changes to a field even when the source has not been updated.

.NET Framework
Available since 4.0
Return to top
© 2015 Microsoft