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
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ 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 | | 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> |
| Complete IconPacks collection with all Icons in one package | | 69196 | <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> |
| [Boxicons v2](https://v2.boxicons.com/) | 2.1.4 | 1634 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.BoxIcons2/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.BoxIcons2.svg?style=flat-square&&label=BoxIcons2"></a> |
| [Boxicons v3](https://boxicons.com/) | 3.0.0 | 3584 | <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> |
| [Codicons](https://github.com/microsoft/vscode-codicons) | 0.0.39 | 493 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.Codicons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.Codicons.svg?style=flat-square&&label=Codicons"></a> |
| [Coolicons](https://github.com/krystonschwarze/coolicons) | 4.1 | 442 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.Coolicons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.Coolicons.svg?style=flat-square&&label=Coolicons"></a> |
Expand Down
6 changes: 3 additions & 3 deletions src/MahApps.Metro.IconPacks.BoxIcons/PackIconBoxIcons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
namespace MahApps.Metro.IconPacks
{
/// <summary>
/// BoxIcons licensed under [SIL OFL 1.1](<see><cref>http://scripts.sil.org/OFL</cref></see>)
/// Contributions, corrections and requests can be made on GitHub <see><cref>https://github.com/atisawd/boxicons</cref></see>.
/// BoxIcons v3 licensed under [CC 4.0 License](<see><cref>https://docs.boxicons.com/license/free</cref></see>)
/// Project web site <see><cref>https://boxicons.com/</cref></see>.
/// </summary>
[MetaData("Boxicons", "https://boxicons.com/", "https://boxicons.com/usage/#license")]
[MetaData("Boxicons v3", "https://boxicons.com/", "https://docs.boxicons.com/license/free")]
public class PackIconBoxIcons : PackIconControlBase
{
public static readonly DependencyProperty KindProperty
Expand Down
5,202 changes: 3,576 additions & 1,626 deletions src/MahApps.Metro.IconPacks.BoxIcons/PackIconBoxIconsKind.cs

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/MahApps.Metro.IconPacks.BoxIcons/PathIconBoxIcons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
namespace MahApps.Metro.IconPacks
{
/// <summary>
/// BoxIcons licensed under [SIL OFL 1.1](<see><cref>http://scripts.sil.org/OFL</cref></see>)
/// Contributions, corrections and requests can be made on GitHub <see><cref>https://github.com/atisawd/boxicons</cref></see>.
/// BoxIcons v3 licensed under [CC 4.0 License](<see><cref>https://docs.boxicons.com/license/free</cref></see>)
/// Project web site <see><cref>https://boxicons.com/</cref></see>.
/// </summary>
[MetaData("Boxicons", "https://boxicons.com/", "https://boxicons.com/usage/#license")]
[MetaData("Boxicons v3", "https://boxicons.com/", "https://docs.boxicons.com/license/free")]
public class PathIconBoxIcons : PathIconControlBase
{
public static readonly DependencyProperty KindProperty
Expand Down
2 changes: 1 addition & 1 deletion src/MahApps.Metro.IconPacks.BoxIcons/Resources/Icons.json

Large diffs are not rendered by default.

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);BOXICONS2</DefineConstants>
<IconsName>BoxIcons2</IconsName>
<AssemblyName>MahApps.Metro.IconPacks.BoxIcons2</AssemblyName>
<Title>MahApps.Metro.IconPacks.BoxIcons2</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.BoxIcons2/PackIconBoxIcons2.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>
/// BoxIcons licensed under [MIT](<see><cref>https://v2.boxicons.com/usage#license</cref></see>)
/// Contributions, corrections and requests can be made on GitHub <see><cref>https://github.com/atisawd/boxicons</cref></see>.
/// </summary>
[MetaData("Boxicons v2", "https://v2.boxicons.com/", "https://v2.boxicons.com/usage#license")]
public class PackIconBoxIcons2 : PackIconControlBase
{
public static readonly DependencyProperty KindProperty
= DependencyProperty.Register(nameof(Kind), typeof(PackIconBoxIcons2Kind), typeof(PackIconBoxIcons2), new PropertyMetadata(default(PackIconBoxIcons2Kind), KindPropertyChangedCallback));

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

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

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

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

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

protected override void UpdateData()
{
if (Kind != default(PackIconBoxIcons2Kind))
{
string data = null;
PackIconDataFactory<PackIconBoxIcons2Kind>.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 BoxIcons2CursorExtension : BoxIcons2ImageExtension, IPackIconCursorExtension
{
public BoxIcons2CursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush;
public BoxIcons2CursorExtension(PackIconBoxIcons2Kind 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(PackIconBoxIcons2))]
#else
[MarkupExtensionReturnType(typeof(PackIconBoxIcons2))]
#endif
public class BoxIcons2Extension : BasePackIconExtension
{
public BoxIcons2Extension()
{
}

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

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

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

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

public BoxIcons2ImageExtension(PackIconBoxIcons2Kind kind)
{
this.Kind = kind;
}

[ConstructorArgument("kind")]
public PackIconBoxIcons2Kind 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 PackIconBoxIcons2Kind kind)
{
PackIconDataFactory<PackIconBoxIcons2Kind>.DataIndex.Value?.TryGetValue(kind, out data);
}
return data;
}

/// <inheritdoc />
protected override ScaleTransform GetScaleTransform(object iconKind)
{
return new ScaleTransform(1, -1);
}
}
}
Loading
Loading