Changing Font Icon in WPF using Font Awesome

后端 未结 3 421
忘了有多久
忘了有多久 2020-12-03 01:34

I am making use of Font Awesome\'s icons to render basic font images within my C# WPF application. During run-time when I attempt to alter the TextBlock to display a differe

3条回答
  •  心在旅途
    2020-12-03 02:16

    Font Awesome has NuGet packages named FontAwesome.UWP and FontAwesome.WPF. Just download one of this.

    If you will use a icon import follow namespace into your XAML code:

    xmlns:fa="http://schemas.fontawesome.io/icons/"
    

    Use it into your button like this:

    
    

    And finally in your C# code behind:

    using FontAwesome.WPF; // on the top of the code
    btnButton.Content = FontAwesomeIcon.LongArrowRight;
    

提交回复
热议问题