InputElement and adds features like focus management, context menus, data templates, and lifecycle events.
Namespace
Inheritance
InputElement → Control
Properties
Gets or sets the control’s focus adorner template.
Gets or sets a user-defined object attached to the control. Useful for storing custom data.
Gets or sets a context menu for the control.
Gets or sets a context flyout for the control.
Gets a value indicating whether the control is fully constructed in the visual tree and both layout and render are complete. Read-only.
Gets or sets the data templates for the control. Each control may define data templates which are applied to the control itself and its children. Read-only collection.
Events
Occurs when the control has been fully constructed in the visual tree and both layout and render are complete. This event is guaranteed to occur after the control template is applied.
Occurs when the control is removed from the visual tree.
Occurs when the bounds (actual size) of the control have changed.
Protected Methods
Gets the element that receives the focus adorner. Returns the control itself by default. Override to customize focus target behavior.
Raises the
Loaded event. Override to add custom logic when the control is loaded.Raises the
Unloaded event. Override to add custom logic when the control is unloaded.Raises the
SizeChanged event. Override to respond to size changes.Returns a new, type-specific
AutomationPeer implementation for the control. Override to provide custom automation support.Usage
XAML Example
C# Example
Checking Load State
Source File
Control.cs:1-559
See Also
- ContentControl - Displays content according to a data template
- InputElement - Base class for input handling
- Loaded Event Lifecycle