private void CancelChange() { ValueEditorUtils.ExecuteCommand(this.BeginCommand, this, null); ValueEditorUtils.UpdateBinding(this, StringEditor.ValueProperty, false); ValueEditorUtils.ExecuteCommand(this.CancelCommand, this, null); ValueEditorUtils.UpdateBinding(this, StringEditor.ValueProperty, UpdateBindingType.Target); this.UpdateTextFromValue(); }
private void CommitChange() { ValueEditorUtils.ExecuteCommand(this.BeginCommand, this, null); this.Value = this.Text; ValueEditorUtils.ExecuteCommand(this.CommitCommand, this, null); ValueEditorUtils.UpdateBinding(this, StringEditor.ValueProperty, UpdateBindingType.Target); // Now update the text value in case the model or a binding has reformated this.UpdateTextFromValue(); }
public static void UpdateBinding(FrameworkElement element, DependencyProperty property, bool updateSource) { ValueEditorUtils.UpdateBinding(element, property, (updateSource ? UpdateBindingType.Both : UpdateBindingType.Target)); }