From f47dd29e4be80bf9ba105ed458b3551774125ef8 Mon Sep 17 00:00:00 2001 From: Eiad Al-Khanshour Date: Fri, 5 Nov 2021 00:47:35 +0300 Subject: [PATCH 1/5] Add support to create cursors. --- .../MahApps.Metro.IconPacks.Core.csproj | 2 +- .../PackIconCursorExtension.cs | 39 +++++ .../PackIconCursorHelper.cs | 156 ++++++++++++++++++ .../PackIconBootstrapIconsCursorExtension.cs | 33 ++++ .../PackIconBoxIconsCursorExtension.cs | 33 ++++ .../PackIconCodiconsCursorExtension.cs | 33 ++++ .../PackIconCooliconsCursorExtension.cs | 33 ++++ .../Entypo/PackIconEntypoCursorExtension.cs | 33 ++++ .../PackIconEvaIconsCursorExtension.cs | 33 ++++ .../PackIconFeatherIconsCursorExtension.cs | 33 ++++ .../PackIconFileIconsCursorExtension.cs | 33 ++++ .../PackIconFontAwesomeCursorExtension.cs | 33 ++++ .../PackIconFontaudioCursorExtension.cs | 33 ++++ .../PackIconFontistoCursorExtension.cs | 33 ++++ .../PackIconForkAwesomeCursorExtension.cs | 33 ++++ .../PackIconIoniconsCursorExtension.cs | 33 ++++ .../PackIconJamIconsCursorExtension.cs | 33 ++++ .../PackIconMaterialCursorExtension.cs | 33 ++++ .../PackIconMaterialDesignCursorExtension.cs | 33 ++++ .../PackIconMaterialLightCursorExtension.cs | 33 ++++ .../Microns/PackIconMicronsCursorExtension.cs | 30 ++++ .../Modern/PackIconModernCursorExtension.cs | 33 ++++ .../PackIconOcticonsCursorExtension.cs | 33 ++++ .../PackIconPicolIconsCursorExtension.cs | 33 ++++ .../PackIconPixelartIconsCursorExtension.cs | 33 ++++ .../PackIconRPGAwesomeCursorExtension.cs | 33 ++++ .../PackIconRadixIconsCursorExtension.cs | 33 ++++ .../PackIconRemixIconCursorExtension.cs | 33 ++++ .../PackIconSimpleIconsCursorExtension.cs | 33 ++++ .../PackIconTypiconsCursorExtension.cs | 33 ++++ .../Unicons/PackIconUniconsCursorExtension.cs | 33 ++++ .../PackIconVaadinIconsCursorExtension.cs | 33 ++++ .../PackIconWeatherIconsCursorExtension.cs | 33 ++++ .../PackIconZondiconsCursorExtension.cs | 33 ++++ ...Apps.Metro.IconPacks.BootstrapIcons.csproj | 2 + .../MahApps.Metro.IconPacks.BoxIcons.csproj | 2 + .../MahApps.Metro.IconPacks.Codicons.csproj | 2 + .../MahApps.Metro.IconPacks.Coolicons.csproj | 2 + .../MahApps.Metro.IconPacks.Entypo.csproj | 2 + .../MahApps.Metro.IconPacks.EvaIcons.csproj | 2 + ...ahApps.Metro.IconPacks.FeatherIcons.csproj | 2 + .../MahApps.Metro.IconPacks.FileIcons.csproj | 2 + ...MahApps.Metro.IconPacks.FontAwesome.csproj | 2 + .../MahApps.Metro.IconPacks.Fontaudio.csproj | 2 + .../MahApps.Metro.IconPacks.Fontisto.csproj | 2 + ...MahApps.Metro.IconPacks.ForkAwesome.csproj | 2 + .../MahApps.Metro.IconPacks.Ionicons.csproj | 2 + .../MahApps.Metro.IconPacks.JamIcons.csproj | 2 + .../MahApps.Metro.IconPacks.Material.csproj | 2 + ...Apps.Metro.IconPacks.MaterialDesign.csproj | 2 + ...hApps.Metro.IconPacks.MaterialLight.csproj | 2 + .../MahApps.Metro.IconPacks.Microns.csproj | 2 + .../MahApps.Metro.IconPacks.Modern.csproj | 2 + .../MahApps.Metro.IconPacks.Octicons.csproj | 2 + .../MahApps.Metro.IconPacks.PicolIcons.csproj | 2 + ...hApps.Metro.IconPacks.PixelartIcons.csproj | 2 + .../MahApps.Metro.IconPacks.RPGAwesome.csproj | 2 + .../MahApps.Metro.IconPacks.RadixIcons.csproj | 2 + .../MahApps.Metro.IconPacks.RemixIcon.csproj | 2 + ...MahApps.Metro.IconPacks.SimpleIcons.csproj | 2 + .../MahApps.Metro.IconPacks.Typicons.csproj | 2 + .../MahApps.Metro.IconPacks.Unicons.csproj | 2 + ...MahApps.Metro.IconPacks.VaadinIcons.csproj | 2 + ...ahApps.Metro.IconPacks.WeatherIcons.csproj | 2 + .../MahApps.Metro.IconPacks.Zondicons.csproj | 2 + 65 files changed, 1278 insertions(+), 1 deletion(-) create mode 100644 src/MahApps.Metro.IconPacks.Core/PackIconCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks.Core/PackIconCursorHelper.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/BootstrapIcons/PackIconBootstrapIconsCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/BoxIcons/PackIconBoxIconsCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/Codicons/PackIconCodiconsCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/Coolicons/PackIconCooliconsCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/Entypo/PackIconEntypoCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/EvaIcons/PackIconEvaIconsCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/FeatherIcons/PackIconFeatherIconsCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/FileIcons/PackIconFileIconsCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/FontAwesome/PackIconFontAwesomeCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/Fontaudio/PackIconFontaudioCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/Fontisto/PackIconFontistoCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/ForkAwesome/PackIconForkAwesomeCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/Ionicons/PackIconIoniconsCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/JamIcons/PackIconJamIconsCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/Material/PackIconMaterialCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/MaterialDesign/PackIconMaterialDesignCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/MaterialLight/PackIconMaterialLightCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/Microns/PackIconMicronsCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/Modern/PackIconModernCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/Octicons/PackIconOcticonsCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/PicolIcons/PackIconPicolIconsCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/PixelartIcons/PackIconPixelartIconsCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/RPGAwesome/PackIconRPGAwesomeCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/RadixIcons/PackIconRadixIconsCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/RemixIcon/PackIconRemixIconCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/SimpleIcons/PackIconSimpleIconsCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/Typicons/PackIconTypiconsCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/Unicons/PackIconUniconsCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/VaadinIcons/PackIconVaadinIconsCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/WeatherIcons/PackIconWeatherIconsCursorExtension.cs create mode 100644 src/MahApps.Metro.IconPacks/Icons/Zondicons/PackIconZondiconsCursorExtension.cs diff --git a/src/MahApps.Metro.IconPacks.Core/MahApps.Metro.IconPacks.Core.csproj b/src/MahApps.Metro.IconPacks.Core/MahApps.Metro.IconPacks.Core.csproj index 285ea593..84ea2120 100644 --- a/src/MahApps.Metro.IconPacks.Core/MahApps.Metro.IconPacks.Core.csproj +++ b/src/MahApps.Metro.IconPacks.Core/MahApps.Metro.IconPacks.Core.csproj @@ -17,7 +17,7 @@ - + diff --git a/src/MahApps.Metro.IconPacks.Core/PackIconCursorExtension.cs b/src/MahApps.Metro.IconPacks.Core/PackIconCursorExtension.cs new file mode 100644 index 00000000..aece00ac --- /dev/null +++ b/src/MahApps.Metro.IconPacks.Core/PackIconCursorExtension.cs @@ -0,0 +1,39 @@ +using System.Windows; +using System.Windows.Input; +using System.Windows.Media; + +namespace MahApps.Metro.IconPacks +{ + public interface IPackIconCursorExtension + { + /// + /// Get or set the hot spot point of the cursor. Default point is upper left corner (0,0) + /// + Point HotSpot { get; set; } + + /// + /// Get or set cursor width. Default value is 32 + /// + double Width { get; set; } + + /// + /// Get or set cursor height. Default value is 32 + /// + double Height { get; set; } + + /// + /// Get or set cursor outline color. If not set a black brush will be used. + /// + /// + /// If you don't want to draw an outline stroke, set property to 0. + /// If you set the property to transparent, the outline will not be drawn, + /// but its thickness will be cut from the fill area. + /// + Brush StrokeBrush { get; set; } + + /// + /// Get or set cursor outline thickness. Default value is 0.5 + /// + double StrokeThickness { get; set; } + } +} diff --git a/src/MahApps.Metro.IconPacks.Core/PackIconCursorHelper.cs b/src/MahApps.Metro.IconPacks.Core/PackIconCursorHelper.cs new file mode 100644 index 00000000..a632111a --- /dev/null +++ b/src/MahApps.Metro.IconPacks.Core/PackIconCursorHelper.cs @@ -0,0 +1,156 @@ +using System.Windows; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.IO; + +namespace MahApps.Metro.IconPacks +{ + public static class PackIconCursorHelper + { + /// + /// Get the that will be used to create the cursor + /// + /// String data of icon geometry. + /// Transformation group of the icon (we get it from ). + /// Width of cursor (optional, default is 32) + /// Width of cursor (optional, default is 32) + /// + /// A object that contains the icon to be used in the cursor. + /// The has all transformations to be scaled to desired size and aligned to top left corner. + /// + public static Geometry GetCursorGeometry(string pathData, TransformGroup transformGroup, double width = 32, double height = 32) + { + Geometry geometry = Geometry.Parse(pathData); // This geometry is frozen and can not be modified + geometry = geometry.Clone(); // Create a modifiable copy of geometry. + + // Apply icon pack transformation + geometry.Transform = transformGroup; + + // The resulting geometry bounds may not be aligned to (0,0) point. We need to shifted. + Rect rect = geometry.Bounds; + transformGroup.Children.Add(new TranslateTransform(-rect.X, -rect.Y)); + + // Apply the requested size. + transformGroup.Children.Add(new ScaleTransform(width / rect.Width, height / rect.Height)); + + + geometry.Freeze(); + return geometry; + } + + /// + /// Get from a object + /// + /// Cursor + /// Fill . If not set a white brush will be used. + /// Outline . If not set a black brush will be used. + /// Outline thickness. Default is 0.5 + /// Hot spot point of the cursor. Default is (0,0) + /// + /// A . + /// + public static Cursor GeometryToCursor(Geometry geometry, Brush brush = null, Brush strokeBrush = null, double strokeThickness = 0.5, Point hotspot = default) + { + Pen pen = new Pen(strokeBrush ?? DefaultStrokeBrush, strokeThickness); + brush = brush ?? DefaultBrush; + + var visual = new DrawingVisual(); + using (DrawingContext dc = visual.RenderOpen()) + { + dc.DrawGeometry(brush, pen, geometry); + } + Rect rect = visual.ContentBounds; + + int width = (int)rect.Width; + if (width < 1) + { + width = (int)DefaultWidth; + } + int height = (int)rect.Height; + if (height < 1) + { + height = (int)DefaultHeight; + } + + RenderTargetBitmap renderTargetBitmap = new RenderTargetBitmap(width, height, 96, 96, PixelFormats.Pbgra32); + renderTargetBitmap.Render(visual); + return BitmapSourceToCursor(renderTargetBitmap, hotspot); + } + + /// + /// Convert a to a object. + /// + /// A to be converted. + /// A of cursor hot spot + /// + /// A . + /// + public static Cursor BitmapSourceToCursor(BitmapSource bitmapSource, Point hotSpot) + { + // Taken from https://stackoverflow.com/questions/46805/custom-cursor-in-wpf/27077188#27077188 + + var pngStream = new MemoryStream(); + PngBitmapEncoder png = new PngBitmapEncoder(); + png.Frames.Add(BitmapFrame.Create(bitmapSource)); + png.Save(pngStream); + + // write cursor header info + var cursorStream = new MemoryStream(); + cursorStream.Write(new byte[2] { 0x00, 0x00 }, 0, 2); // ICONDIR: Reserved. Must always be 0. + cursorStream.Write(new byte[2] { 0x02, 0x00 }, 0, 2); // ICONDIR: Specifies image type: 1 for icon (.ICO) image, 2 for cursor (.CUR) image. Other values are invalid + cursorStream.Write(new byte[2] { 0x01, 0x00 }, 0, 2); // ICONDIR: Specifies number of images in the file. + cursorStream.Write(new byte[1] { (byte)bitmapSource.Width }, 0, 1); // ICONDIRENTRY: Specifies image width in pixels. Can be any number between 0 and 255. Value 0 means image width is 256 pixels. + cursorStream.Write(new byte[1] { (byte)bitmapSource.Height }, 0, 1); // ICONDIRENTRY: Specifies image height in pixels. Can be any number between 0 and 255. Value 0 means image height is 256 pixels. + cursorStream.Write(new byte[1] { 0x00 }, 0, 1); // ICONDIRENTRY: Specifies number of colors in the color palette. Should be 0 if the image does not use a color palette. + cursorStream.Write(new byte[1] { 0x00 }, 0, 1); // ICONDIRENTRY: Reserved. Should be 0. + cursorStream.Write(new byte[2] { (byte)hotSpot.X, 0x00 }, 0, 2); // ICONDIRENTRY: Specifies the horizontal coordinates of the hot spot in number of pixels from the left. + cursorStream.Write(new byte[2] { (byte)hotSpot.Y, 0x00 }, 0, 2); // ICONDIRENTRY: Specifies the vertical coordinates of the hot spot in number of pixels from the top. + cursorStream.Write(new byte[4] { // ICONDIRENTRY: Specifies the size of the image's data in bytes + (byte)(pngStream.Length & 0x000000FF), + (byte)((pngStream.Length & 0x0000FF00) >> 0x08), + (byte)((pngStream.Length & 0x00FF0000) >> 0x10), + (byte)((pngStream.Length & 0xFF000000) >> 0x18) + }, 0, 4); + cursorStream.Write(new byte[4] { // ICONDIRENTRY: Specifies the offset of BMP or PNG data from the beginning of the ICO/CUR file + (byte)0x16, + (byte)0x00, + (byte)0x00, + (byte)0x00, + }, 0, 4); + + // copy PNG stream to cursor stream + pngStream.Seek(0, SeekOrigin.Begin); + pngStream.CopyTo(cursorStream); + + // return cursor stream + cursorStream.Seek(0, SeekOrigin.Begin); + return new Cursor(cursorStream); + } + + /// + /// Get or set the default width of cursor (32 by default). + /// + public static double DefaultWidth { get; set; } = 32; + + /// + /// Get or set the default height of cursor (32 by default). + /// + public static double DefaultHeight { get; set; } = 32; + + /// + /// Get or set the default stroke thickness of cursor (1.0 by default). + /// + public static double DefaultStrokeThickness { get; set; } = 1.0; + + /// + /// Get or set the default stroke brush of cursor (Black by default). + /// + public static Brush DefaultStrokeBrush { get; set; } = Brushes.Black; + + /// + /// Get or set the default fill brush of cursor (Black by default). + /// + public static Brush DefaultBrush { get; set; } = Brushes.Black; + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/BootstrapIcons/PackIconBootstrapIconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/BootstrapIcons/PackIconBootstrapIconsCursorExtension.cs new file mode 100644 index 00000000..1541cda1 --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/BootstrapIcons/PackIconBootstrapIconsCursorExtension.cs @@ -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 BootstrapIconsCursorExtension : BootstrapIconsImageExtension, IPackIconCursorExtension + { + public BootstrapIconsCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public BootstrapIconsCursorExtension(PackIconBootstrapIconsKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/BoxIcons/PackIconBoxIconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/BoxIcons/PackIconBoxIconsCursorExtension.cs new file mode 100644 index 00000000..4fc591d8 --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/BoxIcons/PackIconBoxIconsCursorExtension.cs @@ -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 BoxIconsCursorExtension : BoxIconsImageExtension, IPackIconCursorExtension + { + public BoxIconsCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public BoxIconsCursorExtension(PackIconBoxIconsKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/Codicons/PackIconCodiconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/Codicons/PackIconCodiconsCursorExtension.cs new file mode 100644 index 00000000..1e548260 --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/Codicons/PackIconCodiconsCursorExtension.cs @@ -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 CodiconsCursorExtension : CodiconsImageExtension, IPackIconCursorExtension + { + public CodiconsCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public CodiconsCursorExtension(PackIconCodiconsKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/Coolicons/PackIconCooliconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/Coolicons/PackIconCooliconsCursorExtension.cs new file mode 100644 index 00000000..b51bb881 --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/Coolicons/PackIconCooliconsCursorExtension.cs @@ -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 CooliconsCursorExtension : CooliconsImageExtension, IPackIconCursorExtension + { + public CooliconsCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public CooliconsCursorExtension(PackIconCooliconsKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/Entypo/PackIconEntypoCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/Entypo/PackIconEntypoCursorExtension.cs new file mode 100644 index 00000000..f48bacd5 --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/Entypo/PackIconEntypoCursorExtension.cs @@ -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 EntypoCursorExtension : EntypoImageExtension, IPackIconCursorExtension + { + public EntypoCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public EntypoCursorExtension(PackIconEntypoKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/EvaIcons/PackIconEvaIconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/EvaIcons/PackIconEvaIconsCursorExtension.cs new file mode 100644 index 00000000..6450ef1e --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/EvaIcons/PackIconEvaIconsCursorExtension.cs @@ -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 EvaIconsCursorExtension : EvaIconsImageExtension, IPackIconCursorExtension + { + public EvaIconsCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public EvaIconsCursorExtension(PackIconEvaIconsKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/FeatherIcons/PackIconFeatherIconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/FeatherIcons/PackIconFeatherIconsCursorExtension.cs new file mode 100644 index 00000000..3ed4f7c7 --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/FeatherIcons/PackIconFeatherIconsCursorExtension.cs @@ -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 FeatherIconsCursorExtension : FeatherIconsImageExtension, IPackIconCursorExtension + { + public FeatherIconsCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public FeatherIconsCursorExtension(PackIconFeatherIconsKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/FileIcons/PackIconFileIconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/FileIcons/PackIconFileIconsCursorExtension.cs new file mode 100644 index 00000000..42d77299 --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/FileIcons/PackIconFileIconsCursorExtension.cs @@ -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 FileIconsCursorExtension : FileIconsImageExtension, IPackIconCursorExtension + { + public FileIconsCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public FileIconsCursorExtension(PackIconFileIconsKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/FontAwesome/PackIconFontAwesomeCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/FontAwesome/PackIconFontAwesomeCursorExtension.cs new file mode 100644 index 00000000..744508c9 --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/FontAwesome/PackIconFontAwesomeCursorExtension.cs @@ -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 FontAwesomeCursorExtension : FontAwesomeImageExtension, IPackIconCursorExtension + { + public FontAwesomeCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public FontAwesomeCursorExtension(PackIconFontAwesomeKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/Fontaudio/PackIconFontaudioCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/Fontaudio/PackIconFontaudioCursorExtension.cs new file mode 100644 index 00000000..16cbb513 --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/Fontaudio/PackIconFontaudioCursorExtension.cs @@ -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 FontaudioCursorExtension : FontaudioImageExtension, IPackIconCursorExtension + { + public FontaudioCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public FontaudioCursorExtension(PackIconFontaudioKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/Fontisto/PackIconFontistoCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/Fontisto/PackIconFontistoCursorExtension.cs new file mode 100644 index 00000000..47570f69 --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/Fontisto/PackIconFontistoCursorExtension.cs @@ -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 FontistoCursorExtension : FontistoImageExtension, IPackIconCursorExtension + { + public FontistoCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public FontistoCursorExtension(PackIconFontistoKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/ForkAwesome/PackIconForkAwesomeCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/ForkAwesome/PackIconForkAwesomeCursorExtension.cs new file mode 100644 index 00000000..deabe9b6 --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/ForkAwesome/PackIconForkAwesomeCursorExtension.cs @@ -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 ForkAwesomeCursorExtension : ForkAwesomeImageExtension + { + public ForkAwesomeCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public ForkAwesomeCursorExtension(PackIconForkAwesomeKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/Ionicons/PackIconIoniconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/Ionicons/PackIconIoniconsCursorExtension.cs new file mode 100644 index 00000000..7b7467ef --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/Ionicons/PackIconIoniconsCursorExtension.cs @@ -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 IoniconsCursorExtension : IoniconsImageExtension, IPackIconCursorExtension + { + public IoniconsCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public IoniconsCursorExtension(PackIconIoniconsKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/JamIcons/PackIconJamIconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/JamIcons/PackIconJamIconsCursorExtension.cs new file mode 100644 index 00000000..8dd3cce1 --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/JamIcons/PackIconJamIconsCursorExtension.cs @@ -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 JamIconsCursorExtension : JamIconsImageExtension, IPackIconCursorExtension + { + public JamIconsCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public JamIconsCursorExtension(PackIconJamIconsKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/Material/PackIconMaterialCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/Material/PackIconMaterialCursorExtension.cs new file mode 100644 index 00000000..f2323b79 --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/Material/PackIconMaterialCursorExtension.cs @@ -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 MaterialCursorExtension : MaterialImageExtension, IPackIconCursorExtension + { + public MaterialCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public MaterialCursorExtension(PackIconMaterialKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/MaterialDesign/PackIconMaterialDesignCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/MaterialDesign/PackIconMaterialDesignCursorExtension.cs new file mode 100644 index 00000000..6b3cd539 --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/MaterialDesign/PackIconMaterialDesignCursorExtension.cs @@ -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 MaterialDesignCursorExtension : MaterialDesignImageExtension, IPackIconCursorExtension + { + public MaterialDesignCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public MaterialDesignCursorExtension(PackIconMaterialDesignKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/MaterialLight/PackIconMaterialLightCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/MaterialLight/PackIconMaterialLightCursorExtension.cs new file mode 100644 index 00000000..3595c3c5 --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/MaterialLight/PackIconMaterialLightCursorExtension.cs @@ -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 MaterialLightCursorExtension : MaterialLightImageExtension, IPackIconCursorExtension + { + public MaterialLightCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public MaterialLightCursorExtension(PackIconMaterialLightKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/Microns/PackIconMicronsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/Microns/PackIconMicronsCursorExtension.cs new file mode 100644 index 00000000..ca66da93 --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/Microns/PackIconMicronsCursorExtension.cs @@ -0,0 +1,30 @@ +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 MicronsCursorExtension : MicronsImageExtension, IPackIconCursorExtension + { + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/Modern/PackIconModernCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/Modern/PackIconModernCursorExtension.cs new file mode 100644 index 00000000..8a1da2f3 --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/Modern/PackIconModernCursorExtension.cs @@ -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 ModernCursorExtension : ModernImageExtension, IPackIconCursorExtension + { + public ModernCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public ModernCursorExtension(PackIconModernKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/Octicons/PackIconOcticonsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/Octicons/PackIconOcticonsCursorExtension.cs new file mode 100644 index 00000000..2117e2c0 --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/Octicons/PackIconOcticonsCursorExtension.cs @@ -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 OcticonsCursorExtension : OcticonsImageExtension, IPackIconCursorExtension + { + public OcticonsCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public OcticonsCursorExtension(PackIconOcticonsKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/PicolIcons/PackIconPicolIconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/PicolIcons/PackIconPicolIconsCursorExtension.cs new file mode 100644 index 00000000..d4e831eb --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/PicolIcons/PackIconPicolIconsCursorExtension.cs @@ -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 PicolIconsCursorExtension : PicolIconsImageExtension, IPackIconCursorExtension + { + public PicolIconsCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public PicolIconsCursorExtension(PackIconPicolIconsKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/PixelartIcons/PackIconPixelartIconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/PixelartIcons/PackIconPixelartIconsCursorExtension.cs new file mode 100644 index 00000000..7cbbc811 --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/PixelartIcons/PackIconPixelartIconsCursorExtension.cs @@ -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 PixelartIconsCursorExtension : PixelartIconsImageExtension, IPackIconCursorExtension + { + public PixelartIconsCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public PixelartIconsCursorExtension(PackIconPixelartIconsKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/RPGAwesome/PackIconRPGAwesomeCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/RPGAwesome/PackIconRPGAwesomeCursorExtension.cs new file mode 100644 index 00000000..0ac22ee3 --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/RPGAwesome/PackIconRPGAwesomeCursorExtension.cs @@ -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 RPGAwesomeCursorExtension : RPGAwesomeImageExtension, IPackIconCursorExtension + { + public RPGAwesomeCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public RPGAwesomeCursorExtension(PackIconRPGAwesomeKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/RadixIcons/PackIconRadixIconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/RadixIcons/PackIconRadixIconsCursorExtension.cs new file mode 100644 index 00000000..6ad491c8 --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/RadixIcons/PackIconRadixIconsCursorExtension.cs @@ -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 RadixIconsCursorExtension : RadixIconsImageExtension, IPackIconCursorExtension + { + public RadixIconsCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public RadixIconsCursorExtension(PackIconRadixIconsKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/RemixIcon/PackIconRemixIconCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/RemixIcon/PackIconRemixIconCursorExtension.cs new file mode 100644 index 00000000..d38738cc --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/RemixIcon/PackIconRemixIconCursorExtension.cs @@ -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 RemixIconCursorExtension : RemixIconImageExtension, IPackIconCursorExtension + { + public RemixIconCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public RemixIconCursorExtension(PackIconRemixIconKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/SimpleIcons/PackIconSimpleIconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/SimpleIcons/PackIconSimpleIconsCursorExtension.cs new file mode 100644 index 00000000..c941ae86 --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/SimpleIcons/PackIconSimpleIconsCursorExtension.cs @@ -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 SimpleIconsCursorExtension : SimpleIconsImageExtension, IPackIconCursorExtension + { + public SimpleIconsCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public SimpleIconsCursorExtension(PackIconSimpleIconsKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/Typicons/PackIconTypiconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/Typicons/PackIconTypiconsCursorExtension.cs new file mode 100644 index 00000000..c848c58e --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/Typicons/PackIconTypiconsCursorExtension.cs @@ -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 TypiconsCursorExtension : TypiconsImageExtension, IPackIconCursorExtension + { + public TypiconsCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public TypiconsCursorExtension(PackIconTypiconsKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/Unicons/PackIconUniconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/Unicons/PackIconUniconsCursorExtension.cs new file mode 100644 index 00000000..d4987a98 --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/Unicons/PackIconUniconsCursorExtension.cs @@ -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 UniconsCursorExtension : UniconsImageExtension, IPackIconCursorExtension + { + public UniconsCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public UniconsCursorExtension(PackIconUniconsKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/VaadinIcons/PackIconVaadinIconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/VaadinIcons/PackIconVaadinIconsCursorExtension.cs new file mode 100644 index 00000000..7ee52259 --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/VaadinIcons/PackIconVaadinIconsCursorExtension.cs @@ -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 VaadinIconsCursorExtension : VaadinIconsImageExtension, IPackIconCursorExtension + { + public VaadinIconsCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public VaadinIconsCursorExtension(PackIconVaadinIconsKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/WeatherIcons/PackIconWeatherIconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/WeatherIcons/PackIconWeatherIconsCursorExtension.cs new file mode 100644 index 00000000..0865208e --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/WeatherIcons/PackIconWeatherIconsCursorExtension.cs @@ -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 WeatherIconsCursorExtension : WeatherIconsImageExtension, IPackIconCursorExtension + { + public WeatherIconsCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public WeatherIconsCursorExtension(PackIconWeatherIconsKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/Icons/Zondicons/PackIconZondiconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/Zondicons/PackIconZondiconsCursorExtension.cs new file mode 100644 index 00000000..74149ebc --- /dev/null +++ b/src/MahApps.Metro.IconPacks/Icons/Zondicons/PackIconZondiconsCursorExtension.cs @@ -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 ZondiconsCursorExtension : ZondiconsImageExtension, IPackIconCursorExtension + { + public ZondiconsCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public ZondiconsCursorExtension(PackIconZondiconsKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.BootstrapIcons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.BootstrapIcons.csproj index a6c5e129..3c113472 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.BootstrapIcons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.BootstrapIcons.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.BoxIcons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.BoxIcons.csproj index a0932b84..7b5ae9cd 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.BoxIcons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.BoxIcons.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Codicons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Codicons.csproj index e22d25c7..24eb8382 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Codicons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Codicons.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Coolicons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Coolicons.csproj index 024961cb..5d0a6077 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Coolicons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Coolicons.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Entypo.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Entypo.csproj index e58bbee9..31a9ddf9 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Entypo.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Entypo.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.EvaIcons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.EvaIcons.csproj index 932586dd..b5b78e34 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.EvaIcons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.EvaIcons.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.FeatherIcons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.FeatherIcons.csproj index 502d9842..88e5b903 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.FeatherIcons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.FeatherIcons.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.FileIcons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.FileIcons.csproj index d61d9b3c..29aa9621 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.FileIcons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.FileIcons.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.FontAwesome.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.FontAwesome.csproj index a04ff2f9..f0824fcd 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.FontAwesome.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.FontAwesome.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Fontaudio.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Fontaudio.csproj index fc104b89..41d9dcc2 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Fontaudio.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Fontaudio.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Fontisto.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Fontisto.csproj index a9644edf..29166ae7 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Fontisto.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Fontisto.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.ForkAwesome.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.ForkAwesome.csproj index b2e3f4c9..a3ec1132 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.ForkAwesome.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.ForkAwesome.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Ionicons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Ionicons.csproj index 3e3c78dd..6c2fb9b6 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Ionicons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Ionicons.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.JamIcons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.JamIcons.csproj index 4fbf51b5..f952420d 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.JamIcons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.JamIcons.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Material.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Material.csproj index 04d584e1..3788c104 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Material.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Material.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.MaterialDesign.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.MaterialDesign.csproj index 56155caf..8d4d720b 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.MaterialDesign.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.MaterialDesign.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.MaterialLight.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.MaterialLight.csproj index ac780bbd..508f406f 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.MaterialLight.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.MaterialLight.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Microns.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Microns.csproj index fdafe402..58ceba12 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Microns.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Microns.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Modern.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Modern.csproj index cdeb2bf6..954cd5a9 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Modern.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Modern.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Octicons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Octicons.csproj index 47f6ac3e..0f629496 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Octicons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Octicons.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.PicolIcons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.PicolIcons.csproj index 0c9745fc..5a7ce02a 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.PicolIcons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.PicolIcons.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.PixelartIcons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.PixelartIcons.csproj index 0a9a7755..30333649 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.PixelartIcons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.PixelartIcons.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.RPGAwesome.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.RPGAwesome.csproj index 326920da..3ebd4636 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.RPGAwesome.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.RPGAwesome.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.RadixIcons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.RadixIcons.csproj index 2ffb97b5..f574dd60 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.RadixIcons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.RadixIcons.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.RemixIcon.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.RemixIcon.csproj index 36fccda6..07a360cd 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.RemixIcon.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.RemixIcon.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.SimpleIcons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.SimpleIcons.csproj index ed27a650..3c3d2965 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.SimpleIcons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.SimpleIcons.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Typicons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Typicons.csproj index d8cedff3..e9137841 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Typicons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Typicons.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Unicons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Unicons.csproj index 4488b139..3aa785b9 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Unicons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Unicons.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.VaadinIcons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.VaadinIcons.csproj index ffa2e230..a8651ca8 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.VaadinIcons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.VaadinIcons.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.WeatherIcons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.WeatherIcons.csproj index 2bcfcd9b..f3f4014d 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.WeatherIcons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.WeatherIcons.csproj @@ -25,6 +25,8 @@ + + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Zondicons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Zondicons.csproj index 64ccd32c..5066ad9d 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Zondicons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Zondicons.csproj @@ -25,6 +25,8 @@ + + From ebf00731c05fc48cfbdf7a36d2f12ace5979a730 Mon Sep 17 00:00:00 2001 From: Eiad Al-Khanshour Date: Sat, 13 Nov 2021 11:51:03 +0300 Subject: [PATCH 2/5] Added some value checks and excepsions. --- .../PackIconCursorExtension.cs | 6 +-- .../PackIconCursorHelper.cs | 52 ++++++++++++++++--- 2 files changed, 49 insertions(+), 9 deletions(-) diff --git a/src/MahApps.Metro.IconPacks.Core/PackIconCursorExtension.cs b/src/MahApps.Metro.IconPacks.Core/PackIconCursorExtension.cs index aece00ac..a12e006d 100644 --- a/src/MahApps.Metro.IconPacks.Core/PackIconCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks.Core/PackIconCursorExtension.cs @@ -7,17 +7,17 @@ namespace MahApps.Metro.IconPacks public interface IPackIconCursorExtension { /// - /// Get or set the hot spot point of the cursor. Default point is upper left corner (0,0) + /// Get or set the hot spot point of the cursor (from (0,0) to (255,255)). Default point is upper left corner (0,0) /// Point HotSpot { get; set; } /// - /// Get or set cursor width. Default value is 32 + /// Get or set cursor width (1 to 256). Default value is 32 /// double Width { get; set; } /// - /// Get or set cursor height. Default value is 32 + /// Get or set cursor height (1 to 256). Default value is 32 /// double Height { get; set; } diff --git a/src/MahApps.Metro.IconPacks.Core/PackIconCursorHelper.cs b/src/MahApps.Metro.IconPacks.Core/PackIconCursorHelper.cs index a632111a..10afe923 100644 --- a/src/MahApps.Metro.IconPacks.Core/PackIconCursorHelper.cs +++ b/src/MahApps.Metro.IconPacks.Core/PackIconCursorHelper.cs @@ -1,4 +1,5 @@ -using System.Windows; +using System; +using System.Windows; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; @@ -13,14 +14,23 @@ public static class PackIconCursorHelper /// /// String data of icon geometry. /// Transformation group of the icon (we get it from ). - /// Width of cursor (optional, default is 32) - /// Width of cursor (optional, default is 32) + /// Width of cursor (optional, between 1 and 256, default is 32) + /// Width of cursor (optional, between 1 and 256, default is 32) /// /// A object that contains the icon to be used in the cursor. /// The has all transformations to be scaled to desired size and aligned to top left corner. /// public static Geometry GetCursorGeometry(string pathData, TransformGroup transformGroup, double width = 32, double height = 32) { + if (width < 1 || width > 256) + { + throw new ArgumentOutOfRangeException(nameof(width) + " should be between 1 and 256."); + } + if (height < 1 || height > 256) + { + throw new ArgumentOutOfRangeException(nameof(height) + " should be between 1 and 256."); + } + Geometry geometry = Geometry.Parse(pathData); // This geometry is frozen and can not be modified geometry = geometry.Clone(); // Create a modifiable copy of geometry. @@ -46,12 +56,21 @@ public static Geometry GetCursorGeometry(string pathData, TransformGroup transfo /// Fill . If not set a white brush will be used. /// Outline . If not set a black brush will be used. /// Outline thickness. Default is 0.5 - /// Hot spot point of the cursor. Default is (0,0) + /// Hot spot point of the cursor (from (0,0) to (255,255)). Default is (0,0) /// /// A . /// public static Cursor GeometryToCursor(Geometry geometry, Brush brush = null, Brush strokeBrush = null, double strokeThickness = 0.5, Point hotspot = default) { + if (hotspot.X < 0 || hotspot.X > 255) + { + throw new ArgumentOutOfRangeException("hotspot.X should be between 0 and 255."); + } + if (hotspot.Y < 0 || hotspot.Y > 255) + { + throw new ArgumentOutOfRangeException("hotspot.Y should be between 0 and 255."); + } + Pen pen = new Pen(strokeBrush ?? DefaultStrokeBrush, strokeThickness); brush = brush ?? DefaultBrush; @@ -88,6 +107,27 @@ public static Cursor GeometryToCursor(Geometry geometry, Brush brush = null, Bru /// public static Cursor BitmapSourceToCursor(BitmapSource bitmapSource, Point hotSpot) { + if (hotSpot.X < 0 || hotSpot.X > 255) + { + throw new ArgumentOutOfRangeException("hotspot.X should be between 0 and 255."); + } + if (hotSpot.Y < 0 || hotSpot.Y > 255) + { + throw new ArgumentOutOfRangeException("hotspot.Y should be between 0 and 255."); + } + + if (bitmapSource.Width < 1 || bitmapSource.Width > 256) + { + throw new ArgumentOutOfRangeException("BitmapSource.Width should be between 1 and 256."); + } + if (bitmapSource.Height < 1 || bitmapSource.Height > 256) + { + throw new ArgumentOutOfRangeException("BitmapSource.Height should be between 1 and 256."); + } + + double width = bitmapSource.Width == 256 ? 0 : bitmapSource.Width; + double height = bitmapSource.Height == 256 ? 0 : bitmapSource.Height; + // Taken from https://stackoverflow.com/questions/46805/custom-cursor-in-wpf/27077188#27077188 var pngStream = new MemoryStream(); @@ -100,8 +140,8 @@ public static Cursor BitmapSourceToCursor(BitmapSource bitmapSource, Point hotSp cursorStream.Write(new byte[2] { 0x00, 0x00 }, 0, 2); // ICONDIR: Reserved. Must always be 0. cursorStream.Write(new byte[2] { 0x02, 0x00 }, 0, 2); // ICONDIR: Specifies image type: 1 for icon (.ICO) image, 2 for cursor (.CUR) image. Other values are invalid cursorStream.Write(new byte[2] { 0x01, 0x00 }, 0, 2); // ICONDIR: Specifies number of images in the file. - cursorStream.Write(new byte[1] { (byte)bitmapSource.Width }, 0, 1); // ICONDIRENTRY: Specifies image width in pixels. Can be any number between 0 and 255. Value 0 means image width is 256 pixels. - cursorStream.Write(new byte[1] { (byte)bitmapSource.Height }, 0, 1); // ICONDIRENTRY: Specifies image height in pixels. Can be any number between 0 and 255. Value 0 means image height is 256 pixels. + cursorStream.Write(new byte[1] { (byte)width }, 0, 1); // ICONDIRENTRY: Specifies image width in pixels. Can be any number between 0 and 255. Value 0 means image width is 256 pixels. + cursorStream.Write(new byte[1] { (byte)height }, 0, 1); // ICONDIRENTRY: Specifies image height in pixels. Can be any number between 0 and 255. Value 0 means image height is 256 pixels. cursorStream.Write(new byte[1] { 0x00 }, 0, 1); // ICONDIRENTRY: Specifies number of colors in the color palette. Should be 0 if the image does not use a color palette. cursorStream.Write(new byte[1] { 0x00 }, 0, 1); // ICONDIRENTRY: Reserved. Should be 0. cursorStream.Write(new byte[2] { (byte)hotSpot.X, 0x00 }, 0, 2); // ICONDIRENTRY: Specifies the horizontal coordinates of the hot spot in number of pixels from the left. From a4ee0e030309613e47896f5a6e3023b33c325276 Mon Sep 17 00:00:00 2001 From: punker76 Date: Sat, 10 Sep 2022 22:55:04 +0200 Subject: [PATCH 3/5] Change scaling factor for both dimensions to fit the icons size. --- src/MahApps.Metro.IconPacks.Core/PackIconCursorHelper.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/MahApps.Metro.IconPacks.Core/PackIconCursorHelper.cs b/src/MahApps.Metro.IconPacks.Core/PackIconCursorHelper.cs index 10afe923..2dc14138 100644 --- a/src/MahApps.Metro.IconPacks.Core/PackIconCursorHelper.cs +++ b/src/MahApps.Metro.IconPacks.Core/PackIconCursorHelper.cs @@ -42,7 +42,8 @@ public static Geometry GetCursorGeometry(string pathData, TransformGroup transfo transformGroup.Children.Add(new TranslateTransform(-rect.X, -rect.Y)); // Apply the requested size. - transformGroup.Children.Add(new ScaleTransform(width / rect.Width, height / rect.Height)); + var aspectRatio = Math.Min(width / rect.Width, height / rect.Height); + transformGroup.Children.Add(new ScaleTransform(aspectRatio, aspectRatio)); geometry.Freeze(); From a32e3c5acfba3d780aa7cc146a9246aa036899a5 Mon Sep 17 00:00:00 2001 From: punker76 Date: Fri, 26 Apr 2024 11:15:47 +0200 Subject: [PATCH 4/5] fix: minor copy&paste issues --- .../PackIconBootstrapIconsCursorExtension.cs | 2 +- .../Icons/BoxIcons/PackIconBoxIconsCursorExtension.cs | 6 +++--- .../Icons/Codicons/PackIconCodiconsCursorExtension.cs | 4 ++-- .../Icons/Coolicons/PackIconCooliconsCursorExtension.cs | 4 ++-- .../Icons/Entypo/PackIconEntypoCursorExtension.cs | 4 ++-- .../Icons/EvaIcons/PackIconEvaIconsCursorExtension.cs | 4 ++-- .../FeatherIcons/PackIconFeatherIconsCursorExtension.cs | 4 ++-- .../Icons/FileIcons/PackIconFileIconsCursorExtension.cs | 4 ++-- .../FontAwesome/PackIconFontAwesomeCursorExtension.cs | 4 ++-- .../Icons/Fontaudio/PackIconFontaudioCursorExtension.cs | 4 ++-- .../Icons/Fontisto/PackIconFontistoCursorExtension.cs | 4 ++-- .../ForkAwesome/PackIconForkAwesomeCursorExtension.cs | 6 +++--- .../Icons/Ionicons/PackIconIoniconsCursorExtension.cs | 4 ++-- .../Icons/JamIcons/PackIconJamIconsCursorExtension.cs | 4 ++-- .../Icons/Material/PackIconMaterialCursorExtension.cs | 4 ++-- .../PackIconMaterialDesignCursorExtension.cs | 4 ++-- .../MaterialLight/PackIconMaterialLightCursorExtension.cs | 4 ++-- .../Icons/Microns/PackIconMicronsCursorExtension.cs | 7 +++++-- .../Icons/Modern/PackIconModernCursorExtension.cs | 4 ++-- .../Icons/Octicons/PackIconOcticonsCursorExtension.cs | 4 ++-- .../Icons/PicolIcons/PackIconPicolIconsCursorExtension.cs | 4 ++-- .../PixelartIcons/PackIconPixelartIconsCursorExtension.cs | 4 ++-- .../Icons/RPGAwesome/PackIconRPGAwesomeCursorExtension.cs | 4 ++-- .../Icons/RadixIcons/PackIconRadixIconsCursorExtension.cs | 4 ++-- .../Icons/RemixIcon/PackIconRemixIconCursorExtension.cs | 4 ++-- .../SimpleIcons/PackIconSimpleIconsCursorExtension.cs | 4 ++-- .../Icons/Typicons/PackIconTypiconsCursorExtension.cs | 4 ++-- .../Icons/Unicons/PackIconUniconsCursorExtension.cs | 4 ++-- .../VaadinIcons/PackIconVaadinIconsCursorExtension.cs | 4 ++-- .../WeatherIcons/PackIconWeatherIconsCursorExtension.cs | 4 ++-- .../Icons/Zondicons/PackIconZondiconsCursorExtension.cs | 4 ++-- .../MahApps.Metro.IconPacks.BootstrapIcons.csproj | 4 +--- .../MahApps.Metro.IconPacks.BoxIcons.csproj | 4 +--- .../MahApps.Metro.IconPacks.Codicons.csproj | 4 +--- .../MahApps.Metro.IconPacks.Coolicons.csproj | 4 +--- .../MahApps.Metro.IconPacks.Entypo.csproj | 4 +--- .../MahApps.Metro.IconPacks.EvaIcons.csproj | 4 +--- .../MahApps.Metro.IconPacks.FeatherIcons.csproj | 4 +--- .../MahApps.Metro.IconPacks.FileIcons.csproj | 4 +--- .../MahApps.Metro.IconPacks.FontAwesome.csproj | 4 +--- .../MahApps.Metro.IconPacks.Fontaudio.csproj | 4 +--- .../MahApps.Metro.IconPacks.Fontisto.csproj | 4 +--- .../MahApps.Metro.IconPacks.ForkAwesome.csproj | 4 +--- .../MahApps.Metro.IconPacks.Ionicons.csproj | 4 +--- .../MahApps.Metro.IconPacks.JamIcons.csproj | 4 +--- .../MahApps.Metro.IconPacks.Material.csproj | 4 +--- .../MahApps.Metro.IconPacks.MaterialDesign.csproj | 4 +--- .../MahApps.Metro.IconPacks.MaterialLight.csproj | 4 +--- .../MahApps.Metro.IconPacks.Microns.csproj | 4 +--- .../MahApps.Metro.IconPacks.Modern.csproj | 4 +--- .../MahApps.Metro.IconPacks.Octicons.csproj | 4 +--- .../MahApps.Metro.IconPacks.PicolIcons.csproj | 4 +--- .../MahApps.Metro.IconPacks.PixelartIcons.csproj | 4 +--- .../MahApps.Metro.IconPacks.RPGAwesome.csproj | 4 +--- .../MahApps.Metro.IconPacks.RadixIcons.csproj | 4 +--- .../MahApps.Metro.IconPacks.RemixIcon.csproj | 4 +--- .../MahApps.Metro.IconPacks.SimpleIcons.csproj | 4 +--- .../MahApps.Metro.IconPacks.Typicons.csproj | 4 +--- .../MahApps.Metro.IconPacks.Unicons.csproj | 4 +--- .../MahApps.Metro.IconPacks.VaadinIcons.csproj | 4 +--- .../MahApps.Metro.IconPacks.WeatherIcons.csproj | 4 +--- .../MahApps.Metro.IconPacks.Zondicons.csproj | 4 +--- 62 files changed, 97 insertions(+), 156 deletions(-) diff --git a/src/MahApps.Metro.IconPacks/Icons/BootstrapIcons/PackIconBootstrapIconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/BootstrapIcons/PackIconBootstrapIconsCursorExtension.cs index 1541cda1..3ef47622 100644 --- a/src/MahApps.Metro.IconPacks/Icons/BootstrapIcons/PackIconBootstrapIconsCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/BootstrapIcons/PackIconBootstrapIconsCursorExtension.cs @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/BoxIcons/PackIconBoxIconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/BoxIcons/PackIconBoxIconsCursorExtension.cs index 4fc591d8..b574475e 100644 --- a/src/MahApps.Metro.IconPacks/Icons/BoxIcons/PackIconBoxIconsCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/BoxIcons/PackIconBoxIconsCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -7,7 +7,7 @@ namespace MahApps.Metro.IconPacks { [MarkupExtensionReturnType(typeof(Cursor))] - public class BoxIconsCursorExtension : BoxIconsImageExtension, IPackIconCursorExtension + public class BoxIconsCursorExtension : BoxIconsImageExtension, IPackIconCursorExtension { public BoxIconsCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; public BoxIconsCursorExtension(PackIconBoxIconsKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/Codicons/PackIconCodiconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/Codicons/PackIconCodiconsCursorExtension.cs index 1e548260..8f733099 100644 --- a/src/MahApps.Metro.IconPacks/Icons/Codicons/PackIconCodiconsCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/Codicons/PackIconCodiconsCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/Coolicons/PackIconCooliconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/Coolicons/PackIconCooliconsCursorExtension.cs index b51bb881..31176b44 100644 --- a/src/MahApps.Metro.IconPacks/Icons/Coolicons/PackIconCooliconsCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/Coolicons/PackIconCooliconsCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/Entypo/PackIconEntypoCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/Entypo/PackIconEntypoCursorExtension.cs index f48bacd5..d9bc703c 100644 --- a/src/MahApps.Metro.IconPacks/Icons/Entypo/PackIconEntypoCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/Entypo/PackIconEntypoCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/EvaIcons/PackIconEvaIconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/EvaIcons/PackIconEvaIconsCursorExtension.cs index 6450ef1e..b7c47921 100644 --- a/src/MahApps.Metro.IconPacks/Icons/EvaIcons/PackIconEvaIconsCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/EvaIcons/PackIconEvaIconsCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/FeatherIcons/PackIconFeatherIconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/FeatherIcons/PackIconFeatherIconsCursorExtension.cs index 3ed4f7c7..124f8963 100644 --- a/src/MahApps.Metro.IconPacks/Icons/FeatherIcons/PackIconFeatherIconsCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/FeatherIcons/PackIconFeatherIconsCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/FileIcons/PackIconFileIconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/FileIcons/PackIconFileIconsCursorExtension.cs index 42d77299..b629c6e5 100644 --- a/src/MahApps.Metro.IconPacks/Icons/FileIcons/PackIconFileIconsCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/FileIcons/PackIconFileIconsCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/FontAwesome/PackIconFontAwesomeCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/FontAwesome/PackIconFontAwesomeCursorExtension.cs index 744508c9..49448da8 100644 --- a/src/MahApps.Metro.IconPacks/Icons/FontAwesome/PackIconFontAwesomeCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/FontAwesome/PackIconFontAwesomeCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/Fontaudio/PackIconFontaudioCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/Fontaudio/PackIconFontaudioCursorExtension.cs index 16cbb513..46c2ca0c 100644 --- a/src/MahApps.Metro.IconPacks/Icons/Fontaudio/PackIconFontaudioCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/Fontaudio/PackIconFontaudioCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/Fontisto/PackIconFontistoCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/Fontisto/PackIconFontistoCursorExtension.cs index 47570f69..0d76a6e8 100644 --- a/src/MahApps.Metro.IconPacks/Icons/Fontisto/PackIconFontistoCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/Fontisto/PackIconFontistoCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/ForkAwesome/PackIconForkAwesomeCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/ForkAwesome/PackIconForkAwesomeCursorExtension.cs index deabe9b6..3beca1b8 100644 --- a/src/MahApps.Metro.IconPacks/Icons/ForkAwesome/PackIconForkAwesomeCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/ForkAwesome/PackIconForkAwesomeCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -7,7 +7,7 @@ namespace MahApps.Metro.IconPacks { [MarkupExtensionReturnType(typeof(Cursor))] - public class ForkAwesomeCursorExtension : ForkAwesomeImageExtension + public class ForkAwesomeCursorExtension : ForkAwesomeImageExtension, IPackIconCursorExtension { public ForkAwesomeCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; public ForkAwesomeCursorExtension(PackIconForkAwesomeKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/Ionicons/PackIconIoniconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/Ionicons/PackIconIoniconsCursorExtension.cs index 7b7467ef..e1ddeb95 100644 --- a/src/MahApps.Metro.IconPacks/Icons/Ionicons/PackIconIoniconsCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/Ionicons/PackIconIoniconsCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/JamIcons/PackIconJamIconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/JamIcons/PackIconJamIconsCursorExtension.cs index 8dd3cce1..c28799a8 100644 --- a/src/MahApps.Metro.IconPacks/Icons/JamIcons/PackIconJamIconsCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/JamIcons/PackIconJamIconsCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/Material/PackIconMaterialCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/Material/PackIconMaterialCursorExtension.cs index f2323b79..1cee0c12 100644 --- a/src/MahApps.Metro.IconPacks/Icons/Material/PackIconMaterialCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/Material/PackIconMaterialCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/MaterialDesign/PackIconMaterialDesignCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/MaterialDesign/PackIconMaterialDesignCursorExtension.cs index 6b3cd539..f55c5d0c 100644 --- a/src/MahApps.Metro.IconPacks/Icons/MaterialDesign/PackIconMaterialDesignCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/MaterialDesign/PackIconMaterialDesignCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/MaterialLight/PackIconMaterialLightCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/MaterialLight/PackIconMaterialLightCursorExtension.cs index 3595c3c5..978cc244 100644 --- a/src/MahApps.Metro.IconPacks/Icons/MaterialLight/PackIconMaterialLightCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/MaterialLight/PackIconMaterialLightCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/Microns/PackIconMicronsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/Microns/PackIconMicronsCursorExtension.cs index ca66da93..c8461c2f 100644 --- a/src/MahApps.Metro.IconPacks/Icons/Microns/PackIconMicronsCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/Microns/PackIconMicronsCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -9,6 +9,9 @@ namespace MahApps.Metro.IconPacks [MarkupExtensionReturnType(typeof(Cursor))] public class MicronsCursorExtension : MicronsImageExtension, IPackIconCursorExtension { + public MicronsCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + public MicronsCursorExtension(PackIconMicronsKind kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + /// public Point HotSpot { get; set; } /// @@ -27,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/Modern/PackIconModernCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/Modern/PackIconModernCursorExtension.cs index 8a1da2f3..dddb7f6c 100644 --- a/src/MahApps.Metro.IconPacks/Icons/Modern/PackIconModernCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/Modern/PackIconModernCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/Octicons/PackIconOcticonsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/Octicons/PackIconOcticonsCursorExtension.cs index 2117e2c0..c0fca6c8 100644 --- a/src/MahApps.Metro.IconPacks/Icons/Octicons/PackIconOcticonsCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/Octicons/PackIconOcticonsCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/PicolIcons/PackIconPicolIconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/PicolIcons/PackIconPicolIconsCursorExtension.cs index d4e831eb..fcedd80b 100644 --- a/src/MahApps.Metro.IconPacks/Icons/PicolIcons/PackIconPicolIconsCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/PicolIcons/PackIconPicolIconsCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/PixelartIcons/PackIconPixelartIconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/PixelartIcons/PackIconPixelartIconsCursorExtension.cs index 7cbbc811..6ddc58c1 100644 --- a/src/MahApps.Metro.IconPacks/Icons/PixelartIcons/PackIconPixelartIconsCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/PixelartIcons/PackIconPixelartIconsCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/RPGAwesome/PackIconRPGAwesomeCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/RPGAwesome/PackIconRPGAwesomeCursorExtension.cs index 0ac22ee3..5964b6dc 100644 --- a/src/MahApps.Metro.IconPacks/Icons/RPGAwesome/PackIconRPGAwesomeCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/RPGAwesome/PackIconRPGAwesomeCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/RadixIcons/PackIconRadixIconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/RadixIcons/PackIconRadixIconsCursorExtension.cs index 6ad491c8..1ec7458d 100644 --- a/src/MahApps.Metro.IconPacks/Icons/RadixIcons/PackIconRadixIconsCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/RadixIcons/PackIconRadixIconsCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/RemixIcon/PackIconRemixIconCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/RemixIcon/PackIconRemixIconCursorExtension.cs index d38738cc..7d8ca46b 100644 --- a/src/MahApps.Metro.IconPacks/Icons/RemixIcon/PackIconRemixIconCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/RemixIcon/PackIconRemixIconCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/SimpleIcons/PackIconSimpleIconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/SimpleIcons/PackIconSimpleIconsCursorExtension.cs index c941ae86..699accb1 100644 --- a/src/MahApps.Metro.IconPacks/Icons/SimpleIcons/PackIconSimpleIconsCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/SimpleIcons/PackIconSimpleIconsCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/Typicons/PackIconTypiconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/Typicons/PackIconTypiconsCursorExtension.cs index c848c58e..af853e9f 100644 --- a/src/MahApps.Metro.IconPacks/Icons/Typicons/PackIconTypiconsCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/Typicons/PackIconTypiconsCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/Unicons/PackIconUniconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/Unicons/PackIconUniconsCursorExtension.cs index d4987a98..99d36966 100644 --- a/src/MahApps.Metro.IconPacks/Icons/Unicons/PackIconUniconsCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/Unicons/PackIconUniconsCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/VaadinIcons/PackIconVaadinIconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/VaadinIcons/PackIconVaadinIconsCursorExtension.cs index 7ee52259..89b3f4ad 100644 --- a/src/MahApps.Metro.IconPacks/Icons/VaadinIcons/PackIconVaadinIconsCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/VaadinIcons/PackIconVaadinIconsCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/WeatherIcons/PackIconWeatherIconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/WeatherIcons/PackIconWeatherIconsCursorExtension.cs index 0865208e..e5ded32a 100644 --- a/src/MahApps.Metro.IconPacks/Icons/WeatherIcons/PackIconWeatherIconsCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/WeatherIcons/PackIconWeatherIconsCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/Icons/Zondicons/PackIconZondiconsCursorExtension.cs b/src/MahApps.Metro.IconPacks/Icons/Zondicons/PackIconZondiconsCursorExtension.cs index 74149ebc..cee3fc56 100644 --- a/src/MahApps.Metro.IconPacks/Icons/Zondicons/PackIconZondiconsCursorExtension.cs +++ b/src/MahApps.Metro.IconPacks/Icons/Zondicons/PackIconZondiconsCursorExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -30,4 +30,4 @@ public override object ProvideValue(IServiceProvider serviceProvider) return PackIconCursorHelper.GeometryToCursor(geometry, Brush, StrokeBrush, StrokeThickness, HotSpot); } } -} +} \ No newline at end of file diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.BootstrapIcons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.BootstrapIcons.csproj index 3c113472..632e8263 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.BootstrapIcons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.BootstrapIcons.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.BoxIcons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.BoxIcons.csproj index 7b5ae9cd..a8cd3671 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.BoxIcons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.BoxIcons.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Codicons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Codicons.csproj index 24eb8382..998c5e49 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Codicons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Codicons.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Coolicons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Coolicons.csproj index 5d0a6077..9e4284bf 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Coolicons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Coolicons.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Entypo.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Entypo.csproj index 31a9ddf9..86d3fb2d 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Entypo.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Entypo.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.EvaIcons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.EvaIcons.csproj index b5b78e34..670a4a74 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.EvaIcons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.EvaIcons.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.FeatherIcons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.FeatherIcons.csproj index 88e5b903..68daeb2d 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.FeatherIcons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.FeatherIcons.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.FileIcons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.FileIcons.csproj index 29aa9621..453fce38 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.FileIcons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.FileIcons.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.FontAwesome.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.FontAwesome.csproj index f0824fcd..cce5feee 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.FontAwesome.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.FontAwesome.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Fontaudio.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Fontaudio.csproj index 41d9dcc2..aa209ff6 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Fontaudio.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Fontaudio.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Fontisto.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Fontisto.csproj index 29166ae7..484b3b43 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Fontisto.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Fontisto.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.ForkAwesome.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.ForkAwesome.csproj index a3ec1132..06be38d8 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.ForkAwesome.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.ForkAwesome.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Ionicons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Ionicons.csproj index 6c2fb9b6..46d60261 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Ionicons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Ionicons.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.JamIcons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.JamIcons.csproj index f952420d..1b8ca2e4 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.JamIcons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.JamIcons.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Material.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Material.csproj index 3788c104..95be825e 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Material.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Material.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.MaterialDesign.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.MaterialDesign.csproj index 8d4d720b..f72a9922 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.MaterialDesign.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.MaterialDesign.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.MaterialLight.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.MaterialLight.csproj index 508f406f..7e6dd074 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.MaterialLight.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.MaterialLight.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Microns.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Microns.csproj index 58ceba12..1af7b9ac 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Microns.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Microns.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Modern.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Modern.csproj index 954cd5a9..50b8226b 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Modern.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Modern.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Octicons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Octicons.csproj index 0f629496..b1564cde 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Octicons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Octicons.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.PicolIcons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.PicolIcons.csproj index 5a7ce02a..a9ef3e51 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.PicolIcons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.PicolIcons.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.PixelartIcons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.PixelartIcons.csproj index 30333649..da843b98 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.PixelartIcons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.PixelartIcons.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.RPGAwesome.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.RPGAwesome.csproj index 3ebd4636..71233ed4 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.RPGAwesome.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.RPGAwesome.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.RadixIcons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.RadixIcons.csproj index f574dd60..697ac50d 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.RadixIcons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.RadixIcons.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.RemixIcon.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.RemixIcon.csproj index 07a360cd..986b1d22 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.RemixIcon.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.RemixIcon.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.SimpleIcons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.SimpleIcons.csproj index 3c3d2965..d4ef2240 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.SimpleIcons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.SimpleIcons.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Typicons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Typicons.csproj index e9137841..af31411d 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Typicons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Typicons.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Unicons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Unicons.csproj index 3aa785b9..789d2850 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Unicons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Unicons.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.VaadinIcons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.VaadinIcons.csproj index a8651ca8..6136de49 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.VaadinIcons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.VaadinIcons.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.WeatherIcons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.WeatherIcons.csproj index f3f4014d..d24e8022 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.WeatherIcons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.WeatherIcons.csproj @@ -24,9 +24,7 @@ - - - + diff --git a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Zondicons.csproj b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Zondicons.csproj index 5066ad9d..cc6076d1 100644 --- a/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Zondicons.csproj +++ b/src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.Zondicons.csproj @@ -24,9 +24,7 @@ - - - + From 5e5baed605cb5f5ba95faf79eec2dfd86112f2cd Mon Sep 17 00:00:00 2001 From: punker76 Date: Fri, 26 Apr 2024 11:39:54 +0200 Subject: [PATCH 5/5] feat: add general PackIconCursorExtension --- .../PackIconCursorExtension.cs | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/MahApps.Metro.IconPacks/PackIconCursorExtension.cs diff --git a/src/MahApps.Metro.IconPacks/PackIconCursorExtension.cs b/src/MahApps.Metro.IconPacks/PackIconCursorExtension.cs new file mode 100644 index 00000000..4a0ad6d9 --- /dev/null +++ b/src/MahApps.Metro.IconPacks/PackIconCursorExtension.cs @@ -0,0 +1,34 @@ +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 PackIconCursorExtension : PackIconImageExtension, IPackIconCursorExtension + { + public PackIconCursorExtension() : base() => base.Brush = PackIconCursorHelper.DefaultBrush; + + public PackIconCursorExtension(Enum kind) : base(kind) => base.Brush = PackIconCursorHelper.DefaultBrush; + + /// + public Point HotSpot { get; set; } + /// + public double Width { get; set; } = PackIconCursorHelper.DefaultWidth; + /// + public double Height { get; set; } = PackIconCursorHelper.DefaultHeight; + /// + public Brush StrokeBrush { get; set; } + /// + 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); + } + } +} \ No newline at end of file