CVB.Net 15.0
TextAdorner Class Reference

Base class for all adorners displaying text. More...

Inherits Adorner.

Inherited by ImageInfoAdorner, MeasureLineAdorner, MouseOverInfoAdorner, and RectangleAdorner.

Static Public Attributes

static readonly DependencyProperty FontBackgroundColorProperty
 Backing store for FontBackgroundColor property.
 
static readonly DependencyProperty FontFamilyProperty
 Backing store for the FontFamily property.
 
static readonly DependencyProperty FontShadowThicknessProperty
 Backing store for the FontShadowThickness property.
 
static readonly DependencyProperty FontSizeProperty
 Backing store for the FontSize property.
 
static readonly DependencyProperty FontStretchProperty
 Backing store of the FontStretch property.
 
static readonly DependencyProperty FontStyleProperty
 Backing store of the FontStyle property. More...
 
static readonly DependencyProperty FontWeightProperty
 Backing store for the FontWeight property.
 
static readonly DependencyProperty ForegroundProperty
 Backing store for Foreground property.
 

Protected Member Functions

 TextAdorner (UIElement adornedElement)
 Ctor. More...
 
FormattedText NewDefaultText (string text)
 Creates a new FormattedText based on the current culture and control font settings. More...
 
void DrawString (DrawingContext drawingContext, FormattedText text, Point location)
 Draws the given text with a drop shadow to ensure its visibility. More...
 

Properties

Color FontBackgroundColor [get, set]
 Gets/sets the background color for the font's background. More...
 
FontFamily FontFamily [get, set]
 Gets/sets the font family of the text. More...
 
double FontShadowThickness [get, set]
 Gets/sets the thickness of the border of the text. More...
 
double FontSize [get, set]
 Gets/sets the font size of the text. More...
 
FontStretch FontStretch [get, set]
 Gets/sets the font stretch of the text. More...
 
FontStyle FontStyle [get, set]
 Gets/sets the font style of the text.
 
FontWeight FontWeight [get, set]
 Gets/sets the font weight of the text. More...
 
Brush Foreground [get, set]
 Gets/sets the foreground brush to draw the text with. More...
 

Detailed Description

Base class for all adorners displaying text.

Constructor & Destructor Documentation

◆ TextAdorner()

TextAdorner ( UIElement  adornedElement)
protected

Ctor.

Parameters
adornedElementElement to place adorner on.

Member Function Documentation

◆ DrawString()

void DrawString ( DrawingContext  drawingContext,
FormattedText  text,
Point  location 
)
protected

Draws the given text with a drop shadow to ensure its visibility.

Parameters
drawingContextContext to draw on.
textFormatted text to print.
locationPoint where the text is drawn.

◆ NewDefaultText()

FormattedText NewDefaultText ( string  text)
protected

Creates a new FormattedText based on the current culture and control font settings.

Parameters
textText from which the formatted text is created.
Returns
New formatted text.

Member Data Documentation

◆ FontStyleProperty

readonly DependencyProperty FontStyleProperty
static

Backing store of the FontStyle property.

Default is control default.

Property Documentation

◆ FontBackgroundColor

Color FontBackgroundColor
getset

Gets/sets the background color for the font's background.

Default is Colors.White.

◆ FontFamily

FontFamily FontFamily
getset

Gets/sets the font family of the text.

Default is control default.

◆ FontShadowThickness

double FontShadowThickness
getset

Gets/sets the thickness of the border of the text.

Thickness in pixels (default is 2).

◆ FontSize

double FontSize
getset

Gets/sets the font size of the text.

Default is control default.

◆ FontStretch

FontStretch FontStretch
getset

Gets/sets the font stretch of the text.

Default is control default.

◆ FontWeight

FontWeight FontWeight
getset

Gets/sets the font weight of the text.

Default is FontWeights.SemiBold.

◆ Foreground

Brush Foreground
getset

Gets/sets the foreground brush to draw the text with.

Default is a solid color Brushes.Black brush.