Skip to content

Commit 657d1d2

Browse files
authored
Merge a6f4c22 into 539c12d
2 parents 539c12d + a6f4c22 commit 657d1d2

19 files changed

+668
-13
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ The same icons are also available for `WPF` and `UWP` with the [MahApps.Metro.Ic
3131

3232
| Icon collection | Version | ∑ | NuGet |
3333
|---|--:|--:|:--|
34-
| Complete IconPacks collection with all Icons in one package | | 65208 | <a href="https://www.nuget.org/packages/IconPacks.Avalonia/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/IconPacks.Avalonia.svg?style=flat-square&&label=IconPacks"></a> |
34+
| Complete IconPacks collection with all Icons in one package | | 65612 | <a href="https://www.nuget.org/packages/IconPacks.Avalonia/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/IconPacks.Avalonia.svg?style=flat-square&&label=IconPacks"></a> |
3535
| [Bootstrap Icons](https://icons.getbootstrap.com/) | 1.13.1 | 2078 | <a href="https://www.nuget.org/packages/IconPacks.Avalonia.BootstrapIcons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/IconPacks.Avalonia.BootstrapIcons.svg?style=flat-square&&label=BootstrapIcons"></a> |
3636
| [Boxicons](https://boxicons.com/) | 2.1.4 | 1634 | <a href="https://www.nuget.org/packages/IconPacks.Avalonia.BoxIcons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/IconPacks.Avalonia.BoxIcons.svg?style=flat-square&&label=BoxIcons"></a> |
3737
| [Circum Icons Free](https://github.com/Klarr-Agency/Circum-Icons) | 2.0.2 | 288 | <a href="https://www.nuget.org/packages/IconPacks.Avalonia.CircumIcons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/IconPacks.Avalonia.CircumIcons.svg?style=flat-square&&label=CircumIcons"></a> |
@@ -50,6 +50,7 @@ The same icons are also available for `WPF` and `UWP` with the [MahApps.Metro.Ic
5050
| [Game Icons](https://github.com/game-icons/icons) | May 4, 2025 | 4170 | <a href="https://www.nuget.org/packages/IconPacks.Avalonia.GameIcons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/IconPacks.Avalonia.GameIcons.svg?style=flat-square&&label=GameIcons"></a> |
5151
| [Ionicons](https://ionicons.com/) | 4.6.4.1 | 696 | <a href="https://www.nuget.org/packages/IconPacks.Avalonia.Ionicons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/IconPacks.Avalonia.Ionicons.svg?style=flat-square&&label=Ionicons"></a> |
5252
| [Jam Icons](https://jam-icons.com/) | 3.1.0 | 940 | <a href="https://www.nuget.org/packages/IconPacks.Avalonia.JamIcons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/IconPacks.Avalonia.JamIcons.svg?style=flat-square&&label=JamIcons"></a> |
53+
| [Keyrune Icons](https://github.com/andrewgioia/keyrune) | 3.17.1 | 404 | <a href="https://www.nuget.org/packages/IconPacks.Avalonia.KeyruneIcons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/IconPacks.Avalonia.KeyruneIcons.svg?style=flat-square&&label=KeyruneIcons"></a> |
5354
| [Lucide Icons](https://github.com/lucide-icons/lucide) | 0.539.0 | 1630 | <a href="https://www.nuget.org/packages/IconPacks.Avalonia.Lucide/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/IconPacks.Avalonia.Lucide.svg?style=flat-square&&label=Lucide"></a> |
5455
| [Material Design Icons](https://pictogrammers.com/library/mdi/) | 7.4.47 | 7447 | <a href="https://www.nuget.org/packages/IconPacks.Avalonia.Material/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/IconPacks.Avalonia.Material.svg?style=flat-square&&label=Material"></a> |
5556
| [Material Design Icons Light](https://github.com/Templarian/MaterialDesignLight) | 0.2.63 | 257 | <a href="https://www.nuget.org/packages/IconPacks.Avalonia.MaterialLight/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/IconPacks.Avalonia.MaterialLight.svg?style=flat-square&&label=MaterialLight"></a> |
@@ -99,6 +100,7 @@ IconPacks.Avalonia is delivered via NuGet package manager. You can find the pack
99100
- [IconPacks.Avalonia.GameIcons](https://www.nuget.org/packages/IconPacks.Avalonia.GameIcons/)
100101
- [IconPacks.Avalonia.Ionicons](https://www.nuget.org/packages/IconPacks.Avalonia.Ionicons/)
101102
- [IconPacks.Avalonia.JamIcons](https://www.nuget.org/packages/IconPacks.Avalonia.JamIcons/)
103+
- [IconPacks.Avalonia.KeyruneIcons](https://www.nuget.org/packages/IconPacks.Avalonia.KeyruneIcons/)
102104
- [IconPacks.Avalonia.Lucide](https://www.nuget.org/packages/IconPacks.Avalonia.Lucide/)
103105
- [IconPacks.Avalonia.Material](https://www.nuget.org/packages/IconPacks.Avalonia.Material/)
104106
- [IconPacks.Avalonia.MaterialLight](https://www.nuget.org/packages/IconPacks.Avalonia.MaterialLight/)
@@ -146,6 +148,7 @@ Install-Package IconPacks.Avalonia.ForkAwesome
146148
Install-Package IconPacks.Avalonia.GameIcons
147149
Install-Package IconPacks.Avalonia.Ionicons
148150
Install-Package IconPacks.Avalonia.JamIcons
151+
Install-Package IconPacks.Avalonia.KeyruneIcons
149152
Install-Package IconPacks.Avalonia.Lucide
150153
Install-Package IconPacks.Avalonia.Material
151154
Install-Package IconPacks.Avalonia.MaterialLight
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using Avalonia.Media;
2+
using IconPacks.Avalonia.Core;
3+
using IconPacks.Avalonia.Core.Converter;
4+
5+
namespace IconPacks.Avalonia.KeyruneIcons.Converter
6+
{
7+
public class PackIconKeyruneIconsKindToImageConverter : PackIconKindToImageConverterBase
8+
{
9+
/// <inheritdoc />
10+
protected override string GetPathData(object iconKind)
11+
{
12+
string data = null;
13+
if (iconKind is PackIconKeyruneIconsKind kind)
14+
{
15+
PackIconDataFactory<PackIconKeyruneIconsKind>.DataIndex.Value?.TryGetValue(kind, out data);
16+
}
17+
18+
return data;
19+
}
20+
}
21+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<DefineConstants>$(DefineConstants);KEYRUNEICONS</DefineConstants>
5+
<IconsName>KeyruneIcons</IconsName>
6+
<AssemblyName>IconPacks.Avalonia.KeyruneIcons</AssemblyName>
7+
<Title>IconPacks.Avalonia.KeyruneIcons</Title>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="Avalonia" />
12+
</ItemGroup>
13+
14+
<ItemGroup>
15+
<ProjectReference Include="..\IconPacks.Avalonia.Core\IconPacks.Avalonia.Core.csproj" />
16+
</ItemGroup>
17+
18+
<ItemGroup>
19+
<AvaloniaResource Include="Resources/**" />
20+
</ItemGroup>
21+
22+
</Project>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Styles xmlns="https://github.com/avaloniaui"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
3+
<Styles.Resources>
4+
<ResourceDictionary>
5+
<ResourceDictionary.MergedDictionaries>
6+
<MergeResourceInclude Source="avares://IconPacks.Avalonia.KeyruneIcons/PackIconKeyruneIcons.axaml" />
7+
</ResourceDictionary.MergedDictionaries>
8+
</ResourceDictionary>
9+
</Styles.Resources>
10+
11+
<StyleInclude Source="avares://IconPacks.Avalonia.Core/PackIcon.axaml" />
12+
</Styles>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<ResourceDictionary xmlns="https://github.com/avaloniaui"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3+
xmlns:iconPacks="https://github.com/MahApps/IconPacks.Avalonia"
4+
x:ClassModifier="internal">
5+
6+
<Design.PreviewWith>
7+
<iconPacks:PackIconKeyruneIcons Kind="_10e" />
8+
</Design.PreviewWith>
9+
10+
<ControlTheme x:Key="{x:Type iconPacks:PackIconKeyruneIcons}"
11+
BasedOn="{StaticResource IconPacks.Avalonia.PackIconControlBase.Theme}"
12+
TargetType="iconPacks:PackIconKeyruneIcons" />
13+
14+
</ResourceDictionary>
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
using Avalonia;
2+
using Avalonia.Media;
3+
using IconPacks.Avalonia.Core;
4+
using IconPacks.Avalonia.Core.Attributes;
5+
6+
namespace IconPacks.Avalonia.KeyruneIcons
7+
{
8+
/// <summary>
9+
/// All icons sourced from GitHub <see><cref>https://github.com/andrewgioia/keyrune</cref></see>
10+
/// In accordance of <see><cref>https://github.com/andrewgioia/keyrune?tab=License-1-ov-file</cref></see>.
11+
/// </summary>
12+
[MetaData("Keyrune Icons", "https://github.com/andrewgioia/keyrune", "https://github.com/andrewgioia/keyrune?tab=License-1-ov-file")]
13+
public class PackIconKeyruneIcons : PackIconControlBase
14+
{
15+
public PackIconKeyruneIcons()
16+
{
17+
UpdateIconPseudoClasses(true, false, false);
18+
}
19+
20+
public static readonly StyledProperty<PackIconKeyruneIconsKind> KindProperty
21+
= AvaloniaProperty.Register<PackIconKeyruneIcons, PackIconKeyruneIconsKind>(nameof(Kind));
22+
23+
/// <summary>
24+
/// Gets or sets the icon to display.
25+
/// </summary>
26+
public PackIconKeyruneIconsKind Kind
27+
{
28+
get { return GetValue(KindProperty); }
29+
set { SetValue(KindProperty, value); }
30+
}
31+
32+
// We override OnPropertyChanged of the base class. That way we can react on property changes
33+
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
34+
{
35+
base.OnPropertyChanged(change);
36+
37+
// if the changed property is the KindProperty, we need to update the stars
38+
if (change.Property == KindProperty)
39+
{
40+
UpdateData();
41+
}
42+
}
43+
44+
protected override void SetKind<TKind>(TKind iconKind)
45+
{
46+
this.SetCurrentValue(KindProperty, iconKind);
47+
}
48+
49+
protected override void UpdateData()
50+
{
51+
if (Kind != default)
52+
{
53+
string data = null;
54+
PackIconDataFactory<PackIconKeyruneIconsKind>.DataIndex.Value?.TryGetValue(Kind, out data);
55+
this.Data = data != null ? StreamGeometry.Parse(data) : null;
56+
}
57+
else
58+
{
59+
this.Data = null;
60+
}
61+
}
62+
}
63+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using System;
2+
using Avalonia.Markup.Xaml;
3+
using IconPacks.Avalonia.Core;
4+
5+
namespace IconPacks.Avalonia.KeyruneIcons
6+
{
7+
public class KeyruneIconsExtension : BasePackIconExtension
8+
{
9+
public KeyruneIconsExtension()
10+
{
11+
}
12+
13+
public KeyruneIconsExtension(PackIconKeyruneIconsKind kind)
14+
{
15+
this.Kind = kind;
16+
}
17+
18+
[ConstructorArgument("kind")] public PackIconKeyruneIconsKind Kind { get; set; }
19+
20+
public override object ProvideValue(IServiceProvider serviceProvider)
21+
{
22+
return this.GetPackIcon<PackIconKeyruneIcons, PackIconKeyruneIconsKind>(this.Kind);
23+
}
24+
}
25+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using System;
2+
using Avalonia.Markup.Xaml;
3+
using Avalonia.Media;
4+
using IconPacks.Avalonia.Core;
5+
6+
namespace IconPacks.Avalonia.KeyruneIcons
7+
{
8+
public class KeyruneIconsImageExtension : BasePackIconImageExtension
9+
{
10+
public KeyruneIconsImageExtension()
11+
{
12+
}
13+
14+
public KeyruneIconsImageExtension(PackIconKeyruneIconsKind kind)
15+
{
16+
this.Kind = kind;
17+
}
18+
19+
[ConstructorArgument("kind")] public PackIconKeyruneIconsKind Kind { get; set; }
20+
21+
public override object ProvideValue(IServiceProvider serviceProvider)
22+
{
23+
return CreateImageSource(this.Kind, this.Brush ?? Brushes.Black);
24+
}
25+
26+
/// <inheritdoc />
27+
protected override string GetPathData(object iconKind)
28+
{
29+
string data = null;
30+
if (iconKind is PackIconKeyruneIconsKind kind)
31+
{
32+
PackIconDataFactory<PackIconKeyruneIconsKind>.DataIndex.Value?.TryGetValue(kind, out data);
33+
}
34+
35+
return data;
36+
}
37+
}
38+
}

0 commit comments

Comments
 (0)