I have a dialog that pops up over the main screen (it\'s actually a user control that appears on the page as per the application demo from Billy Hollis) in my application that h
I also choose to use BindingGroup. But instead of BeginEdit()
/ CommitEdit()
/ CancelEdit()
pattern I call UpdateSource()
explicitly on all the bindings associated with BindingGroup. This approach allows me to add only one event handler instead of 3.
private void OkButton_Click(object sender, RoutedEventArgs e)
{
CommitChanges();
DialogResult = true;
Close();
}
private void CommitChanges()
{
foreach (var bindingExpression in this.BindingGroup.BindingExpressions)
{
bindingExpression.UpdateSource();
}
}