Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SymbolIcon is not supported in a WPF Project

Tags:

wpf

glyphicons

I am trying to use SymbolIcon (as defined here in my WPF-XAML code.
But XAML won't compile stating that "SymbolIcon is not supported in a WPF Project".

Could anyone tell me if I am missing any additional assembly to use SymbolIcon. I do have "Segoe UI Symbol" font on my box.

Thanks, RDV

like image 383
RDV Avatar asked Oct 15 '14 20:10

RDV


People also ask

How do you escape from XAML?

The escape sequence ({}) is used so that an open brace ({) can be used as a literal character in XAML. XAML readers typically use the open brace ({) to denote the entry point of a markup extension; however, they first check the next character to determine whether it is a closing brace (}).

How do you show in XAML?

If your application has multiple windows, then you can choose which window to display by using the Window combo box. Or, use the Show in XAML Live Preview button in the application toolbar that's on the window you want to preview.


1 Answers

SymbolIcon is a UWP control, and is not supported in WPF.

What you can do is:

  • Use a XAML Island to host the SymbolIcon control in your WPF app (Windows 10 1903+).
  • Use the WPF Toolkit IconButton.
  • Use this suggestion:
    <Button FontFamily="Segoe UI Symbol" Content="&#xE110;"/>
    Which renders like this:
like image 57
Shimmy Weitzhandler Avatar answered Oct 18 '22 08:10

Shimmy Weitzhandler