Class
RadGlyph

Represents a glyph element in the Telerik UI for WPF framework. The RadGlyph class is designed for rendering text-based icons or symbols both at runtime and design time. It includes properties to customize the glyph's appearance, such as Glyph, Foreground, Background, and FontSize. The class also supports theming through the IThemable interface, allowing it to adapt its style according to the active theme. The glyph can be used to create visually rich user interfaces, providing flexibility in customizing icons within WPF applications.

Definition

Namespace:Telerik.Windows.Controls

Assembly:Telerik.Windows.Controls.dll

Syntax:

cs-api-definition
public class RadGlyph : FrameworkElement

Inheritance: objectRadGlyph

Constructors

RadGlyph()

Declaration

cs-api-definition
public RadGlyph()

Fields

BackgroundProperty

Identifies the Background dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty BackgroundProperty

Field Value

DependencyProperty

FontProperty

Identifies the Font dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty FontProperty

Field Value

DependencyProperty

FontSizeProperty

Identifies the FontSize dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty FontSizeProperty

Field Value

DependencyProperty

ForegroundProperty

Identifies the Foreground dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty ForegroundProperty

Field Value

DependencyProperty

GlyphProperty

Identifies the Glyph dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty GlyphProperty

Field Value

DependencyProperty

Properties

Background

Gets or sets the background of the element.

Declaration

cs-api-definition
[Bindable(true)]
public Brush Background { get; set; }

Property Value

Brush

Font

Gets or sets the name of the font to be used.

Declaration

cs-api-definition
public string Font { get; set; }

Property Value

string

FontSize

Gets or sets the font size of the element.

Declaration

cs-api-definition
[TypeConverter(typeof(FontSizeConverter))]
[Bindable(true)]
public double FontSize { get; set; }

Property Value

double

Foreground

Gets or sets the foreground of the element which would color the rendered glyph.

Declaration

cs-api-definition
[Bindable(true)]
public Brush Foreground { get; set; }

Property Value

Brush

Glyph

Gets or sets the glyph string value.

Declaration

cs-api-definition
public string Glyph { get; set; }

Property Value

string

TelerikFluentIconsFontFamily

Identifies the TelerikFontFamily property.

Declaration

cs-api-definition
public static FontFamily TelerikFluentIconsFontFamily { get; }

Property Value

FontFamily

TelerikFontFamily

Identifies the TelerikFontFamily property.

Declaration

cs-api-definition
public static FontFamily TelerikFontFamily { get; }

Property Value

FontFamily

Methods

ArrangeOverride(Size)

Declaration

cs-api-definition
protected override Size ArrangeOverride(Size finalSize)

Parameters

finalSize

Size

Returns

Size

GetGeometry(string, string)

Gets a Geometry from the chosen glyph.

Declaration

cs-api-definition
public static Geometry GetGeometry(string glyph, string fontName)

Parameters

glyph

string

The glyph string.

fontName

string

The registered font family name to be used.

Returns

Geometry

GetImageSource(string, double, Brush, string)

Gets an ImageSource for the chosen glyph.

Declaration

cs-api-definition
public static ImageSource GetImageSource(string glyph, double fontSize, Brush foreground, string fontName)

Parameters

glyph

string

The glyph string.

fontSize

double

The font size.

foreground

Brush

The color to render the glyph with.

fontName

string

The registered font family name to be used.

Returns

ImageSource

GetRegisteredFonts()

Gets a list of all the registered fonts.

Declaration

cs-api-definition
public static IEnumerable<string> GetRegisteredFonts()

Returns

IEnumerable<string>

GetTypeface(string)

Gets the of a registered font.

Declaration

cs-api-definition
public static Typeface GetTypeface(string fontName)

Parameters

fontName

string

The name of the font.

Returns

Typeface

LoadLegacyFont()

Registers an old version of font family to be used by all instances of RadGlyph.

Declaration

cs-api-definition
public static void LoadLegacyFont()

MeasureOverride(Size)

Declaration

cs-api-definition
protected override Size MeasureOverride(Size availableSize)

Parameters

availableSize

Size

Returns

Size

OnCreateAutomationPeer()

Creates a RadGlyphAutomationPeer.

Declaration

cs-api-definition
protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer

OnInitialized(EventArgs)

Declaration

cs-api-definition
protected override void OnInitialized(EventArgs e)

Parameters

e

EventArgs

OnRender(DrawingContext)

Renders the formatted glyph.

Declaration

cs-api-definition
protected override void OnRender(DrawingContext drawingContext)

Parameters

drawingContext

DrawingContext

RegisterFont(FontFamily)

Registers a font family to be used by all instances of RadGlyph and RadGlyphExtension.

Declaration

cs-api-definition
public static void RegisterFont(FontFamily fontFamily)

Parameters

fontFamily

FontFamily

RegisterFont(FontFamily, string)

Registers a font family to be used by all instances of RadGlyph and RadGlyphExtension.

Declaration

cs-api-definition
public static void RegisterFont(FontFamily fontFamily, string fontName)

Parameters

fontFamily

FontFamily

fontName

string

RegisterFont(Uri, string)

Registers a font family to be used by all instances of RadGlyph and RadGlyphExtension.

Declaration

cs-api-definition
public static void RegisterFont(Uri fontUri, string fontName)

Parameters

fontUri

Uri

fontName

string

RegisterFont(string)

Registers a font family to be used by all instances of RadGlyph and RadGlyphExtension.

Declaration

cs-api-definition
public static void RegisterFont(string fontName)

Parameters

fontName

string

ResetTheme()

Resets the theme in StyleManager scenario.

Declaration

cs-api-definition
public void ResetTheme()

SetDefaultStyleKey()

Sets the default style key for StyleManager based on the current theme.

Declaration

cs-api-definition
protected virtual void SetDefaultStyleKey()

ToString()

Declaration

cs-api-definition
public override string ToString()

Returns

string