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

Multiple bindings in a button

Thread ID:

Created:

Updated:

Platform:

Replies:

145057 Jun 4,2019 12:44 PM UTC Jun 5,2019 11:51 AM UTC Xamarin.Forms 1
loading
Tags: SfButton
Alexis
Asked On June 4, 2019 12:44 PM UTC

Hi,

I have a button where I use fontfamily fontawesome and another fontfamily.

The text I want to write is:  " Facebook"

My issue is that Facebook is also detected as a fontawesome key.

So I would like to do:

 <buttons:SfButton.Text>
<Run Text="&#xf39e;" FontFamily="{StaticResource FontAwesomeBrands}"/>
<Run Text="Facebook" FontFamily="{StaticResource MyOtherFont}"/>
                            
</buttons:SfButton.Text>

In WPF run does the job. In xamarin forms it's not existing.

How can I do it?

Thanks,

Bharathiraja K [Syncfusion]
Replied On June 5, 2019 11:51 AM UTC

Hi Alexis, 
 
Greetings from Syncfusion. We have prepared the sample to add Font- Awesome style and other custom style to button, the sample will be downloaded from below link. 
 
 
The FontFamily property of the SfButton is used to customize the font family of the text. 
 
[XAML]: 
<buttons:SfButton Text="Facebook" FontFamily="{StaticResource Lobster-Regular}" TextColor="White" HorizontalOptions="FillAndExpand" VerticalOptions="Start" HeightRequest="40" CornerRadius="15"> 
            </buttons:SfButton> 
 
To display Font Awesome icons, we can use image source as like the below code snippet. 
 
<buttons:SfButton  Text="" x:Name="buttonCallMobile" Clicked="ButtonCallMobile_OnClicked" ShowIcon="true" BackgroundColor="White" > 
            <buttons:SfButton.ImageSource> 
                <FontImageSource Glyph="&#xf39e;" Size="15" Color="{StaticResource RarikBlue}"  
                                         FontFamily="{StaticResource FontfamilyFontAwesome}"> 
                </FontImageSource> 
            </buttons:SfButton.ImageSource> 
        </buttons:SfButton> 
 
 
 
Output:  
 
 
Regards, 
Bharathi. 


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