This is a migrated thread and some comments may be shown as answers.

Use Font Glyph As Icon

1 Answer 596 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
David asked on 07 Oct 2016, 04:59 PM

Hi there,

Love the Desktop Alert component and love the font glyph's you guys have supplied as part of the Implicit Styling.

How would I use a font glyph as my icon for a Desktop Alert?

Thanks in advance,


1 Answer, 1 is accepted

Sort by
Telerik team
answered on 11 Oct 2016, 06:10 AM
Hello David,

Yes, you can use them in the RadDesktopAlert. You can pass a DataTemplate in the IconTemplate property of the RadDesktopAlert. As an example:

In your App.xaml:
    <ResourceDictionary Source="/Telerik.Windows.Themes.Office2016;component/Themes/System.Windows.xaml" />
    <ResourceDictionary Source="/Telerik.Windows.Themes.Office2016;component/Themes/Telerik.Windows.Controls.xaml" />
    <ResourceDictionary Source="/Telerik.Windows.Themes.Office2016;component/Themes/Telerik.Windows.Controls.Navigation.xaml" />
    <ResourceDictionary Source="/Telerik.Windows.Themes.Office2016;component/Themes/Telerik.Windows.Controls.Data.xaml" />
    <ResourceDictionary Source="/Telerik.Windows.Controls;component/Themes/FontResources.xaml"/>

In your MainWindow.xaml:
  <DataTemplate x:Key="GlyphTemplate">
    <TextBlock Text="{StaticResource GlyphCheck}" FontFamily="{StaticResource TelerikWebUI}" FontSize="32" Margin="0 0 10 0" />

and in MainWindow.xaml.cs:
private void RadButton_Click(object sender, RoutedEventArgs e)
  var alert = new RadDesktopAlert();
  var dataTemplate = this.Resources["GlyphTemplate"] as DataTemplate;
  alert.IconTemplate = dataTemplate;
  alert.Header = "DONE NOTIFICATION";
  alert.Content = "This is a test fot Glyphs.";
  alert.ShowDuration = 3000;
  RadDesktopAlertManager manager = new RadDesktopAlertManager();

I have used for the example the Office2016 theme, but the Glyph dictionary and font is accessible in all the themes for WPF with the need to merge the FontResources.xaml from Telerik.Windows.Controls.dll to use its contents as StaticResource references.

Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question