charri / Font-Awesome-WPF

FontAwesome controls for WPF+UWP
MIT License
530 stars 147 forks source link

How to use FontAwesome.WPF when image source URI is required #34

Closed afluegge closed 7 years ago

afluegge commented 7 years ago

I have a situation where I need a URI as an IconSource. How can I use FontAwesom.WPF in this situation?

Details: "Extended WPF Toolkit" AvalonDock LayoutAnchorable has a property to set the panel icon ("IconSource") which requires a URI. The property does not allow binding. I want to use a FontAwesom icon as the panel icon.

<xcad:DockingManager>
    <xcad:LayoutRoot x:Name="LayoutRoot">
        <xcad:LayoutPanel Orientation="Horizontal">
            <xcad:LayoutAnchorablePane DockMinWidth="200">
                <xcad:LayoutAnchorable ContentId="Properties" Title="Properties" IconSource=" ??? ">
                    . . .
                </xcad:LayoutAnchorable>
            </xcad:LayoutAnchorablePane>
        </xcad:LayoutPanel>
    </xcad:LayoutRoot>
</xcad:DockingManager>
charri commented 7 years ago

This is currently not supported. Easiest method would be to download the image you need (http://fa2png.io/).

DesselBane commented 7 years ago

Can you use a Resource (Static or Dynamic) ? Then you could use a MarkupExtension which I suggested (here) to get the FA into an ImageSource