Displaying Glyth
Hello everyone
I am trying to Display a Glyth, but I cannot
I use this, to generate my icons
Xamarin
-
Eduardo Gomez 3,416 Reputation points
2021-07-04T20:42:04.827+00:00 I use the material design icons
-
Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 26,146 Reputation points • Microsoft Vendor
2021-07-05T07:40:31.873+00:00 Do you mean "glyph" instead of "glyth"? Maybe you could specify the font family to which the font icon belongs. In addition, you can refer to
https://stackoverflow.com/questions/61258115/fontawesome-xamarin-setting-glyph-not-working-from-code-behind
https://learn.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/text/fonts -
Eduardo Gomez 3,416 Reputation points
2021-07-05T08:26:34.273+00:00 I did this, but it doesn't show up
Glyph = new FontImageSource { Glyph = IconFonts.Grid, FontFamily = "material", Size = 44![111797-screenshot-2021-07-05-102504.png][1] }; x:DataType="vm:NotesVM" xmlns:syncfusion="clr-namespace:Syncfusion.ListView.XForms;assembly=Syncfusion.SfListView.XForms"> <ContentPage.ToolbarItems> <ToolbarItem Command="{x:Binding ChangeLayoutCommand}"> <ToolbarItem.IconImageSource> <FontImageSource Glyph="{x:Binding Glyph}"/> </ToolbarItem.IconImageSource> </ToolbarItem> </ContentPage.ToolbarItems> <ContentPage.BindingContext> <vm:NotesVM/> </ContentPage.BindingContext> <ContentPage.Content>
-
Eduardo Gomez 3,416 Reputation points
2021-07-05T08:31:43.253+00:00 I did what you told me but it doesn't show up
View Model
Glyph = IconFonts.Grid, FontFamily = "material", Size = 44
My view
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Safe.View.NotesPage" xmlns:vm="clr-namespace:Safe.ViewModel" xmlns:model="clr-namespace:Safe.Model" xmlns:fi="clr-namespace:MaterialFonts.Fonts" Visual="Material" Title="Notes" x:DataType="vm:NotesVM" xmlns:syncfusion="clr-namespace:Syncfusion.ListView.XForms;assembly=Syncfusion.SfListView.XForms"> <ContentPage.ToolbarItems> <ToolbarItem Command="{x:Binding ChangeLayoutCommand}"> <ToolbarItem.IconImageSource> <FontImageSource Glyph="{x:Binding Glyph}"/> </ToolbarItem.IconImageSource> </ToolbarItem> </ContentPage.ToolbarItems>
-
Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 26,146 Reputation points • Microsoft Vendor
2021-07-07T07:57:23.977+00:00 Is the value of Glyph "\u000f02c1"? It should be escaped in XAML.
-
Eduardo Gomez 3,416 Reputation points
2021-07-07T18:52:03.357+00:00 For the grid, I use
\U000f02c1
And for the List, I want to use this
\U000f0279
What can I do to bind it
-
Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 26,146 Reputation points • Microsoft Vendor
2021-07-08T09:52:02.1+00:00 You could set a property to ViewModel and raise OnPropertyChanged. For more information you can refer to https://learn.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/data-binding/
Sign in to comment