diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/InPlaceEditor.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/InPlaceEditor.cs index 2b819a068c..9143a643df 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/InPlaceEditor.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/InPlaceEditor.cs @@ -53,12 +53,12 @@ namespace ICSharpCode.WpfDesign.Designer.Controls } public override void OnApplyTemplate() - { + { base.OnApplyTemplate(); editor = new TextBox(); editor = Template.FindName("editor", this) as TextBox; // Gets the TextBox-editor from the Template Debug.Assert(editor != null); - } + } /// /// Binds the Text Property of the element extended with . @@ -90,25 +90,27 @@ namespace ICSharpCode.WpfDesign.Designer.Controls } protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e) - { + { base.OnGotKeyboardFocus(e); changeGroup = designItem.OpenGroup("Change Text"); editor.Focus(); - } + } protected override void OnLostKeyboardFocus(KeyboardFocusChangedEventArgs e) - { + { if (changeGroup != null) changeGroup.Abort(); + if (textBlock != null) + textBlock.Visibility = Visibility.Visible; base.OnLostKeyboardFocus(e); - } + } /// /// Change is committed if the user releases the Escape Key. /// /// protected override void OnKeyUp(KeyEventArgs e) - { + { base.OnKeyUp(e); if (e.Key == Key.Escape) { // Commit the changes to the DOM @@ -126,6 +128,6 @@ namespace ICSharpCode.WpfDesign.Designer.Controls this.Visibility = Visibility.Hidden; textBlock.Visibility = Visibility.Visible; } - } + } } }