how use icon [Font-awesome] in WPF

后端 未结 4 1779
谎友^
谎友^ 2020-12-25 12:41

I am new in WPF. I want to use Font-awesome Icon in textbox and button. but the icon is not bind with my textbox

I install Font-awesome resource to my application.<

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-25 13:14

    I know this is an old question, and this option may not have been available to you at the time, so I thought I would provide an updated method for anyone who stumbles across this. I recommend you install the NuGet package 'FontAwesome5' from here:

    FontAwesome5 on NuGet.org

    or search "fontawesome5" in Visual Studio's built-in NuGet Package Manager window:

    Tools > NuGet Package Manager > Manage NuGet Packages for Solution...

    -it is usually the top result when using this exact search term.

    Then simply add the following namespace to your XAML document:

    xmlns:fa5="http://schemas.fontawesome.com/icons/"
    

    and then you should find relative ease in adding icons to your project. For example:

    
    

    or

    
    

    And the beauty of this is that IntelliSense will show you a list of all available icons, saving you the hassle of going to the website to search them up.

提交回复
热议问题