SampleDataService SymbolCode, what exactly are they? TS 5.4, WinUI 3 #4720
-
I'm using the template studio and fist, great job on this. So, I dug in and checked out how the Template is doing it. The template is creating sample data in the SampleDataService. But what I found was unexpected. Instead of glyph codes, it generates numbers in the 50k range. For example, the sample data has
It looks just like the Segoe Fluent Icons Globe. From the WinUI 3 Gallery I see the same globe is: So what are the 50k numbers? And how can I get a copy of them so I can actually use the Content Grid Template? These codes work with data binding to the but the Text and Code Glyphs don't seem to. So, it would be really cool to know what these are. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I found the answer. The Unicode Point listed in WinUI 3 Gallery is a Hex value (I should have caught that earlier). Convert this hex to decimal and you get the number. But, that's not enough. For the binding to work with the FontIcon control, the value must be a Char. Lame that this needs to be done, but it's doable. Perhaps in the template, a comment to this could be included in the service and view model.
The "Code" for this is another property in my data model. But it could be any of the Hex codes that the WinUI 3 Gallery lists as Unicode Points. It pretty lame that you can use a Text Glyph (something like &# xE80F; without the space) in the Xaml for the control. But when you bind to the same property, you cannot. I couldn't find this in the documentation for the FontIcon. Perhpas it's a .Net 8 bug. |
Beta Was this translation helpful? Give feedback.
I found the answer. The Unicode Point listed in WinUI 3 Gallery is a Hex value (I should have caught that earlier). Convert this hex to decimal and you get the number. But, that's not enough. For the binding to work with the FontIcon control, the value must be a Char. Lame that this needs to be done, but it's doable. Perhaps in the template, a comment to this could be included in the service and view model.
Here is an easy fix that I'm putting in one of my data models
public char GlyphHexToChar => (char)int.Parse(Code, NumberStyles.HexNumber);
The "Code" for this is another property in my data model. But it could be any of the Hex codes that the WinUI 3 Gallery lists as Unicode Points.
It…