All Projects → Projektanker → Icons.Avalonia

Projektanker / Icons.Avalonia

Licence: MIT license
No description or website provided.

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to Icons.Avalonia

GoogleMD-Icons
Google Material Design Icons Library
Stars: ✭ 14 (-73.08%)
Mutual labels:  icons, materialdesignicons
Material.Icons.Avalonia
Avalonia control for display material icons from Material.Icons: https://github.com/SKProCH/Material.Icons
Stars: ✭ 19 (-63.46%)
Mutual labels:  icons, avaloniaui
Avalonia.IconPacks
Import of Visual Studio image library and MahApps.Metro.IconPacks for Avalonia
Stars: ✭ 121 (+132.69%)
Mutual labels:  icons, avaloniaui
dicefont
Scalable vector graphics for dice in icon font format
Stars: ✭ 20 (-61.54%)
Mutual labels:  icons
mdn-dinocons
A scalable set of icons for use across Mozilla Developer websites
Stars: ✭ 21 (-59.62%)
Mutual labels:  icons
api-docs
Documentation for Icons8 API
Stars: ✭ 17 (-67.31%)
Mutual labels:  icons
MahiruLauncher
🍢 Cross-platform modular launcher
Stars: ✭ 14 (-73.08%)
Mutual labels:  avaloniaui
adapticon
The app icon is one of the most important assets of an app and therefore it is key to make it look perfect on any device. Adaptive Icons make that possible and also allow you to add a nice little extra touch to your app.
Stars: ✭ 20 (-61.54%)
Mutual labels:  icons
hass-hue-icons
Additional vector icons for home assistant to model Philips Hue bulbs and fixtures.
Stars: ✭ 161 (+209.62%)
Mutual labels:  icons
iconcolor
Automatic icon colorization using deep convolutional neural networks. "Towards Icon Design Using Machine Learning." In Stanford CS229, Fall 2017.
Stars: ✭ 35 (-32.69%)
Mutual labels:  icons
phosphor-figma
A flexible icon family for Figma
Stars: ✭ 17 (-67.31%)
Mutual labels:  icons
oojs-ui
OOUI is a modern JavaScript UI library with strong cross-browser support. It is the standard library for MediaWiki and Wikipedia. This is a mirror from https://gerrit.wikimedia.org. Main website:
Stars: ✭ 45 (-13.46%)
Mutual labels:  icons
octicons-modular
GitHub Octicons with tree-shaking support and icon-per-file style.
Stars: ✭ 25 (-51.92%)
Mutual labels:  icons
vector-icons
Free Vector icons for Website and Mobile App
Stars: ✭ 28 (-46.15%)
Mutual labels:  icons
vscode-icon
🌀 Round OSX icon for VSCode 🚀
Stars: ✭ 16 (-69.23%)
Mutual labels:  icons
react-flagkit
🇺🇦 React wrapper for FlagKit Flag Icons
Stars: ✭ 21 (-59.62%)
Mutual labels:  icons
WP-SVG-Icons-WordPress-Plugin
WPIcons Plugin (Formally WP SVG Icons) - Quickly and easily install font icons and custom SVG icons on any WordPress site.
Stars: ✭ 18 (-65.38%)
Mutual labels:  icons
tasarimcilar-ve-yazilimcilar-icin-kaynak-arsivim
Tasarım ve yazılım ile ilgili 2017 yılından günümüze kadar geçen zamanda toplamış olduğum arşivimi sizle ile paylaşıyorum. Ne mi var her şey...
Stars: ✭ 276 (+430.77%)
Mutual labels:  icons
KGySoft.Drawing
KGy SOFT Drawing is a library for advanced image, icon and graphics handling.
Stars: ✭ 27 (-48.08%)
Mutual labels:  icons
StadiaIcons
A set of icons for games based on the Google Stadia logo.
Stars: ✭ 20 (-61.54%)
Mutual labels:  icons

Icons.Avalonia

A library to easily display icons in an Avalonia App.

CI-CD

NuGet

Name Description Version
Projektanker.Icons.Avalonia Core library Nuget
Projektanker.Icons.Avalonia.FontAwesome Font Awesome 6 Free Nuget
Projektanker.Icons.Avalonia.MaterialDesign Material Design Icons Nuget

Icon providers

Name Prefix Example
FontAwesome 6 fa fa-github
MaterialDesign mdi mdi-github

Usage

A full example is available in the demo directory.

1. Register icon providers on app start up

Register the icon provider(s) with the AppBuilder.

class Program
{
    // Initialization code. Don't use any Avalonia, third-party APIs or any
    // SynchronizationContext-reliant code before AppMain is called: things aren't initialized
    // yet and stuff might break.
    public static void Main(string[] args)
    {
        BuildAvaloniaApp()
            .StartWithClassicDesktopLifetime(args);
    }

    // Avalonia configuration, don't remove; also used by visual designer.
    public static AppBuilder BuildAvaloniaApp()
    {
        return AppBuilder.Configure<App>()
            .UsePlatformDetect()
            .LogToTrace()
            .WithIcons(container => container
                .Register<FontAwesomeIconProvider>()
                .Register<MaterialDesignIconProvider>());
    }
}

2. Add xml namespace

Add xmlns:i="clr-namespace:Projektanker.Icons.Avalonia;assembly=Projektanker.Icons.Avalonia" to your view.

3. Use the icon

Standalone

<i:Icon Value="fa-brands fa-github" />

Attached to ContentControl (e.g. Button)

<Button i:Attached.Icon="fa-brands fa-github" />

Attached to MenuItem

<MenuItem Header="About" i:MenuItem.Icon="fa-solid fa-circle-info" />

Done

Screenshot

Implement your own Icon Provider

Just implement the IIconProvider interface:

namespace Projektanker.Icons.Avalonia
{
    /// <summary>
    /// Represents an icon reader.
    /// </summary>
    public interface IIconReader
    {
        /// <summary>
        /// Gets the SVG path of the requested icon.
        /// </summary>
        /// <param name="value">The value specifying the icon to return it's path from.</param>
        /// <returns>The path of the icon.</returns>
        /// <exception cref="System.Collections.Generic.KeyNotFoundException">
        /// The icon associated with the specified <paramref name="value"/> does not exists.
        /// </exception>
        string GetIconPath(string value);
    }

    /// <summary>
    /// Represents an icon provider.
    /// </summary>
    public interface IIconProvider : IIconReader
    {
        /// <summary>
        /// Gets the prefix of the <see cref="IIconProvider"/>.
        /// </summary>
        string Prefix { get; }
    }
}

and register it with the IIconProviderContainer:

container.Register<MyCustomIconProvider>()

or

IIconProvider provider = new MyCustomIconProvider(/* custom ctor arguments */);
container.Register(provider);

The IIconProvider.Prefix property has to be unique within all registered providers. It is used to select the right provider. E.g. FontAwesomeIconProvider's prefix is fa.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].