TextStylePresenter Class
Represents a control for rendering a text style preview.
public class TextStylePresenter : Decorator
- Inheritance:
- object Visual UIElement FrameworkElement Decorator object
Constructors
TextStylePresenter()
Initializes an instance of the class.
public TextStylePresenter()
Properties
Background
Gets or sets the Brush for the background.
Padding
Gets or sets the padding inside the control.
public Thickness Padding { get; set; }
Property Value
- Thickness:
The padding inside the control. The default value is
3,0
.
Methods
MeasureOverride(Size)
Measures the child element of a Decorator to prepare for arranging it during the ArrangeOverride(Size) pass.
protected override Size MeasureOverride(Size constraint)
Parameter | Type | Description |
---|---|---|
constraint | Size | An upper limit System.Windows.Size that should not be exceeded. |
Returns
- Size:
The target System.Windows.Size of the element.
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)
Parameter | Type | Description |
---|---|---|
drawingContext | DrawingContext | The drawing instructions for a specific element. This context is provided to the layout system. |
Fields
BackgroundProperty
Identifies the Background dependency property. This field is read-only.
public static readonly DependencyProperty BackgroundProperty
PaddingProperty
Identifies the Padding dependency property. This field is read-only.
public static readonly DependencyProperty PaddingProperty