New to Telerik UI for WPFStart a free 30-day trial

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:

C#
public class RadGlyph : FrameworkElement

Inheritance: objectRadGlyph

Constructors

C#
public RadGlyph()

Fields

BackgroundProperty

DependencyProperty

Identifies the Background dependency property.

C#
public static readonly DependencyProperty BackgroundProperty

FontProperty

DependencyProperty

Identifies the Font dependency property.

C#
public static readonly DependencyProperty FontProperty

FontSizeProperty

DependencyProperty

Identifies the FontSize dependency property.

C#
public static readonly DependencyProperty FontSizeProperty

ForegroundProperty

DependencyProperty

Identifies the Foreground dependency property.

C#
public static readonly DependencyProperty ForegroundProperty

GlyphProperty

DependencyProperty

Identifies the Glyph dependency property.

C#
public static readonly DependencyProperty GlyphProperty

Properties

Gets or sets the background of the element.

C#
[Bindable(true)]
public Brush Background { get; set; }

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

C#
public string Font { get; set; }

Gets or sets the font size of the element.

C#
[TypeConverter(typeof(FontSizeConverter))]
[Bindable(true)]
public double FontSize { get; set; }

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

C#
[Bindable(true)]
public Brush Foreground { get; set; }

Gets or sets the glyph string value.

C#
public string Glyph { get; set; }

Identifies the TelerikFontFamily property.

C#
public static FontFamily TelerikFluentIconsFontFamily { get; }

Identifies the TelerikFontFamily property.

C#
public static FontFamily TelerikFontFamily { get; }

Methods

C#
protected override Size ArrangeOverride(Size finalSize)
Parameters:finalSizeSizeReturns:

Size

Gets a Geometry from the chosen glyph.

C#
public static Geometry GetGeometry(string glyph, string fontName)
Parameters:glyphstring

The glyph string.

fontNamestring

The registered font family name to be used.

Returns:

Geometry

Gets an ImageSource for the chosen glyph.

C#
public static ImageSource GetImageSource(string glyph, double fontSize, Brush foreground, string fontName)
Parameters:glyphstring

The glyph string.

fontSizedouble

The font size.

foregroundBrush

The color to render the glyph with.

fontNamestring

The registered font family name to be used.

Returns:

ImageSource

Gets a list of all the registered fonts.

C#
public static IEnumerable<string> GetRegisteredFonts()
Returns:

IEnumerable<string>

Gets the of a registered font.

C#
public static Typeface GetTypeface(string fontName)
Parameters:fontNamestring

The name of the font.

Returns:

Typeface

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

C#
public static void LoadLegacyFont()
C#
protected override Size MeasureOverride(Size availableSize)
Parameters:availableSizeSizeReturns:

Size

Creates a RadGlyphAutomationPeer.

C#
protected override AutomationPeer OnCreateAutomationPeer()
Returns:

AutomationPeer

C#
protected override void OnInitialized(EventArgs e)
Parameters:eEventArgs

Renders the formatted glyph.

C#
protected override void OnRender(DrawingContext drawingContext)
Parameters:drawingContextDrawingContext

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

C#
public static void RegisterFont(FontFamily fontFamily, string fontName)
Parameters:fontFamilyFontFamilyfontNamestring

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

C#
public static void RegisterFont(FontFamily fontFamily)
Parameters:fontFamilyFontFamily

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

C#
public static void RegisterFont(string fontName)
Parameters:fontNamestring

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

C#
public static void RegisterFont(Uri fontUri, string fontName)
Parameters:fontUriUrifontNamestring

Resets the theme in StyleManager scenario.

C#
public void ResetTheme()

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

C#
protected virtual void SetDefaultStyleKey()
C#
public override string ToString()
Returns:

string