Provides the font list, preview, and recently used sections used by RadFontDropDownList.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class RadFontPopupEditorElement : RadPopupEditorElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IInputEditor, IValueEditor, ISupportInitialize
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemRadEditorElementEditorBaseElementPopupEditorBaseElementRadPopupEditorElementRadFontPopupEditorElement...
Derived Classes:
Implements:
Inherited Members
Constructors
Creates the font list, loads installed fonts, and wires selection and preview behavior.
public RadFontPopupEditorElement()
Fields
Caches font instances by family name for rendering the font preview column.
protected Dictionary<string, Font> fonts
Indicates that installed fonts are being loaded without rebuilding the list for each font.
protected bool isPopulating
Properties
Allows you to localize the text of the All Fonts group.
public string AllFontsItemText { get; set; }
Returns the underlying RadListView control.
public RadListView FontListView { get; }
Returns a list that contains all system fonts.
public List<string> FontNames { get; }
Gets the hovered font when the drop down is opened.
public string PreviewFont { get; }
Gets or sets the count of the items in the recently used fonts section.
public int RecentlyUsedItemsCount { get; set; }
Allows you to localize the text of the Recently Used Fonts group.
public string RecentlyUsedItemText { get; set; }
Gets or sets the Selected font name.
public string SelectedFont { get; set; }
Enable or disables the preview font functionality.
public bool SelectOnHover { get; set; }
Gets or sets the visibility of the Recently Used Fonts section.
public bool ShowRecentlyUsedFonts { get; set; }
Gets RadDropDownListElement as the effective type used to resolve theme values.
protected override Type ThemeEffectiveType { get; }
Overrides:
Methods
By default the control loads the fonts according to the font families exposed by the InstalledFontCollection class. This method can be used to add other fonts, including such not installed on the machine.
public virtual void AddFont(FontFamily fontFamily)
The font to be added.
Adds a font according to the provided family name. The ThemeResolutionService class will be also checked for any loaded custom fonts matching the font name.
public virtual void AddFont(string fontFamilyName)
The font to be added.
Synchronizes the font list view's theme with the popup owner's active theme.
protected override void ApplyThemeToPopup(RadPopupControlBase popup)
The popup form being themed.
Overrides:
Creates the popup form and hosts the font list in its keyboard-navigable panel.
protected override RadPopupControlBase CreatePopupForm()
The popup form containing the font list.
Overrides:
Raises PreviewFontChanged with this element as the event sender.
protected virtual void OnPreviewFontChanged(object sender, SelectedFontEventArgs e)
Ignored; subscribers receive this element as the sender.
eSelectedFontEventArgsThe font currently being previewed.
Raises SelectedFontChanged with this element as the event sender.
protected virtual void OnSelctedFontChanged(object sender, SelectedFontEventArgs e)
Ignored; subscribers receive this element as the sender.
eSelectedFontEventArgsThe selected font to report.
Loads the installed font families into the list while suppressing per-font list rebuilds.
protected virtual void PopulateFonts()
Removes the specified font from the font collection used by the control.
public virtual void RemoveFont(FontFamily fontFamily)
The font to be removed.
Removes the font with the specified name from the font collection used by the control.
public virtual void RemoveFont(string fontFamilyName)
The family name of the font to be removed.
Events
Fires when the hovered font is changed.
public event SelectedFontEventHandler PreviewFontChanged
Fires when the selected font is changed.
public event SelectedFontEventHandler SelectedFontChanged