In This Article

EditableContentControl Class

Represents a control that displays content by default but can toggle to an editable mode for editing the content.

public class EditableContentControl : ContentControl, DUCE.IResource, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IHaveResources, IQueryAmbient, IAddChild
Inheritance:
System.Object System.Windows.Threading.DispatcherObject System.Windows.DependencyObject System.Windows.Media.Visual System.Windows.UIElement System.Windows.FrameworkElement System.Windows.Controls.Control System.Windows.Controls.ContentControl Object
Derived:
ShellEditableContentControl

Constructors

EditableContentControl()

Initializes an instance of the EditableContentControl class.

public EditableContentControl()

Properties

EditableContent

Gets or sets the content being edited.

public object EditableContent { get; set; }

Property Value

System.Object:

The content being edited.

Remarks

This property is for internal use only.

IsEditing

Gets or sets whether the content is currently being edited.

public bool IsEditing { get; set; }

Property Value

System.Boolean:

true if the content is currently being edited; otherwise, false.

Remarks

This property toggles the UI of the control between display and edit modes.

Methods

OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs)

Occurs when the property value has changed.

protected override void OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs e)
Parameter Type Description
e System.Windows.DependencyPropertyChangedEventArgs

The System.Windows.DependencyPropertyChangedEventArgs containing data related to this event.

OnKeyDown(KeyEventArgs)

Occurs when a key is pressed.

protected override void OnKeyDown(KeyEventArgs e)
Parameter Type Description
e System.Windows.Input.KeyEventArgs

The System.Windows.Input.KeyEventArgs that contains the event data.

SelectText(TextBox)

Selects the text in the specified System.Windows.Controls.TextBox when editing starts.

protected virtual void SelectText(TextBox textBox)
Parameter Type Description
textBox System.Windows.Controls.TextBox

The System.Windows.Controls.TextBox to update.

Remarks

The default implementation of this method selects all text. Override it to select a range of text instead, such as a filename's actual name range before the extension.

SetContentAfterEditing(Object)

Sets the Content property with the specified edited content following a committed edit.

protected virtual void SetContentAfterEditing(object editedContent)
Parameter Type Description
editedContent System.Object

The EditableContent value prior to editing ending.

Fields

EditableContentProperty

Identifies the EditableContent dependency property. This field is read-only.

public static readonly DependencyProperty EditableContentProperty

IsEditingProperty

Identifies the IsEditing dependency property. This field is read-only.

public static readonly DependencyProperty IsEditingProperty

Inherited Members

  • System.Object.ToString()
  • System.Object.Equals(System.Object)
  • System.Object.Equals(System.Object, System.Object)
  • System.Object.ReferenceEquals(System.Object, System.Object)
  • System.Object.GetHashCode()
  • System.Object.GetType()
  • System.Object.MemberwiseClone()

Extension Methods