Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The same icons are also available for [Avalonia](https://avaloniaui.net/ with th

| Icon collection | Version | ∑ | NuGet |
|---|--:|--:|:--|
| Complete IconPacks collection with all Icons in one package | | 65208 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.svg?style=flat-square&&label=IconPacks"></a> |
| Complete IconPacks collection with all Icons in one package | | 65612 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.svg?style=flat-square&&label=IconPacks"></a> |
| [Bootstrap Icons](https://icons.getbootstrap.com/) | 1.13.1 | 2078 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.BootstrapIcons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.BootstrapIcons.svg?style=flat-square&&label=BootstrapIcons"></a> |
| [Boxicons](https://boxicons.com/) | 2.1.4 | 1634 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.BoxIcons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.BoxIcons.svg?style=flat-square&&label=BoxIcons"></a> |
| [Circum Icons Free](https://github.com/Klarr-Agency/Circum-Icons) | 2.0.2 | 288 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.CircumIcons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.CircumIcons.svg?style=flat-square&&label=CircumIcons"></a> |
Expand All @@ -52,6 +52,7 @@ The same icons are also available for [Avalonia](https://avaloniaui.net/ with th
| [Game Icons](https://github.com/game-icons/icons) | May 4, 2025 | 4170 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.GameIcons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.GameIcons.svg?style=flat-square&&label=GameIcons"></a> |
| [Ionicons](https://ionicons.com/) | 4.6.4.1 | 696 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.Ionicons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.Ionicons.svg?style=flat-square&&label=Ionicons"></a> |
| [Jam Icons](https://jam-icons.com/) | 3.1.0 | 940 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.JamIcons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.JamIcons.svg?style=flat-square&&label=JamIcons"></a> |
| [Keyrune Icons](https://github.com/andrewgioia/keyrune) | 3.17.1 | 404 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.KeyruneIcons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.KeyruneIcons.svg?style=flat-square&&label=KeyruneIcons"></a> |
| [Lucide Icons](https://github.com/lucide-icons/lucide) | 0.539.0 | 1630 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.Lucide/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.Lucide.svg?style=flat-square&&label=Lucide"></a> |
| [Material Design Icons](https://pictogrammers.com/library/mdi/) | 7.4.47 | 7447 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.Material/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.Material.svg?style=flat-square&&label=Material"></a> |
| [Material Design Icons Light](https://github.com/Templarian/MaterialDesignLight) | 0.2.63 | 257 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.MaterialLight/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.MaterialLight.svg?style=flat-square&&label=MaterialLight"></a> |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<DefineConstants>$(DefineConstants);KEYRUNEICONS</DefineConstants>
<IconsName>KeyruneIcons</IconsName>
<AssemblyName>MahApps.Metro.IconPacks.KeyruneIcons</AssemblyName>
<Title>MahApps.Metro.IconPacks.KeyruneIcons</Title>
<RootNamespace>MahApps.Metro.IconPacks</RootNamespace>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\MahApps.Metro.IconPacks.Core\MahApps.Metro.IconPacks.Core.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Remove="Resources\*.*" />
<EmbeddedResource Include="Resources\*.*" />
</ItemGroup>

<!-- WPF Items include -->
<ItemGroup Condition="'$(IsWpf)' == 'true'">
<None Remove="**\*.rd.xml" />
<Compile Remove="Path*.*" />
<Page Generator="MSBuild:Compile" Include="Themes\WPF\*.xaml" Link="Themes\%(RecursiveDir)%(Filename)%(Extension)" SubType="Designer" Exclude="**\bin\**\*.xaml;**\obj\**\*.xaml" />
</ItemGroup>

<!-- UWP Items include -->
<ItemGroup Condition="'$(IsUwp)' == 'true'">
<Compile Remove="*Image*.cs;*Cursor*.cs" />
<Compile Remove="Themes\**\*.*" />
<EmbeddedResource Include="Properties\$(AssemblyName).rd.xml" />
<Page Generator="MSBuild:Compile" Include="Themes\UAP\*.xaml" Link="Themes\%(RecursiveDir)%(Filename)%(Extension)" SubType="Designer" Exclude="**\bin\**\*.xaml;**\obj\**\*.xaml" />
<Compile DependentUpon="%(Filename)" Update="**\*.xaml.cs" />
</ItemGroup>

</Project>
76 changes: 76 additions & 0 deletions src/MahApps.Metro.IconPacks.KeyruneIcons/PackIconKeyruneIcons.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
#if (NETFX_CORE || WINDOWS_UWP)
using Windows.UI.Xaml;
using Windows.UI.Xaml.Data;
#else
using System.Windows;
#endif

namespace MahApps.Metro.IconPacks
{
/// <summary>
/// All icons sourced from GitHub <see><cref>https://github.com/andrewgioia/keyrune</cref></see>
/// In accordance of <see><cref>https://github.com/andrewgioia/keyrune?tab=License-1-ov-file</cref></see>.
/// </summary>
[MetaData("Keyrune Icons", "https://github.com/andrewgioia/keyrune", "https://github.com/andrewgioia/keyrune?tab=License-1-ov-file")]
public class PackIconKeyruneIcons : PackIconControlBase
{
public static readonly DependencyProperty KindProperty
= DependencyProperty.Register(nameof(Kind), typeof(PackIconKeyruneIconsKind), typeof(PackIconKeyruneIcons), new PropertyMetadata(default(PackIconKeyruneIconsKind), KindPropertyChangedCallback));

private static void KindPropertyChangedCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
{
if (e.NewValue != e.OldValue)
{
((PackIconKeyruneIcons)dependencyObject).UpdateData();
}
}

/// <summary>
/// Gets or sets the icon to display.
/// </summary>
public PackIconKeyruneIconsKind Kind
{
get { return (PackIconKeyruneIconsKind)GetValue(KindProperty); }
set { SetValue(KindProperty, value); }
}

#if !(NETFX_CORE || WINDOWS_UWP)
static PackIconKeyruneIcons()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(PackIconKeyruneIcons), new FrameworkPropertyMetadata(typeof(PackIconKeyruneIcons)));
}
#endif

public PackIconKeyruneIcons()
{
#if NETFX_CORE || WINDOWS_UWP
this.DefaultStyleKey = typeof(PackIconKeyruneIcons);
#endif
}

protected override void SetKind<TKind>(TKind iconKind)
{
#if NETFX_CORE || WINDOWS_UWP
BindingOperations.SetBinding(this, PackIconKeyruneIcons.KindProperty, new Binding() { Source = iconKind, Mode = BindingMode.OneTime });
#else
this.SetCurrentValue(KindProperty, iconKind);
#endif
}

protected override void UpdateData()
{
if (Kind != default(PackIconKeyruneIconsKind))
{
string data = null;
PackIconDataFactory<PackIconKeyruneIconsKind>.DataIndex.Value?.TryGetValue(Kind, out data);
this.Data = data;
}
else
{
this.Data = null;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System;
using System.Windows;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;

namespace MahApps.Metro.IconPacks
{
[MarkupExtensionReturnType(typeof(Cursor))]
public class KeyruneIconsCursorExtension : KeyruneIconsImageExtension, IPackIconCursorExtension
{
public KeyruneIconsCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush;
public KeyruneIconsCursorExtension(PackIconKeyruneIconsKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush;

/// <inheritdoc/>
public Point HotSpot { get; set; }
/// <inheritdoc/>
public double Width { get; set; } = PackIconCursorHelper.DefaultWidth;
/// <inheritdoc/>
public double Height { get; set; } = PackIconCursorHelper.DefaultHeight;
/// <inheritdoc/>
public Brush StrokeBrush { get; set; }
/// <inheritdoc/>
public double StrokeThickness { get; set; } = PackIconCursorHelper.DefaultStrokeThickness;

public override object ProvideValue(IServiceProvider serviceProvider)
{
TransformGroup transformGroup = (TransformGroup)GetTransformGroup(this.Kind);
Geometry geometry = PackIconCursorHelper.GetCursorGeometry(GetPathData(this.Kind), transformGroup, Width, Height);
return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#if (NETFX_CORE || WINDOWS_UWP)
using Windows.UI.Xaml.Markup;
#else
using System;
using System.Windows.Markup;
#endif

namespace MahApps.Metro.IconPacks
{
#if (NETFX_CORE || WINDOWS_UWP)
[MarkupExtensionReturnType(ReturnType = typeof(PackIconKeyruneIcons))]
#else
[MarkupExtensionReturnType(typeof(PackIconKeyruneIcons))]
#endif
public class KeyruneIconsExtension : BasePackIconExtension
{
public KeyruneIconsExtension()
{
}

#if !(NETFX_CORE || WINDOWS_UWP)
public KeyruneIconsExtension(PackIconKeyruneIconsKind kind)
{
this.Kind = kind;
}

[ConstructorArgument("kind")]
#endif
public PackIconKeyruneIconsKind Kind { get; set; }

#if (NETFX_CORE || WINDOWS_UWP)
protected override object ProvideValue()
#else
public override object ProvideValue(IServiceProvider serviceProvider)
#endif
{
return this.GetPackIcon<PackIconKeyruneIcons, PackIconKeyruneIconsKind>(this.Kind);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System;
using System.Windows.Markup;
using System.Windows.Media;

namespace MahApps.Metro.IconPacks
{
[MarkupExtensionReturnType(typeof(ImageSource))]
public class KeyruneIconsImageExtension : BasePackIconImageExtension
{
public KeyruneIconsImageExtension()
{
}

public KeyruneIconsImageExtension(PackIconKeyruneIconsKind kind)
{
this.Kind = kind;
}

[ConstructorArgument("kind")]
public PackIconKeyruneIconsKind Kind { get; set; }

public override object ProvideValue(IServiceProvider serviceProvider)
{
return CreateImageSource(this.Kind, this.Brush ?? Brushes.Black);
}

/// <inheritdoc />
protected override string GetPathData(object iconKind)
{
string data = null;
if (iconKind is PackIconKeyruneIconsKind kind)
{
PackIconDataFactory<PackIconKeyruneIconsKind>.DataIndex.Value?.TryGetValue(kind, out data);
}
return data;
}
}
}
Loading
Loading