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:
- Object DispatcherObject DependencyObject Visual UIElement FrameworkElement Control 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
- 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
- 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 | DependencyPropertyChangedEventArgs | The 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 | KeyEventArgs | The KeyEventArgs that contains the event data. |
SelectText(TextBox)
Selects the text in the specified TextBox when editing starts.
protected virtual void SelectText(TextBox textBox)
Parameter | Type | Description |
---|---|---|
textBox | TextBox | The 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 | 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
- Object.ToString()
- Object.Equals(Object)
- Object.Equals(Object, Object)
- Object.ReferenceEquals(Object, Object)
- Object.GetHashCode()
- Object.GetType()
- Object.MemberwiseClone()