Giter Club home page Giter Club logo

Comments (4)

mkoertgen avatar mkoertgen commented on June 12, 2024 1

Hi @foreachthing,

As of now the lookup order is hard-coded, cf.:

We did not add the style-concept yet. That would probably a good extension. The way i would go about is to add style-property in xaml, e.g.

<fa:IconBlock Icon="Home" Foreground="Blue" Style="<Regular> or <Solid>" />

As a workaround you can always use the font explicitly in a TextBlock (see Readme) like this

<TextBlock Grid.Column="1" Text="&#xf042;"   <----- Use hex-code of "IconChar.FolderOpen" here
    FontFamily="/FontAwesome.Sharp;component/fonts/#Font Awesome 5 Free Solid"
    Foreground="Chartreuse"
    TextAlignment="Center" />

But of course then you lose most of the goodness FontAwesome.Sharp brings to the table ;-)

from fontawesome.sharp.

foreachthing avatar foreachthing commented on June 12, 2024

Thanks for your answer @mkoertgen
I guess I should have mentioned that I am using Windows Forms (somehow I can't get used to wpf).
Any chance of using solids with c#?

from fontawesome.sharp.

mkoertgen avatar mkoertgen commented on June 12, 2024

Hi @foreachthing,

You can always sub-class the component you want to use and override the FontFor-method.

For example the IconButton:

public class MyIconButton : IconButton
{
   public override FontFor(IconChar icon)
   {
        if (UseSolid)
           return ....
   }
}

As of now access to the internally loaded fonts is private/internal in FormsIconHelper.cs but it should be no problem to make this public.

from fontawesome.sharp.

foreachthing avatar foreachthing commented on June 12, 2024

Yeah ... !
I'm fairly new to c# and could not get it to work.

So, I adjusted the code according issue #33, and that was it! :-)

Thanks for your patience and hard work.

from fontawesome.sharp.

Related Issues (20)

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.