protected override void OnLostFocus(RoutedEventArgs e) { base.OnLostFocus(e); this.IsEditing = false; ValueEditorUtils.ExecuteCommand(this.LostFocusCommand, this, null); e.Handled = true; }
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(); }
private void OnFinishEditing() { ICommand finishedEditingCommand = this.FinishEditingCommand; if (finishedEditingCommand != null) { ValueEditorUtils.ExecuteCommand(finishedEditingCommand, this, null); } else { Keyboard.Focus(null); } }