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 | | 58895 | <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 | | 61439 | <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 @@ -58,6 +58,7 @@ The same icons are also available for [Avalonia](https://avaloniaui.net/ with th
| [Microns](https://github.com/stephenhutchings/microns) | 1.1.4 | 164 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.Microns/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.Microns.svg?style=flat-square&&label=Microns"></a> |
| [MingCute Icon](https://github.com/Richard9394/MingCute) | 2.9.6 | 3098 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.MingCuteIcons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.MingCuteIcons.svg?style=flat-square&&label=MingCuteIcons"></a> |
| [Modern UI Icons](https://github.com/Templarian/WindowsIcons) | Feb 12, 2015 | 1260 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.Modern/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.Modern.svg?style=flat-square&&label=Modern"></a> |
| [MynaUI Icons](https://github.com/praveenjuge/mynaui-icons) | 0.3.9 | 2544 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.MynaUIIcons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.MynaUIIcons.svg?style=flat-square&&label=MynaUIIcons"></a> |
| [Primer Octicons (GitHub)](https://github.com/primer/octicons) | 19.15.3 | 651 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.Octicons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.Octicons.svg?style=flat-square&&label=Octicons"></a> |
| [Phosphor Icons](https://phosphoricons.com/) | 2.1.1 | 7560 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.PhosphorIcons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.PhosphorIcons.svg?style=flat-square&&label=PhosphorIcons"></a> |
| [PICOL Icons](https://github.com/PicolSigns/Icons) | 1.1.0 | 549 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.PicolIcons/" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.PicolIcons.svg?style=flat-square&&label=PicolIcons"></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);MYNAUIICONS</DefineConstants>
<IconsName>MynaUIIcons</IconsName>
<AssemblyName>MahApps.Metro.IconPacks.MynaUIIcons</AssemblyName>
<Title>MahApps.Metro.IconPacks.MynaUIIcons</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.MynaUIIcons/PackIconMynaUIIcons.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>
/// MynaUI Icons are licensed under [MIT license](<see><cref>https://github.com/praveenjuge/mynaui-icons?tab=MIT-1-ov-file</cref></see>).
/// Contributions, corrections and requests can be made on GitHub <see><cref>https://github.com/praveenjuge/mynaui-icons</cref></see>.
/// </summary>
[MetaData("MynaUI Icons", "https://github.com/praveenjuge/mynaui-icons", "https://github.com/praveenjuge/mynaui-icons?tab=MIT-1-ov-file")]
public class PackIconMynaUIIcons : PackIconControlBase
{
public static readonly DependencyProperty KindProperty
= DependencyProperty.Register(nameof(Kind), typeof(PackIconMynaUIIconsKind), typeof(PackIconMynaUIIcons), new PropertyMetadata(default(PackIconMynaUIIconsKind), KindPropertyChangedCallback));

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

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

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

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

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

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

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

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

#if (NETFX_CORE || WINDOWS_UWP)
protected override object ProvideValue()
#else
public override object ProvideValue(IServiceProvider serviceProvider)
#endif
{
return this.GetPackIcon<PackIconMynaUIIcons, PackIconMynaUIIconsKind>(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 MynaUIIconsImageExtension : BasePackIconImageExtension
{
public MynaUIIconsImageExtension()
{
}

public MynaUIIconsImageExtension(PackIconMynaUIIconsKind kind)
{
this.Kind = kind;
}

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

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