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. Image for the cookie policy date

Multiple bindings in a button

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,

1 Reply

BK Bharathiraja K Syncfusion Team 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. 


Loader.
Live Chat Icon For mobile
Up arrow icon