We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

FontIconText icon not showing when initialized via c#

Thread ID:

Created:

Updated:

Platform:

Replies:

146597 Aug 9,2019 02:53 PM UTC Aug 19,2019 07:22 AM UTC Xamarin.Forms 5
loading
Tags: SfRadialMenu
Mario
Asked On August 9, 2019 02:53 PM UTC

This works in Xaml:

<radialMenu:SfRadialMenuItem ItemTapped="OnSaveRadialMenuItemTapped" FontIconText="i" IconFontFamily="{StaticResource customfontfamily}"></radialMenu:SfRadialMenuItem>

However when I try the same thing in C# it only shows "i" not the icon:

  string iconFontFamily = Device.RuntimePlatform == Device.Android ? "Edsembli" : "Edsembli.ttf";
  item = new SfRadialMenuItem()
                {
                    FontIconText = "i",
                    IconFontFamily = iconFontFamily,
                };

                       itemCollection.Add(item);

Muneesh Kumar G [Syncfusion]
Replied On August 12, 2019 07:12 AM UTC

Hi Mario, 
 
Greetings from Syncfusion.  
 
We have analyzed your requirement “FontIconText string in C# doesn't working in SfRadialMenu” from our side. We have prepared the sample for your reference. Please try the attached below sample and let us know if you have any concern on this.  
  
Code snippet: 
 
   public partial class MainPage : ContentPage     
 { 
         SfRadialMenu radialMenu = new SfRadialMenu();       
   public MainPage()         
 {             
 InitializeComponent();        
      Grid grid = new Grid();          
    radialMenu.CenterButtonFontFamily = Device.RuntimePlatform == Device.Android ? "radialmenu_Segoe MDL2 Assets.ttf" : Device.RuntimePlatform == Device.iOS ? "Segoe MDL2 Assets" : "radialmenu_Segoe_MDL2_Assets.ttf#Segoe MDL2 Assets";         
 
     radialMenu.CenterButtonText = "\uE713";      
        radialMenu.CenterButtonRadius = 32;         
     string[] radialMenuItems = new string[] { "\uE734", "\uE700", "\uE72d", "\uE735", "\uE700", "\uE73a" };          
 
    for (int itemCount = 0; itemCount < radialMenuItems.Count(); itemCount++)          
    {       
           radialMenu.Items.Add(new SfRadialMenuItem()           
       {                 
     FontIconText = radialMenuItems[itemCount],         
             IconFontSize = 25,                   
   IconFontFamily = Device.RuntimePlatform == Device.iOS ? "Segoe MDL2 Assets" :  
Device.RuntimePlatform == Device.Android ? "radialmenu_Segoe MDL2 Assets.ttf" :  
"radialmenu_Segoe_MDL2_Assets.ttf#Segoe MDL2 Assets"              
    });             
 }            
  grid.Children.Add(radialMenu);      
        this.Content = grid;        
  } 
     } 
 
 
 
 
  
Sample Link:  
  
Please let us know if you have any queries.  
 
Thanks, 
Muneesh Kumar G. 


Mario
Replied On August 14, 2019 02:40 PM UTC

That doesn't really answer my question because you are using something that I already seen in the documentation. My character map is attached. How does that translate to codes in your example?

ie. I'm going from "i" to " "\uE734"?

Attachment: Capture_b998bf0d.zip

Muneesh Kumar G [Syncfusion]
Replied On August 15, 2019 05:14 AM UTC

Hi Mario,  
 
Thanks for the update. 
  
In last update you have attached the image of the FontFamily file. For this please share us the custom FontFamily file with the text code. It will help us to provide the sample to explain you clearly. 
 
Thanks,   
Muneesh Kumar G.  
 


Mario
Replied On August 15, 2019 01:19 PM UTC

font family file is attached. The Capture_b998bf0d.zip contains a screenshot with the text codes.

Attachment: Edsembli_48db5a88.zip

Muneesh Kumar G [Syncfusion]
Replied On August 19, 2019 07:22 AM UTC

Hi Mario, 
 
Thanks for your update.  
 
We have analyzed your requirement “FontIconText string in C# doesn't working in SfRadialMenu” from our side. We have modified the sample with given FontFamily file. Please try the attached below sample and let us know if you have any concern on this. 
 
Code Snippet: 
Grid grid = new Grid(); 
 radialMenu.CenterButtonFontFamily = Device.RuntimePlatform == Device.Android ? "Edsembli.ttf" : Device.RuntimePlatform == Device.iOS ? "Edsembli" : "Edsembli.ttf#Edsembli"; 
 radialMenu.CenterButtonText = "h"; 
 radialMenu.CenterButtonRadius = 32; 
 radialMenu.SelectionColor = Color.Red; 
 string[] radialMenuItems = new string[] { "i", "j", "k", "p", "r", "l" }; 
 for (int itemCount = 0; itemCount < radialMenuItems.Count(); itemCount++) 
 { 
         radialMenu.Items.Add(new SfRadialMenuItem() 
         { 
                    FontIconText = radialMenuItems[itemCount], 
                    IconFontSize = 25, 
                    IconFontFamily = Device.RuntimePlatform == Device.Android ? "Edsembli.ttf" : Device.RuntimePlatform == Device.iOS ? "Edsembli" : "Edsembli.ttf#Edsembli" 
            }); 
   } 
  grid.Children.Add(radialMenu); 
  this.Content = grid; 
 
Sample Link: 
 
Please refer below image for above sample: 
 
 
 
Please let us know if you have any other queries.  
  
Thanks,   
Muneesh Kumar G.  
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon