示例#1
0
 private void CancelStartedChange()
 {
     ValueEditorUtils.UpdateBinding((FrameworkElement)this, ChoiceEditor.ValueProperty, UpdateBindingType.Target);
     ValueEditorUtils.UpdateBinding((FrameworkElement)this, ChoiceEditor.ValueIndexProperty, UpdateBindingType.Target);
     this.UpdateInternalValuesFromValue();
     ValueEditorUtils.ExecuteCommand(this.CancelCommand, (IInputElement)this, (object)null);
 }
示例#2
0
 protected override void OnLostFocus(RoutedEventArgs e)
 {
     base.OnLostFocus(e);
     this.IsEditing = false;
     ValueEditorUtils.ExecuteCommand(this.LostFocusCommand, this, null);
     e.Handled = true;
 }
示例#3
0
        private void OnFinishEditing()
        {
            ICommand finishEditingCommand = this.FinishEditingCommand;

            if (finishEditingCommand == null)
            {
                Keyboard.Focus(null);
                return;
            }
            ValueEditorUtils.ExecuteCommand(finishEditingCommand, this, null);
        }
示例#4
0
 private void UpdateChange()
 {
     if (!this.transactionOpen)
     {
         ValueEditorUtils.ExecuteCommand(this.BeginCommand, this, null);
     }
     this.Value = base.Text;
     ValueEditorUtils.ExecuteCommand(this.UpdateCommand, this, null);
     this.transactionOpen = true;
     ValueEditorUtils.UpdateBinding(this, StringEditor.ValueProperty, UpdateBindingType.Target);
     this.UpdateTextFromValue();
 }
示例#5
0
 private void CancelChange()
 {
     if (!this.transactionOpen)
     {
         ValueEditorUtils.ExecuteCommand(this.BeginCommand, this, null);
     }
     ValueEditorUtils.UpdateBinding(this, StringEditor.ValueProperty, false);
     ValueEditorUtils.ExecuteCommand(this.CancelCommand, this, null);
     this.transactionOpen = false;
     ValueEditorUtils.UpdateBinding(this, StringEditor.ValueProperty, UpdateBindingType.Target);
     this.UpdateTextFromValue();
 }
示例#6
0
 private void OnLastAction()
 {
     if (this.LastActionCommand != null)
     {
         ValueEditorUtils.ExecuteCommand(this.LastActionCommand, (IInputElement)this, (object)null);
     }
     else
     {
         int num = this.SelectedIndex < 0 ? this.savedIndex : this.SelectedIndex;
         this.SelectedIndex = -1;
         this.SelectedIndex = num;
     }
 }
示例#7
0
 protected override void OnTextChanged(TextChangedEventArgs e)
 {
     base.OnTextChanged(e);
     if (this.ignoreTextChanges)
     {
         return;
     }
     ValueEditorUtils.ExecuteCommand(this.TextChangedCommand, this, base.Text);
     if (this.IsEditing)
     {
         this.lostFocusAction = StringEditor.LostFocusAction.Commit;
     }
 }
示例#8
0
        private void OnFinishEditing()
        {
            ICommand finishEditingCommand = this.FinishEditingCommand;

            if (finishEditingCommand != null)
            {
                ValueEditorUtils.ExecuteCommand(finishEditingCommand, (IInputElement)this, (object)null);
            }
            else
            {
                Keyboard.Focus((IInputElement)null);
            }
        }
示例#9
0
 private void CommitChange()
 {
     ValueEditorUtils.ExecuteCommand(this.BeginCommand, (IInputElement)this, (object)null);
     if (this.UpdateValueFromInternalValues())
     {
         ValueEditorUtils.UpdateBinding((FrameworkElement)this, ChoiceEditor.ValueProperty, UpdateBindingType.Source);
         ValueEditorUtils.UpdateBinding((FrameworkElement)this, ChoiceEditor.ValueIndexProperty, UpdateBindingType.Source);
         ValueEditorUtils.ExecuteCommand(this.CommitCommand, (IInputElement)this, (object)null);
         ValueEditorUtils.UpdateBinding((FrameworkElement)this, ChoiceEditor.ValueProperty, UpdateBindingType.Target);
         ValueEditorUtils.UpdateBinding((FrameworkElement)this, ChoiceEditor.ValueIndexProperty, UpdateBindingType.Target);
     }
     else
     {
         this.CancelStartedChange();
     }
     this.lostFocusAction = ChoiceEditor.LostFocusAction.None;
 }
示例#10
0
 private void CancelChange()
 {
     ValueEditorUtils.ExecuteCommand(this.BeginCommand, (IInputElement)this, (object)null);
     this.CancelStartedChange();
 }