In This Article

TextStylePresenter Class

Represents a control for rendering a text style preview.

public class TextStylePresenter : Decorator, 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.Decorator Object

Constructors

TextStylePresenter()

public TextStylePresenter()

Properties

Background

Gets or sets the System.Windows.Media.Brush for the background.

public Brush Background { get; set; }

Property Value

System.Windows.Media.Brush:

The System.Windows.Media.Brush for the background.

Padding

Gets or sets the padding inside the control.

public Thickness Padding { get; set; }

Property Value

System.Windows.Thickness:

The padding inside the control. The default value is 3,0.

Methods

MeasureOverride(Size)

Measures the child element of a System.Windows.Controls.Decorator to prepare for arranging it during the System.Windows.Controls.Decorator.ArrangeOverride(System.Windows.Size) pass.

protected override Size MeasureOverride(Size constraint)
Parameter Type Description
constraint System.Windows.Size

An upper limit System.Windows.Size that should not be exceeded.

Returns

System.Windows.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 System.Windows.Media.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

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