GithubHelp home page GithubHelp logo

jandotnet / fontawesome5 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from martintopfstedt/fontawesome5

0.0 1.0 0.0 6.4 MB

WPF controls for the iconic SVG, font, and CSS toolkit Font Awesome 5.

License: MIT License

C# 99.99% Batchfile 0.01%

fontawesome5's Introduction

FontAwesome5

Build Status

WPF (.Net and .Net Core) and UWP controls for the iconic SVG, font, and CSS toolkit Font Awesome 5.

Font Awesome: https://github.com/FortAwesome/Font-Awesome

  • Current Version: v5.15.3

Getting Started

Installation

Install-Package FontAwesome5

https://www.nuget.org/packages/FontAwesome5

Usage XAML

The usage is the same like the version from charri, just the FontAwesomeIcon enumeration has changed to EFontAwesomeIcon and has the Styles included, which means "Flag" changed to "Solid_Flag" or "Regular_Flag", and the name space changed from "http://schemas.fontawesome.io" to "http://schemas.fontawesome.com".

https://github.com/charri/Font-Awesome-WPF/blob/master/README-WPF.md#usage-xaml

Usage XAML SVG

The SvgAwesome can be used like the ImageAwesome.

<Window x:Class="FontAwesome5.WPF.Example"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:fa5="http://schemas.fontawesome.com/icons/"
        Title="FontAwesome5.WPF.Example" Height="300" Width="300">
    <Grid  Margin="20">
        <fa5:SvgAwesome Icon="Solid_Flag" VerticalAlignment="Center" HorizontalAlignment="Center" />
    </Grid>
</Window>

Converters (WPF only)

ImageSourceConverter

https://github.com/charri/Font-Awesome-WPF/blob/master/README-WPF.md#imagesourceconverter

LabelConverter

Gets the Label/Name of a EFontAwesomeIcon. The converter parameter can contain a format string, where {0} is the label/name and {1} is the style.

Example:

<Window x:Class="FontAwesome5.WPF.Example"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:fa5="http://schemas.fontawesome.com/icons/"
        Title="FontAwesome5.WPF.Example" Height="300" Width="300">
    <Window.Resources>
        <fa5:LabelConverter x:Key="LabelConverter"/>
    </Window.Resources>
    <Grid  Margin="20">        
        <TextBlock Text="{Binding EFontAwesomeIcon, Converter={StaticResource LabelConverter}}"/>                
        <TextBlock Text="{Binding EFontAwesomeIcon, Converter={StaticResource LabelConverter}, ConverterParameter='{}{0} ({1})'}"/>
    </Grid>
</Window>

StyleConverter

Gets the EFontAwesomeStyle of a EFontAwesomeIcon.

Example:

<Window x:Class="FontAwesome5.WPF.Example"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:fa5="http://schemas.fontawesome.com/icons/"
        Title="FontAwesome5.WPF.Example" Height="300" Width="300">
    <Window.Resources>
        <fa5:StyleConverter x:Key="StyleConverter"/>
    </Window.Resources>
    <Grid  Margin="20">        
        <TextBlock Text="{Binding EFontAwesomeIcon, Converter={StaticResource StyleConverter}}"/>                
    </Grid>
</Window>

Credits

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.