ClassRadGlyph
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:
public class RadGlyph : FrameworkElement
Inheritance: objectRadGlyph
Constructors
RadGlyph()
Declaration
public RadGlyph()
Fields
BackgroundProperty
Identifies the Background dependency property.
Declaration
public static readonly DependencyProperty BackgroundProperty
Field Value
DependencyProperty
FontProperty
Identifies the Font dependency property.
Declaration
public static readonly DependencyProperty FontProperty
Field Value
DependencyProperty
FontSizeProperty
Identifies the FontSize dependency property.
Declaration
public static readonly DependencyProperty FontSizeProperty
Field Value
DependencyProperty
ForegroundProperty
Identifies the Foreground dependency property.
Declaration
public static readonly DependencyProperty ForegroundProperty
Field Value
DependencyProperty
GlyphProperty
Identifies the Glyph dependency property.
Declaration
public static readonly DependencyProperty GlyphProperty
Field Value
DependencyProperty
Properties
Background
Gets or sets the background of the element.
Declaration
[Bindable(true)]
public Brush Background { get; set; }
Property Value
Brush
Font
Gets or sets the name of the font to be used.
FontSize
Gets or sets the font size of the element.
Declaration
[TypeConverter(typeof(FontSizeConverter))]
[Bindable(true)]
public double FontSize { get; set; }
Property Value
Foreground
Gets or sets the foreground of the element which would color the rendered glyph.
Declaration
[Bindable(true)]
public Brush Foreground { get; set; }
Property Value
Brush
Glyph
Gets or sets the glyph string value.
TelerikFluentIconsFontFamily
Identifies the TelerikFontFamily property.
Declaration
public static FontFamily TelerikFluentIconsFontFamily { get; }
Property Value
FontFamily
TelerikFontFamily
Identifies the TelerikFontFamily property.
Declaration
public static FontFamily TelerikFontFamily { get; }
Property Value
FontFamily
Methods
ArrangeOverride(Size)
Declaration
protected override Size ArrangeOverride(Size finalSize)
Parameters
finalSize
Size
Returns
Size
GetGeometry(string, string)
Gets a Geometry from the chosen glyph.
GetImageSource(string, double, Brush, string)
Gets an ImageSource for the chosen glyph.
Declaration
public static ImageSource GetImageSource(string glyph, double fontSize, Brush foreground, string fontName)
Parameters
glyph
The glyph string.
fontSize
The font size.
foreground
Brush
The color to render the glyph with.
fontName
The registered font family name to be used.
Returns
ImageSource
GetRegisteredFonts()
Gets a list of all the registered fonts.
Declaration
public static IEnumerable<string> GetRegisteredFonts()
Returns
GetTypeface(string)
Gets the of a registered font.
Declaration
public static Typeface GetTypeface(string fontName)
Parameters
fontName
The name of the font.
Returns
Typeface
LoadLegacyFont()
Registers an old version of font family to be used by all instances of RadGlyph.
Declaration
public static void LoadLegacyFont()
MeasureOverride(Size)
Declaration
protected override Size MeasureOverride(Size availableSize)
Parameters
availableSize
Size
Returns
Size
OnCreateAutomationPeer()
Creates a RadGlyphAutomationPeer.
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
AutomationPeer
OnInitialized(EventArgs)
Declaration
protected override void OnInitialized(EventArgs e)
Parameters
e
OnRender(DrawingContext)
Renders the formatted glyph.
Declaration
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
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
public static void RegisterFont(FontFamily fontFamily, string fontName)
Parameters
fontFamily
FontFamily
fontName
RegisterFont(Uri, string)
Registers a font family to be used by all instances of RadGlyph and RadGlyphExtension.
Declaration
public static void RegisterFont(Uri fontUri, string fontName)
Parameters
fontUri
Uri
fontName
RegisterFont(string)
Registers a font family to be used by all instances of RadGlyph and RadGlyphExtension.
Declaration
public static void RegisterFont(string fontName)
Parameters
fontName
ResetTheme()
Resets the theme in StyleManager scenario.
Declaration
public void ResetTheme()
SetDefaultStyleKey()
Sets the default style key for StyleManager based on the current theme.
Declaration
protected virtual void SetDefaultStyleKey()