示例#1
0
 protected override void OnLostFocus(RoutedEventArgs e)
 {
     base.OnLostFocus(e);
     this.IsEditing = false;
     ValueEditorUtils.ExecuteCommand(this.LostFocusCommand, this, null);
     e.Handled = true;
 }
示例#2
0
 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();
 }
示例#3
0
 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();
 }
示例#4
0
        private void OnFinishEditing()
        {
            ICommand finishedEditingCommand = this.FinishEditingCommand;

            if (finishedEditingCommand != null)
            {
                ValueEditorUtils.ExecuteCommand(finishedEditingCommand, this, null);
            }
            else
            {
                Keyboard.Focus(null);
            }
        }