Table of Contents

Class PlaceholderAdorner

Namespace
Tudormobile.Wpf.Adorners
Assembly
Tudormobile.WpfControls.dll

Represents an adorner that displays placeholder text for a TextBoxBase control when it is empty.

public class PlaceholderAdorner : Adorner, IAnimatable, ISupportInitialize, IFrameworkInputElement, IInputElement, IQueryAmbient
Inheritance
PlaceholderAdorner
Implements
Inherited Members

Remarks

This adorner is designed to provide a visual cue to users by displaying placeholder text over a TextBoxBase control, such as a TextBox, when the control has no user input. The placeholder text is rendered with reduced opacity to distinguish it from actual user input. The PlaceholderText property specifies the text to display as the placeholder. The adorner is not hit-test visible, ensuring it does not interfere with user interactions with the adorned control.

Constructors

PlaceholderAdorner(UIElement)

Represents an adorner that provides a visual placeholder for a UI element.

public PlaceholderAdorner(UIElement adornedElement)

Parameters

adornedElement UIElement

The UI element to which the adorner is attached. Cannot be null.

Remarks

This adorner is not hit-testable, meaning it does not respond to user input or mouse events.

Properties

PlaceholderText

Gets or sets the placeholder text displayed in the input field when it is empty.

public string? PlaceholderText { get; set; }

Property Value

string

Methods

OnRender(DrawingContext)

When overridden in a derived class, participates in rendering operations that are directed by the layout system. The rendering instructions for this element are not used directly when this method is invoked, and are instead preserved for later asynchronous use by layout and drawing.

protected override void OnRender(DrawingContext drawingContext)

Parameters

drawingContext DrawingContext

The drawing instructions for a specific element. This context is provided to the layout system.