diff --git a/README.md b/README.md
index de77b54f..780e2db6 100644
--- a/README.md
+++ b/README.md
@@ -44,6 +44,25 @@ public static class MauiProgram
}
```
+# Table of Contents
+
+- [Usage](#usage)
+- [Advanced Settings](#advanced-settings)
+- [New Changes in v4](#new-changes-in-v4)
+- [Workaround (Must Read)](#workaround)
+- [Built in Control Usage](#built-in-control-usage)
+- [Xaml Extension Usage](#xaml-extension-usage)
+- [Data Binding Usage](#data-binding-usage)
+- [C# Markup Usage](#c-markup-usage)
+- [OnPlatform and OnIdiom Usage](#onplatform-and-onidiom-usage)
+- [Breaking Changes](#breaking-changes)
+ - [Version 3 to 4](#version-3-to-4)
+ - [Version 2 to 3](#version-2-to-3)
+ - [Version 1 to 2](#version-1-to-2)
+- [Advanced Usage](#advanced-usage)
+- [Contribute](#contribute)
+- [License](#license)
+
# Usage
In order to make use of the **.Net Maui Icons** you can use the below namespace:
@@ -52,6 +71,19 @@ In order to make use of the **.Net Maui Icons** you can use the below namespace:
xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
```
+# Advanced Settings
+
+You can set the default icon size, font override, and default font auto-scaling using the `UseMauiIconsCore` builder extension as follows:
+
+```csharp
+builder.UseMauiIconsCore(x =>
+{
+ x.SetDefaultIconSize(30.0);
+ x.SetDefaultFontOverride(true);
+ x.SetDefaultFontAutoScaling(true);
+})
+```
+
## Workaround
if you came across this issue dotnet/maui#7503 when using new namespace, Make sure to create an discarded instance of MauiIcon in the codebehind like below
@@ -67,47 +99,6 @@ if you came across this issue dotnet/maui#7503 when using new namespace, Make su
```
-## Breaking Changes
-
-### Version 1 to 2
-
-`Old (v1)`
-
-```xml
-xmlns:cupertino="clr-namespace:MauiIcons.Cupertino;assembly=MauiIcons.Cupertino"
-xmlns:fluent="clr-namespace:MauiIcons.Fluent;assembly=MauiIcons.Fluent"
-xmlns:material="clr-namespace:MauiIcons.Material;assembly=MauiIcons.Material"
-
-
-
-
-```
-
-`New (v2)`
-
-```xml
-xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
-
-
-
-
-```
-
-### Version 2 to 3
-
- - Removal of **TypeArgument** and Built in OnPlatform and OnIdiom Support, Use MauiIcons Integrated [Custom OnPlatform and OnIdioms Feature](#custom-onplatform-and-onidiom-usage)
- - Removal of **Dotnet 7** Support
-
-### Nuget Package Changes
-
-- **`AathifMahir.Maui.MauiIcons.Material`** doesn't contain all the Variants anymore, Now only contains **Regular version** of Material Icons. Other Variants Decoupled into Seperate Packages Like Below
- - [`AathifMahir.Maui.MauiIcons.Material.Outlined`](https://www.nuget.org/packages/AathifMahir.Maui.MauiIcons.Material.Outlined/)
- - [`AathifMahir.Maui.MauiIcons.Material.Rounded`](https://www.nuget.org/packages/AathifMahir.Maui.MauiIcons.Material.Rounded/)
- - [`AathifMahir.Maui.MauiIcons.Material.Sharp`](https://www.nuget.org/packages/AathifMahir.Maui.MauiIcons.Material.Sharp/)
-
-- **`AathifMahir.Maui.MauiIcons.FluentFilled`** is Depcrecated and Replaced by [`AathifMahir.Maui.MauiIcons.Fluent.Filled`](https://www.nuget.org/packages/AathifMahir.Maui.MauiIcons.Fluent.Filled/)
-
-
## Built in Control Usage
`Xaml`
@@ -132,20 +123,20 @@ new MauiIcon().Icon(MaterialIcons.ABC).IconColor(Colors.Violet);
## Xaml Extension Usage
```xml
-
+
-
+
-
+
-
+
-
+
```
-## Xaml Extension Data Binding Usage
+## Data Binding Usage
-The below example, Make Sures that BindingContext Inside the Xaml Extension is Set to Root of this Page, Likewise make sure to set the BindingContext When using Binding Inside the MauiIcons Xaml Extension, Additionally This example Binds to MyIcon and MyColor Properties Which Present in Code Behind But Not Included in this Example.
+The below example Binds to MyIcon and MyColor Properties Which Present in Code Behind But Not Included in this Example.
```xml
-
+
+
+ Glyph="{mi:Fluent Icon={Binding MyIcon}, IconColor={Binding MyColor}}" />
-
+
-
+
-
+
+
+
```
@@ -180,24 +176,24 @@ new ImageButton().Icon(FluentIcons.Accounts);
new Image().Icon(CupertinoIcons.AntFill);
-new Label().Icon(MaterialIcons.Home).IconSize(40.0).IconColor(Colors.Red);
+new Label().Icon(MaterialIcons.Home, fontOverride: true).IconSize(40.0).IconColor(Colors.Red);
-new Entry().Icon(CupertinoIcons.AntFill).IconSize(20.0).IconColor(Colors.Aqua);
+new Entry().Icon(CupertinoIcons.AntFill, fontOverride: true).IconSize(20.0).IconColor(Colors.Aqua);
-new SearchBar().Icon(MaterialIcons.ABC);
+new SearchBar().Icon(MaterialIcons.ABC, fontOverride: true);
```
-## Applying Icon To Text or Placeholder
+#### Applying Icon To Text or Placeholder
Controls that Supports Placeholder, Can Assign the Icon To PlaceHolder or Text,
-Defaults to Placeholder but can be set to Text by Setting isPlaceHolder Parameter to False
+Defaults to Placeholder but can be set to Text by Setting TargetName Parameter to `Text`
```csharp
-new Entry().Icon(CupertinoIcons.AntFill, isPlaceHolder: false).IconSize(20.0).IconColor(Colors.Aqua);
+new Entry().Icon(CupertinoIcons.AntFill, fontOverride: true, targetName: "Text").IconSize(20.0).IconColor(Colors.Aqua);
-new SearchBar().Icon(MaterialIcons.ABC, isPlaceHolder: false);
+new SearchBar().Icon(MaterialIcons.ABC, fontOverride: true, targetName: "PlaceHolder"); // Setting TargetName PlaceHolder is Redundant as it's Default
```
-**Disclaimer:** It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release: **Label**, **Image**, **ImageButton**, **SearchBar**, **Editor**, and **Entry**. Additionally, the native **MauiIcon** control, when combined with C# markup, can prove to be quite versatile and offer extra features for various scenarios.
+**Disclaimer:** It's important to note that we are Overriding Font on Input Control to Set the Icon that Could Cause Unexpected Behaviors and Rendering Issues as well.
## Icon Suffix
@@ -222,19 +218,31 @@ new MauiIcon().Icon(CupertinoIcons.Airplane).IconColor(Colors.Cyan).IconSuffix("
`Xaml`
```xml
+
+
+
+
+
+
```
`C#`
```csharp
+// Entrance Animation
new MauiIcon().Icon(CupertinoIcons.AntFill).EntranceAnimationType(AnimationType.Fade);
new MauiIcon().Icon(FluentIcons.Accounts).EntranceAnimationType(AnimationType.Rotate);
new MauiIcon().Icon(MaterialIcons.ABC).EntranceAnimationType(AnimationType.Scale).EntranceAnimationDuration(4000);
+
+// OnClick Animation
+new MauiIcon().Icon(CupertinoIcons.AntFill).OnClickAnimationType(AnimationType.Fade);
+new MauiIcon().Icon(FluentIcons.Accounts).OnClickAnimationType(AnimationType.Rotate);
+new MauiIcon().Icon(MaterialIcons.ABC).OnClickAnimationType(AnimationType.Scale).OnClickAnimationDuration(4000);
```
-## Custom OnPlatform and OnIdiom Usage
+## OnPlatform and OnIdiom Usage
`Xaml`
```xml
@@ -250,6 +258,117 @@ new MauiIcon().Icon(FluentIcons.Accounts).OnIdioms(new List{"Desktop", "
new MauiIcon().Icon(MaterialIcons.ABC).OnPlatforms(new List{"WinUI", "Android"}).OnIdioms(new List{"Desktop", "Phone"});
```
+## Breaking Changes
+
+### Version 3 to 4
+
+ - Icon won't be applied to the Controls like Entry, SearchBar and etc.. by default Instead v4 would throw an Exception, Need to set **FontOverride** to true to apply the Icon to these Controls on Builder Extension Level or Control Level
+ - This Behavior can be reverted to Behavior of v3 by Using new `UseMauiIconsCore` Builder Extension and using `SetDefaultFontOverride` Method like Below
+
+```csharp
+ builder.UseMauiIconsCore(x =>
+ {
+ x.SetDefaultFontOverride(true);
+ })
+```
+
+ - Icon Size is Now Set to Control's FontSize by Default, Previously it was set to **30.0** by Default
+ - This Behavior can be reverted to Behavior of v3 by Using new `UseMauiIconsCore` Builder Extension and using `SetDefaultIconSize` Method like Below
+```csharp
+ builder.UseMauiIconsCore(x =>
+ {
+ x.SetDefaultIconSize(30.0);
+ })
+```
+---
+
+### Version 2 to 3
+
+ - Removal of **TypeArgument** and Built in OnPlatform and OnIdiom Support, Use MauiIcons Integrated [OnPlatform and OnIdioms Feature](#onplatform-and-onidiom-usage)
+ - Removal of **Dotnet 7** Support
+
+---
+
+### Version 1 to 2
+
+`Old (v1)`
+
+```xml
+xmlns:fluent="clr-namespace:MauiIcons.Fluent;assembly=MauiIcons.Fluent"
+
+
+```
+
+`New (v2)`
+
+```xml
+xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
+
+
+```
+
+## New Changes in v4
+
+ 1. We have a new way of Assigning/Setting Icons, Introducing New Attached Property for Icons,
+ The new **AttachedProperty** Brings in Support for **Triggers**, **Behaviors**, **Styles**, etc.. which is lacking on Classic Xaml Markup Extension, and also it's more cleaner and readable
+```xml
+/// Old
+
+
+// New
+
+```
+
+**Disclaimer**: The Old Xaml Markup Extension is still Supported and can be used, but it's recommended to use the new Attached Property for better support and readability and we have plans to deprecate the old Xaml Markup Extension in the future in favor of Attached Property
+
+#### Example of Using Styles
+```xml
+
+
+
+```
+---
+ 2. Introducing New `UseMauiIconsCore` Builder Extension for Setting Default Icon Size, Font Override, Default Font Auto Scaling and etc.. Check the [Advanced Settings](#advanced-settings) for More Information
+---
+ 3. Improved Built in OnPlatforms and OnIdioms with Binding Improvements and Enhanced Performance
+---
+ 4. New `OnClickAnimation` Support for MauiIcon Control, Check the [Animation Usage](#animation-usage) for More Information
+
+
+## Advanced Usage
+
+- If you came across Situation where the Controls Does Have Multiple Source to Apply Icons, You want the Icon you Set on Attached Property to Apply to All the Sources, You can do that as well, Set the TargetName to `.`, This will Apply the Icon to All the Sources
+```xml
+
+
+
+```
+- If you came across Situation Where you want to Apply the Icon to Different Source over Default Source that Set by MauiIcons, You can do that as well, Set the TargetName to Source Property Name, This will Apply the Icon to that Specific Source
+```xml
+
+
+
+```
+- If you came across Situation where the Controls Does Have Multiple Source to Apply Icons, You want different icon for those Additional Sources, You can do that by Applying the Icon Directly to Source Using Xaml Markup like Below Example
+```xml
+
+
+
+```
+
+Overall TargetName Behaves like a Source Property Name, If you want to Apply the Icon to Specific Source, Set the TargetName to Source Property Name, If you want to Apply the Icon to All the Sources, Set the TargetName to `.`
+
# Properties
| Parameters | Type | Description |
@@ -268,6 +387,8 @@ new MauiIcon().Icon(MaterialIcons.ABC).OnPlatforms(new List{"WinUI", "An
| **IconSuffixAutoScaling** | `bool` | Gets or sets a value indicating whether the icon suffix should automatically scale. |
| **EntranceAnimationType** | `AnimationType` | Gets or Sets the type of entrance animation for the element |
| **EntranceAnimationDuration** | `uint` | Gets or sets the duration of the entrance animation for the element |
+| **OnClickAnimationType** | `AnimationType` | Gets or Sets the type of on-click animation for the element |
+| **OnClickAnimationDuration** | `uint` | Gets or sets the duration of the on-click animation for the element |
| **OnPlatforms** | `IList` | Gets or sets the supported platforms |
| **OnIdioms** | `IList` | Gets or sets the supported idioms |
diff --git a/samples/MauiIcons.Sample/AppShell.xaml b/samples/MauiIcons.Sample/AppShell.xaml
index bf5333f0..cfc3cb25 100644
--- a/samples/MauiIcons.Sample/AppShell.xaml
+++ b/samples/MauiIcons.Sample/AppShell.xaml
@@ -7,22 +7,20 @@
xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
Shell.FlyoutBehavior="Disabled">
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/MauiIcons.Sample/MainPage.xaml b/samples/MauiIcons.Sample/MainPage.xaml
index 3fbea290..135dabf7 100644
--- a/samples/MauiIcons.Sample/MainPage.xaml
+++ b/samples/MauiIcons.Sample/MainPage.xaml
@@ -5,8 +5,26 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MauiIcons.Sample"
xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
+ x:Name="thisRoot"
x:DataType="local:MainPage">
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
@@ -40,6 +58,96 @@
OnPlatforms="MacCatalyst, WinUI" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -48,6 +156,7 @@
+
diff --git a/samples/MauiIcons.Sample/MainPage.xaml.cs b/samples/MauiIcons.Sample/MainPage.xaml.cs
index bc792856..b31d2fa0 100644
--- a/samples/MauiIcons.Sample/MainPage.xaml.cs
+++ b/samples/MauiIcons.Sample/MainPage.xaml.cs
@@ -1,4 +1,6 @@
using MauiIcons.Core;
+using MauiIcons.Cupertino;
+using MauiIcons.FontAwesome.Brand;
namespace MauiIcons.Sample;
@@ -7,8 +9,122 @@ public partial class MainPage : ContentPage
public MainPage()
{
InitializeComponent();
+ BindingContext = this;
// Temporary Workaround for url styled namespace in xaml
_ = new MauiIcon();
+
+ }
+
+ private CupertinoIcons _icon = CupertinoIcons.Airplane;
+
+ public CupertinoIcons MyIcon
+ {
+ get => _icon;
+ set
+ {
+ if (value != _icon)
+ {
+ _icon = value;
+ OnPropertyChanged();
+ }
+ }
+ }
+
+ private FontAwesomeBrandIcons _icon1 = FontAwesomeBrandIcons.Microsoft;
+
+ public FontAwesomeBrandIcons MyIcon1
+ {
+ get => _icon1;
+ set
+ {
+ if (value != _icon1)
+ {
+ _icon1 = value;
+ OnPropertyChanged();
+ }
+ }
+ }
+
+ private Color _labelColor = Colors.Coral;
+ public Color MyLabelColor
+ {
+ get => _labelColor;
+ set
+ {
+ if (value != _labelColor)
+ {
+ _labelColor = value;
+ OnPropertyChanged();
+ }
+ }
+ }
+
+ bool _isPlaceHolder = true;
+ public bool IsPlaceHolder
+ {
+ get => _isPlaceHolder;
+ set
+ {
+ if (value != _isPlaceHolder)
+ {
+ _isPlaceHolder = value;
+ OnPropertyChanged();
+ }
+ }
+ }
+
+ IList _onPlatforms = ["WinUI", "Android"];
+ public IList OnPlatforms
+ {
+ get => _onPlatforms;
+ set
+ {
+ if (value != _onPlatforms)
+ {
+ _onPlatforms = value;
+ OnPropertyChanged();
+ }
+ }
+ }
+
+ IList _onIdioms = ["Desktop", "Mobile"];
+ public IList OnIdioms
+ {
+ get => _onIdioms;
+ set
+ {
+ if (value != _onIdioms)
+ {
+ _onIdioms = value;
+ OnPropertyChanged();
+ }
+ }
+ }
+
+ private string _myPlaceHolder = "This is a Placeholder";
+
+ public string MyPlaceHolder
+ {
+ get => _myPlaceHolder;
+ set
+ {
+ if (value != _myPlaceHolder)
+ {
+ _myPlaceHolder = value;
+ OnPropertyChanged();
+ }
+ }
+ }
+
+ private void Button_Clicked(object sender, EventArgs e)
+ {
+ MyIcon = MyIcon == CupertinoIcons.Airplane ? CupertinoIcons.Alarm : CupertinoIcons.Airplane;
+ MyIcon1 = MyIcon1 == FontAwesomeBrandIcons.Microsoft ? FontAwesomeBrandIcons.Apple : FontAwesomeBrandIcons.Microsoft;
+ MyLabelColor = MyLabelColor == Colors.Coral ? Colors.Blue : Colors.Coral;
+ IsPlaceHolder = !IsPlaceHolder;
+ OnPlatforms = OnPlatforms.Contains("WinUI") ? ["Android"] : ["WinUI", "Android"];
+ OnIdioms = OnIdioms.Contains("Desktop") ? ["Mobile"] : ["Desktop", "Mobile"];
+ MyPlaceHolder = MyPlaceHolder == "This is a Placeholder" ? "This is a New Placeholder" : "This is a Placeholder";
}
}
diff --git a/samples/MauiIcons.Sample/MarkupPage.cs b/samples/MauiIcons.Sample/MarkupPage.cs
index 58962cee..171af17e 100644
--- a/samples/MauiIcons.Sample/MarkupPage.cs
+++ b/samples/MauiIcons.Sample/MarkupPage.cs
@@ -40,7 +40,7 @@ private void AddMarkup()
VerticalOptions = LayoutOptions.Center,
Children =
{
- new MauiIcon().Icon(FluentFilledIcons.Accessibility48Filled).IconColor(Colors.Cyan).OnIdioms(new List{"Desktop"}).OnPlatforms(new List{"Android"}),
+ new MauiIcon().Icon(FluentFilledIcons.Accessibility48Filled).IconColor(Colors.Cyan).OnIdioms(["Desktop"]).OnPlatforms(["WinUI"]).OnClickAnimationType(AnimationType.Wiggle),
new MauiIcon().Icon(FluentFilledIcons.Accessibility48Filled).IconColor(Colors.Green),
new MauiIcon().Icon(MaterialIcons.Accessibility).IconColor(Colors.Blue),
new MauiIcon().Icon(MaterialRoundedIcons.Accessibility).IconColor(Colors.Yellow),
@@ -57,8 +57,8 @@ private void AddMarkup()
Children =
{
new MauiIcon().Icon(CupertinoIcons.AntFill).IconColor(Colors.Purple).IconSuffix("Background Color").IconSuffixTextColor(Colors.Purple).IconSuffixBackgroundColor(Colors.Green).IconBackgroundColor(Colors.Yellow).IconAndSuffixBackgroundColor(Colors.White),
- new ImageButton().Icon(MaterialOutlinedIcons.SmokingRooms).OnIdioms(new List{"Desktop"}).OnPlatforms(new List{"WinUI"}),
- new Image().Icon(FluentIcons.Accessibility24).IconColor(Colors.Pink).IconSize(50.0).OnPlatforms(new List(){ "Android", "WinUI"}),
+ new ImageButton().Icon(MaterialOutlinedIcons.SmokingRooms).OnIdioms(["Desktop"]).OnPlatforms(["WinUI"]),
+ new Image().Icon(FluentIcons.Accessibility24).IconColor(Colors.Pink).IconSize(50.0).OnPlatforms(["Android", "WinUI"]),
new Image().Icon(FluentIcons.Accessibility24),
new Image().Icon(MaterialIcons.AccessAlarm).IconSize(40.0),
new Label().Icon(FluentIcons.Accessibility24).IconSize(40.0),
@@ -72,13 +72,13 @@ private void AddMarkup()
VerticalOptions = LayoutOptions.Center,
Children =
{
- new Entry().Icon(FluentIcons.Airplane20).IconSize(20.0),
+ new Entry().Icon(FluentIcons.Airplane20, fontOverride: true).IconSize(20.0),
new Button().Icon(CupertinoIcons.Alarm).IconSize(30),
new Button().Text("Test"),
label,
button,
image,
- new Label().Icon(FluentIcons.Accessibility24).IconSize(40.0).IconColor(Colors.Pink).OnIdioms(new List{"Desktop", "Phone"}).OnPlatforms(new List{"WinUI", "MacCatalyst", "Android"}),
+ new Label().Icon(FluentIcons.Accessibility24).IconSize(40.0).IconColor(Colors.Pink).OnIdioms(["Desktop", "Phone"]).OnPlatforms(["WinUI", "MacCatalyst", "Android"]),
}
},
new HorizontalStackLayout ()
@@ -91,8 +91,9 @@ private void AddMarkup()
{
new MauiIcon().Icon(FontAwesomeBrandIcons.Pinterest).IconColor(Colors.Red),
new Button().Icon(FontAwesomeBrandIcons.Github).IconSize(30),
- new Entry().Icon(FontAwesomeIcons.Building).IconSize(20.0),
+ new Entry().Icon(FontAwesomeIcons.Building, fontOverride: true).IconSize(20.0),
new Image{ Source = MaterialIcons.Favorite.ToImageSource(iconColor: Colors.Blue, iconSize: 50) },
+
}
}
diff --git a/samples/MauiIcons.Sample/MauiIcons.Sample.csproj b/samples/MauiIcons.Sample/MauiIcons.Sample.csproj
index 14a1f605..76ce6236 100644
--- a/samples/MauiIcons.Sample/MauiIcons.Sample.csproj
+++ b/samples/MauiIcons.Sample/MauiIcons.Sample.csproj
@@ -51,6 +51,7 @@
+
@@ -59,6 +60,10 @@
+
+
+
+
@@ -74,7 +79,8 @@
-
+
+
diff --git a/samples/MauiIcons.Sample/MauiProgram.cs b/samples/MauiIcons.Sample/MauiProgram.cs
index 63b118a1..d151f31f 100644
--- a/samples/MauiIcons.Sample/MauiProgram.cs
+++ b/samples/MauiIcons.Sample/MauiProgram.cs
@@ -1,4 +1,5 @@
using CommunityToolkit.Maui.Markup;
+using MauiIcons.Core;
using MauiIcons.Cupertino;
using MauiIcons.Fluent;
using MauiIcons.Fluent.Filled;
@@ -20,6 +21,12 @@ public static MauiApp CreateMauiApp()
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp()
+ .UseMauiIconsCore(x =>
+ {
+ x.SetDefaultIconSize(30.0);
+ x.SetDefaultIconAutoScaling(true);
+ x.SetDefaultFontOverride(true);
+ })
.UseMaterialMauiIcons()
.UseMaterialOutlinedMauiIcons()
.UseMaterialRoundedMauiIcons()
diff --git a/samples/MauiIcons.Sample/Resources/Images/car.svg b/samples/MauiIcons.Sample/Resources/Images/car.svg
new file mode 100644
index 00000000..99551d93
--- /dev/null
+++ b/samples/MauiIcons.Sample/Resources/Images/car.svg
@@ -0,0 +1,46 @@
+
+
+
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
index 70e25aed..97a0423d 100644
--- a/src/Directory.Build.props
+++ b/src/Directory.Build.props
@@ -29,9 +29,9 @@
MauiIconsicon.png
- 3.0.0.0
- 3.0.0.0
- 3.0.0
+ 4.0.0.0
+ 4.0.0.0
+ 4.0.0$(AssemblyName) ($(TargetFramework))$(Version)$(VersionSuffix)false
diff --git a/src/MauiIcons.Core/Base/BaseIcon.cs b/src/MauiIcons.Core/Base/BaseIcon.cs
new file mode 100644
index 00000000..56f7cf94
--- /dev/null
+++ b/src/MauiIcons.Core/Base/BaseIcon.cs
@@ -0,0 +1,63 @@
+using Microsoft.Maui.Graphics.Converters;
+
+namespace MauiIcons.Core.Base;
+public class BaseIcon : BindableObject
+{
+ public static readonly BindableProperty IconProperty = BindableProperty.Create(nameof(Icon), typeof(Enum), typeof(BaseIcon), null);
+ public static readonly BindableProperty IconSizeProperty = BindableProperty.Create(nameof(IconSize), typeof(double), typeof(BaseIcon), Options.DefaultIconSize);
+ public static readonly BindableProperty IconColorProperty = BindableProperty.Create(nameof(IconColor), typeof(Color), typeof(BaseIcon), null);
+ public static readonly BindableProperty IconBackgroundColorProperty = BindableProperty.Create(nameof(IconBackgroundColor), typeof(Color), typeof(BaseIcon), null);
+ public static readonly BindableProperty IconAutoScalingProperty = BindableProperty.Create(nameof(IconAutoScaling), typeof(bool?), typeof(BaseIcon), Options.DefaultIconAutoScaling);
+
+ public Enum? Icon
+ {
+ get => (Enum?)GetValue(IconProperty);
+ set => SetValue(IconProperty, value);
+ }
+
+ [System.ComponentModel.TypeConverter(typeof(FontSizeConverter))]
+ public double IconSize
+ {
+ get => (double)GetValue(IconSizeProperty);
+ set => SetValue(IconSizeProperty, value);
+ }
+
+ [System.ComponentModel.TypeConverter(typeof(ColorTypeConverter))]
+ public Color IconColor
+ {
+ get => (Color)GetValue(IconColorProperty);
+ set => SetValue(IconColorProperty, value);
+ }
+
+ [System.ComponentModel.TypeConverter(typeof(ColorTypeConverter))]
+ public Color IconBackgroundColor
+ {
+ get => (Color)GetValue(IconBackgroundColorProperty);
+ set => SetValue(IconBackgroundColorProperty, value);
+ }
+
+ public bool? IconAutoScaling
+ {
+ get => (bool?)GetValue(IconAutoScalingProperty);
+ set => SetValue(IconAutoScalingProperty, value);
+ }
+
+ ///
+ /// Property Name is Used to Set the Icon to Different Property that the Specific Control Uses Instead of Default Property that Set by MauiIcon
+ ///
+ public string TargetName { get; set; } = string.Empty;
+
+ [System.ComponentModel.TypeConverter(typeof(ListStringTypeConverter))]
+ public IList OnPlatforms { get; set; } = [];
+
+ [System.ComponentModel.TypeConverter(typeof(ListStringTypeConverter))]
+ public IList OnIdioms { get; set; } = [];
+
+ ///
+ /// This is Used to Override the FontFamily and Styles to Make Use Rendering Icon Directly in the Font
+ ///
+ public bool FontOverride { get; set; } = false;
+
+
+
+}
diff --git a/src/MauiIcons.Core/BuilderExtension.Shared.cs b/src/MauiIcons.Core/BuilderExtension.Shared.cs
new file mode 100644
index 00000000..e1adaa8d
--- /dev/null
+++ b/src/MauiIcons.Core/BuilderExtension.Shared.cs
@@ -0,0 +1,9 @@
+namespace MauiIcons.Core;
+public static class BuilderExtension
+{
+ public static MauiAppBuilder UseMauiIconsCore(this MauiAppBuilder builder, Action? options = default)
+ {
+ options?.Invoke(new Options());
+ return builder;
+ }
+}
diff --git a/src/MauiIcons.Core/Common/AnimationType.cs b/src/MauiIcons.Core/Common/AnimationType.cs
index af74e8e7..acdee285 100644
--- a/src/MauiIcons.Core/Common/AnimationType.cs
+++ b/src/MauiIcons.Core/Common/AnimationType.cs
@@ -2,6 +2,7 @@
public enum AnimationType
{
None,
+ Wiggle,
Fade,
Rotate,
Scale
diff --git a/src/MauiIcons.Core/Controls/IMauiIcon.cs b/src/MauiIcons.Core/Controls/IMauiIcon.cs
index a3d53073..17f298f6 100644
--- a/src/MauiIcons.Core/Controls/IMauiIcon.cs
+++ b/src/MauiIcons.Core/Controls/IMauiIcon.cs
@@ -3,14 +3,11 @@
namespace MauiIcons.Core;
public interface IMauiIcon
{
-
-#nullable enable
///
/// Gets or sets the icon enum value.
///
- Enum? Icon { get; }
+ Enum? Icon { get; }
-#nullable disable
///
/// Gets or sets the size of the icon.
@@ -67,7 +64,7 @@ public interface IMauiIcon
/// Gets or sets the background color for the icon and Suffix, It applies the color to whole control.
///
[System.ComponentModel.TypeConverter(typeof(ColorTypeConverter))]
- Color IconAndSuffixBackgroundColor { get; }
+ Color BackgroundColor { get; }
///
/// Gets or sets a value indicating whether the icon suffix should automatically scale.
@@ -84,6 +81,17 @@ public interface IMauiIcon
///
uint EntranceAnimationDuration { get; }
+
+ ///
+ /// Gets or Sets the type of on-click animation for the element.
+ ///
+ AnimationType OnClickAnimationType { get; }
+
+ ///
+ /// Gets or sets the duration of the on-click animation for the element.
+ ///
+ uint OnClickAnimationDuration { get; }
+
///
/// Gets or sets the Platforms that control should render.
///
diff --git a/src/MauiIcons.Core/Controls/MauiIcon.Attached.cs b/src/MauiIcons.Core/Controls/MauiIcon.Attached.cs
new file mode 100644
index 00000000..fb5b4889
--- /dev/null
+++ b/src/MauiIcons.Core/Controls/MauiIcon.Attached.cs
@@ -0,0 +1,264 @@
+using MauiIcons.Core.Base;
+using MauiIcons.Core.Converters;
+using MauiIcons.Core.Helpers;
+
+namespace MauiIcons.Core;
+public partial class MauiIcon
+{
+ public static readonly BindableProperty ValueProperty = BindableProperty.CreateAttached("Value", typeof(BaseIcon), typeof(MauiIcon), null, propertyChanged: OnValuePropertyChanged);
+
+ private static void OnValuePropertyChanged(BindableObject bindable, object oldValue, object newValue)
+ {
+ if (newValue is null) return;
+
+ BaseIcon baseIcon = (BaseIcon)newValue;
+ bool isAllSetProperty = baseIcon.TargetName.Equals(".");
+ bool isNotFontOverridenOrSuppressed = !baseIcon.FontOverride && !Options.DefaultFontOverride;
+
+ if (!baseIcon.IsSet(BindableObject.BindingContextProperty))
+ baseIcon.SetBinding(BindableObject.BindingContextProperty, new Binding(nameof(BindingContext), source: bindable));
+
+ switch (bindable)
+ {
+ case Button button:
+ button.SetBinding(Button.TextColorProperty, new Binding(nameof(baseIcon.IconColor), source: baseIcon,
+ converter: new DefaultFontColorConverter(), converterParameter: button.TextColor));
+ button.SetBinding(Button.BackgroundColorProperty, new Binding(nameof(baseIcon.IconBackgroundColor), source: baseIcon,
+ converter: new DefaultFontColorConverter(), converterParameter: button.BackgroundColor));
+ button.SetBinding(Button.FontSizeProperty, new Binding(nameof(baseIcon.IconSize), source: baseIcon,
+ converter: new DefaultFontSizeConverter(), converterParameter: button.FontSize));
+ button.SetBinding(Button.FontAutoScalingEnabledProperty, new Binding(nameof(baseIcon.IconAutoScaling), source: baseIcon,
+ converter: new DefaultFontAutoScalingConverter(), converterParameter: button.FontAutoScalingEnabled));
+
+ SetConditionalBinding(nameof(Button.Text),
+ matchBinding: () =>
+ {
+ if (isNotFontOverridenOrSuppressed)
+ throw new MauiIconsException("Your Applying Icon to Button Text Property Instead of ImageSource, To apply an icon to text, " +
+ "set FontOverride to true or UseMauiIconsCore Builder and Set DefaultFontOverride Globally. This will override the fonts and use default fonts instead of any assigned custom fonts.");
+
+ button.SetValue(Button.FontFamilyProperty, baseIcon.Icon.GetFontFamily());
+ button.SetBinding(Button.TextProperty, new Binding(nameof(baseIcon.Icon), source: baseIcon,
+ converter: new IconToGlyphConverter()));
+ },
+ defaultBinding: () =>
+ {
+ button.SetValue(Button.ImageSourceProperty, new FontImageSource());
+ SetFontImageSourceBinding((FontImageSource)button.ImageSource, baseIcon, button.TextColor);
+ });
+ break;
+
+ case Span span:
+ span.SetValue(Span.FontFamilyProperty, baseIcon.Icon.GetFontFamily());
+ span.SetBinding(Span.TextProperty, new Binding(nameof(baseIcon.Icon), source: baseIcon,
+ converter: new IconToGlyphConverter()));
+ span.SetBinding(Span.TextColorProperty, new Binding(nameof(baseIcon.IconColor), source: baseIcon,
+ converter: new DefaultFontColorConverter(), converterParameter: span.TextColor));
+ span.SetBinding(Span.BackgroundColorProperty, new Binding(nameof(baseIcon.IconBackgroundColor), source: baseIcon,
+ converter: new DefaultFontColorConverter(), converterParameter: span.BackgroundColor));
+ span.SetBinding(Span.FontSizeProperty, new Binding(nameof(baseIcon.IconSize), source: baseIcon,
+ converter: new DefaultFontSizeConverter(), converterParameter: span.FontSize));
+ span.SetBinding(Span.FontAutoScalingEnabledProperty, new Binding(nameof(baseIcon.IconAutoScaling), source: baseIcon,
+ converter: new DefaultFontAutoScalingConverter(), converterParameter: span.FontAutoScalingEnabled));
+ break;
+
+ case Label label:
+ label.SetValue(Label.FontFamilyProperty, baseIcon.Icon.GetFontFamily());
+ label.SetBinding(Label.TextProperty, new Binding(nameof(baseIcon.Icon), source: baseIcon,
+ converter: new IconToGlyphConverter()));
+ label.SetBinding(Label.TextColorProperty, new Binding(nameof(baseIcon.IconColor), source: baseIcon,
+ converter: new IconToGlyphConverter(), converterParameter: label.TextColor));
+ label.SetBinding(Label.BackgroundColorProperty, new Binding(nameof(baseIcon.IconBackgroundColor), source: baseIcon,
+ converter: new DefaultFontColorConverter(), converterParameter: label.BackgroundColor));
+ label.SetBinding(Label.FontSizeProperty, new Binding(nameof(baseIcon.IconSize), source: baseIcon,
+ converter: new DefaultFontSizeConverter(), converterParameter: label.FontSize));
+ label.SetBinding(Label.FontAutoScalingEnabledProperty, new Binding(nameof(baseIcon.IconAutoScaling), source: baseIcon,
+ converter: new DefaultFontAutoScalingConverter(), converterParameter: label.FontAutoScalingEnabled));
+ break;
+
+ case InputView inputView:
+ if (isNotFontOverridenOrSuppressed)
+ throw new MauiIconsException("This input control does not natively support icons or image sources. To apply an icon to text or placholder, " +
+ "set FontOverride to true or UseMauiIconsCore Builder and Set DefaultFontOverride Globally. This will replace any custom fonts with the default fonts. Please be aware that explicitly setting the FontFamily on the control itself will not render the icon. " +
+ "Additionally, using FontOverride may cause unexpected behavior, such as issues with text rendering.");
+
+ inputView.SetValue(InputView.FontFamilyProperty, baseIcon.Icon.GetFontFamily());
+ inputView.SetBinding(InputView.BackgroundColorProperty, new Binding(nameof(baseIcon.IconBackgroundColor), source: baseIcon,
+ converter: new DefaultFontColorConverter(), converterParameter: inputView.BackgroundColor));
+ inputView.SetBinding(InputView.FontSizeProperty, new Binding(nameof(baseIcon.IconSize), source: baseIcon,
+ converter: new DefaultFontSizeConverter(), converterParameter: inputView.FontSize));
+ inputView.SetBinding(InputView.FontAutoScalingEnabledProperty, new Binding(nameof(baseIcon.IconAutoScaling), source: baseIcon,
+ converter: new DefaultFontAutoScalingConverter(), converterParameter: inputView.FontAutoScalingEnabled));
+
+ SetConditionalBinding(nameof(InputView.Text),
+ matchBinding: () =>
+ {
+ inputView.SetBinding(InputView.TextProperty, new Binding(nameof(baseIcon.Icon), source: baseIcon, converter: new IconToGlyphConverter()));
+ inputView.SetBinding(InputView.TextColorProperty, new Binding(nameof(baseIcon.IconColor), source: baseIcon, converter: new DefaultFontColorConverter(), converterParameter: inputView.TextColor));
+ },
+ defaultBinding: () =>
+ {
+ inputView.SetBinding(InputView.PlaceholderProperty, new Binding(nameof(baseIcon.Icon), source: baseIcon, converter: new IconToGlyphConverter()));
+ inputView.SetBinding(InputView.PlaceholderColorProperty, new Binding(nameof(baseIcon.IconColor), source: baseIcon, converter: new DefaultFontColorConverter(), converterParameter: inputView.PlaceholderColor));
+ });
+ break;
+
+ case MauiIcon mauiIcon:
+ mauiIcon.SetBinding(MauiIcon.ValueProperty, new Binding(nameof(baseIcon.Icon), source: baseIcon));
+ mauiIcon.SetBinding(MauiIcon.IconColorProperty, new Binding(nameof(baseIcon.IconColor), source: baseIcon,
+ converter: new DefaultFontColorConverter(), converterParameter: mauiIcon.IconColor));
+ mauiIcon.SetBinding(MauiIcon.IconBackgroundColorProperty, new Binding(nameof(baseIcon.IconBackgroundColor), source: baseIcon,
+ converter: new DefaultFontColorConverter(), converterParameter: mauiIcon.IconBackgroundColor));
+ mauiIcon.SetBinding(MauiIcon.IconSizeProperty, new Binding(nameof(baseIcon.IconSize), source: baseIcon));
+ mauiIcon.SetBinding(MauiIcon.IconAutoScalingProperty, new Binding(nameof(baseIcon.IconAutoScaling), source: baseIcon));
+ mauiIcon.SetBinding(MauiIcon.OnPlatformsProperty, new Binding(nameof(baseIcon.OnPlatforms), source: baseIcon));
+ mauiIcon.SetBinding(MauiIcon.OnIdiomsProperty, new Binding(nameof(baseIcon.OnIdioms), source: baseIcon));
+ break;
+
+ case Image image:
+ image.SetValue(Image.SourceProperty, new FontImageSource());
+ SetFontImageSourceBinding((FontImageSource)image.Source, baseIcon);
+ break;
+ case ImageButton imageButton:
+ imageButton.SetValue(ImageButton.SourceProperty, new FontImageSource());
+ SetFontImageSourceBinding((FontImageSource)imageButton.Source, baseIcon);
+ break;
+ case ImageCell imageCell:
+ imageCell.SetValue(ImageCell.ImageSourceProperty, new FontImageSource());
+ SetFontImageSourceBinding((FontImageSource)imageCell.ImageSource, baseIcon, imageCell.TextColor);
+ break;
+ case FontImageSource fontImage:
+ SetFontImageSourceBinding(fontImage, baseIcon);
+ break;
+
+ case BaseShellItem baseShellItem:
+ SetConditionalBinding(nameof(BaseShellItem.FlyoutIcon),
+ matchBinding: () =>
+ {
+ baseShellItem.SetValue(BaseShellItem.FlyoutIconProperty, new FontImageSource());
+ SetFontImageSourceBinding((FontImageSource)baseShellItem.FlyoutIcon, baseIcon);
+ },
+ defaultBinding: () =>
+ {
+ baseShellItem.SetValue(BaseShellItem.IconProperty, new FontImageSource());
+ SetFontImageSourceBinding((FontImageSource)baseShellItem.Icon, baseIcon);
+ });
+ break;
+
+ case Shell shell:
+ SetConditionalBinding(nameof(Shell.FlyoutIcon),
+ matchBinding: () =>
+ {
+ shell.SetValue(Shell.FlyoutIconProperty, new FontImageSource());
+ SetFontImageSourceBinding((FontImageSource)shell.FlyoutIcon, baseIcon);
+ },
+ defaultBinding: () =>
+ {
+ shell.SetValue(Shell.IconImageSourceProperty, new FontImageSource());
+ SetFontImageSourceBinding((FontImageSource)shell.IconImageSource, baseIcon);
+ });
+ break;
+
+ case SearchHandler searchHandler:
+ SetConditionalBinding(nameof(SearchHandler.ClearIcon),
+ matchBinding: () =>
+ {
+ searchHandler.SetValue(SearchHandler.ClearIconProperty, new FontImageSource());
+ SetFontImageSourceBinding((FontImageSource)searchHandler.ClearIcon, baseIcon, searchHandler.TextColor);
+ },
+ defaultBinding: () =>
+ {
+ searchHandler.SetValue(SearchHandler.QueryIconProperty, new FontImageSource());
+ SetFontImageSourceBinding((FontImageSource)searchHandler.QueryIcon, baseIcon, searchHandler.TextColor);
+ });
+ break;
+
+ case BackButtonBehavior backButtonBehavior:
+ backButtonBehavior.SetValue(BackButtonBehavior.IconOverrideProperty, new FontImageSource());
+ SetFontImageSourceBinding((FontImageSource)backButtonBehavior.IconOverride, baseIcon);
+ break;
+
+ case MenuItem menuItem:
+ menuItem.SetValue(MenuItem.IconImageSourceProperty, new FontImageSource());
+ SetFontImageSourceBinding((FontImageSource)menuItem.IconImageSource, baseIcon);
+ break;
+
+ case Page page:
+ page.SetValue(Page.IconImageSourceProperty, new FontImageSource());
+ SetFontImageSourceBinding((FontImageSource)page.IconImageSource, baseIcon);
+ break;
+
+ case Picker picker:
+ if (isNotFontOverridenOrSuppressed)
+ throw new MauiIconsException("This Picker Control doesn't natively support icons or image sources. To apply an icon to Title, " +
+ "set FontOverride to true or UseMauiIconsCore Builder and Set DefaultFontOverride Globally. This will override the fonts and use default fonts instead of any assigned custom fonts and additionally explicitly setting font or text on the control itself would not render the icon.");
+
+ picker.SetValue(Picker.FontFamilyProperty, baseIcon.Icon.GetFontFamily());
+ picker.SetBinding(Picker.TitleProperty, new Binding(nameof(baseIcon.Icon), source: baseIcon, converter: new IconToGlyphConverter()));
+ picker.SetBinding(Picker.TitleColorProperty, new Binding(nameof(baseIcon.IconColor), source: baseIcon,
+ converter: new DefaultFontColorConverter(), converterParameter: picker.TitleColor));
+ picker.SetBinding(Picker.FontSizeProperty, new Binding(nameof(baseIcon.IconSize), source: baseIcon,
+ converter: new DefaultFontSizeConverter(), converterParameter: picker.FontSize));
+ picker.SetBinding(Picker.FontAutoScalingEnabledProperty, new Binding(nameof(baseIcon.IconAutoScaling), source: baseIcon,
+ converter: new DefaultFontAutoScalingConverter(), converterParameter: picker.FontAutoScalingEnabled));
+ picker.SetBinding(Picker.BackgroundColorProperty, new Binding(nameof(baseIcon.IconBackgroundColor), source: baseIcon,
+ converter: new DefaultFontColorConverter(), converterParameter: picker.BackgroundColor));
+ break;
+
+ case RadioButton radioButton:
+ Image img = new();
+ img.SetValue(Image.SourceProperty, new FontImageSource());
+ SetFontImageSourceBinding((FontImageSource)img.Source, baseIcon, radioButton.TextColor);
+ radioButton.SetValue(RadioButton.ContentProperty, img);
+ break;
+
+ case Slider slider:
+ slider.SetValue(Slider.ThumbImageSourceProperty, new FontImageSource());
+ SetFontImageSourceBinding((FontImageSource)slider.ThumbImageSource, baseIcon);
+ break;
+
+ default:
+ throw new MauiIconsException($"MauiIcons extension doesn't support the {bindable} control, which doesn't natively support assigning icons or images.");
+ }
+
+ void SetConditionalBinding(string propertyName, Action matchBinding, Action defaultBinding)
+ {
+ if (isAllSetProperty || IsPropertyNameIsSet(propertyName))
+ {
+ matchBinding();
+
+ if (!isAllSetProperty)
+ return;
+ }
+
+ defaultBinding();
+
+ bool IsPropertyNameIsSet(ReadOnlySpan propertyName) =>
+ baseIcon.TargetName.AsSpan().CompareTo(propertyName, StringComparison.OrdinalIgnoreCase) == 0;
+ }
+ }
+
+ static void SetFontImageSourceBinding(FontImageSource fontImageSource, BaseIcon baseIcon, Color? textColor = null)
+ {
+ fontImageSource.SetValue(FontImageSource.FontFamilyProperty, baseIcon.Icon.GetFontFamily());
+ fontImageSource.SetBinding(FontImageSource.GlyphProperty, new Binding(nameof(baseIcon.Icon), source: baseIcon,
+ converter: new IconToGlyphConverter()));
+ fontImageSource.SetBinding(FontImageSource.SizeProperty, new Binding(nameof(baseIcon.IconSize), source: baseIcon,
+ converter: new DefaultFontSizeConverter(), converterParameter: fontImageSource.Size));
+ fontImageSource.SetBinding(FontImageSource.ColorProperty, new Binding(nameof(baseIcon.IconColor), source: baseIcon,
+ converter: new DefaultFontColorConverter(),
+ converterParameter: textColor ?? fontImageSource.Color));
+ fontImageSource.SetBinding(FontImageSource.FontAutoScalingEnabledProperty, new Binding(nameof(baseIcon.IconAutoScaling), source: baseIcon,
+ converter: new DefaultFontAutoScalingConverter(), converterParameter: fontImageSource.FontAutoScalingEnabled));
+ }
+
+ public static BaseIcon? GetValue(BindableObject view)
+ {
+ return (BaseIcon?)view.GetValue(ValueProperty);
+ }
+
+ public static void SetValue(BindableObject view, BaseIcon? value)
+ {
+ view.SetValue(ValueProperty, value);
+ }
+}
diff --git a/src/MauiIcons.Core/Controls/MauiIcon.cs b/src/MauiIcons.Core/Controls/MauiIcon.cs
index fa8bbd59..f689e759 100644
--- a/src/MauiIcons.Core/Controls/MauiIcon.cs
+++ b/src/MauiIcons.Core/Controls/MauiIcon.cs
@@ -3,36 +3,69 @@
using Microsoft.Maui.Graphics.Converters;
namespace MauiIcons.Core;
-public sealed class MauiIcon : ContentView, IMauiIcon
+
+public sealed partial class MauiIcon : ContentView, IMauiIcon
{
public static readonly BindableProperty IconProperty = BindableProperty.Create(nameof(Icon), typeof(Enum), typeof(MauiIcon), null);
public static readonly BindableProperty IconSizeProperty = BindableProperty.Create(nameof(IconSize), typeof(double), typeof(MauiIcon), 30.0);
public static readonly BindableProperty IconColorProperty = BindableProperty.Create(nameof(IconColor), typeof(Color), typeof(MauiIcon), null);
public static readonly BindableProperty IconBackgroundColorProperty = BindableProperty.Create(nameof(IconBackgroundColor), typeof(Color), typeof(MauiIcon), null);
public static readonly BindableProperty IconAutoScalingProperty = BindableProperty.Create(nameof(IconAutoScaling), typeof(bool), typeof(MauiIcon), false);
- public static readonly BindableProperty IconSuffixProperty = BindableProperty.Create(nameof(IconSuffix), typeof(string), typeof(MauiIcon), null, propertyChanged: IconSuffixPropertyChanged);
+
+ public static readonly BindableProperty IconSuffixProperty = BindableProperty.Create(nameof(IconSuffix), typeof(string), typeof(MauiIcon), null,
+ propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ ((MauiIcon)bindable)._iconSuffixSpacer.Text = !string.IsNullOrEmpty((string)newValue) ? " " : null;
+ });
+
public static readonly BindableProperty IconSuffixFontFamilyProperty = BindableProperty.Create(nameof(IconSuffixFontFamily), typeof(string), typeof(MauiIcon), null);
public static readonly BindableProperty IconSuffixFontSizeProperty = BindableProperty.Create(nameof(IconSuffixFontSize), typeof(double), typeof(MauiIcon), 20.0);
public static readonly BindableProperty IconSuffixTextColorProperty = BindableProperty.Create(nameof(IconSuffixTextColor), typeof(Color), typeof(MauiIcon), null);
public static readonly BindableProperty IconSuffixBackgroundColorProperty = BindableProperty.Create(nameof(IconSuffixBackgroundColor), typeof(Color), typeof(MauiIcon), null);
- public static readonly BindableProperty IconAndSuffixBackgroundColorProperty = BindableProperty.Create(nameof(IconAndSuffixBackgroundColor), typeof(Color), typeof(MauiIcon));
public static readonly BindableProperty IconSuffixAutoScalingProperty = BindableProperty.Create(nameof(IconSuffixAutoScaling), typeof(bool), typeof(MauiIcon), false);
+ public static readonly BindableProperty IconAndSuffixBackgroundColorProperty = BackgroundColorProperty;
public static readonly BindableProperty EntranceAnimationTypeProperty = BindableProperty.Create(nameof(EntranceAnimationType), typeof(AnimationType), typeof(MauiIcon), AnimationType.None);
public static readonly BindableProperty EntranceAnimationDurationProperty = BindableProperty.Create(nameof(EntranceAnimationDuration), typeof(uint), typeof(MauiIcon), (uint)1500);
- public static readonly BindableProperty OnPlatformsProperty = BindableProperty.Create(nameof(OnPlatforms), typeof(IList), typeof(MauiIcon), null);
- public static readonly BindableProperty OnIdiomsProperty = BindableProperty.Create(nameof(OnIdioms), typeof(IList), typeof(MauiIcon), null);
- private static void IconSuffixPropertyChanged(BindableObject bindable, object oldValue, object newValue) =>
- ((MauiIcon)bindable)._iconSuffixSpacer.Text = !string.IsNullOrEmpty((string)newValue) ? " " : null;
+ public static readonly BindableProperty OnPlatformsProperty = BindableProperty.Create(nameof(OnPlatforms), typeof(IList), typeof(MauiIcon), null,
+ propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ if (newValue is not null && newValue is IList platforms && bindable is MauiIcon icon)
+ icon.Content = PlatformHelper.IsValidPlatformsAndIdioms(platforms, icon.OnIdioms) ?
+ icon.Content ?? icon._root ?? icon.BuildIconControl() : null;
+
+ });
+ public static readonly BindableProperty OnIdiomsProperty = BindableProperty.Create(nameof(OnIdioms), typeof(IList), typeof(MauiIcon), null,
+ propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ if (newValue is not null && newValue is IList idioms && bindable is MauiIcon icon)
+ icon.Content = PlatformHelper.IsValidPlatformsAndIdioms(icon.OnPlatforms, idioms) ?
+ icon.Content ?? icon._root ?? icon.BuildIconControl() : null;
+ });
+
+ public static readonly BindableProperty OnClickAnimationTypeProperty = BindableProperty.Create(nameof(OnClickAnimationType), typeof(AnimationType), typeof(MauiIcon), AnimationType.None,
+ propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ if(newValue is AnimationType type && type is not AnimationType.None && bindable is MauiIcon icon)
+ {
+ var tapGestureRecognizer = new TapGestureRecognizer();
+ tapGestureRecognizer.Tapped += icon.OnIconTapped;
+ icon._iconLabel.GestureRecognizers.Add(tapGestureRecognizer);
+ }
+ else if (bindable is MauiIcon mi)
+ {
+ mi.DisposeGestureRecognizer();
+ }
+ });
+
+ public static readonly BindableProperty OnClickAnimationDurationProperty = BindableProperty.Create(nameof(OnClickAnimationDuration), typeof(uint), typeof(MauiIcon), (uint)600);
-#nullable enable
public Enum? Icon
{
get => (Enum?)GetValue(IconProperty);
set => SetValue(IconProperty, value);
}
-#nullable disable
[System.ComponentModel.TypeConverter(typeof(FontSizeConverter))]
public double IconSize
@@ -54,6 +87,7 @@ public Color IconBackgroundColor
get => (Color)GetValue(IconBackgroundColorProperty);
set => SetValue(IconBackgroundColorProperty, value);
}
+
public bool IconAutoScaling
{
get => (bool)GetValue(IconAutoScalingProperty);
@@ -92,6 +126,12 @@ public Color IconSuffixBackgroundColor
set => SetValue(IconSuffixBackgroundColorProperty, value);
}
+ public bool IconSuffixAutoScaling
+ {
+ get => (bool)GetValue(IconSuffixAutoScalingProperty);
+ set => SetValue(IconSuffixAutoScalingProperty, value);
+ }
+
[System.ComponentModel.TypeConverter(typeof(ColorTypeConverter))]
public Color IconAndSuffixBackgroundColor
{
@@ -99,12 +139,6 @@ public Color IconAndSuffixBackgroundColor
set => SetValue(IconAndSuffixBackgroundColorProperty, value);
}
- public bool IconSuffixAutoScaling
- {
- get => (bool)GetValue(IconSuffixAutoScalingProperty);
- set => SetValue(IconSuffixAutoScalingProperty, value);
- }
-
public AnimationType EntranceAnimationType
{
get => (AnimationType)GetValue(EntranceAnimationTypeProperty);
@@ -129,32 +163,42 @@ public IList OnIdioms
get => (IList)GetValue(OnIdiomsProperty);
set => SetValue(OnIdiomsProperty, value);
}
+ public AnimationType OnClickAnimationType
+ {
+ get => (AnimationType)GetValue(OnClickAnimationTypeProperty);
+ set => SetValue(OnClickAnimationTypeProperty, value);
+ }
+ public uint OnClickAnimationDuration
+ {
+ get => (uint)GetValue(OnClickAnimationDurationProperty);
+ set => SetValue(OnClickAnimationDurationProperty, value);
+ }
public MauiIcon()
{
Content = BuildIconControl();
Loaded += async (s, r) =>
{
- RemoveContentBasedOnPlatformAndIdiom();
- _iconSpan.FontFamily = Icon.GetFontFamily();
- await AnimateIcon(_rootLabel);
+ _iconLabel.SetValue(Label.FontFamilyProperty, Icon.GetFontFamily());
+ await AnimationHelper.AnimateIconAsync(EntranceAnimationType, _iconLabel, EntranceAnimationDuration);
};
}
- private Label _rootLabel;
- private Span _iconSpan;
+ private readonly HorizontalStackLayout _root = new();
+ private readonly Label _iconLabel = new();
+ private readonly Label _suffixLabel = new();
private readonly Span _iconSuffixSpacer = new();
- private Span _suffixSpan;
- private Label BuildIconControl()
+ private readonly Span _suffixSpan = new();
+
+ private HorizontalStackLayout BuildIconControl()
{
- _iconSpan = new();
- _iconSpan.SetBinding(Span.TextProperty, new Binding(nameof(Icon), converter: new EnumToStringConverter(), source: this));
- _iconSpan.SetBinding(Span.FontAutoScalingEnabledProperty, new Binding(nameof(IconAutoScaling), source: this));
- _iconSpan.SetBinding(Span.FontSizeProperty, new Binding(nameof(IconSize), source: this));
- _iconSpan.SetBinding(Span.TextColorProperty, new Binding(nameof(IconColor), source: this));
- _iconSpan.SetBinding(Span.BackgroundColorProperty, new Binding(nameof(IconBackgroundColor), source: this));
+ _iconLabel.SetBinding(Label.TextProperty, new Binding(nameof(Icon), converter: new IconToGlyphConverter(), source: this));
+ _iconLabel.SetBinding(Label.FontAutoScalingEnabledProperty, new Binding(nameof(IconAutoScaling), source: this));
+ _iconLabel.SetBinding(Label.FontSizeProperty, new Binding(nameof(IconSize), source: this));
+ _iconLabel.SetBinding(Label.TextColorProperty, new Binding(nameof(IconColor), source: this));
+ _iconLabel.SetBinding(Label.BackgroundColorProperty, new Binding(nameof(IconBackgroundColor), source: this));
+ _iconLabel.SetValue(Label.VerticalOptionsProperty, LayoutOptions.Center);
- _suffixSpan = new();
_suffixSpan.SetBinding(Span.TextProperty, new Binding(nameof(IconSuffix), source: this));
_suffixSpan.SetBinding(Span.FontAutoScalingEnabledProperty, new Binding(nameof(IconSuffixAutoScaling), source: this));
_suffixSpan.SetBinding(Span.FontSizeProperty, new Binding(nameof(IconSuffixFontSize), source: this));
@@ -162,33 +206,27 @@ private Label BuildIconControl()
_suffixSpan.SetBinding(Span.TextColorProperty, new Binding(nameof(IconSuffixTextColor), source: this));
_suffixSpan.SetBinding(Span.BackgroundColorProperty, new Binding(nameof(IconSuffixBackgroundColor), source: this));
- _rootLabel = new();
- _rootLabel.SetBinding(Label.BackgroundColorProperty, new Binding(nameof(IconAndSuffixBackgroundColor), source: this));
- _rootLabel.FormattedText = new FormattedString();
- _rootLabel.FormattedText.Spans.Add(_iconSpan);
- _rootLabel.FormattedText.Spans.Add(_iconSuffixSpacer);
- _rootLabel.FormattedText.Spans.Add(_suffixSpan);
- return _rootLabel;
+ _suffixLabel.SetValue(Label.FormattedTextProperty, new FormattedString());
+ _suffixLabel.SetValue(Label.VerticalOptionsProperty, LayoutOptions.Center);
+ _suffixLabel.FormattedText.Spans.Add(_iconSuffixSpacer);
+ _suffixLabel.FormattedText.Spans.Add(_suffixSpan);
+
+ _root.Children.Add(_iconLabel);
+ _root.Children.Add(_suffixLabel);
+ return _root;
}
- private async Task AnimateIcon(Label label)
+ private async void OnIconTapped(object? sender, TappedEventArgs e)
{
- switch (EntranceAnimationType)
+ await AnimationHelper.AnimateIconAsync(OnClickAnimationType, _iconLabel, OnClickAnimationDuration);
+ }
+
+ public void DisposeGestureRecognizer()
+ {
+ if (_iconLabel.GestureRecognizers.Count > 0 && _iconLabel.GestureRecognizers[0] is TapGestureRecognizer tapGestureRecognizer)
{
- case AnimationType.None:
- return;
- case AnimationType.Fade:
- label.Opacity = 0;
- await label.FadeTo(1, EntranceAnimationDuration);
- return;
- case AnimationType.Scale:
- await label.ScaleTo(1.5, EntranceAnimationDuration);
- await label.ScaleTo(1, EntranceAnimationDuration);
- return;
- case AnimationType.Rotate:
- await label.RotateTo(360, EntranceAnimationDuration);
- label.Rotation = 0;
- return;
+ tapGestureRecognizer.Tapped -= OnIconTapped;
+ _iconLabel.GestureRecognizers.Clear();
}
}
@@ -216,11 +254,26 @@ private async Task AnimateIcon(Label label)
public static explicit operator Label(MauiIcon mi)
{
- var label = mi._rootLabel;
- mi._iconSpan.FontFamily = mi.Icon.GetFontFamily();
+ var label = new Label
+ {
+ FormattedText = new FormattedString()
+ };
+ label.FormattedText.Spans.Add(new Span
+ {
+ Text = mi._iconLabel.Text,
+ FontSize = mi._iconLabel.FontSize,
+ FontAutoScalingEnabled = mi._iconLabel.FontAutoScalingEnabled,
+ FontFamily = mi.Icon.GetFontFamily(),
+ TextColor = mi._iconLabel.TextColor,
+ BackgroundColor = mi._iconLabel.BackgroundColor
+ });
+ label.FormattedText.Spans.Add(mi._iconSuffixSpacer);
+ label.FormattedText.Spans.Add(mi._suffixSpan);
+ label.VerticalOptions = LayoutOptions.Center;
+ label.BackgroundColor = mi.IconAndSuffixBackgroundColor.SetDefaultOrAssignedColor(label.BackgroundColor);
label.Loaded += async (s, r) =>
{
- await mi.AnimateIcon(label);
+ await AnimationHelper.AnimateIconAsync(mi.EntranceAnimationType, label, mi.EntranceAnimationDuration);
};
return label;
}
@@ -239,12 +292,4 @@ public static explicit operator Button(MauiIcon mi)
return button;
}
- private void RemoveContentBasedOnPlatformAndIdiom()
- {
- if (!PlatformHelper.IsValidPlatformsAndIdioms(OnPlatforms, OnIdioms))
- Content = null;
-
- return;
- }
-
}
diff --git a/src/MauiIcons.Core/Converters/DefaultFontAutoScalingConverter.cs b/src/MauiIcons.Core/Converters/DefaultFontAutoScalingConverter.cs
new file mode 100644
index 00000000..7ba56b0e
--- /dev/null
+++ b/src/MauiIcons.Core/Converters/DefaultFontAutoScalingConverter.cs
@@ -0,0 +1,18 @@
+using System.Globalization;
+
+namespace MauiIcons.Core.Converters;
+internal sealed class DefaultFontAutoScalingConverter : IValueConverter
+{
+ public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) =>
+ value switch
+ {
+ null when parameter is bool => parameter,
+ bool => value,
+ _ => false
+ };
+
+ public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+}
diff --git a/src/MauiIcons.Core/Converters/DefaultColorConverter.cs b/src/MauiIcons.Core/Converters/DefaultFontColorConverter.cs
similarity index 88%
rename from src/MauiIcons.Core/Converters/DefaultColorConverter.cs
rename to src/MauiIcons.Core/Converters/DefaultFontColorConverter.cs
index cc0bb0bb..e9ae5996 100644
--- a/src/MauiIcons.Core/Converters/DefaultColorConverter.cs
+++ b/src/MauiIcons.Core/Converters/DefaultFontColorConverter.cs
@@ -1,7 +1,7 @@
using System.Globalization;
namespace MauiIcons.Core.Converters;
-internal sealed class DefaultColorConverter : IValueConverter
+internal sealed class DefaultFontColorConverter : IValueConverter
{
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) =>
value switch
diff --git a/src/MauiIcons.Core/Converters/DefaultFontSizeConverter.cs b/src/MauiIcons.Core/Converters/DefaultFontSizeConverter.cs
new file mode 100644
index 00000000..7b2ac823
--- /dev/null
+++ b/src/MauiIcons.Core/Converters/DefaultFontSizeConverter.cs
@@ -0,0 +1,18 @@
+using System.Globalization;
+
+namespace MauiIcons.Core.Converters;
+internal sealed class DefaultFontSizeConverter : IValueConverter
+{
+ public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) =>
+ value switch
+ {
+ null or double and 0 when parameter is double and > 0 => parameter,
+ double and > 0 => value,
+ _ => 30.0
+ };
+
+ public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+}
diff --git a/src/MauiIcons.Core/Converters/EnumToStringConverter.cs b/src/MauiIcons.Core/Converters/IconToGlyphConverter.cs
similarity index 82%
rename from src/MauiIcons.Core/Converters/EnumToStringConverter.cs
rename to src/MauiIcons.Core/Converters/IconToGlyphConverter.cs
index f40f7fd7..48a70a26 100644
--- a/src/MauiIcons.Core/Converters/EnumToStringConverter.cs
+++ b/src/MauiIcons.Core/Converters/IconToGlyphConverter.cs
@@ -2,7 +2,7 @@
using System.Globalization;
namespace MauiIcons.Core.Converters;
-internal sealed class EnumToStringConverter : IValueConverter
+internal sealed class IconToGlyphConverter : IValueConverter
{
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
@@ -17,7 +17,7 @@ internal sealed class EnumToStringConverter : IValueConverter
{
if (value is not null && value is string str)
{
- return str.GetEnumByDescription();
+ return str.GetEnumByDescription(targetType);
}
return null;
}
diff --git a/src/MauiIcons.Core/Exceptions/MauiIconsException.cs b/src/MauiIcons.Core/Exceptions/MauiIconsException.cs
new file mode 100644
index 00000000..a5cc4f27
--- /dev/null
+++ b/src/MauiIcons.Core/Exceptions/MauiIconsException.cs
@@ -0,0 +1,6 @@
+namespace MauiIcons.Core;
+public sealed class MauiIconsException : Exception
+{
+ public MauiIconsException(string message): base(message){}
+ public MauiIconsException(string code, string message) : base(string.Format("{code}: {message}", code, message)){}
+}
diff --git a/src/MauiIcons.Core/Exceptions/MauiIconsExpection.cs b/src/MauiIcons.Core/Exceptions/MauiIconsExpection.cs
deleted file mode 100644
index 995fb763..00000000
--- a/src/MauiIcons.Core/Exceptions/MauiIconsExpection.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace MauiIcons.Core;
-public sealed class MauiIconsExpection : Exception
-{
- public MauiIconsExpection(string message): base(message){}
- public MauiIconsExpection(string code, string message) : base(string.Format("{code}: {message}", code, message)){}
-}
diff --git a/src/MauiIcons.Core/Extensions/BaseIconExtension.cs b/src/MauiIcons.Core/Extensions/BaseIconExtension.cs
index 1b550635..c3865db6 100644
--- a/src/MauiIcons.Core/Extensions/BaseIconExtension.cs
+++ b/src/MauiIcons.Core/Extensions/BaseIconExtension.cs
@@ -1,63 +1,26 @@
-using MauiIcons.Core.Converters;
+using MauiIcons.Core.Base;
+using MauiIcons.Core.Converters;
using MauiIcons.Core.Helpers;
-using Microsoft.Maui.Graphics.Converters;
namespace MauiIcons.Core;
[ContentProperty(nameof(Icon))]
-public abstract class BaseIconExtension : BindableObject, IMarkupExtension where TEnum : Enum
+public abstract class BaseIconExtension : BaseIcon, IMarkupExtension where TEnum : Enum
{
- public static readonly BindableProperty IconProperty = BindableProperty.Create(nameof(Icon), typeof(TEnum?), typeof(BaseIconExtension), null);
- public static readonly BindableProperty IconSizeProperty = BindableProperty.Create(nameof(IconSize), typeof(double), typeof(BaseIconExtension), 30.0);
- public static readonly BindableProperty IconColorProperty = BindableProperty.Create(nameof(IconColor), typeof(Color), typeof(BaseIconExtension), null);
- public static readonly BindableProperty IconBackgroundColorProperty = BindableProperty.Create(nameof(IconBackgroundColor), typeof(Color), typeof(BaseIconExtension), null);
- public static readonly BindableProperty IconAutoScalingProperty = BindableProperty.Create(nameof(IconAutoScaling), typeof(bool), typeof(BaseIconExtension), false);
+ public static new readonly BindableProperty IconProperty = BindableProperty.Create(nameof(Icon), typeof(TEnum?), typeof(BaseIconExtension), null);
- public TEnum? Icon
+ public new TEnum? Icon
{
get => (TEnum?)GetValue(IconProperty);
set => SetValue(IconProperty, value);
}
- [System.ComponentModel.TypeConverter(typeof(FontSizeConverter))]
- public double IconSize
- {
- get => (double)GetValue(IconSizeProperty);
- set => SetValue(IconSizeProperty, value);
- }
-
- [System.ComponentModel.TypeConverter(typeof(ColorTypeConverter))]
- public Color IconColor
- {
- get => (Color)GetValue(IconColorProperty);
- set => SetValue(IconColorProperty, value);
- }
-
- [System.ComponentModel.TypeConverter(typeof(ColorTypeConverter))]
- public Color IconBackgroundColor
- {
- get => (Color)GetValue(IconBackgroundColorProperty);
- set => SetValue(IconBackgroundColorProperty, value);
- }
-
- public bool IconAutoScaling
- {
- get => (bool)GetValue(IconAutoScalingProperty);
- set => SetValue(IconAutoScalingProperty, value);
- }
-
- [System.ComponentModel.TypeConverter(typeof(ListStringTypeConverter))]
- public IList OnPlatforms { get; set; } = new List();
-
- [System.ComponentModel.TypeConverter(typeof(ListStringTypeConverter))]
- public IList OnIdioms { get; set; } = new List();
-
public BindingBase ProvideValue(IServiceProvider serviceProvider)
{
var valueProvider = serviceProvider.GetService() ?? throw new ArgumentException();
Type? returnType = (valueProvider.TargetProperty as BindableProperty)?.ReturnType;
- if (PlatformHelper.IsValidPlatformsAndIdioms(OnPlatforms, OnIdioms))
+ if (PlatformHelper.IsValidPlatformsAndIdioms(OnPlatforms, OnIdioms) && valueProvider.TargetObject is not null)
return SetMauiIconBasedOnType(valueProvider.TargetObject, returnType);
return new Binding();
@@ -68,117 +31,138 @@ object IMarkupExtension.ProvideValue(IServiceProvider serviceProvider) =>
Binding SetMauiIconBasedOnType(object targetObject, Type? returnType)
{
- if(returnType == typeof(Enum))
+ if (returnType == typeof(Enum))
return SetFontProperties(targetObject, disableConverter: true);
if (returnType == typeof(string))
return SetFontProperties(targetObject);
if (returnType == typeof(ImageSource) || returnType == typeof(FontImageSource))
- return SetImageSourceProperties();
+ return SetImageSourceProperties(targetObject);
+
+ if(returnType == typeof(BaseIcon))
+ return SetBaseIconProperties();
+
+ if (returnType is null && targetObject is Setter setter)
+ return setter.Property.DeclaringType != typeof(MauiIcon)
+ ? throw new MauiIconsException("MauiIcons doesn't support Style Setter to be used in conjunction with Xaml Extension.")
+ : SetBaseIconProperties();
if (returnType is null && (targetObject is On or OnPlatform
or OnPlatform or OnPlatformExtension
or OnIdiom or OnIdiom
or OnIdiomExtension))
- throw new MauiIconsExpection("MauiIcons doesn't support Maui OnPlatform or OnIdiom," +
+ throw new MauiIconsException("MauiIcons doesn't support Maui OnPlatform or OnIdiom," +
"Therefore it is recommended to utilize MauiIcon's integrated Custom OnPlatform or OnIdiom functionalities.");
- else if (returnType is null && targetObject is Setter)
- throw new MauiIconsExpection("MauiIcons doesn't support Style Setter to be used in conjunction with Xaml Extension.");
-
- throw new MauiIconsExpection($"MauiIcons Extension does not provide {returnType} support");
+ throw new MauiIconsException($"MauiIcons Extension does not provide {returnType} support");
}
Binding SetFontProperties(object targetObject, bool disableConverter = false)
{
+ if (!IsSet(BindableObject.BindingContextProperty))
+ SetBinding(BindableObject.BindingContextProperty, new Binding(nameof(BindingContext), source: targetObject));
+
switch (targetObject)
{
case Button button:
- button.FontFamily = Icon.GetFontFamily();
- button.SetBinding(Button.TextColorProperty, new Binding(nameof(IconColor), source: this, mode: BindingMode.OneWay,
- converter: new DefaultColorConverter(), converterParameter: button.TextColor));
- button.SetBinding(Button.BackgroundColorProperty, new Binding(nameof(IconBackgroundColor), source: this, mode: BindingMode.OneWay,
- converter: new DefaultColorConverter(), converterParameter: button.BackgroundColor));
- button.SetBinding(Button.FontSizeProperty, new Binding(nameof(IconSize), source: this, mode: BindingMode.OneWay));
- button.SetBinding(Button.FontAutoScalingEnabledProperty, new Binding(nameof(IconAutoScaling), source: this, mode: BindingMode.OneWay));
+ button.SetValue(Button.FontFamilyProperty, Icon.GetFontFamily());
+ button.SetBinding(Button.TextColorProperty, new Binding(nameof(IconColor), source: this,
+ converter: new DefaultFontColorConverter(), converterParameter: button.TextColor));
+ button.SetBinding(Button.BackgroundColorProperty, new Binding(nameof(IconBackgroundColor), source: this,
+ converter: new DefaultFontColorConverter(), converterParameter: button.BackgroundColor));
+ button.SetBinding(Button.FontSizeProperty, new Binding(nameof(IconSize), source: this,
+ converter: new DefaultFontSizeConverter(), converterParameter: button.FontSize));
+ button.SetBinding(Button.FontAutoScalingEnabledProperty, new Binding(nameof(IconAutoScaling), source: this,
+ converter: new DefaultFontAutoScalingConverter(), converterParameter: button.FontAutoScalingEnabled));
break;
case Label label:
- label.FontFamily = Icon.GetFontFamily();
- label.SetBinding(Label.TextColorProperty, new Binding(nameof(IconColor), source: this, mode: BindingMode.OneWay,
- converter: new DefaultColorConverter(), converterParameter: label.TextColor));
- label.SetBinding(Label.BackgroundColorProperty, new Binding(nameof(IconBackgroundColor), source: this, mode: BindingMode.OneWay,
- converter: new DefaultColorConverter(), converterParameter: label.BackgroundColor));
- label.SetBinding(Label.FontSizeProperty, new Binding(nameof(IconSize), source: this, mode: BindingMode.OneWay));
- label.SetBinding(Label.FontAutoScalingEnabledProperty, new Binding(nameof(IconAutoScaling), source: this, mode: BindingMode.OneWay));
+ label.SetValue(Label.FontFamilyProperty, Icon.GetFontFamily());
+ label.SetBinding(Label.TextColorProperty, new Binding(nameof(IconColor), source: this,
+ converter: new DefaultFontColorConverter(), converterParameter: label.TextColor));
+ label.SetBinding(Label.BackgroundColorProperty, new Binding(nameof(IconBackgroundColor), source: this,
+ converter: new DefaultFontColorConverter(), converterParameter: label.BackgroundColor));
+ label.SetBinding(Label.FontSizeProperty, new Binding(nameof(IconSize), source: this,
+ converter: new DefaultFontSizeConverter(), converterParameter: label.FontSize));
+ label.SetBinding(Label.FontAutoScalingEnabledProperty, new Binding(nameof(IconAutoScaling), source: this,
+ converter: new DefaultFontAutoScalingConverter(), converterParameter: label.FontAutoScalingEnabled));
break;
case Span span:
- span.FontFamily = Icon.GetFontFamily();
- span.SetBinding(Span.TextColorProperty, new Binding(nameof(IconColor), source: this, mode: BindingMode.OneWay,
- converter: new DefaultColorConverter(), converterParameter: span.TextColor));
- span.SetBinding(Span.BackgroundColorProperty, new Binding(nameof(IconBackgroundColor), source: this, mode: BindingMode.OneWay,
- converter: new DefaultColorConverter(), converterParameter: span.BackgroundColor));
- span.SetBinding(Span.FontSizeProperty, new Binding(nameof(IconSize), source: this, mode: BindingMode.OneWay));
- span.SetBinding(Span.FontAutoScalingEnabledProperty, new Binding(nameof(IconAutoScaling), source: this, mode: BindingMode.OneWay));
+ span.SetValue(Span.FontFamilyProperty, Icon.GetFontFamily());
+ span.SetBinding(Span.TextColorProperty, new Binding(nameof(IconColor), source: this,
+ converter: new DefaultFontColorConverter(), converterParameter: span.TextColor));
+ span.SetBinding(Span.BackgroundColorProperty, new Binding(nameof(IconBackgroundColor), source: this,
+ converter: new DefaultFontColorConverter(), converterParameter: span.BackgroundColor));
+ span.SetBinding(Span.FontSizeProperty, new Binding(nameof(IconSize), source: this,
+ converter: new DefaultFontSizeConverter(), converterParameter: span.FontSize));
+ span.SetBinding(Span.FontAutoScalingEnabledProperty, new Binding(nameof(IconAutoScaling), source: this,
+ converter: new DefaultFontAutoScalingConverter(), converterParameter: span.FontAutoScalingEnabled));
break;
- case Entry entry:
- entry.FontFamily = Icon.GetFontFamily();
- entry.SetBinding(Entry.TextColorProperty, new Binding(nameof(IconColor), source: this, mode: BindingMode.OneWay,
- converter: new DefaultColorConverter(), converterParameter: entry.TextColor));
- entry.SetBinding(Entry.BackgroundColorProperty, new Binding(nameof(IconBackgroundColor), source: this, mode: BindingMode.OneWay,
- converter: new DefaultColorConverter(), converterParameter: entry.BackgroundColor));
- entry.SetBinding(Entry.FontSizeProperty, new Binding(nameof(IconSize), source: this, mode: BindingMode.OneWay));
- entry.SetBinding(Entry.FontAutoScalingEnabledProperty, new Binding(nameof(IconAutoScaling), source: this, mode: BindingMode.OneWay));
- break;
- case Editor editor:
- editor.FontFamily = Icon.GetFontFamily();
- editor.SetBinding(Editor.TextColorProperty, new Binding(nameof(IconColor), source: this, mode: BindingMode.OneWay,
- converter: new DefaultColorConverter(), converterParameter: editor.TextColor));
- editor.SetBinding(Editor.BackgroundColorProperty, new Binding(nameof(IconBackgroundColor), source: this, mode: BindingMode.OneWay,
- converter: new DefaultColorConverter(), converterParameter: editor.BackgroundColor));
- editor.SetBinding(Editor.FontSizeProperty, new Binding(nameof(IconSize), source: this, mode: BindingMode.OneWay));
- editor.SetBinding(Editor.FontAutoScalingEnabledProperty, new Binding(nameof(IconAutoScaling), source: this, mode: BindingMode.OneWay));
- break;
- case SearchBar searchBar:
- searchBar.FontFamily = Icon.GetFontFamily();
- searchBar.SetBinding(SearchBar.TextColorProperty, new Binding(nameof(IconColor), source: this, mode: BindingMode.OneWay,
- converter: new DefaultColorConverter(), converterParameter: searchBar.TextColor));
- searchBar.SetBinding(SearchBar.BackgroundColorProperty, new Binding(nameof(IconBackgroundColor), source: this, mode: BindingMode.OneWay,
- converter: new DefaultColorConverter(), converterParameter: searchBar.BackgroundColor));
- searchBar.SetBinding(SearchBar.FontSizeProperty, new Binding(nameof(IconSize), source: this, mode: BindingMode.OneWay));
- searchBar.SetBinding(SearchBar.FontAutoScalingEnabledProperty, new Binding(nameof(IconAutoScaling), source: this, mode: BindingMode.OneWay));
+ case InputView input:
+ if(!FontOverride && !Options.DefaultFontOverride)
+ throw new MauiIconsException("This input control does not natively support icons or image sources. To apply an icon, " +
+ "set OverrideFont to true. This will replace any custom fonts with the default fonts. Please be aware that explicitly setting the FontFamily on the control itself will not render the icon. " +
+ "Additionally, using OverrideFont may cause unexpected behavior, such as issues with text rendering.");
+
+ input.SetValue(InputView.FontFamilyProperty, Icon.GetFontFamily());
+ input.SetBinding(InputView.TextColorProperty, new Binding(nameof(IconColor), source: this,
+ converter: new DefaultFontColorConverter(), converterParameter: input.TextColor));
+ input.SetBinding(InputView.BackgroundColorProperty, new Binding(nameof(IconBackgroundColor), source: this,
+ converter: new DefaultFontColorConverter(), converterParameter: input.BackgroundColor));
+ input.SetBinding(InputView.FontSizeProperty, new Binding(nameof(IconSize), source: this,
+ converter: new DefaultFontSizeConverter(), converterParameter: input.FontSize));
+ input.SetBinding(InputView.FontAutoScalingEnabledProperty, new Binding(nameof(IconAutoScaling), source: this,
+ converter: new DefaultFontAutoScalingConverter(), converterParameter: input.FontAutoScalingEnabled));
break;
case MauiIcon mauiIcon:
- mauiIcon.SetBinding(MauiIcon.IconColorProperty, new Binding(nameof(IconColor), source: this, mode: BindingMode.OneWay,
- converter: new DefaultColorConverter(), converterParameter: mauiIcon.IconColor));
- mauiIcon.SetBinding(MauiIcon.IconBackgroundColorProperty, new Binding(nameof(IconBackgroundColor), source: this, mode: BindingMode.OneWay,
- converter: new DefaultColorConverter(), converterParameter: mauiIcon.IconBackgroundColor));
- mauiIcon.SetBinding(MauiIcon.IconSizeProperty, new Binding(nameof(IconSize), source: this, mode: BindingMode.OneWay));
- mauiIcon.SetBinding(MauiIcon.IconAutoScalingProperty, new Binding(nameof(IconAutoScaling), source: this, mode: BindingMode.OneWay));
+ mauiIcon.SetBinding(MauiIcon.IconColorProperty, new Binding(nameof(IconColor), source: this,
+ converter: new DefaultFontColorConverter(), converterParameter: mauiIcon.IconColor));
+ mauiIcon.SetBinding(MauiIcon.IconBackgroundColorProperty, new Binding(nameof(IconBackgroundColor), source: this,
+ converter: new DefaultFontColorConverter(), converterParameter: mauiIcon.IconBackgroundColor));
+ mauiIcon.SetBinding(MauiIcon.IconSizeProperty, new Binding(nameof(IconSize), source: this,
+ converter: new DefaultFontSizeConverter(), converterParameter: mauiIcon.IconSize));
+ mauiIcon.SetBinding(MauiIcon.IconAutoScalingProperty, new Binding(nameof(IconAutoScaling), source: this,
+ converter: new DefaultFontAutoScalingConverter(), converterParameter: mauiIcon.IconAutoScaling));
+ mauiIcon.SetBinding(MauiIcon.OnPlatformsProperty, new Binding(nameof(OnPlatforms), source: this));
+ mauiIcon.SetBinding(MauiIcon.OnIdiomsProperty, new Binding(nameof(OnIdioms), source: this));
break;
case FontImageSource fontImageSource:
- fontImageSource.FontFamily = Icon.GetFontFamily();
- fontImageSource.SetBinding(FontImageSource.SizeProperty, new Binding(nameof(IconSize), source: this, mode: BindingMode.OneWay));
- fontImageSource.SetBinding(FontImageSource.ColorProperty, new Binding(nameof(IconColor), source: this, mode: BindingMode.OneWay,
- converter: new DefaultColorConverter(), converterParameter: fontImageSource.Color));
- fontImageSource.SetBinding(FontImageSource.FontAutoScalingEnabledProperty, new Binding(nameof(IconAutoScaling), source: this, mode: BindingMode.OneWay));
+ fontImageSource.SetValue(FontImageSource.FontFamilyProperty, Icon.GetFontFamily());
+ fontImageSource.SetBinding(FontImageSource.SizeProperty, new Binding(nameof(IconSize), source: this,
+ converter: new DefaultFontSizeConverter(), converterParameter: fontImageSource.Size));
+ fontImageSource.SetBinding(FontImageSource.ColorProperty, new Binding(nameof(IconColor), source: this,
+ converter: new DefaultFontColorConverter(), converterParameter: fontImageSource.Color));
+ fontImageSource.SetBinding(FontImageSource.FontAutoScalingEnabledProperty, new Binding(nameof(IconAutoScaling), source: this,
+ converter: new DefaultFontAutoScalingConverter(), converterParameter: fontImageSource.FontAutoScalingEnabled));
break;
default:
- throw new MauiIconsExpection($"MauiIcons extension doesn't support this control {targetObject}");
+ throw new MauiIconsException($"MauiIcons extension doesn't support this control {targetObject}");
}
- return new Binding(nameof(Icon), mode: BindingMode.OneWay, converter: !disableConverter ? new EnumToStringConverter() : null, source: this);
+ return new Binding(nameof(Icon), converter: !disableConverter ? new IconToGlyphConverter() : null, source: this);
}
- Binding SetImageSourceProperties()
+ Binding SetImageSourceProperties(object targetObject)
{
+ if (!IsSet(BindableObject.BindingContextProperty))
+ SetBinding(BindableObject.BindingContextProperty, new Binding(nameof(BindingContext), source: targetObject));
+ IText? element = targetObject as IText;
InternalSource = new FontImageSource();
- ((FontImageSource)InternalSource).SetBinding(FontImageSource.GlyphProperty, new Binding(nameof(Icon), mode: BindingMode.OneWay, converter: new EnumToStringConverter(), source: this));
- ((FontImageSource)InternalSource).FontFamily = Icon.GetFontFamily();
- ((FontImageSource)InternalSource).SetBinding(FontImageSource.SizeProperty, new Binding(nameof(IconSize), source: this));
+ ((FontImageSource)InternalSource).SetBinding(FontImageSource.GlyphProperty, new Binding(nameof(Icon),
+ converter: new IconToGlyphConverter(), source: this));
+ ((FontImageSource)InternalSource).SetValue(FontImageSource.FontFamilyProperty, Icon.GetFontFamily());
+ ((FontImageSource)InternalSource).SetBinding(FontImageSource.SizeProperty, new Binding(nameof(IconSize), source: this,
+ converter: new DefaultFontSizeConverter(), converterParameter: ((FontImageSource)InternalSource).Size));
((FontImageSource)InternalSource).SetBinding(FontImageSource.ColorProperty, new Binding(nameof(IconColor), source: this,
- converter: new DefaultColorConverter(), converterParameter: ((FontImageSource)InternalSource).Color));
- ((FontImageSource)InternalSource).SetBinding(FontImageSource.FontAutoScalingEnabledProperty, new Binding(nameof(IconAutoScaling), source: this));
- return new Binding(nameof(InternalSource), mode: BindingMode.OneWay, source: this);
+ converter: new DefaultFontColorConverter(), converterParameter: element is not null ? element.TextColor : ((FontImageSource)InternalSource).Color));
+ ((FontImageSource)InternalSource).SetBinding(FontImageSource.FontAutoScalingEnabledProperty, new Binding(nameof(IconAutoScaling), source: this,
+ converter: new DefaultFontAutoScalingConverter(), converterParameter: ((FontImageSource)InternalSource).FontAutoScalingEnabled));
+ return new Binding(nameof(InternalSource), source: this);
+ }
+
+ Binding SetBaseIconProperties()
+ {
+ base.SetValue(BaseIcon.IconProperty, Icon);
+ return new Binding(".", source: this);
}
public static readonly BindableProperty InternalSourceProperty = BindableProperty.Create(nameof(InternalSource), typeof(ImageSource), typeof(BaseIconExtension), null);
@@ -191,5 +175,4 @@ public ImageSource InternalSource
get => (ImageSource)GetValue(InternalSourceProperty);
set => SetValue(InternalSourceProperty, value);
}
-
}
diff --git a/src/MauiIcons.Core/Extensions/CommonExtension.cs b/src/MauiIcons.Core/Extensions/CommonExtension.cs
index e5c21b69..5e328385 100644
--- a/src/MauiIcons.Core/Extensions/CommonExtension.cs
+++ b/src/MauiIcons.Core/Extensions/CommonExtension.cs
@@ -10,13 +10,13 @@ public static class CommonExtension
/// sets the size of the icon. Defaults to 30.0
/// sets a value indicating whether the icon should automatically scale. Defaults to false
/// Icon as ImageSource
- ///
+ ///
/// Thrown when the Enum is not a MauiIcons Construct
///
public static ImageSource ToImageSource(this Enum icon, Color? iconColor = null, double iconSize = 30.0, bool iconAutoScaling = false)
{
if (icon.GetDescription() is null)
- throw new MauiIconsExpection("MauiIcons ToImageSourceExtension Only Works on MauiIcons Constructs Not on All the Enum Types");
+ throw new MauiIconsException("MauiIcons ToImageSourceExtension Only Works on MauiIcons Constructs Not on All the Enum Types");
return new FontImageSource()
{
diff --git a/src/MauiIcons.Core/Extensions/MauiIconMarkupExtension.cs b/src/MauiIcons.Core/Extensions/MauiIconMarkupExtension.cs
index 4c7af3b9..944e0d4b 100644
--- a/src/MauiIcons.Core/Extensions/MauiIconMarkupExtension.cs
+++ b/src/MauiIcons.Core/Extensions/MauiIconMarkupExtension.cs
@@ -1,5 +1,4 @@
-using MauiIcons.Core.Helpers;
-using System.Runtime.CompilerServices;
+using System.Runtime.CompilerServices;
namespace MauiIcons.Core;
public static class MauiIconMarkupExtension
@@ -172,6 +171,30 @@ public static TDuration EntranceAnimationDuration(this TDuration bind
}
return bindable;
}
+
+ ///
+ /// Sets the type of onclick animation for the element.
+ ///
+ public static TAnimation OnClickAnimationType(this TAnimation bindable, AnimationType animationType) where TAnimation : BindableObject, IMauiIcon
+ {
+ if (IsMauiIconType(bindable))
+ {
+ bindable.SetValue(MauiIcon.OnClickAnimationTypeProperty, animationType);
+ }
+ return bindable;
+ }
+
+ ///
+ /// Sets the duration of the onclick animation for the element.
+ ///
+ public static TDuration OnClickAnimationDuration(this TDuration bindable, uint duration) where TDuration : BindableObject, IMauiIcon
+ {
+ if (IsMauiIconType(bindable))
+ {
+ bindable.SetValue(MauiIcon.OnClickAnimationDurationProperty, duration);
+ }
+ return bindable;
+ }
///
/// Sets a value for multiple platforms that this should render.
///
@@ -203,6 +226,6 @@ static bool IsMauiIconType(TType bindable) where TType : BindableObject,
DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new(17, 1);
defaultInterpolatedStringHandler.AppendFormatted(typeof(TType));
defaultInterpolatedStringHandler.AppendLiteral(" is not supported");
- throw new MauiIconsExpection(defaultInterpolatedStringHandler.ToStringAndClear());
+ throw new MauiIconsException(defaultInterpolatedStringHandler.ToStringAndClear());
}
}
diff --git a/src/MauiIcons.Core/Extensions/MauiImageMarkupExtension.cs b/src/MauiIcons.Core/Extensions/MauiImageMarkupExtension.cs
index 316ecb99..dd0fd916 100644
--- a/src/MauiIcons.Core/Extensions/MauiImageMarkupExtension.cs
+++ b/src/MauiIcons.Core/Extensions/MauiImageMarkupExtension.cs
@@ -175,7 +175,7 @@ static TType ThrowCustomExpection()
DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new(17, 1);
defaultInterpolatedStringHandler.AppendFormatted(typeof(TType));
defaultInterpolatedStringHandler.AppendLiteral(" is not supported");
- throw new MauiIconsExpection(defaultInterpolatedStringHandler.ToStringAndClear());
+ throw new MauiIconsException(defaultInterpolatedStringHandler.ToStringAndClear());
}
static FontImageSource GetExistingSource(TType bindable) where TType : BindableObject
@@ -186,6 +186,6 @@ static FontImageSource GetExistingSource(TType bindable) where TType : Bi
return (FontImageSource)fontImage.Source;
}
- throw new MauiIconsExpection("This Image Element Does Not Support Maui Icon Extensions.");
+ throw new MauiIconsException("This Image Element Does Not Support Maui Icon Extensions.");
}
}
diff --git a/src/MauiIcons.Core/Extensions/MauiTextMarkupExtension.cs b/src/MauiIcons.Core/Extensions/MauiTextMarkupExtension.cs
index 2ba1b3c3..0854b3cb 100644
--- a/src/MauiIcons.Core/Extensions/MauiTextMarkupExtension.cs
+++ b/src/MauiIcons.Core/Extensions/MauiTextMarkupExtension.cs
@@ -7,7 +7,7 @@ public static class MauiTextMarkupExtension
///
/// Sets the icon.
///
- public static TIcon Icon(this TIcon bindable, Enum icon, bool isPlaceHolder = true) where TIcon : BindableObject, IText
+ public static TIcon Icon(this TIcon bindable, Enum icon, string targetName = "placeholder", bool fontOverride = false) where TIcon : BindableObject, IText
{
if (bindable is ILabel)
{
@@ -27,12 +27,18 @@ public static TIcon Icon(this TIcon bindable, Enum icon, bool isPlaceHold
bindable.SetValue(Span.FontFamilyProperty, icon.GetType().Name);
return bindable;
}
+
+ if (!Options.DefaultFontOverride && !fontOverride)
+ throw new MauiIconsException("the input controls does not natively support icons or image sources. To apply an icon to text or placholder, " +
+ "Set fontOverride Parameter to True or UseMauiIconsCore Builder and Set DefaultFontOverride Globally. This will replace any custom fonts with the default fonts. Please be aware that explicitly setting the FontFamily on the control itself will not render the icon. " +
+ "Additionally, using FontOverride may cause unexpected behavior, such as issues with text rendering.");
+
if (bindable is IEntry)
{
- if (isPlaceHolder)
- bindable.SetValue(Entry.PlaceholderProperty, icon.GetDescription());
- else
+ if (IsPropertyNameIsSet(targetName, "text"))
bindable.SetValue(Entry.TextProperty, icon.GetDescription());
+ else
+ bindable.SetValue(Entry.PlaceholderProperty, icon.GetDescription());
bindable.SetValue(Entry.FontFamilyProperty, icon.GetType().Name);
@@ -40,20 +46,20 @@ public static TIcon Icon(this TIcon bindable, Enum icon, bool isPlaceHold
}
if(bindable is ISearchBar)
{
- if(isPlaceHolder)
- bindable.SetValue(SearchBar.PlaceholderProperty, icon.GetDescription());
- else
+ if(IsPropertyNameIsSet(targetName, "text"))
bindable.SetValue(SearchBar.TextProperty, icon.GetDescription());
+ else
+ bindable.SetValue(SearchBar.PlaceholderProperty, icon.GetDescription());
bindable.SetValue(SearchBar.FontFamilyProperty, icon.GetType().Name);
return bindable;
}
if(bindable is IEditor)
{
- if(isPlaceHolder)
- bindable.SetValue(Editor.PlaceholderProperty, icon.GetDescription());
- else
+ if(IsPropertyNameIsSet(targetName, "text"))
bindable.SetValue(Editor.TextProperty, icon.GetDescription());
+ else
+ bindable.SetValue(Editor.PlaceholderProperty, icon.GetDescription());
bindable.SetValue(Editor.FontFamilyProperty, icon.GetType().Name);
return bindable;
@@ -61,6 +67,9 @@ public static TIcon Icon(this TIcon bindable, Enum icon, bool isPlaceHold
return ThrowCustomExpection();
}
+ static bool IsPropertyNameIsSet(ReadOnlySpan target, ReadOnlySpan propertyName) =>
+ target.Equals(propertyName, StringComparison.OrdinalIgnoreCase);
+
///
/// Sets the size of the icon.
///
@@ -104,7 +113,7 @@ public static TSize IconSize(this TSize bindable, double size, bool isPla
///
/// Sets the color of the icon.
///
- public static TColor IconColor(this TColor bindable, Color color, bool isPlaceHolder = true) where TColor : BindableObject, IText
+ public static TColor IconColor(this TColor bindable, Color color, string targetName = "placeholder") where TColor : BindableObject, IText
{
if (bindable is ILabel)
{
@@ -123,25 +132,29 @@ public static TColor IconColor(this TColor bindable, Color color, bool i
}
if (bindable is IEntry)
{
- if(isPlaceHolder)
- bindable.SetValue(Entry.PlaceholderColorProperty, color);
- else
+ if(IsPropertyNameIsSet(targetName, "text"))
bindable.SetValue(Entry.TextColorProperty, color);
+ else
+ bindable.SetValue(Entry.PlaceholderColorProperty, color);
return bindable;
}
if (bindable is ISearchBar)
{
- if(isPlaceHolder)
- bindable.SetValue(SearchBar.PlaceholderColorProperty, color);
- else
+ if(IsPropertyNameIsSet(targetName, "text"))
bindable.SetValue(SearchBar.TextColorProperty, color);
+ else
+ bindable.SetValue(SearchBar.PlaceholderColorProperty, color);
return bindable;
}
if (bindable is IEditor)
{
- bindable.SetValue(Editor.PlaceholderColorProperty, color);
+ if(IsPropertyNameIsSet(targetName, "text"))
+ bindable.SetValue(Editor.TextColorProperty, color);
+ else
+ bindable.SetValue(Editor.PlaceholderColorProperty, color);
+
return bindable;
}
@@ -151,7 +164,7 @@ public static TColor IconColor(this TColor bindable, Color color, bool i
///
/// Sets the background color of the icon.
///
- public static TColor IconBackgroundColor(this TColor bindable, Color color, bool isPlaceHolder = true) where TColor : BindableObject, IText
+ public static TColor IconBackgroundColor(this TColor bindable, Color color, string targetName = "placeholder") where TColor : BindableObject, IText
{
if (bindable is ILabel)
{
@@ -190,7 +203,7 @@ public static TColor IconBackgroundColor(this TColor bindable, Color col
///
/// Sets a value indicating whether the icon should automatically scale.
///
- public static TBool IconAutoScaling(this TBool bindable, bool value, bool isPlaceHolder = true) where TBool : BindableObject, IText
+ public static TBool IconAutoScaling(this TBool bindable, bool value, string targetName = "placeholder") where TBool : BindableObject, IText
{
if (bindable is ILabel)
{
@@ -229,7 +242,7 @@ public static TBool IconAutoScaling(this TBool bindable, bool value, bool
///
/// Sets a value for multiple platforms that this should render.
///
- public static TPlatform OnPlatforms(this TPlatform bindable, IList platforms, bool isPlaceHolder = true) where TPlatform : BindableObject, IText
+ public static TPlatform OnPlatforms(this TPlatform bindable, IList platforms, string targetName = "placeholder") where TPlatform : BindableObject, IText
{
if (bindable is ILabel && PlatformHelper.IsValidPlatform(platforms))
return bindable;
@@ -322,7 +335,7 @@ public static TPlatform OnPlatforms(this TPlatform bindable, IList
/// Sets a value for multiple Idioms that this should render.
///
- public static TIdiom OnIdioms(this TIdiom bindable, IList idioms, bool isPlaceHolder = true) where TIdiom : BindableObject, IText
+ public static TIdiom OnIdioms(this TIdiom bindable, IList idioms, string targetName = "placeholder") where TIdiom : BindableObject, IText
{
if (bindable is ILabel && PlatformHelper.IsValidIdiom(idioms))
return bindable;
@@ -416,6 +429,6 @@ static TType ThrowCustomExpection()
DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new(17, 1);
defaultInterpolatedStringHandler.AppendFormatted(typeof(TType));
defaultInterpolatedStringHandler.AppendLiteral(" is not supported");
- throw new MauiIconsExpection(defaultInterpolatedStringHandler.ToStringAndClear());
+ throw new MauiIconsException(defaultInterpolatedStringHandler.ToStringAndClear());
}
}
diff --git a/src/MauiIcons.Core/Helpers/AnimationHelper.cs b/src/MauiIcons.Core/Helpers/AnimationHelper.cs
new file mode 100644
index 00000000..f18f6bed
--- /dev/null
+++ b/src/MauiIcons.Core/Helpers/AnimationHelper.cs
@@ -0,0 +1,34 @@
+namespace MauiIcons.Core.Helpers;
+internal static class AnimationHelper
+{
+ internal static async Task AnimateIconAsync(AnimationType type, View view, uint duration)
+ {
+ switch (type)
+ {
+ case AnimationType.None:
+ return;
+ case AnimationType.Wiggle:
+ uint maxDuration = Math.Max(duration, 200);
+ int noOfTimes = (int)(maxDuration / 200);
+ for (int i = 0; i < noOfTimes; i++)
+ {
+ await view.RotateTo(15, 200, Easing.Linear);
+ await view.RotateTo(-15, 200, Easing.Linear);
+ }
+ await view.RotateTo(0, 200, Easing.Linear);
+ return;
+ case AnimationType.Fade:
+ view.Opacity = 0;
+ await view.FadeTo(1, duration);
+ return;
+ case AnimationType.Scale:
+ await view.ScaleTo(1.5, duration);
+ await view.ScaleTo(1, duration);
+ return;
+ case AnimationType.Rotate:
+ await view.RotateTo(360, duration);
+ view.Rotation = 0;
+ return;
+ }
+ }
+}
diff --git a/src/MauiIcons.Core/Helpers/EnumHelper.cs b/src/MauiIcons.Core/Helpers/EnumHelper.cs
index 91d94cb9..29f3a412 100644
--- a/src/MauiIcons.Core/Helpers/EnumHelper.cs
+++ b/src/MauiIcons.Core/Helpers/EnumHelper.cs
@@ -33,13 +33,28 @@ public static string GetDescription(this Enum? value)
}
return default;
}
+
+ public static Enum? GetEnumByDescription(this string? description, Type type)
+ {
+ if (description is null) return default;
+ if(!type.IsEnum) throw new NotSupportedException("Type must be an Enum");
+
+ foreach (Enum enumItem in Enum.GetValues(type))
+ {
+ if (enumItem.GetDescription() == description)
+ {
+ return enumItem;
+ }
+ }
+ return default;
+ }
public static string GetFontFamily(this TEnum? value) where TEnum : struct
{
if(value is null) return string.Empty;
return value.GetType().Name;
}
- public static string GetFontFamily(this TEnum? value) where TEnum : Enum
+ public static string GetFontFamily(this TEnum value) where TEnum : Enum?
{
if (value is null) return string.Empty;
return value.GetType().Name;
diff --git a/src/MauiIcons.Core/Helpers/PlatformHelper.cs b/src/MauiIcons.Core/Helpers/PlatformHelper.cs
index 60804416..173f3629 100644
--- a/src/MauiIcons.Core/Helpers/PlatformHelper.cs
+++ b/src/MauiIcons.Core/Helpers/PlatformHelper.cs
@@ -1,29 +1,28 @@
-namespace MauiIcons.Core.Helpers;
+using System.Runtime.InteropServices;
+
+namespace MauiIcons.Core.Helpers;
internal static class PlatformHelper
{
+ private static readonly string _currentPlatform = DeviceInfo.Platform.ToString();
+ private static readonly string _currentIdiom = DeviceInfo.Idiom.ToString();
public static bool IsValidPlatform(IList platforms)
{
- if (platforms is null) return true;
-
- string targetPlatform = DeviceInfo.Platform.ToString();
+ if (platforms is null || platforms.Count is 0) return true;
- foreach (var value in platforms)
+ foreach (var value in CollectionsMarshal.AsSpan((List)platforms))
{
- if (value.Contains(targetPlatform))
+ if (value.Contains(_currentPlatform, StringComparison.OrdinalIgnoreCase))
return true;
}
return false;
- }
-
+ }
public static bool IsValidIdiom(IList idioms)
{
- if(idioms is null) return true;
-
- string targetIdiom = DeviceInfo.Idiom.ToString();
+ if (idioms is null || idioms.Count is 0) return true;
- foreach (var value in idioms)
+ foreach (var value in CollectionsMarshal.AsSpan((List)idioms))
{
- if (value.Contains(targetIdiom))
+ if (value.Contains(_currentIdiom, StringComparison.OrdinalIgnoreCase))
return true;
}
return false;
@@ -31,47 +30,46 @@ public static bool IsValidIdiom(IList idioms)
public static bool IsValidPlatformsAndIdioms(IList onPlatforms, IList onIdioms)
{
- if(onPlatforms is null && onIdioms is null) return true;
-
bool isPlatformsPresent = onPlatforms is not null && onPlatforms.Count > 0;
bool isIdiomsPresent = onIdioms is not null && onIdioms.Count > 0;
- bool isPlatformAndIdiomDefault = !isPlatformsPresent && !isIdiomsPresent;
+ if(!isPlatformsPresent && !isIdiomsPresent)
+ return true;
+
bool isPlatformsAndIdioms = isPlatformsPresent && isIdiomsPresent && IsValidPlatformAndIdiom(onPlatforms!, onIdioms!);
bool isPlatformsOnly = isPlatformsPresent && !isIdiomsPresent && IsValidPlatform(onPlatforms!);
bool isIdiomsOnly = isIdiomsPresent && !isPlatformsPresent && IsValidIdiom(onIdioms!);
-
- return isPlatformAndIdiomDefault
- || isPlatformsAndIdioms
- || isPlatformsOnly
- || isIdiomsOnly;
- }
- private static bool IsValidPlatformAndIdiom(IList platforms, IList idioms)
- {
- int indexMin = Math.Min(platforms.Count, idioms.Count);
- int indexMax = Math.Max(platforms.Count, idioms.Count);
+ static bool IsValidPlatformAndIdiom(IList platforms, IList idioms)
+ {
+ var platformSpan = CollectionsMarshal.AsSpan((List)platforms);
+ var idiomSpan = CollectionsMarshal.AsSpan((List)idioms);
- bool onPlatform = false;
- bool onIdiom = false;
+ int indexMin = Math.Min(platformSpan.Length, idiomSpan.Length);
+ int indexMax = Math.Max(platformSpan.Length, idiomSpan.Length);
- string targetPlatform = DeviceInfo.Platform.ToString();
- string targetIdiom = DeviceInfo.Idiom.ToString();
+ bool onPlatform = false;
+ bool onIdiom = false;
- for (int i = 0; i < indexMax; i++)
- {
- if (i < indexMin && platforms[i].Contains(targetPlatform) && idioms[i].Contains(targetIdiom))
- return true;
+ for (int i = 0; i < indexMax; i++)
+ {
+ if (i < indexMin && platformSpan[i].Contains(_currentPlatform, StringComparison.OrdinalIgnoreCase) && idiomSpan[i].Contains(_currentIdiom, StringComparison.OrdinalIgnoreCase))
+ return true;
- if (i < platforms.Count && platforms[i].Contains(targetPlatform))
- onPlatform = true;
+ if (i < platforms.Count && platformSpan[i].Contains(_currentPlatform, StringComparison.OrdinalIgnoreCase))
+ onPlatform = true;
- if (i < idioms.Count && idioms[i].Contains(targetIdiom))
- onIdiom = true;
+ if (i < idioms.Count && idiomSpan[i].Contains(_currentIdiom, StringComparison.OrdinalIgnoreCase))
+ onIdiom = true;
- if (onPlatform && onIdiom)
- break;
+ if (onPlatform && onIdiom)
+ break;
+ }
+ return onPlatform && onIdiom;
}
- return onPlatform && onIdiom;
+
+ return isPlatformsAndIdioms
+ || isPlatformsOnly
+ || isIdiomsOnly;
}
}
diff --git a/src/MauiIcons.Core/Options.cs b/src/MauiIcons.Core/Options.cs
new file mode 100644
index 00000000..1f6340a3
--- /dev/null
+++ b/src/MauiIcons.Core/Options.cs
@@ -0,0 +1,37 @@
+namespace MauiIcons.Core;
+
+#pragma warning disable CA1822 // Mark members as static
+public class Options
+{
+ internal static bool DefaultFontOverride { get; private set; }
+ internal static double DefaultIconSize { get; private set; } = 0;
+
+ internal static bool? DefaultIconAutoScaling { get; private set; }
+
+ ///
+ /// This property determines whether exceptions are suppressed when the overriding font is not set on a specific control that uses MauiIcons.
+ ///
+ ///
+ /// The default value is false.
+ ///
+ public void SetDefaultFontOverride(bool value) => DefaultFontOverride = value;
+
+
+ ///
+ /// This property determines the default size of the icon.
+ ///
+ ///
+
+ public void SetDefaultIconSize(double value) => DefaultIconSize = value;
+
+
+ ///
+ /// This property determines whether the icon auto-scaling is enabled by default.
+ ///
+ ///
+ public void SetDefaultIconAutoScaling(bool value) => DefaultIconAutoScaling = value;
+
+
+
+}
+#pragma warning restore CA1822 // Mark members as static
diff --git a/src/MauiIcons.Core/ReleaseNotes.txt b/src/MauiIcons.Core/ReleaseNotes.txt
index d6c8c6e8..d21fd39b 100644
--- a/src/MauiIcons.Core/ReleaseNotes.txt
+++ b/src/MauiIcons.Core/ReleaseNotes.txt
@@ -1,4 +1,13 @@
-v3.0.0
+v4.0.0
+• Various Enhancements and Fixes for MauiIcon Control
+• New Attached Property for Seamless Icon Integration
+• Styles and Triggers Support
+• New OnClick Animation Support for MauiIcon Control
+• Enhanced Global Customization Support using New `UseMauiIconsCore` Extension
+• Overall Fixes and Enhancements
+• Breaking Changes: [https://github.com/AathifMahir/MauiIcons/#breaking-changes]
+
+v3.0.0
• Critical Fixes for Xaml Markup Binding Support
• Breaking Changes: Removal of Dotnet 7 Support
• Breaking Changes: Removal of Maui OnPlatform and OnIdioms Support Instead Use MauiIcons Integrated Custom OnPlatforms and OnIdioms Feature
diff --git a/src/MauiIcons.Cupertino/ReadMe.txt b/src/MauiIcons.Cupertino/ReadMe.txt
index 1b8f71e6..70ee1238 100644
--- a/src/MauiIcons.Cupertino/ReadMe.txt
+++ b/src/MauiIcons.Cupertino/ReadMe.txt
@@ -38,9 +38,9 @@ new MauiIcon().Icon(CupertinoIcons.AntFill).IconColor(Colors.Purple);
Xaml Extension Usage:
-
+
-
+
----------------------------------------------------------------------------------------------
@@ -50,9 +50,7 @@ new ImageButton().Icon(CupertinoIcons.AntFill),
new Image().Icon(CupertinoIcons.AntFill),
-new Label().Icon(CupertinoIcons.AntFill).IconSize(40.0).IconColor(Colors.Red),
-
-new Entry().Icon(CupertinoIcons.AntFill).IconSize(20.0).IconColor(Colors.Aqua),
+new Button().Icon(CupertinoIcons.AntFill).IconSize(40.0).IconColor(Colors.Red),
Disclaimer: It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release:
diff --git a/src/MauiIcons.Cupertino/ReleaseNotes.txt b/src/MauiIcons.Cupertino/ReleaseNotes.txt
index cfece77a..b0bbcd21 100644
--- a/src/MauiIcons.Cupertino/ReleaseNotes.txt
+++ b/src/MauiIcons.Cupertino/ReleaseNotes.txt
@@ -1,4 +1,13 @@
-v3.0.0
+v4.0.0
+• Various Enhancements and Fixes for MauiIcon Control
+• New Attached Property for Seamless Icon Integration
+• Styles and Triggers Support
+• New OnClick Animation Support for MauiIcon Control
+• Enhanced Global Customization Support using New `UseMauiIconsCore` Extension
+• Overall Fixes and Enhancements
+• Breaking Changes: [https://github.com/AathifMahir/MauiIcons/#breaking-changes]
+
+v3.0.0
• Critical Fixes for Xaml Markup Binding Support
• Breaking Changes: Removal of Dotnet 7 Support
• Breaking Changes: Removal of Maui OnPlatform and OnIdioms Support Instead Use MauiIcons Integrated Custom OnPlatforms and OnIdioms Feature
diff --git a/src/MauiIcons.Cupertino/readme.md b/src/MauiIcons.Cupertino/readme.md
index 8d391054..8d8c245c 100644
--- a/src/MauiIcons.Cupertino/readme.md
+++ b/src/MauiIcons.Cupertino/readme.md
@@ -21,6 +21,25 @@ public static class MauiProgram
}
```
+# Table of Contents
+
+- [Usage](#usage)
+- [Advanced Settings](#advanced-settings)
+- [New Changes in v4](#new-changes-in-v4)
+- [Workaround (Must Read)](#workaround)
+- [Built in Control Usage](#built-in-control-usage)
+- [Xaml Extension Usage](#xaml-extension-usage)
+- [C# Markup Usage](#c-markup-usage)
+- [Applying Icon To Text or Placeholder](#applying-icon-to-text-or-placeholder)
+- [OnPlatform and OnIdiom Usage](#onplatform-and-onidiom-usage)
+- [Breaking Changes](#breaking-changes)
+ - [Version 3 to 4](#version-3-to-4)
+ - [Version 2 to 3](#version-2-to-3)
+ - [Version 1 to 2](#version-1-to-2)
+- [Advanced Usage](#advanced-usage)
+- [License](#license)
+- [Contribute](#contribute)
+
# Usage
@@ -37,6 +56,19 @@ xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
using MauiIcons.Cupertino;
```
+# Advanced Settings
+
+You can set the default icon size, font override, and default font auto-scaling using the `UseMauiIconsCore` builder extension as follows:
+
+```csharp
+builder.UseMauiIconsCore(x =>
+{
+ x.SetDefaultIconSize(30.0);
+ x.SetDefaultFontOverride(true);
+ x.SetDefaultFontAutoScaling(true);
+})
+```
+
## Workaround
if you came across this issue dotnet/maui#7503 when using new namespace, Make sure to create an discarded instance of MauiIcon in the codebehind like below
@@ -52,31 +84,6 @@ if you came across this issue dotnet/maui#7503 when using new namespace, Make su
```
-## Breaking Changes
-
-### Version 1 to 2
-
-`Old (v1)`
-
-```xml
-xmlns:cupertino="clr-namespace:MauiIcons.Cupertino;assembly=MauiIcons.Cupertino"
-
-
-```
-
-`New (v2)`
-
-```xml
-xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
-
-
-```
-
-### Version 2 to 3
-
- - Removal of **TypeArgument** and Built in OnPlatform and OnIdiom Support, Use MauiIcons Integrated [Custom OnPlatform and OnIdioms Feature](#custom-onplatform-and-onidiom-usage)
- - Removal of **Dotnet 7** Support
-
## Built in Control Usage
`Xaml`
@@ -95,35 +102,11 @@ All the Properties and Features of Built in Control, **[Check Here](https://gith
## Xaml Extension Usage
```xml
-
-
-
-```
+
-## Xaml Extension Data Binding Usage
+
-The below example, Make Sures that BindingContext Inside the Xaml Extension is Set to Root of this Page, Likewise make sure to set the BindingContext When using Binding Inside the MauiIcons Xaml Extension, Additionally This example Binds to MyIcon and MyColor Properties Which Present in Code Behind But Not Included in this Example.
-```xml
-
-
-
-
-
-
-
-
-
-
-
-
+
```
## C# Markup Usage
@@ -133,26 +116,32 @@ new ImageButton().Icon(CupertinoIcons.AntFill),
new Image().Icon(CupertinoIcons.AntFill),
-new Label().Icon(CupertinoIcons.AntFill).IconSize(40.0).IconColor(Colors.Red),
-
-new Entry().Icon(CupertinoIcons.AntFill).IconSize(20.0).IconColor(Colors.Aqua),
+new Button().Icon(CupertinoIcons.AntFill).IconSize(40.0).IconColor(Colors.Red)
```
**Disclaimer:** It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release: **Label**, **Image**, **ImageButton**, **SearchBar**, **Editor**, and **Entry**. Additionally, the native **MauiIcon** control, when combined with C# markup, can prove to be quite versatile and offer extra features for various scenarios.
## Applying Icon To Text or Placeholder
Controls that Supports Placeholder, Can Assign the Icon To PlaceHolder or Text,
-Defaults to Placeholder but can be set to Text by Setting isPlaceHolder Parameter to False
+Defaults to Placeholder but can be set to Text by Setting TargetName Parameter to `Text`
+`xaml`
+```xml
+
+
+
+```
+
+`c#`
```csharp
-new Entry().Icon(CupertinoIcons.AntFill, isPlaceHolder: false).IconSize(20.0).IconColor(Colors.Aqua);
+new Entry().Icon(CupertinoIcons.AntFill, targetName: "Text");
-new SearchBar().Icon(MaterialIcons.ABC, isPlaceHolder: false);
+new SearchBar().Icon(CupertinoIcons.Airplane, targetName: "Placeholder");
```
-**Disclaimer:** It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release: **Label**, **Image**, **ImageButton**, **SearchBar**, **Editor**, and **Entry**. Additionally, the native **MauiIcon** control, when combined with C# markup, can prove to be quite versatile and offer extra features for various scenarios.
+**Disclaimer:** It's important to note that we are Overriding Font on Input Control to Set the Icon that Could Cause Unexpected Behaviors and Rendering Issues as well.
-## Custom OnPlatform and OnIdiom Usage
+## OnPlatform and OnIdiom Usage
`Xaml`
```xml
@@ -168,6 +157,90 @@ new MauiIcon().Icon(CupertinoIcons.Airplane).OnIdioms(new List{"Desktop"
new MauiIcon().Icon(CupertinoIcons.AntFill).OnPlatforms(new List{"WinUI", "Android"}).OnIdioms(new List{"Desktop", "Phone"});
```
+## Breaking Changes
+
+### Version 3 to 4
+
+ - Icon won't be applied to the Controls like Entry, SearchBar and etc.. by default Instead v4 would throw an Exception, Need to set **FontOverride** to true to apply the Icon to these Controls on Builder Extension Level or Control Level
+ - This Behavior can be reverted to Behavior of v3 by Using new `UseMauiIconsCore` Builder Extension and using `SetDefaultFontOverride` Method like Below
+
+```csharp
+ builder.UseMauiIconsCore(x =>
+ {
+ x.SetDefaultFontOverride(true);
+ })
+```
+
+ - Icon Size is Now Set to Control's FontSize by Default, Previously it was set to **30.0** by Default
+ - This Behavior can be reverted to Behavior of v3 by Using new `UseMauiIconsCore` Builder Extension and using `SetDefaultIconSize` Method like Below
+```csharp
+ builder.UseMauiIconsCore(x =>
+ {
+ x.SetDefaultIconSize(30.0);
+ })
+```
+---
+
+
+### Version 2 to 3
+
+ - Removal of **TypeArgument** and Built in OnPlatform and OnIdiom Support, Use MauiIcons Integrated [Custom OnPlatform and OnIdioms Feature](#custom-onplatform-and-onidiom-usage)
+ - Removal of **Dotnet 7** Support
+
+---
+
+### Version 1 to 2
+
+`Old (v1)`
+
+```xml
+xmlns:cupertino="clr-namespace:MauiIcons.Cupertino;assembly=MauiIcons.Cupertino"
+
+
+```
+
+`New (v2)`
+
+```xml
+xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
+
+
+```
+
+## New Changes in v4
+
+ 1. We have a new way of Assigning/Setting Icons, Introducing New Attached Property for Icons,
+ The new **AttachedProperty** Brings in Support for **Triggers**, **Behaviors**, **Styles**, etc.. which is lacking on Classic Xaml Markup Extension, and also it's more cleaner and readable
+```xml
+/// Old
+
+
+// New
+
+```
+
+**Disclaimer**: The Old Xaml Markup Extension is still Supported and can be used, but it's recommended to use the new Attached Property for better support and readability and we have plans to deprecate the old Xaml Markup Extension in the future in favor of Attached Property
+
+### Example of Using Styles
+```xml
+
+
+
+```
+
+ 2. Introducing New `UseMauiIconsCore` Builder Extension for Setting Default Icon Size, Font Override, Default Font Auto Scaling and etc..
+ 3. Improved Built in OnPlatforms and OnIdioms with Binding Improvements and Enhanced Performance
+ 4. New [`OnClickAnimation`](https://github.com/AathifMahir/MauiIcons/#animation-usage) Support for MauiIcon Control
+
+
+
+## Advanced Usage
+
+The **.Net Maui Icons** library offers a wide range of features and capabilities, including the ability to customize how icons applied and which property it is applied too and etc. For more information on advanced usage, please refer to the [**Advanced Usage**](https://github.com/AathifMahir/MauiIcons/#advanced-usage)
+
+
# License
**MauiIcons.Cupertino**
@@ -176,3 +249,6 @@ The MauiIcons.Cupertino library is distributed under the [MIT License](https://g
**Cupertino Icons**
The Cupertino Icons library is distributed under the [MIT License](https://github.com/framework7io/framework7-icons/blob/master/LICENSE).
+# Contribute
+
+If you wish to contribute to this project, please don't hesitate to create an [issue or request](https://github.com/AathifMahir/MauiIcons/issues). Your input and feedback are highly appreciated. Additionally, if you're interested in supporting the project by providing resources or [**becoming a sponsor**](https://github.com/sponsors/AathifMahir), your contributions would be welcomed and instrumental in its continued development and success. Thank you for your interest in contributing to this endeavor.
diff --git a/src/MauiIcons.Fluent.Filled/ReadMe.txt b/src/MauiIcons.Fluent.Filled/ReadMe.txt
index f6af139e..ce716f11 100644
--- a/src/MauiIcons.Fluent.Filled/ReadMe.txt
+++ b/src/MauiIcons.Fluent.Filled/ReadMe.txt
@@ -38,9 +38,9 @@ new MauiIcon().Icon(FluentFilledIcons.AppFolder48Filled).IconColor(Colors.Purple
Xaml Extension Usage:
-
+
-
+
----------------------------------------------------------------------------------------------
@@ -50,9 +50,7 @@ new ImageButton().Icon(FluentFilledIcons.Airplane20Filled),
new Image().Icon(FluentFilledIcons.AppFolder48Filled),
-new Label().Icon(FluentFilledIcons.Airplane20Filled).IconSize(40.0).IconColor(Colors.Red),
-
-new Entry().Icon(FluentFilledIcons.AppFolder48Filled).IconSize(20.0).IconColor(Colors.Aqua),
+new ImageButton().Icon(FluentFilledIcons.Airplane20Filled).IconSize(40.0).IconColor(Colors.Red),
Disclaimer: It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release:
diff --git a/src/MauiIcons.Fluent.Filled/ReleaseNotes.txt b/src/MauiIcons.Fluent.Filled/ReleaseNotes.txt
index 38f30c41..6b49bbb2 100644
--- a/src/MauiIcons.Fluent.Filled/ReleaseNotes.txt
+++ b/src/MauiIcons.Fluent.Filled/ReleaseNotes.txt
@@ -1,4 +1,13 @@
-v3.0.0
+v4.0.0
+• Various Enhancements and Fixes for MauiIcon Control
+• New Attached Property for Seamless Icon Integration
+• Styles and Triggers Support
+• New OnClick Animation Support for MauiIcon Control
+• Enhanced Global Customization Support using New `UseMauiIconsCore` Extension
+• Overall Fixes and Enhancements
+• Breaking Changes: [https://github.com/AathifMahir/MauiIcons/#breaking-changes]
+
+v3.0.0
• Critical Fixes for Xaml Markup Binding Support
• Breaking Changes: Removal of Dotnet 7 Support
• Breaking Changes: Removal of Maui OnPlatform and OnIdioms Support Instead Use MauiIcons Integrated Custom OnPlatforms and OnIdioms Feature
diff --git a/src/MauiIcons.Fluent.Filled/readme.md b/src/MauiIcons.Fluent.Filled/readme.md
index 3f8cfcf0..6e6897f2 100644
--- a/src/MauiIcons.Fluent.Filled/readme.md
+++ b/src/MauiIcons.Fluent.Filled/readme.md
@@ -21,6 +21,26 @@ public static class MauiProgram
}
```
+
+# Table of Contents
+
+- [Usage](#usage)
+- [Advanced Settings](#advanced-settings)
+- [New Changes in v4](#new-changes-in-v4)
+- [Workaround (Must Read)](#workaround)
+- [Built in Control Usage](#built-in-control-usage)
+- [Xaml Extension Usage](#xaml-extension-usage)
+- [C# Markup Usage](#c-markup-usage)
+- [Applying Icon To Text or Placeholder](#applying-icon-to-text-or-placeholder)
+- [OnPlatform and OnIdiom Usage](#onplatform-and-onidiom-usage)
+- [Breaking Changes](#breaking-changes)
+ - [Version 3 to 4](#version-3-to-4)
+ - [Version 2 to 3](#version-2-to-3)
+ - [Version 1 to 2](#version-1-to-2)
+- [Advanced Usage](#advanced-usage)
+- [License](#license)
+- [Contribute](#contribute)
+
# Usage
@@ -37,6 +57,19 @@ xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
using MauiIcons.Fluent.Filled;
```
+# Advanced Settings
+
+You can set the default icon size, font override, and default font auto-scaling using the `UseMauiIconsCore` builder extension as follows:
+
+```csharp
+builder.UseMauiIconsCore(x =>
+{
+ x.SetDefaultIconSize(30.0);
+ x.SetDefaultFontOverride(true);
+ x.SetDefaultFontAutoScaling(true);
+})
+```
+
## Workaround
if you came across this issue dotnet/maui#7503 when using new namespace, Make sure to create an discarded instance of MauiIcon in the codebehind like below
@@ -52,35 +85,6 @@ if you came across this issue dotnet/maui#7503 when using new namespace, Make su
```
-## Breaking Changes
-
-### Version 1 to 2
-
-`Old (v1)`
-
-```xml
-xmlns:fluentFilled="clr-namespace:MauiIcons.Fluent.Filled;assembly=MauiIcons.Fluent.Filled"
-
-
-```
-
-`New (v2)`
-
-```xml
-xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
-
-
-```
-
-### Version 2 to 3
-
- - Removal of **TypeArgument** and Built in OnPlatform and OnIdiom Support, Use MauiIcons Integrated [Custom OnPlatform and OnIdioms Feature](#custom-onplatform-and-onidiom-usage)
- - Removal of **Dotnet 7** Support
-
-### Nuget Package Changes
-
-- **`AathifMahir.Maui.MauiIcons.FluentFilled`** is Depcrecated and Replaced by [`AathifMahir.Maui.MauiIcons.Fluent.Filled`](https://www.nuget.org/packages/AathifMahir.Maui.MauiIcons.Fluent.Filled/)
-
## Built in Control Usage
`Xaml`
@@ -99,35 +103,11 @@ All the Properties and Features of Built in Control, **[Check Here](https://gith
## Xaml Extension Usage
```xml
-
-
-
-```
+
-## Xaml Extension Data Binding Usage
+
-The below example, Make Sures that BindingContext Inside the Xaml Extension is Set to Root of this Page, Likewise make sure to set the BindingContext When using Binding Inside the MauiIcons Xaml Extension, Additionally This example Binds to MyIcon and MyColor Properties Which Present in Code Behind But Not Included in this Example.
-```xml
-
-
-
-
-
-
-
-
-
-
-
-
+
```
## C# Markup Usage
@@ -137,17 +117,23 @@ new ImageButton().Icon(FluentFilledIcons.AppFolder48Filled),
new Image().Icon(FluentFilledIcons.Accessibility48Filled),
-new Label().Icon(FluentFilledIcons.AppFolder48Filled).IconSize(40.0).IconColor(Colors.Red),
-
-new Entry().Icon(FluentFilledIcons.Accessibility48Filled).IconSize(20.0).IconColor(Colors.Aqua),
+new Button().Icon(FluentFilledIcons.AppFolder48Filled).IconSize(40.0).IconColor(Colors.Red)
```
**Disclaimer:** It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release: **Label**, **Image**, **ImageButton**, **SearchBar**, **Editor**, and **Entry**. Additionally, the native **MauiIcon** control, when combined with C# markup, can prove to be quite versatile and offer extra features for various scenarios.
## Applying Icon To Text or Placeholder
Controls that Supports Placeholder, Can Assign the Icon To PlaceHolder or Text,
-Defaults to Placeholder but can be set to Text by Setting isPlaceHolder Parameter to False
+Defaults to Placeholder but can be set to Text by Setting TargetName Parameter to `Text`
+
+`xaml`
+```xml
+
+
+
+```
+`c#`
```csharp
new Entry().Icon(FluentFilledIcons.Accessibility48Filled, isPlaceHolder: false).IconSize(20.0).IconColor(Colors.Aqua);
@@ -156,7 +142,7 @@ new SearchBar().Icon(FluentFilledIcons.AppFolder48Filled, isPlaceHolder: false);
**Disclaimer:** It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release: **Label**, **Image**, **ImageButton**, **SearchBar**, **Editor**, and **Entry**. Additionally, the native **MauiIcon** control, when combined with C# markup, can prove to be quite versatile and offer extra features for various scenarios.
-## Custom OnPlatform and OnIdiom Usage
+## OnPlatform and OnIdiom Usage
`Xaml`
```xml
@@ -172,6 +158,93 @@ new MauiIcon().Icon(FluentFilledIcons.Accessibility48Filled).OnIdioms(new List{"WinUI", "Android"}).OnIdioms(new List{"Desktop", "Phone"});
```
+## Breaking Changes
+
+### Version 3 to 4
+
+ - Icon won't be applied to the Controls like Entry, SearchBar and etc.. by default Instead v4 would throw an Exception, Need to set **FontOverride** to true to apply the Icon to these Controls on Builder Extension Level or Control Level
+ - This Behavior can be reverted to Behavior of v3 by Using new `UseMauiIconsCore` Builder Extension and using `SetDefaultFontOverride` Method like Below
+
+```csharp
+ builder.UseMauiIconsCore(x =>
+ {
+ x.SetDefaultFontOverride(true);
+ })
+```
+
+ - Icon Size is Now Set to Control's FontSize by Default, Previously it was set to **30.0** by Default
+ - This Behavior can be reverted to Behavior of v3 by Using new `UseMauiIconsCore` Builder Extension and using `SetDefaultIconSize` Method like Below
+```csharp
+ builder.UseMauiIconsCore(x =>
+ {
+ x.SetDefaultIconSize(30.0);
+ })
+```
+---
+
+### Version 2 to 3
+
+ - Removal of **TypeArgument** and Built in OnPlatform and OnIdiom Support, Use MauiIcons Integrated [Custom OnPlatform and OnIdioms Feature](#custom-onplatform-and-onidiom-usage)
+ - Removal of **Dotnet 7** Support
+
+#### Nuget Package Changes
+
+- **`AathifMahir.Maui.MauiIcons.FluentFilled`** is Depcrecated and Replaced by [`AathifMahir.Maui.MauiIcons.Fluent.Filled`](https://www.nuget.org/packages/AathifMahir.Maui.MauiIcons.Fluent.Filled/)
+
+---
+
+### Version 1 to 2
+
+`Old (v1)`
+
+```xml
+xmlns:fluentFilled="clr-namespace:MauiIcons.Fluent.Filled;assembly=MauiIcons.Fluent.Filled"
+
+
+```
+
+`New (v2)`
+
+```xml
+xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
+
+
+```
+
+## New Changes in v4
+
+ 1. We have a new way of Assigning/Setting Icons, Introducing New Attached Property for Icons,
+ The new **AttachedProperty** Brings in Support for **Triggers**, **Behaviors**, **Styles**, etc.. which is lacking on Classic Xaml Markup Extension, and also it's more cleaner and readable
+```xml
+/// Old
+
+
+// New
+
+```
+
+**Disclaimer**: The Old Xaml Markup Extension is still Supported and can be used, but it's recommended to use the new Attached Property for better support and readability and we have plans to deprecate the old Xaml Markup Extension in the future in favor of Attached Property
+
+### Example of Using Styles
+```xml
+
+
+
+```
+
+ 2. Introducing New `UseMauiIconsCore` Builder Extension for Setting Default Icon Size, Font Override, Default Font Auto Scaling and etc..
+ 3. Improved Built in OnPlatforms and OnIdioms with Binding Improvements and Enhanced Performance
+ 4. New [`OnClickAnimation`](https://github.com/AathifMahir/MauiIcons/#animation-usage) Support for MauiIcon Control
+
+
+## Advanced Usage
+
+The **.Net Maui Icons** library offers a wide range of features and capabilities, including the ability to customize how icons applied and which property it is applied too and etc. For more information on advanced usage, please refer to the [**Advanced Usage**](https://github.com/AathifMahir/MauiIcons/#advanced-usage)
+
+
+
# License
**MauiIcons.Fluent.Filled**
@@ -180,4 +253,7 @@ MauiIcons.Fluent.Filled is Licensed Under [MIT License](https://github.com/Aathi
**Fluent UI System Icons**
Fluent UI System Icons is Licensed Under [MIT License](https://github.com/microsoft/fluentui-system-icons/blob/main/LICENSE).
+# Contribute
+
+If you wish to contribute to this project, please don't hesitate to create an [issue or request](https://github.com/AathifMahir/MauiIcons/issues). Your input and feedback are highly appreciated. Additionally, if you're interested in supporting the project by providing resources or [**becoming a sponsor**](https://github.com/sponsors/AathifMahir), your contributions would be welcomed and instrumental in its continued development and success. Thank you for your interest in contributing to this endeavor.
diff --git a/src/MauiIcons.Fluent/ReadMe.txt b/src/MauiIcons.Fluent/ReadMe.txt
index e8b3c4b5..271814e2 100644
--- a/src/MauiIcons.Fluent/ReadMe.txt
+++ b/src/MauiIcons.Fluent/ReadMe.txt
@@ -38,9 +38,11 @@ new MauiIcon().Icon(FluentIcons.AppFolder48).IconColor(Colors.Purple);
Xaml Extension Usage:
-
+
-
+
+
+
----------------------------------------------------------------------------------------------
@@ -50,9 +52,7 @@ new ImageButton().Icon(FluentIcons.Airplane20),
new Image().Icon(FluentIcons.AppFolder48),
-new Label().Icon(FluentIcons.Airplane20).IconSize(40.0).IconColor(Colors.Red),
-
-new Entry().Icon(FluentIcons.AppFolder48).IconSize(20.0).IconColor(Colors.Aqua),
+new Button().Icon(FluentIcons.Airplane20).IconSize(40.0).IconColor(Colors.Red),
Disclaimer: It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release:
diff --git a/src/MauiIcons.Fluent/ReleaseNotes.txt b/src/MauiIcons.Fluent/ReleaseNotes.txt
index 379f04e1..54d45f99 100644
--- a/src/MauiIcons.Fluent/ReleaseNotes.txt
+++ b/src/MauiIcons.Fluent/ReleaseNotes.txt
@@ -1,4 +1,13 @@
-v3.0.0
+v4.0.0
+• Various Enhancements and Fixes for MauiIcon Control
+• New Attached Property for Seamless Icon Integration
+• Styles and Triggers Support
+• New OnClick Animation Support for MauiIcon Control
+• Enhanced Global Customization Support using New `UseMauiIconsCore` Extension
+• Overall Fixes and Enhancements
+• Breaking Changes: [https://github.com/AathifMahir/MauiIcons/#breaking-changes]
+
+v3.0.0
• Critical Fixes for Xaml Markup Binding Support
• Breaking Changes: Removal of Dotnet 7 Support
• Breaking Changes: Removal of Maui OnPlatform and OnIdioms Support Instead Use MauiIcons Integrated Custom OnPlatforms and OnIdioms Feature
diff --git a/src/MauiIcons.Fluent/readme.md b/src/MauiIcons.Fluent/readme.md
index 3288a768..4dd311dc 100644
--- a/src/MauiIcons.Fluent/readme.md
+++ b/src/MauiIcons.Fluent/readme.md
@@ -21,6 +21,26 @@ public static class MauiProgram
}
```
+# Table of Contents
+
+- [Usage](#usage)
+- [Advanced Settings](#advanced-settings)
+- [New Changes in v4](#new-changes-in-v4)
+- [Workaround (Must Read)](#workaround)
+- [Built in Control Usage](#built-in-control-usage)
+- [Xaml Extension Usage](#xaml-extension-usage)
+- [C# Markup Usage](#c-markup-usage)
+- [Applying Icon To Text or Placeholder](#applying-icon-to-text-or-placeholder)
+- [OnPlatform and OnIdiom Usage](#onplatform-and-onidiom-usage)
+- [Breaking Changes](#breaking-changes)
+ - [Version 3 to 4](#version-3-to-4)
+ - [Version 2 to 3](#version-2-to-3)
+ - [Version 1 to 2](#version-1-to-2)
+- [Advanced Usage](#advanced-usage)
+- [License](#license)
+- [Contribute](#contribute)
+
+
# Usage
@@ -37,6 +57,19 @@ xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
using MauiIcons.Fluent;
```
+# Advanced Settings
+
+You can set the default icon size, font override, and default font auto-scaling using the `UseMauiIconsCore` builder extension as follows:
+
+```csharp
+builder.UseMauiIconsCore(x =>
+{
+ x.SetDefaultIconSize(30.0);
+ x.SetDefaultFontOverride(true);
+ x.SetDefaultFontAutoScaling(true);
+})
+```
+
## Workaround
if you came across this issue dotnet/maui#7503 when using new namespace, Make sure to create an discarded instance of MauiIcon in the codebehind like below
@@ -52,32 +85,6 @@ if you came across this issue dotnet/maui#7503 when using new namespace, Make su
```
-## Breaking Changes
-
-### Version 1 to 2
-
-`Old (v1)`
-
-```xml
-xmlns:fluent="clr-namespace:MauiIcons.Fluent;assembly=MauiIcons.Fluent"
-
-
-```
-
-`New (v2)`
-
-```xml
-xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
-
-
-```
-
-### Version 2 to 3
-
- - Removal of **TypeArgument** and Built in OnPlatform and OnIdiom Support, Use MauiIcons Integrated [Custom OnPlatform and OnIdioms Feature](#custom-onplatform-and-onidiom-usage)
- - Removal of **Dotnet 7** Support
-
-
## Built in Control Usage
`Xaml`
@@ -91,42 +98,19 @@ new MauiIcon() {Icon = Fluent.AppFolder48, IconColor = Colors.Green};
new MauiIcon().Icon(FluentIcons.Accessibility48).IconColor(Colors.Purple);
```
-All the Properties and Features of Built in Control, **[Check Here](https://github.com/AathifMahir/MauiIcons)**
+All the Properties and Features of Built in Control, **[Check Here](https://github.com/AathifMahir/MauiIcons#properties)**
## Xaml Extension Usage
```xml
-
-
-
-```
+
-## Xaml Extension Data Binding Usage
+
-The below example, Make Sures that BindingContext Inside the Xaml Extension is Set to Root of this Page, Likewise make sure to set the BindingContext When using Binding Inside the MauiIcons Xaml Extension, Additionally This example Binds to MyIcon and MyColor Properties Which Present in Code Behind But Not Included in this Example.
-```xml
-
-
-
-
-
-
-
-
-
-
-
-
+
```
+
## C# Markup Usage
```csharp
@@ -134,26 +118,32 @@ new ImageButton().Icon(FluentIcons.AppFolder48),
new Image().Icon(FluentIcons.Accessibility48),
-new Label().Icon(FluentIcons.AppFolder48).IconSize(40.0).IconColor(Colors.Red),
-
-new Entry().Icon(FluentIcons.Accessibility48).IconSize(20.0).IconColor(Colors.Aqua),
+new Button().Icon(FluentIcons.AppFolder48).IconSize(40.0).IconColor(Colors.Red)
```
**Disclaimer:** It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release: **Label**, **Image**, **ImageButton**, **SearchBar**, **Editor**, and **Entry**. Additionally, the native **MauiIcon** control, when combined with C# markup, can prove to be quite versatile and offer extra features for various scenarios.
## Applying Icon To Text or Placeholder
Controls that Supports Placeholder, Can Assign the Icon To PlaceHolder or Text,
-Defaults to Placeholder but can be set to Text by Setting isPlaceHolder Parameter to False
+Defaults to Placeholder but can be set to Text by Setting TargetName Parameter to `Text`
+
+`xaml`
+```xml
+
+
+
+```
+`c#`
```csharp
-new Entry().Icon(FluentIcons.Accessibility48, isPlaceHolder: false).IconSize(20.0).IconColor(Colors.Aqua);
+new Entry().Icon(FluentIcons.Accessibility48, targetName: "Text").IconSize(20.0).IconColor(Colors.Aqua);
-new SearchBar().Icon(FluentIcons.AppFolder48, isPlaceHolder: false);
+new SearchBar().Icon(FluentIcons.AppFolder48, targetName: "Placeholder");
```
-**Disclaimer:** It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release: **Label**, **Image**, **ImageButton**, **SearchBar**, **Editor**, and **Entry**. Additionally, the native **MauiIcon** control, when combined with C# markup, can prove to be quite versatile and offer extra features for various scenarios.
+**Disclaimer:** It's important to note that we are Overriding Font on Input Control to Set the Icon that Could Cause Unexpected Behaviors and Rendering Issues as well.
-## Custom OnPlatform and OnIdiom Usage
+## OnPlatform and OnIdiom Usage
`Xaml`
```xml
@@ -169,6 +159,87 @@ new MauiIcon().Icon(FluentIcons.Accessibility48).OnIdioms(new List{"Desk
new MauiIcon().Icon(FluentIcons.AppFolder48).OnPlatforms(new List{"WinUI", "Android"}).OnIdioms(new List{"Desktop", "Phone"});
```
+## Breaking Changes
+
+### Version 3 to 4
+
+ - Icon won't be applied to the Controls like Entry, SearchBar and etc.. by default Instead v4 would throw an Exception, Need to set **FontOverride** to true to apply the Icon to these Controls on Builder Extension Level or Control Level
+ - This Behavior can be reverted to Behavior of v3 by Using new `UseMauiIconsCore` Builder Extension and using `SetDefaultFontOverride` Method like Below
+
+```csharp
+ builder.UseMauiIconsCore(x =>
+ {
+ x.SetDefaultFontOverride(true);
+ })
+```
+
+ - Icon Size is Now Set to Control's FontSize by Default, Previously it was set to **30.0** by Default
+ - This Behavior can be reverted to Behavior of v3 by Using new `UseMauiIconsCore` Builder Extension and using `SetDefaultIconSize` Method like Below
+```csharp
+ builder.UseMauiIconsCore(x =>
+ {
+ x.SetDefaultIconSize(30.0);
+ })
+```
+---
+
+### Version 2 to 3
+
+ - Removal of **TypeArgument** and Built in OnPlatform and OnIdiom Support, Use MauiIcons Integrated [OnPlatform and OnIdioms Feature](#onplatform-and-onidiom-usage)
+ - Removal of **Dotnet 7** Support
+
+---
+
+### Version 1 to 2
+
+`Old (v1)`
+
+```xml
+xmlns:fluent="clr-namespace:MauiIcons.Fluent;assembly=MauiIcons.Fluent"
+
+
+```
+
+`New (v2)`
+
+```xml
+xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
+
+
+```
+
+## New Changes in v4
+
+ 1. We have a new way of Assigning/Setting Icons, Introducing New Attached Property for Icons,
+ The new **AttachedProperty** Brings in Support for **Triggers**, **Behaviors**, **Styles**, etc.. which is lacking on Classic Xaml Markup Extension, and also it's more cleaner and readable
+```xml
+/// Old
+
+
+// New
+
+```
+
+**Disclaimer**: The Old Xaml Markup Extension is still Supported and can be used, but it's recommended to use the new Attached Property for better support and readability and we have plans to deprecate the old Xaml Markup Extension in the future in favor of Attached Property
+
+### Example of Using Styles
+```xml
+
+
+
+```
+
+ 2. Introducing New `UseMauiIconsCore` Builder Extension for Setting Default Icon Size, Font Override, Default Font Auto Scaling and etc..
+ 3. Improved Built in OnPlatforms and OnIdioms with Binding Improvements and Enhanced Performance
+ 4. New [`OnClickAnimation`](https://github.com/AathifMahir/MauiIcons/#animation-usage) Support for MauiIcon Control
+
+
+## Advanced Usage
+
+The **.Net Maui Icons** library offers a wide range of features and capabilities, including the ability to customize how icons applied and which property it is applied too and etc. For more information on advanced usage, please refer to the [**Advanced Usage**](https://github.com/AathifMahir/MauiIcons/#advanced-usage)
+
# License
**MauiIcons.Fluent**
@@ -177,3 +248,6 @@ The MauiIcons.Fluent is library is distributed under the [MIT License](https://g
**Fluent UI System Icons**
The Fluent UI System Icons library is distributed under the [MIT License](https://github.com/microsoft/fluentui-system-icons/blob/main/LICENSE).
+# Contribute
+
+If you wish to contribute to this project, please don't hesitate to create an [issue or request](https://github.com/AathifMahir/MauiIcons/issues). Your input and feedback are highly appreciated. Additionally, if you're interested in supporting the project by providing resources or [**becoming a sponsor**](https://github.com/sponsors/AathifMahir), your contributions would be welcomed and instrumental in its continued development and success. Thank you for your interest in contributing to this endeavor.
diff --git a/src/MauiIcons.FontAwesome.Brand/ReadMe.txt b/src/MauiIcons.FontAwesome.Brand/ReadMe.txt
index ec0fa34d..e6fb6361 100644
--- a/src/MauiIcons.FontAwesome.Brand/ReadMe.txt
+++ b/src/MauiIcons.FontAwesome.Brand/ReadMe.txt
@@ -38,9 +38,9 @@ new MauiIcon().Icon(FontAwesomeBrandIcons.Shopify).IconColor(Colors.Purple);
Xaml Extension Usage:
-
+
-
+
----------------------------------------------------------------------------------------------
@@ -50,9 +50,7 @@ new ImageButton().Icon(FontAwesomeBrandIcons.Hashtag),
new Image().Icon(FontAwesomeBrandIcons.Shopify),
-new Label().Icon(FontAwesomeBrandIcons.GooglePay).IconSize(40.0).IconColor(Colors.Red),
-
-new Entry().Icon(FontAwesomeBrandIcons.Hashtag).IconSize(20.0).IconColor(Colors.Aqua),
+new Button().Icon(FontAwesomeBrandIcons.GooglePay).IconSize(40.0).IconColor(Colors.Red),
Disclaimer: It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release:
diff --git a/src/MauiIcons.FontAwesome.Brand/ReleaseNotes.txt b/src/MauiIcons.FontAwesome.Brand/ReleaseNotes.txt
index 2ea8a7c4..6b034ed9 100644
--- a/src/MauiIcons.FontAwesome.Brand/ReleaseNotes.txt
+++ b/src/MauiIcons.FontAwesome.Brand/ReleaseNotes.txt
@@ -1,4 +1,13 @@
-v3.0.0
+v4.0.0
+• Various Enhancements and Fixes for MauiIcon Control
+• New Attached Property for Seamless Icon Integration
+• Styles and Triggers Support
+• New OnClick Animation Support for MauiIcon Control
+• Enhanced Global Customization Support using New `UseMauiIconsCore` Extension
+• Overall Fixes and Enhancements
+• Breaking Changes: [https://github.com/AathifMahir/MauiIcons/#breaking-changes]
+
+v3.0.0
• Critical Fixes for Xaml Markup Binding Support
• Breaking Changes: Removal of Dotnet 7 Support
• Breaking Changes: Removal of Maui OnPlatform and OnIdioms Support Instead Use MauiIcons Integrated Custom OnPlatforms and OnIdioms Feature
diff --git a/src/MauiIcons.FontAwesome.Brand/readme.md b/src/MauiIcons.FontAwesome.Brand/readme.md
index d1843bd6..ce7b2698 100644
--- a/src/MauiIcons.FontAwesome.Brand/readme.md
+++ b/src/MauiIcons.FontAwesome.Brand/readme.md
@@ -21,10 +21,30 @@ public static class MauiProgram
}
```
+# Table of Contents
+
+- [Usage](#usage)
+- [Advanced Settings](#advanced-settings)
+- [New Changes in v4](#new-changes-in-v4)
+- [Workaround (Must Read)](#workaround)
+- [Built in Control Usage](#built-in-control-usage)
+- [Xaml Extension Usage](#xaml-extension-usage)
+- [C# Markup Usage](#c-markup-usage)
+- [Applying Icon To Text or Placeholder](#applying-icon-to-text-or-placeholder)
+- [OnPlatform and OnIdiom Usage](#onplatform-and-onidiom-usage)
+- [Breaking Changes](#breaking-changes)
+ - [Version 3 to 4](#version-3-to-4)
+ - [Version 2 to 3](#version-2-to-3)
+ - [Version 1 to 2](#version-1-to-2)
+- [Advanced Usage](#advanced-usage)
+- [License](#license)
+- [Contribute](#contribute)
+
+
# Usage
-In order to make use of the **.Net Maui Icons - Font Awesome Brand** you can use the below namespace:
+In order to make use of the **.Net Maui Icons - Font Awesome** you can use the below namespace:
`Xaml`
@@ -37,6 +57,19 @@ xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
using MauiIcons.FontAwesome.Brand;
```
+# Advanced Settings
+
+You can set the default icon size, font override, and default font auto-scaling using the `UseMauiIconsCore` builder extension as follows:
+
+```csharp
+builder.UseMauiIconsCore(x =>
+{
+ x.SetDefaultIconSize(30.0);
+ x.SetDefaultFontOverride(true);
+ x.SetDefaultFontAutoScaling(true);
+})
+```
+
## Workaround
if you came across this issue dotnet/maui#7503 when using new namespace, Make sure to create an discarded instance of MauiIcon in the codebehind like below
@@ -52,24 +85,17 @@ if you came across this issue dotnet/maui#7503 when using new namespace, Make su
```
-## Breaking Changes
-
-### Version 2 to 3
-
- - Removal of **TypeArgument** and Built in OnPlatform and OnIdiom Support, Use MauiIcons Integrated [Custom OnPlatform and OnIdioms Feature](#custom-onplatform-and-onidiom-usage)
- - Removal of **Dotnet 7** Support
-
## Built in Control Usage
`Xaml`
```xml
-
+
```
`C#`
```csharp
-new MauiIcon() {Icon = FontAwesomeBrandIcons.XTwitter, IconColor = Colors.Green};
+new MauiIcon() {Icon = FontAwesomeBrandIcons.Hashtag, IconColor = Colors.Green};
-new MauiIcon().Icon(FontAwesomeBrandIcons.Github).IconColor(Colors.Purple);
+new MauiIcon().Icon(FontAwesomeBrandIcons.XTwitter).IconColor(Colors.Purple);
```
All the Properties and Features of Built in Control, **[Check Here](https://github.com/AathifMahir/MauiIcons)**
@@ -77,79 +103,121 @@ All the Properties and Features of Built in Control, **[Check Here](https://gith
## Xaml Extension Usage
```xml
-
-
-
-```
+
-## Xaml Extension Data Binding Usage
+
-The below example, Make Sures that BindingContext Inside the Xaml Extension is Set to Root of this Page, Likewise make sure to set the BindingContext When using Binding Inside the MauiIcons Xaml Extension, Additionally This example Binds to MyIcon and MyColor Properties Which Present in Code Behind But Not Included in this Example.
-```xml
-
-
-
-
-
-
-
-
-
-
-
-
+
```
## C# Markup Usage
```csharp
-new ImageButton().Icon(FontAwesomeBrandIcons.Github),
+new ImageButton().Icon(FontAwesomeBrandIcons.Deezer),
new Image().Icon(FontAwesomeBrandIcons.XTwitter),
-new Label().Icon(FontAwesomeBrandIcons.Pinterest).IconSize(40.0).IconColor(Colors.Red),
-
-new Entry().Icon(FontAwesomeBrandIcons.GooglePay).IconSize(20.0).IconColor(Colors.Aqua),
+new Button().Icon(FontAwesomeBrandIcons.Unity).IconSize(40.0).IconColor(Colors.Red)
```
**Disclaimer:** It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release: **Label**, **Image**, **ImageButton**, **SearchBar**, **Editor**, and **Entry**. Additionally, the native **MauiIcon** control, when combined with C# markup, can prove to be quite versatile and offer extra features for various scenarios.
## Applying Icon To Text or Placeholder
Controls that Supports Placeholder, Can Assign the Icon To PlaceHolder or Text,
-Defaults to Placeholder but can be set to Text by Setting isPlaceHolder Parameter to False
+Defaults to Placeholder but can be set to Text by Setting TargetName Parameter to `Text`
+
+`xaml`
+```xml
+
+
+
+```
```csharp
-new Entry().Icon(FontAwesomeBrandIcons.GooglePay, isPlaceHolder: false).IconSize(20.0).IconColor(Colors.Aqua);
+new Entry().Icon(FontAwesomeBrandIcons.Deezer, isPlaceHolder: false).IconSize(20.0).IconColor(Colors.Aqua);
-new SearchBar().Icon(FontAwesomeBrandIcons.PenToSquare, isPlaceHolder: false);
+new SearchBar().Icon(FontAwesomeBrandIcons.HashTag, isPlaceHolder: false);
```
**Disclaimer:** It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release: **Label**, **Image**, **ImageButton**, **SearchBar**, **Editor**, and **Entry**. Additionally, the native **MauiIcon** control, when combined with C# markup, can prove to be quite versatile and offer extra features for various scenarios.
-## Custom OnPlatform and OnIdiom Usage
+## OnPlatform and OnIdiom Usage
`Xaml`
```xml
-
-
-
+
+
+
```
`C#`
```csharp
-new MauiIcon().Icon(FontAwesomeBrandIcons.Pinterest).OnPlatforms(new List{"WinUI", "Android"});
-new MauiIcon().Icon(FontAwesomeBrandIcons.Github).OnIdioms(new List{"Desktop", "Phone"});
-new MauiIcon().Icon(FontAwesomeBrandIcons.PenToSquare).OnPlatforms(new List{"WinUI", "Android"}).OnIdioms(new List{"Desktop", "Phone"});
+new MauiIcon().Icon(FontAwesomeBrandIcons.Unity).OnPlatforms(new List{"WinUI", "Android"});
+new MauiIcon().Icon(FontAwesomeBrandIcons.Deezer).OnIdioms(new List{"Desktop", "Phone"});
+new MauiIcon().Icon(FontAwesomeBrandIcons.XTwitter).OnPlatforms(new List{"WinUI", "Android"}).OnIdioms(new List{"Desktop", "Phone"});
+```
+
+## Breaking Changes
+
+### Version 3 to 4
+
+ - Icon won't be applied to the Controls like Entry, SearchBar and etc.. by default Instead v4 would throw an Exception, Need to set **FontOverride** to true to apply the Icon to these Controls on Builder Extension Level or Control Level
+ - This Behavior can be reverted to Behavior of v3 by Using new `UseMauiIconsCore` Builder Extension and using `SetDefaultFontOverride` Method like Below
+
+```csharp
+ builder.UseMauiIconsCore(x =>
+ {
+ x.SetDefaultFontOverride(true);
+ })
+```
+
+ - Icon Size is Now Set to Control's FontSize by Default, Previously it was set to **30.0** by Default
+ - This Behavior can be reverted to Behavior of v3 by Using new `UseMauiIconsCore` Builder Extension and using `SetDefaultIconSize` Method like Below
+```csharp
+ builder.UseMauiIconsCore(x =>
+ {
+ x.SetDefaultIconSize(30.0);
+ })
+```
+---
+
+### Version 2 to 3
+
+ - Removal of **TypeArgument** and Built in OnPlatform and OnIdiom Support, Use MauiIcons Integrated [Custom OnPlatform and OnIdioms Feature](#custom-onplatform-and-onidiom-usage)
+ - Removal of **Dotnet 7** Support
+
+## New Changes in v4
+
+ 1. We have a new way of Assigning/Setting Icons, Introducing New Attached Property for Icons,
+ The new **AttachedProperty** Brings in Support for **Triggers**, **Behaviors**, **Styles**, etc.. which is lacking on Classic Xaml Markup Extension, and also it's more cleaner and readable
+```xml
+/// Old
+
+
+// New
+
+```
+
+**Disclaimer**: The Old Xaml Markup Extension is still Supported and can be used, but it's recommended to use the new Attached Property for better support and readability and we have plans to deprecate the old Xaml Markup Extension in the future in favor of Attached Property
+
+### Example of Using Styles
+```xml
+
+
+
```
+ 2. Introducing New `UseMauiIconsCore` Builder Extension for Setting Default Icon Size, Font Override, Default Font Auto Scaling and etc..
+ 3. Improved Built in OnPlatforms and OnIdioms with Binding Improvements and Enhanced Performance
+ 4. New [`OnClickAnimation`](https://github.com/AathifMahir/MauiIcons/#animation-usage) Support for MauiIcon Control
+
+
+## Advanced Usage
+
+The **.Net Maui Icons** library offers a wide range of features and capabilities, including the ability to customize how icons applied and which property it is applied too and etc. For more information on advanced usage, please refer to the [**Advanced Usage**](https://github.com/AathifMahir/MauiIcons/#advanced-usage)
+
# License
**MauiIcons.FontAwesome.Brand**
@@ -158,4 +226,8 @@ MauiIcons.FontAwesome.Brand is Licensed Under [MIT License](https://github.com/A
**Font Awesome Free Icons**
Font Awesome Free Icons is Licensed by FontAwesome Under Couple of [License](https://fontawesome.com/license/free).
+# Contribute
+
+If you wish to contribute to this project, please don't hesitate to create an [issue or request](https://github.com/AathifMahir/MauiIcons/issues). Your input and feedback are highly appreciated. Additionally, if you're interested in supporting the project by providing resources or [**becoming a sponsor**](https://github.com/sponsors/AathifMahir), your contributions would be welcomed and instrumental in its continued development and success. Thank you for your interest in contributing to this endeavor.
+
diff --git a/src/MauiIcons.FontAwesome.Solid/ReadMe.txt b/src/MauiIcons.FontAwesome.Solid/ReadMe.txt
index e7638a8c..c3a8fc85 100644
--- a/src/MauiIcons.FontAwesome.Solid/ReadMe.txt
+++ b/src/MauiIcons.FontAwesome.Solid/ReadMe.txt
@@ -38,9 +38,9 @@ new MauiIcon().Icon(FontAwesomeSolidIcons.GreaterThanEqual).IconColor(Colors.Pur
Xaml Extension Usage:
-
+
-
+
----------------------------------------------------------------------------------------------
@@ -50,9 +50,7 @@ new ImageButton().Icon(FontAwesomeSolidIcons.Hashtag),
new Image().Icon(FontAwesomeSolidIcons.GreaterThanEqual),
-new Label().Icon(FontAwesomeSolidIcons.Asterisk).IconSize(40.0).IconColor(Colors.Red),
-
-new Entry().Icon(FontAwesomeSolidIcons.Hashtag).IconSize(20.0).IconColor(Colors.Aqua),
+new Button().Icon(FontAwesomeSolidIcons.Asterisk).IconSize(40.0).IconColor(Colors.Red),
Disclaimer: It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release:
diff --git a/src/MauiIcons.FontAwesome.Solid/ReleaseNotes.txt b/src/MauiIcons.FontAwesome.Solid/ReleaseNotes.txt
index 2ea8a7c4..6b034ed9 100644
--- a/src/MauiIcons.FontAwesome.Solid/ReleaseNotes.txt
+++ b/src/MauiIcons.FontAwesome.Solid/ReleaseNotes.txt
@@ -1,4 +1,13 @@
-v3.0.0
+v4.0.0
+• Various Enhancements and Fixes for MauiIcon Control
+• New Attached Property for Seamless Icon Integration
+• Styles and Triggers Support
+• New OnClick Animation Support for MauiIcon Control
+• Enhanced Global Customization Support using New `UseMauiIconsCore` Extension
+• Overall Fixes and Enhancements
+• Breaking Changes: [https://github.com/AathifMahir/MauiIcons/#breaking-changes]
+
+v3.0.0
• Critical Fixes for Xaml Markup Binding Support
• Breaking Changes: Removal of Dotnet 7 Support
• Breaking Changes: Removal of Maui OnPlatform and OnIdioms Support Instead Use MauiIcons Integrated Custom OnPlatforms and OnIdioms Feature
diff --git a/src/MauiIcons.FontAwesome.Solid/readme.md b/src/MauiIcons.FontAwesome.Solid/readme.md
index dcba3783..140c0a98 100644
--- a/src/MauiIcons.FontAwesome.Solid/readme.md
+++ b/src/MauiIcons.FontAwesome.Solid/readme.md
@@ -21,10 +21,30 @@ public static class MauiProgram
}
```
+# Table of Contents
+
+- [Usage](#usage)
+- [Advanced Settings](#advanced-settings)
+- [New Changes in v4](#new-changes-in-v4)
+- [Workaround (Must Read)](#workaround)
+- [Built in Control Usage](#built-in-control-usage)
+- [Xaml Extension Usage](#xaml-extension-usage)
+- [C# Markup Usage](#c-markup-usage)
+- [Applying Icon To Text or Placeholder](#applying-icon-to-text-or-placeholder)
+- [OnPlatform and OnIdiom Usage](#onplatform-and-onidiom-usage)
+- [Breaking Changes](#breaking-changes)
+ - [Version 3 to 4](#version-3-to-4)
+ - [Version 2 to 3](#version-2-to-3)
+ - [Version 1 to 2](#version-1-to-2)
+- [Advanced Usage](#advanced-usage)
+- [License](#license)
+- [Contribute](#contribute)
+
+
# Usage
-In order to make use of the **.Net Maui Icons - Font Awesome Solid** you can use the below namespace:
+In order to make use of the **.Net Maui Icons - Font Awesome** you can use the below namespace:
`Xaml`
@@ -37,6 +57,19 @@ xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
using MauiIcons.FontAwesome.Solid;
```
+# Advanced Settings
+
+You can set the default icon size, font override, and default font auto-scaling using the `UseMauiIconsCore` builder extension as follows:
+
+```csharp
+builder.UseMauiIconsCore(x =>
+{
+ x.SetDefaultIconSize(30.0);
+ x.SetDefaultFontOverride(true);
+ x.SetDefaultFontAutoScaling(true);
+})
+```
+
## Workaround
if you came across this issue dotnet/maui#7503 when using new namespace, Make sure to create an discarded instance of MauiIcon in the codebehind like below
@@ -52,13 +85,6 @@ if you came across this issue dotnet/maui#7503 when using new namespace, Make su
```
-## Breaking Changes
-
-### Version 2 to 3
-
- - Removal of **TypeArgument** and Built in OnPlatform and OnIdiom Support, Use MauiIcons Integrated [Custom OnPlatform and OnIdioms Feature](#custom-onplatform-and-onidiom-usage)
- - Removal of **Dotnet 7** Support
-
## Built in Control Usage
`Xaml`
@@ -69,7 +95,7 @@ if you came across this issue dotnet/maui#7503 when using new namespace, Make su
```csharp
new MauiIcon() {Icon = FontAwesomeSolidIcons.Hashtag, IconColor = Colors.Green};
-new MauiIcon().Icon(FontAwesomeSolidIcons.Asterisk).IconColor(Colors.Purple);
+new MauiIcon().Icon(FontAwesomeSolidIcons.Plus).IconColor(Colors.Purple);
```
All the Properties and Features of Built in Control, **[Check Here](https://github.com/AathifMahir/MauiIcons)**
@@ -77,78 +103,121 @@ All the Properties and Features of Built in Control, **[Check Here](https://gith
## Xaml Extension Usage
```xml
-
+
-
-```
-
-## Xaml Extension Data Binding Usage
+
-The below example, Make Sures that BindingContext Inside the Xaml Extension is Set to Root of this Page, Likewise make sure to set the BindingContext When using Binding Inside the MauiIcons Xaml Extension, Additionally This example Binds to MyIcon and MyColor Properties Which Present in Code Behind But Not Included in this Example.
-```xml
-
-
-
-
-
-
-
-
-
-
-
-
+
```
## C# Markup Usage
```csharp
-new ImageButton().Icon(FontAwesomeSolidIcons.Asterisk),
-
-new Image().Icon(FontAwesomeSolidIcons.Hashtag),
+new ImageButton().Icon(FontAwesomeSolidIcons.Plus),
-new Label().Icon(FontAwesomeSolidIcons.GreaterThanEqual).IconSize(40.0).IconColor(Colors.Red),
+new Image().Icon(FontAwesomeSolidIcons.Hyphen),
-new Entry().Icon(FontAwesomeSolidIcons.RankingStar).IconSize(20.0).IconColor(Colors.Aqua),
+new Button().Icon(FontAwesomeSolidIcons.Five).IconSize(40.0).IconColor(Colors.Red)
```
**Disclaimer:** It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release: **Label**, **Image**, **ImageButton**, **SearchBar**, **Editor**, and **Entry**. Additionally, the native **MauiIcon** control, when combined with C# markup, can prove to be quite versatile and offer extra features for various scenarios.
## Applying Icon To Text or Placeholder
Controls that Supports Placeholder, Can Assign the Icon To PlaceHolder or Text,
-Defaults to Placeholder but can be set to Text by Setting isPlaceHolder Parameter to False
+Defaults to Placeholder but can be set to Text by Setting TargetName Parameter to `Text`
+
+`xaml`
+```xml
+
+
+
+```
```csharp
-new Entry().Icon(FontAwesomeSolidIcons.RankingStar, isPlaceHolder: false).IconSize(20.0).IconColor(Colors.Aqua);
+new Entry().Icon(FontAwesomeSolidIcons.Plus, isPlaceHolder: false).IconSize(20.0).IconColor(Colors.Aqua);
-new SearchBar().Icon(FontAwesomeSolidIcons.PenToSquare, isPlaceHolder: false);
+new SearchBar().Icon(FontAwesomeSolidIcons.HashTag, isPlaceHolder: false);
```
**Disclaimer:** It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release: **Label**, **Image**, **ImageButton**, **SearchBar**, **Editor**, and **Entry**. Additionally, the native **MauiIcon** control, when combined with C# markup, can prove to be quite versatile and offer extra features for various scenarios.
-## Custom OnPlatform and OnIdiom Usage
+## OnPlatform and OnIdiom Usage
`Xaml`
```xml
-
-
-
+
+
+
```
`C#`
```csharp
-new MauiIcon().Icon(FontAwesomeSolidIcons.GreaterThanEqual).OnPlatforms(new List{"WinUI", "Android"});
-new MauiIcon().Icon(FontAwesomeSolidIcons.Asterisk).OnIdioms(new List{"Desktop", "Phone"});
-new MauiIcon().Icon(FontAwesomeSolidIcons.PenToSquare).OnPlatforms(new List{"WinUI", "Android"}).OnIdioms(new List{"Desktop", "Phone"});
+new MauiIcon().Icon(FontAwesomeSolidIcons.Plus).OnPlatforms(new List{"WinUI", "Android"});
+new MauiIcon().Icon(FontAwesomeSolidIcons.Hashtag).OnIdioms(new List{"Desktop", "Phone"});
+new MauiIcon().Icon(FontAwesomeSolidIcons.Six).OnPlatforms(new List{"WinUI", "Android"}).OnIdioms(new List{"Desktop", "Phone"});
+```
+
+## Breaking Changes
+
+### Version 3 to 4
+
+ - Icon won't be applied to the Controls like Entry, SearchBar and etc.. by default Instead v4 would throw an Exception, Need to set **FontOverride** to true to apply the Icon to these Controls on Builder Extension Level or Control Level
+ - This Behavior can be reverted to Behavior of v3 by Using new `UseMauiIconsCore` Builder Extension and using `SetDefaultFontOverride` Method like Below
+
+```csharp
+ builder.UseMauiIconsCore(x =>
+ {
+ x.SetDefaultFontOverride(true);
+ })
+```
+
+ - Icon Size is Now Set to Control's FontSize by Default, Previously it was set to **30.0** by Default
+ - This Behavior can be reverted to Behavior of v3 by Using new `UseMauiIconsCore` Builder Extension and using `SetDefaultIconSize` Method like Below
+```csharp
+ builder.UseMauiIconsCore(x =>
+ {
+ x.SetDefaultIconSize(30.0);
+ })
```
+---
+
+### Version 2 to 3
+
+ - Removal of **TypeArgument** and Built in OnPlatform and OnIdiom Support, Use MauiIcons Integrated [Custom OnPlatform and OnIdioms Feature](#custom-onplatform-and-onidiom-usage)
+ - Removal of **Dotnet 7** Support
+
+## New Changes in v4
+
+ 1. We have a new way of Assigning/Setting Icons, Introducing New Attached Property for Icons,
+ The new **AttachedProperty** Brings in Support for **Triggers**, **Behaviors**, **Styles**, etc.. which is lacking on Classic Xaml Markup Extension, and also it's more cleaner and readable
+```xml
+/// Old
+
+
+// New
+
+```
+
+**Disclaimer**: The Old Xaml Markup Extension is still Supported and can be used, but it's recommended to use the new Attached Property for better support and readability and we have plans to deprecate the old Xaml Markup Extension in the future in favor of Attached Property
+
+### Example of Using Styles
+```xml
+
+
+
+```
+
+ 2. Introducing New `UseMauiIconsCore` Builder Extension for Setting Default Icon Size, Font Override, Default Font Auto Scaling and etc..
+ 3. Improved Built in OnPlatforms and OnIdioms with Binding Improvements and Enhanced Performance
+ 4. New [`OnClickAnimation`](https://github.com/AathifMahir/MauiIcons/#animation-usage) Support for MauiIcon Control
+
+
+## Advanced Usage
+
+The **.Net Maui Icons** library offers a wide range of features and capabilities, including the ability to customize how icons applied and which property it is applied too and etc. For more information on advanced usage, please refer to the [**Advanced Usage**](https://github.com/AathifMahir/MauiIcons/#advanced-usage)
+
# License
@@ -159,3 +228,8 @@ MauiIcons.FontAwesome.Solid is Licensed Under [MIT License](https://github.com/A
Font Awesome Free Icons is Licensed by FontAwesome Under Couple of [License](https://fontawesome.com/license/free).
+# Contribute
+
+If you wish to contribute to this project, please don't hesitate to create an [issue or request](https://github.com/AathifMahir/MauiIcons/issues). Your input and feedback are highly appreciated. Additionally, if you're interested in supporting the project by providing resources or [**becoming a sponsor**](https://github.com/sponsors/AathifMahir), your contributions would be welcomed and instrumental in its continued development and success. Thank you for your interest in contributing to this endeavor.
+
+
diff --git a/src/MauiIcons.FontAwesome/ReadMe.txt b/src/MauiIcons.FontAwesome/ReadMe.txt
index 2348cf0f..635ba585 100644
--- a/src/MauiIcons.FontAwesome/ReadMe.txt
+++ b/src/MauiIcons.FontAwesome/ReadMe.txt
@@ -38,9 +38,9 @@ new MauiIcon().Icon(FontAwesomeIcons.GreaterThan).IconColor(Colors.Purple);
Xaml Extension Usage:
-
+
-
+
----------------------------------------------------------------------------------------------
@@ -50,9 +50,7 @@ new ImageButton().Icon(FontAwesomeIcons.Hashtag),
new Image().Icon(FontAwesomeIcons.GreaterThan),
-new Label().Icon(FontAwesomeIcons.Asterisk).IconSize(40.0).IconColor(Colors.Red),
-
-new Entry().Icon(FontAwesomeIcons.Hashtag).IconSize(20.0).IconColor(Colors.Aqua),
+new Button().Icon(FontAwesomeIcons.Asterisk).IconSize(40.0).IconColor(Colors.Red),
Disclaimer: It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release:
diff --git a/src/MauiIcons.FontAwesome/ReleaseNotes.txt b/src/MauiIcons.FontAwesome/ReleaseNotes.txt
index 2ea8a7c4..6b034ed9 100644
--- a/src/MauiIcons.FontAwesome/ReleaseNotes.txt
+++ b/src/MauiIcons.FontAwesome/ReleaseNotes.txt
@@ -1,4 +1,13 @@
-v3.0.0
+v4.0.0
+• Various Enhancements and Fixes for MauiIcon Control
+• New Attached Property for Seamless Icon Integration
+• Styles and Triggers Support
+• New OnClick Animation Support for MauiIcon Control
+• Enhanced Global Customization Support using New `UseMauiIconsCore` Extension
+• Overall Fixes and Enhancements
+• Breaking Changes: [https://github.com/AathifMahir/MauiIcons/#breaking-changes]
+
+v3.0.0
• Critical Fixes for Xaml Markup Binding Support
• Breaking Changes: Removal of Dotnet 7 Support
• Breaking Changes: Removal of Maui OnPlatform and OnIdioms Support Instead Use MauiIcons Integrated Custom OnPlatforms and OnIdioms Feature
diff --git a/src/MauiIcons.FontAwesome/readme.md b/src/MauiIcons.FontAwesome/readme.md
index b97121ea..198960b3 100644
--- a/src/MauiIcons.FontAwesome/readme.md
+++ b/src/MauiIcons.FontAwesome/readme.md
@@ -21,6 +21,26 @@ public static class MauiProgram
}
```
+# Table of Contents
+
+- [Usage](#usage)
+- [Advanced Settings](#advanced-settings)
+- [New Changes in v4](#new-changes-in-v4)
+- [Workaround (Must Read)](#workaround)
+- [Built in Control Usage](#built-in-control-usage)
+- [Xaml Extension Usage](#xaml-extension-usage)
+- [C# Markup Usage](#c-markup-usage)
+- [Applying Icon To Text or Placeholder](#applying-icon-to-text-or-placeholder)
+- [OnPlatform and OnIdiom Usage](#onplatform-and-onidiom-usage)
+- [Breaking Changes](#breaking-changes)
+ - [Version 3 to 4](#version-3-to-4)
+ - [Version 2 to 3](#version-2-to-3)
+ - [Version 1 to 2](#version-1-to-2)
+- [Advanced Usage](#advanced-usage)
+- [License](#license)
+- [Contribute](#contribute)
+
+
# Usage
@@ -37,6 +57,19 @@ xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
using MauiIcons.FontAwesome;
```
+# Advanced Settings
+
+You can set the default icon size, font override, and default font auto-scaling using the `UseMauiIconsCore` builder extension as follows:
+
+```csharp
+builder.UseMauiIconsCore(x =>
+{
+ x.SetDefaultIconSize(30.0);
+ x.SetDefaultFontOverride(true);
+ x.SetDefaultFontAutoScaling(true);
+})
+```
+
## Workaround
if you came across this issue dotnet/maui#7503 when using new namespace, Make sure to create an discarded instance of MauiIcon in the codebehind like below
@@ -52,13 +85,6 @@ if you came across this issue dotnet/maui#7503 when using new namespace, Make su
```
-## Breaking Changes
-
-### Version 2 to 3
-
- - Removal of **TypeArgument** and Built in OnPlatform and OnIdiom Support, Use MauiIcons Integrated [Custom OnPlatform and OnIdioms Feature](#custom-onplatform-and-onidiom-usage)
- - Removal of **Dotnet 7** Support
-
## Built in Control Usage
`Xaml`
@@ -77,35 +103,11 @@ All the Properties and Features of Built in Control, **[Check Here](https://gith
## Xaml Extension Usage
```xml
-
+
-
-```
-
-## Xaml Extension Data Binding Usage
+
-The below example, Make Sures that BindingContext Inside the Xaml Extension is Set to Root of this Page, Likewise make sure to set the BindingContext When using Binding Inside the MauiIcons Xaml Extension, Additionally This example Binds to MyIcon and MyColor Properties Which Present in Code Behind But Not Included in this Example.
-```xml
-
-
-
-
-
-
-
-
-
-
-
-
+
```
## C# Markup Usage
@@ -115,16 +117,21 @@ new ImageButton().Icon(FontAwesomeIcons.Asterisk),
new Image().Icon(FontAwesomeIcons.Hashtag),
-new Label().Icon(FontAwesomeIcons.GreaterThan).IconSize(40.0).IconColor(Colors.Red),
-
-new Entry().Icon(FontAwesomeIcons.Star).IconSize(20.0).IconColor(Colors.Aqua),
+new Button().Icon(FontAwesomeIcons.GreaterThan).IconSize(40.0).IconColor(Colors.Red)
```
**Disclaimer:** It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release: **Label**, **Image**, **ImageButton**, **SearchBar**, **Editor**, and **Entry**. Additionally, the native **MauiIcon** control, when combined with C# markup, can prove to be quite versatile and offer extra features for various scenarios.
## Applying Icon To Text or Placeholder
Controls that Supports Placeholder, Can Assign the Icon To PlaceHolder or Text,
-Defaults to Placeholder but can be set to Text by Setting isPlaceHolder Parameter to False
+Defaults to Placeholder but can be set to Text by Setting TargetName Parameter to `Text`
+
+`xaml`
+```xml
+
+
+
+```
```csharp
new Entry().Icon(FontAwesomeIcons.Star, isPlaceHolder: false).IconSize(20.0).IconColor(Colors.Aqua);
@@ -134,7 +141,7 @@ new SearchBar().Icon(FontAwesomeIcons.PenToSquare, isPlaceHolder: false);
**Disclaimer:** It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release: **Label**, **Image**, **ImageButton**, **SearchBar**, **Editor**, and **Entry**. Additionally, the native **MauiIcon** control, when combined with C# markup, can prove to be quite versatile and offer extra features for various scenarios.
-## Custom OnPlatform and OnIdiom Usage
+## OnPlatform and OnIdiom Usage
`Xaml`
```xml
@@ -150,6 +157,68 @@ new MauiIcon().Icon(FontAwesomeIcons.Asterisk).OnIdioms(new List{"Deskto
new MauiIcon().Icon(FontAwesomeIcons.PenToSquare).OnPlatforms(new List{"WinUI", "Android"}).OnIdioms(new List{"Desktop", "Phone"});
```
+## Breaking Changes
+
+### Version 3 to 4
+
+ - Icon won't be applied to the Controls like Entry, SearchBar and etc.. by default Instead v4 would throw an Exception, Need to set **FontOverride** to true to apply the Icon to these Controls on Builder Extension Level or Control Level
+ - This Behavior can be reverted to Behavior of v3 by Using new `UseMauiIconsCore` Builder Extension and using `SetDefaultFontOverride` Method like Below
+
+```csharp
+ builder.UseMauiIconsCore(x =>
+ {
+ x.SetDefaultFontOverride(true);
+ })
+```
+
+ - Icon Size is Now Set to Control's FontSize by Default, Previously it was set to **30.0** by Default
+ - This Behavior can be reverted to Behavior of v3 by Using new `UseMauiIconsCore` Builder Extension and using `SetDefaultIconSize` Method like Below
+```csharp
+ builder.UseMauiIconsCore(x =>
+ {
+ x.SetDefaultIconSize(30.0);
+ })
+```
+---
+
+### Version 2 to 3
+
+ - Removal of **TypeArgument** and Built in OnPlatform and OnIdiom Support, Use MauiIcons Integrated [Custom OnPlatform and OnIdioms Feature](#custom-onplatform-and-onidiom-usage)
+ - Removal of **Dotnet 7** Support
+
+## New Changes in v4
+
+ 1. We have a new way of Assigning/Setting Icons, Introducing New Attached Property for Icons,
+ The new **AttachedProperty** Brings in Support for **Triggers**, **Behaviors**, **Styles**, etc.. which is lacking on Classic Xaml Markup Extension, and also it's more cleaner and readable
+```xml
+/// Old
+
+
+// New
+
+```
+
+**Disclaimer**: The Old Xaml Markup Extension is still Supported and can be used, but it's recommended to use the new Attached Property for better support and readability and we have plans to deprecate the old Xaml Markup Extension in the future in favor of Attached Property
+
+### Example of Using Styles
+```xml
+
+
+
+```
+
+ 2. Introducing New `UseMauiIconsCore` Builder Extension for Setting Default Icon Size, Font Override, Default Font Auto Scaling and etc..
+ 3. Improved Built in OnPlatforms and OnIdioms with Binding Improvements and Enhanced Performance
+ 4. New [`OnClickAnimation`](https://github.com/AathifMahir/MauiIcons/#animation-usage) Support for MauiIcon Control
+
+
+## Advanced Usage
+
+The **.Net Maui Icons** library offers a wide range of features and capabilities, including the ability to customize how icons applied and which property it is applied too and etc. For more information on advanced usage, please refer to the [**Advanced Usage**](https://github.com/AathifMahir/MauiIcons/#advanced-usage)
+
+
# License
**MauiIcons.FontAwesome**
@@ -158,4 +227,9 @@ MauiIcons.FontAwesome is Licensed Under [MIT License](https://github.com/AathifM
**Font Awesome Free Icons**
Font Awesome Free Icons is Licensed by FontAwesome Under Couple of [License](https://fontawesome.com/license/free).
+# Contribute
+
+If you wish to contribute to this project, please don't hesitate to create an [issue or request](https://github.com/AathifMahir/MauiIcons/issues). Your input and feedback are highly appreciated. Additionally, if you're interested in supporting the project by providing resources or [**becoming a sponsor**](https://github.com/sponsors/AathifMahir), your contributions would be welcomed and instrumental in its continued development and success. Thank you for your interest in contributing to this endeavor.
+
+
diff --git a/src/MauiIcons.Material.Outlined/ReadMe.txt b/src/MauiIcons.Material.Outlined/ReadMe.txt
index 4b0fef4d..5eac66bb 100644
--- a/src/MauiIcons.Material.Outlined/ReadMe.txt
+++ b/src/MauiIcons.Material.Outlined/ReadMe.txt
@@ -38,9 +38,9 @@ new MauiIcon().Icon(MaterialOutlinedIcons.AddRoad).IconColor(Colors.Purple);
Xaml Extension Usage:
-
+
-
+
----------------------------------------------------------------------------------------------
@@ -50,9 +50,7 @@ new ImageButton().Icon(MaterialOutlinedIcons.ABC),
new Image().Icon(MaterialOutlinedIcons.AddRoad),
-new Label().Icon(MaterialOutlinedIcons.ABC).IconSize(40.0).IconColor(Colors.Red),
-
-new Entry().Icon(MaterialOutlinedIcons.AddRoad).IconSize(20.0).IconColor(Colors.Aqua),
+new Button().Icon(MaterialOutlinedIcons.ABC).IconSize(40.0).IconColor(Colors.Red),
Disclaimer: It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release:
diff --git a/src/MauiIcons.Material.Outlined/ReleaseNotes.txt b/src/MauiIcons.Material.Outlined/ReleaseNotes.txt
index 9c30a8bf..4aabb007 100644
--- a/src/MauiIcons.Material.Outlined/ReleaseNotes.txt
+++ b/src/MauiIcons.Material.Outlined/ReleaseNotes.txt
@@ -1,4 +1,13 @@
-v3.0.0
+v4.0.0
+• Various Enhancements and Fixes for MauiIcon Control
+• New Attached Property for Seamless Icon Integration
+• Styles and Triggers Support
+• New OnClick Animation Support for MauiIcon Control
+• Enhanced Global Customization Support using New `UseMauiIconsCore` Extension
+• Overall Fixes and Enhancements
+• Breaking Changes: [https://github.com/AathifMahir/MauiIcons/#breaking-changes]
+
+v3.0.0
• Critical Fixes for Xaml Markup Binding Support
• Breaking Changes: Removal of Dotnet 7 Support
• Breaking Changes: Removal of Maui OnPlatform and OnIdioms Support Instead Use MauiIcons Integrated Custom OnPlatforms and OnIdioms Feature
diff --git a/src/MauiIcons.Material.Outlined/readme.md b/src/MauiIcons.Material.Outlined/readme.md
index 5caf1d20..843318e9 100644
--- a/src/MauiIcons.Material.Outlined/readme.md
+++ b/src/MauiIcons.Material.Outlined/readme.md
@@ -21,10 +21,30 @@ public static class MauiProgram
}
```
+# Table of Contents
+
+- [Usage](#usage)
+- [Advanced Settings](#advanced-settings)
+- [New Changes in v4](#new-changes-in-v4)
+- [Workaround (Must Read)](#workaround)
+- [Built in Control Usage](#built-in-control-usage)
+- [Xaml Extension Usage](#xaml-extension-usage)
+- [C# Markup Usage](#c-markup-usage)
+- [Applying Icon To Text or Placeholder](#applying-icon-to-text-or-placeholder)
+- [OnPlatform and OnIdiom Usage](#onplatform-and-onidiom-usage)
+- [Breaking Changes](#breaking-changes)
+ - [Version 3 to 4](#version-3-to-4)
+ - [Version 2 to 3](#version-2-to-3)
+ - [Version 1 to 2](#version-1-to-2)
+- [Advanced Usage](#advanced-usage)
+- [License](#license)
+- [Contribute](#contribute)
+
+
# Usage
-In order to make use of the **.Net Maui Icons - Material** you can use the below namespace:
+In order to make use of the **.Net Maui Icons - Material Outlined** you can use the below namespace:
`Xaml`
@@ -37,6 +57,19 @@ xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
using MauiIcons.Material.Outlined;
```
+# Advanced Settings
+
+You can set the default icon size, font override, and default font auto-scaling using the `UseMauiIconsCore` builder extension as follows:
+
+```csharp
+builder.UseMauiIconsCore(x =>
+{
+ x.SetDefaultIconSize(30.0);
+ x.SetDefaultFontOverride(true);
+ x.SetDefaultFontAutoScaling(true);
+})
+```
+
## Workaround
if you came across this issue dotnet/maui#7503 when using new namespace, Make sure to create an discarded instance of MauiIcon in the codebehind like below
@@ -52,12 +85,6 @@ if you came across this issue dotnet/maui#7503 when using new namespace, Make su
```
-## Breaking Changes
-
-### Version 2 to 3
-
- - Removal of **TypeArgument** and Built in OnPlatform and OnIdiom Support, Use MauiIcons Integrated [Custom OnPlatform and OnIdioms Feature](#custom-onplatform-and-onidiom-usage)
- - Removal of **Dotnet 7** Support
## Built in Control Usage
@@ -77,35 +104,11 @@ All the Properties and Features of Built in Control, **[Check Here](https://gith
## Xaml Extension Usage
```xml
-
+
-
-```
-
-## Xaml Extension Data Binding Usage
+
-The below example, Make Sures that BindingContext Inside the Xaml Extension is Set to Root of this Page, Likewise make sure to set the BindingContext When using Binding Inside the MauiIcons Xaml Extension, Additionally This example Binds to MyIcon and MyColor Properties Which Present in Code Behind But Not Included in this Example.
-```xml
-
-
-
-
-
-
-
-
-
-
-
-
+
```
## C# Markup Usage
@@ -115,17 +118,23 @@ new ImageButton().Icon(MaterialOutlinedIcons.AddRoad),
new Image().Icon(MaterialOutlinedIcons.ABC),
-new Label().Icon(MaterialOutlinedIcons.AddRoad).IconSize(40.0).IconColor(Colors.Red),
-
-new Entry().Icon(MaterialOutlinedIcons.ABC).IconSize(20.0).IconColor(Colors.Aqua),
+new Button().Icon(MaterialOutlinedIcons.AddRoad).IconSize(40.0).IconColor(Colors.Red)
```
**Disclaimer:** It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release: **Label**, **Image**, **ImageButton**, **SearchBar**, **Editor**, and **Entry**. Additionally, the native **MauiIcon** control, when combined with C# markup, can prove to be quite versatile and offer extra features for various scenarios.
## Applying Icon To Text or Placeholder
Controls that Supports Placeholder, Can Assign the Icon To PlaceHolder or Text,
-Defaults to Placeholder but can be set to Text by Setting isPlaceHolder Parameter to False
+Defaults to Placeholder but can be set to Text by Setting TargetName Parameter to `Text`
+`xaml`
+```xml
+
+
+
+```
+
+`C#`
```csharp
new Entry().Icon(MaterialOutlinedIcons.ABC, isPlaceHolder: false).IconSize(20.0).IconColor(Colors.Aqua);
@@ -134,7 +143,7 @@ new SearchBar().Icon(MaterialOutlinedIcons.AddRoad, isPlaceHolder: false);
**Disclaimer:** It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release: **Label**, **Image**, **ImageButton**, **SearchBar**, **Editor**, and **Entry**. Additionally, the native **MauiIcon** control, when combined with C# markup, can prove to be quite versatile and offer extra features for various scenarios.
-## Custom OnPlatform and OnIdiom Usage
+## OnPlatform and OnIdiom Usage
`Xaml`
```xml
@@ -150,6 +159,94 @@ new MauiIcon().Icon(MaterialOutlinedIcons.ABC).OnIdioms(new List{"Deskto
new MauiIcon().Icon(MaterialOutlinedIcons.AddRoad).OnPlatforms(new List{"WinUI", "Android"}).OnIdioms(new List{"Desktop", "Phone"});
```
+## Breaking Changes
+
+### Version 3 to 4
+
+ - Icon won't be applied to the Controls like Entry, SearchBar and etc.. by default Instead v4 would throw an Exception, Need to set **FontOverride** to true to apply the Icon to these Controls on Builder Extension Level or Control Level
+ - This Behavior can be reverted to Behavior of v3 by Using new `UseMauiIconsCore` Builder Extension and using `SetDefaultFontOverride` Method like Below
+
+```csharp
+ builder.UseMauiIconsCore(x =>
+ {
+ x.SetDefaultFontOverride(true);
+ })
+```
+
+ - Icon Size is Now Set to Control's FontSize by Default, Previously it was set to **30.0** by Default
+ - This Behavior can be reverted to Behavior of v3 by Using new `UseMauiIconsCore` Builder Extension and using `SetDefaultIconSize` Method like Below
+```csharp
+ builder.UseMauiIconsCore(x =>
+ {
+ x.SetDefaultIconSize(30.0);
+ })
+```
+---
+
+### Version 2 to 3
+
+ - Removal of **TypeArgument** and Built in OnPlatform and OnIdiom Support, Use MauiIcons Integrated [Custom OnPlatform and OnIdioms Feature](#custom-onplatform-and-onidiom-usage)
+ - Removal of **Dotnet 7** Support
+
+#### Nuget Package Changes
+
+- **`AathifMahir.Maui.MauiIcons.Material`** doesn't contain all the Variants anymore, Now only contains **Regular version** of Material Icons. Other Variants Decoupled into Seperate Packages Like Below
+ - [`AathifMahir.Maui.MauiIcons.Material.Outlined`](https://www.nuget.org/packages/AathifMahir.Maui.MauiIcons.Material.Outlined/)
+ - [`AathifMahir.Maui.MauiIcons.Material.Rounded`](https://www.nuget.org/packages/AathifMahir.Maui.MauiIcons.Material.Rounded/)
+ - [`AathifMahir.Maui.MauiIcons.Material.Sharp`](https://www.nuget.org/packages/AathifMahir.Maui.MauiIcons.Material.Sharp/)
+---
+
+### Version 1 to 2
+
+`Old (v1)`
+
+```xml
+xmlns:MaterialOutlined="clr-namespace:MauiIcons.MaterialOutlined;assembly=MauiIcons.MaterialOutlined"
+
+
+```
+
+`New (v2)`
+
+```xml
+xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
+
+
+```
+
+## New Changes in v4
+
+ 1. We have a new way of Assigning/Setting Icons, Introducing New Attached Property for Icons,
+ The new **AttachedProperty** Brings in Support for **Triggers**, **Behaviors**, **Styles**, etc.. which is lacking on Classic Xaml Markup Extension, and also it's more cleaner and readable
+```xml
+/// Old
+
+
+// New
+
+```
+
+**Disclaimer**: The Old Xaml Markup Extension is still Supported and can be used, but it's recommended to use the new Attached Property for better support and readability and we have plans to deprecate the old Xaml Markup Extension in the future in favor of Attached Property
+
+### Example of Using Styles
+```xml
+
+
+
+```
+
+ 2. Introducing New `UseMauiIconsCore` Builder Extension for Setting Default Icon Size, Font Override, Default Font Auto Scaling and etc..
+ 3. Improved Built in OnPlatforms and OnIdioms with Binding Improvements and Enhanced Performance
+ 4. New [`OnClickAnimation`](https://github.com/AathifMahir/MauiIcons/#animation-usage) Support for MauiIcon Control
+
+
+## Advanced Usage
+
+The **.Net Maui Icons** library offers a wide range of features and capabilities, including the ability to customize how icons applied and which property it is applied too and etc. For more information on advanced usage, please refer to the [**Advanced Usage**](https://github.com/AathifMahir/MauiIcons/#advanced-usage)
+
+
# License
**MauiIcons.Material.Outlined**
@@ -158,4 +255,7 @@ MauiIcons.Material.Outlined is Licensed Under [MIT License](https://github.com/A
**Material Design Icons**
Material Design Icons is Licensed Under [Apache License 2.0](https://github.com/google/material-design-icons/blob/master/LICENSE).
+# Contribute
+
+If you wish to contribute to this project, please don't hesitate to create an [issue or request](https://github.com/AathifMahir/MauiIcons/issues). Your input and feedback are highly appreciated. Additionally, if you're interested in supporting the project by providing resources or [**becoming a sponsor**](https://github.com/sponsors/AathifMahir), your contributions would be welcomed and instrumental in its continued development and success. Thank you for your interest in contributing to this endeavor.
diff --git a/src/MauiIcons.Material.Rounded/ReadMe.txt b/src/MauiIcons.Material.Rounded/ReadMe.txt
index 7b0425ce..8921f82e 100644
--- a/src/MauiIcons.Material.Rounded/ReadMe.txt
+++ b/src/MauiIcons.Material.Rounded/ReadMe.txt
@@ -38,9 +38,9 @@ new MauiIcon().Icon(MaterialRoundedIcons.AddRoad).IconColor(Colors.Purple);
Xaml Extension Usage:
-
+
-
+
----------------------------------------------------------------------------------------------
@@ -50,9 +50,7 @@ new ImageButton().Icon(MaterialRoundedIcons.ABC),
new Image().Icon(MaterialRoundedIcons.AddRoad),
-new Label().Icon(MaterialRoundedIcons.ABC).IconSize(40.0).IconColor(Colors.Red),
-
-new Entry().Icon(MaterialRoundedIcons.AddRoad).IconSize(20.0).IconColor(Colors.Aqua),
+new Button().Icon(MaterialRoundedIcons.ABC).IconSize(40.0).IconColor(Colors.Red),
Disclaimer: It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release:
diff --git a/src/MauiIcons.Material.Rounded/ReleaseNotes.txt b/src/MauiIcons.Material.Rounded/ReleaseNotes.txt
index 9c30a8bf..4aabb007 100644
--- a/src/MauiIcons.Material.Rounded/ReleaseNotes.txt
+++ b/src/MauiIcons.Material.Rounded/ReleaseNotes.txt
@@ -1,4 +1,13 @@
-v3.0.0
+v4.0.0
+• Various Enhancements and Fixes for MauiIcon Control
+• New Attached Property for Seamless Icon Integration
+• Styles and Triggers Support
+• New OnClick Animation Support for MauiIcon Control
+• Enhanced Global Customization Support using New `UseMauiIconsCore` Extension
+• Overall Fixes and Enhancements
+• Breaking Changes: [https://github.com/AathifMahir/MauiIcons/#breaking-changes]
+
+v3.0.0
• Critical Fixes for Xaml Markup Binding Support
• Breaking Changes: Removal of Dotnet 7 Support
• Breaking Changes: Removal of Maui OnPlatform and OnIdioms Support Instead Use MauiIcons Integrated Custom OnPlatforms and OnIdioms Feature
diff --git a/src/MauiIcons.Material.Rounded/readme.md b/src/MauiIcons.Material.Rounded/readme.md
index b691e323..d684d9df 100644
--- a/src/MauiIcons.Material.Rounded/readme.md
+++ b/src/MauiIcons.Material.Rounded/readme.md
@@ -7,7 +7,7 @@ The **.NET MAUI Icons - Material Rounded** library serves as a lightweight icon
In order to use the .NET MAUI Icons - Material Rounded you need to call the extension method in your `MauiProgram.cs` file as follows:
```csharp
-using MauiIcons.Material;
+using MauiIcons.Material.Rounded;
public static class MauiProgram
{
@@ -21,8 +21,29 @@ public static class MauiProgram
}
```
+# Table of Contents
+
+- [Usage](#usage)
+- [Advanced Settings](#advanced-settings)
+- [New Changes in v4](#new-changes-in-v4)
+- [Workaround (Must Read)](#workaround)
+- [Built in Control Usage](#built-in-control-usage)
+- [Xaml Extension Usage](#xaml-extension-usage)
+- [C# Markup Usage](#c-markup-usage)
+- [Applying Icon To Text or Placeholder](#applying-icon-to-text-or-placeholder)
+- [OnPlatform and OnIdiom Usage](#onplatform-and-onidiom-usage)
+- [Breaking Changes](#breaking-changes)
+ - [Version 3 to 4](#version-3-to-4)
+ - [Version 2 to 3](#version-2-to-3)
+ - [Version 1 to 2](#version-1-to-2)
+- [Advanced Usage](#advanced-usage)
+- [License](#license)
+- [Contribute](#contribute)
+
+
# Usage
+
In order to make use of the **.Net Maui Icons - Material Rounded** you can use the below namespace:
`Xaml`
@@ -36,6 +57,19 @@ xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
using MauiIcons.Material.Rounded;
```
+# Advanced Settings
+
+You can set the default icon size, font override, and default font auto-scaling using the `UseMauiIconsCore` builder extension as follows:
+
+```csharp
+builder.UseMauiIconsCore(x =>
+{
+ x.SetDefaultIconSize(30.0);
+ x.SetDefaultFontOverride(true);
+ x.SetDefaultFontAutoScaling(true);
+})
+```
+
## Workaround
if you came across this issue dotnet/maui#7503 when using new namespace, Make sure to create an discarded instance of MauiIcon in the codebehind like below
@@ -51,13 +85,6 @@ if you came across this issue dotnet/maui#7503 when using new namespace, Make su
```
-## Breaking Changes
-
-### Version 2 to 3
-
- - Removal of **TypeArgument** and Built in OnPlatform and OnIdiom Support, Use MauiIcons Integrated [Custom OnPlatform and OnIdioms Feature](#custom-onplatform-and-onidiom-usage)
- - Removal of **Dotnet 7** Support
-
## Built in Control Usage
@@ -77,9 +104,11 @@ All the Properties and Features of Built in Control, **[Check Here](https://gith
## Xaml Extension Usage
```xml
-
+
-
+
+
+
```
## C# Markup Usage
@@ -89,43 +118,23 @@ new ImageButton().Icon(MaterialRoundedIcons.AddRoad),
new Image().Icon(MaterialRoundedIcons.ABC),
-new Label().Icon(MaterialRoundedIcons.AddRoad).IconSize(40.0).IconColor(Colors.Red),
-
-new Entry().Icon(MaterialRoundedIcons.ABC).IconSize(20.0).IconColor(Colors.Aqua),
-```
-
-## Xaml Extension Data Binding Usage
-
-The below example, Make Sures that BindingContext Inside the Xaml Extension is Set to Root of this Page, Likewise make sure to set the BindingContext When using Binding Inside the MauiIcons Xaml Extension, Additionally This example Binds to MyIcon and MyColor Properties Which Present in Code Behind But Not Included in this Example.
-```xml
-
-
-
-
-
-
-
-
-
-
-
-
+new Button().Icon(MaterialRoundedIcons.AddRoad).IconSize(40.0).IconColor(Colors.Red)
```
**Disclaimer:** It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release: **Label**, **Image**, **ImageButton**, **SearchBar**, **Editor**, and **Entry**. Additionally, the native **MauiIcon** control, when combined with C# markup, can prove to be quite versatile and offer extra features for various scenarios.
## Applying Icon To Text or Placeholder
Controls that Supports Placeholder, Can Assign the Icon To PlaceHolder or Text,
-Defaults to Placeholder but can be set to Text by Setting isPlaceHolder Parameter to False
+Defaults to Placeholder but can be set to Text by Setting TargetName Parameter to `Text`
+
+`xaml`
+```xml
+
+
+
+```
+`C#`
```csharp
new Entry().Icon(MaterialRoundedIcons.ABC, isPlaceHolder: false).IconSize(20.0).IconColor(Colors.Aqua);
@@ -134,7 +143,7 @@ new SearchBar().Icon(MaterialRoundedIcons.AddRoad, isPlaceHolder: false);
**Disclaimer:** It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release: **Label**, **Image**, **ImageButton**, **SearchBar**, **Editor**, and **Entry**. Additionally, the native **MauiIcon** control, when combined with C# markup, can prove to be quite versatile and offer extra features for various scenarios.
-## Custom OnPlatform and OnIdiom Usage
+## OnPlatform and OnIdiom Usage
`Xaml`
```xml
@@ -150,6 +159,93 @@ new MauiIcon().Icon(MaterialRoundedIcons.ABC).OnIdioms(new List{"Desktop
new MauiIcon().Icon(MaterialRoundedIcons.AddRoad).OnPlatforms(new List{"WinUI", "Android"}).OnIdioms(new List{"Desktop", "Phone"});
```
+## Breaking Changes
+
+### Version 3 to 4
+
+ - Icon won't be applied to the Controls like Entry, SearchBar and etc.. by default Instead v4 would throw an Exception, Need to set **FontOverride** to true to apply the Icon to these Controls on Builder Extension Level or Control Level
+ - This Behavior can be reverted to Behavior of v3 by Using new `UseMauiIconsCore` Builder Extension and using `SetDefaultFontOverride` Method like Below
+
+```csharp
+ builder.UseMauiIconsCore(x =>
+ {
+ x.SetDefaultFontOverride(true);
+ })
+```
+
+ - Icon Size is Now Set to Control's FontSize by Default, Previously it was set to **30.0** by Default
+ - This Behavior can be reverted to Behavior of v3 by Using new `UseMauiIconsCore` Builder Extension and using `SetDefaultIconSize` Method like Below
+```csharp
+ builder.UseMauiIconsCore(x =>
+ {
+ x.SetDefaultIconSize(30.0);
+ })
+```
+---
+
+### Version 2 to 3
+
+ - Removal of **TypeArgument** and Built in OnPlatform and OnIdiom Support, Use MauiIcons Integrated [Custom OnPlatform and OnIdioms Feature](#custom-onplatform-and-onidiom-usage)
+ - Removal of **Dotnet 7** Support
+
+#### Nuget Package Changes
+
+- **`AathifMahir.Maui.MauiIcons.Material`** doesn't contain all the Variants anymore, Now only contains **Regular version** of Material Icons. Other Variants Decoupled into Seperate Packages Like Below
+ - [`AathifMahir.Maui.MauiIcons.Material.Outlined`](https://www.nuget.org/packages/AathifMahir.Maui.MauiIcons.Material.Outlined/)
+ - [`AathifMahir.Maui.MauiIcons.Material.Rounded`](https://www.nuget.org/packages/AathifMahir.Maui.MauiIcons.Material.Rounded/)
+ - [`AathifMahir.Maui.MauiIcons.Material.Sharp`](https://www.nuget.org/packages/AathifMahir.Maui.MauiIcons.Material.Sharp/)
+---
+
+### Version 1 to 2
+
+`Old (v1)`
+
+```xml
+xmlns:MaterialRounded="clr-namespace:MauiIcons.MaterialRounded;assembly=MauiIcons.MaterialRounded"
+
+
+```
+
+`New (v2)`
+
+```xml
+xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
+
+
+```
+
+## New Changes in v4
+
+ 1. We have a new way of Assigning/Setting Icons, Introducing New Attached Property for Icons,
+ The new **AttachedProperty** Brings in Support for **Triggers**, **Behaviors**, **Styles**, etc.. which is lacking on Classic Xaml Markup Extension, and also it's more cleaner and readable
+```xml
+/// Old
+
+
+// New
+
+```
+
+**Disclaimer**: The Old Xaml Markup Extension is still Supported and can be used, but it's recommended to use the new Attached Property for better support and readability and we have plans to deprecate the old Xaml Markup Extension in the future in favor of Attached Property
+
+### Example of Using Styles
+```xml
+
+
+
+```
+
+ 2. Introducing New `UseMauiIconsCore` Builder Extension for Setting Default Icon Size, Font Override, Default Font Auto Scaling and etc..
+ 3. Improved Built in OnPlatforms and OnIdioms with Binding Improvements and Enhanced Performance
+ 4. New [`OnClickAnimation`](https://github.com/AathifMahir/MauiIcons/#animation-usage) Support for MauiIcon Control
+
+
+## Advanced Usage
+
+The **.Net Maui Icons** library offers a wide range of features and capabilities, including the ability to customize how icons applied and which property it is applied too and etc. For more information on advanced usage, please refer to the [**Advanced Usage**](https://github.com/AathifMahir/MauiIcons/#advanced-usage)
+
# License
**MauiIcons.Material.Rounded**
@@ -158,4 +254,8 @@ MauiIcons.Material.Rounded is Licensed Under [MIT License](https://github.com/Aa
**Material Design Icons**
Material Design Icons is Licensed Under [Apache License 2.0](https://github.com/google/material-design-icons/blob/master/LICENSE).
+# Contribute
+
+If you wish to contribute to this project, please don't hesitate to create an [issue or request](https://github.com/AathifMahir/MauiIcons/issues). Your input and feedback are highly appreciated. Additionally, if you're interested in supporting the project by providing resources or [**becoming a sponsor**](https://github.com/sponsors/AathifMahir), your contributions would be welcomed and instrumental in its continued development and success. Thank you for your interest in contributing to this endeavor.
+
diff --git a/src/MauiIcons.Material.Sharp/ReadMe.txt b/src/MauiIcons.Material.Sharp/ReadMe.txt
index b8ed7fa3..9bf12916 100644
--- a/src/MauiIcons.Material.Sharp/ReadMe.txt
+++ b/src/MauiIcons.Material.Sharp/ReadMe.txt
@@ -38,9 +38,9 @@ new MauiIcon().Icon(MaterialSharpIcons.AddRoad).IconColor(Colors.Purple);
Xaml Extension Usage:
-
+
-
+
----------------------------------------------------------------------------------------------
@@ -50,9 +50,7 @@ new ImageButton().Icon(MaterialSharpIcons.ABC),
new Image().Icon(MaterialSharpIcons.AddRoad),
-new Label().Icon(MaterialSharpIcons.ABC).IconSize(40.0).IconColor(Colors.Red),
-
-new Entry().Icon(MaterialSharpIcons.AddRoad).IconSize(20.0).IconColor(Colors.Aqua),
+new Button().Icon(MaterialSharpIcons.ABC).IconSize(40.0).IconColor(Colors.Red),
Disclaimer: It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release:
diff --git a/src/MauiIcons.Material.Sharp/ReleaseNotes.txt b/src/MauiIcons.Material.Sharp/ReleaseNotes.txt
index 9c30a8bf..4aabb007 100644
--- a/src/MauiIcons.Material.Sharp/ReleaseNotes.txt
+++ b/src/MauiIcons.Material.Sharp/ReleaseNotes.txt
@@ -1,4 +1,13 @@
-v3.0.0
+v4.0.0
+• Various Enhancements and Fixes for MauiIcon Control
+• New Attached Property for Seamless Icon Integration
+• Styles and Triggers Support
+• New OnClick Animation Support for MauiIcon Control
+• Enhanced Global Customization Support using New `UseMauiIconsCore` Extension
+• Overall Fixes and Enhancements
+• Breaking Changes: [https://github.com/AathifMahir/MauiIcons/#breaking-changes]
+
+v3.0.0
• Critical Fixes for Xaml Markup Binding Support
• Breaking Changes: Removal of Dotnet 7 Support
• Breaking Changes: Removal of Maui OnPlatform and OnIdioms Support Instead Use MauiIcons Integrated Custom OnPlatforms and OnIdioms Feature
diff --git a/src/MauiIcons.Material.Sharp/readme.md b/src/MauiIcons.Material.Sharp/readme.md
index 2e019331..1bb8fad3 100644
--- a/src/MauiIcons.Material.Sharp/readme.md
+++ b/src/MauiIcons.Material.Sharp/readme.md
@@ -21,6 +21,26 @@ public static class MauiProgram
}
```
+# Table of Contents
+
+- [Usage](#usage)
+- [Advanced Settings](#advanced-settings)
+- [New Changes in v4](#new-changes-in-v4)
+- [Workaround (Must Read)](#workaround)
+- [Built in Control Usage](#built-in-control-usage)
+- [Xaml Extension Usage](#xaml-extension-usage)
+- [C# Markup Usage](#c-markup-usage)
+- [Applying Icon To Text or Placeholder](#applying-icon-to-text-or-placeholder)
+- [OnPlatform and OnIdiom Usage](#onplatform-and-onidiom-usage)
+- [Breaking Changes](#breaking-changes)
+ - [Version 3 to 4](#version-3-to-4)
+ - [Version 2 to 3](#version-2-to-3)
+ - [Version 1 to 2](#version-1-to-2)
+- [Advanced Usage](#advanced-usage)
+- [License](#license)
+- [Contribute](#contribute)
+
+
# Usage
@@ -37,6 +57,19 @@ xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
using MauiIcons.Material.Sharp;
```
+# Advanced Settings
+
+You can set the default icon size, font override, and default font auto-scaling using the `UseMauiIconsCore` builder extension as follows:
+
+```csharp
+builder.UseMauiIconsCore(x =>
+{
+ x.SetDefaultIconSize(30.0);
+ x.SetDefaultFontOverride(true);
+ x.SetDefaultFontAutoScaling(true);
+})
+```
+
## Workaround
if you came across this issue dotnet/maui#7503 when using new namespace, Make sure to create an discarded instance of MauiIcon in the codebehind like below
@@ -52,12 +85,6 @@ if you came across this issue dotnet/maui#7503 when using new namespace, Make su
```
-## Breaking Changes
-
-### Version 2 to 3
-
- - Removal of **TypeArgument** and Built in OnPlatform and OnIdiom Support, Use MauiIcons Integrated [Custom OnPlatform and OnIdioms Feature](#custom-onplatform-and-onidiom-usage)
- - Removal of **Dotnet 7** Support
## Built in Control Usage
@@ -77,35 +104,11 @@ All the Properties and Features of Built in Control, **[Check Here](https://gith
## Xaml Extension Usage
```xml
-
+
-
-```
-
-## Xaml Extension Data Binding Usage
+
-The below example, Make Sures that BindingContext Inside the Xaml Extension is Set to Root of this Page, Likewise make sure to set the BindingContext When using Binding Inside the MauiIcons Xaml Extension, Additionally This example Binds to MyIcon and MyColor Properties Which Present in Code Behind But Not Included in this Example.
-```xml
-
-
-
-
-
-
-
-
-
-
-
-
+
```
## C# Markup Usage
@@ -115,17 +118,23 @@ new ImageButton().Icon(MaterialSharpIcons.AddRoad),
new Image().Icon(MaterialSharpIcons.ABC),
-new Label().Icon(MaterialSharpIcons.AddRoad).IconSize(40.0).IconColor(Colors.Red),
-
-new Entry().Icon(MaterialSharpIcons.ABC).IconSize(20.0).IconColor(Colors.Aqua),
+new Button().Icon(MaterialSharpIcons.AddRoad).IconSize(40.0).IconColor(Colors.Red)
```
**Disclaimer:** It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release: **Label**, **Image**, **ImageButton**, **SearchBar**, **Editor**, and **Entry**. Additionally, the native **MauiIcon** control, when combined with C# markup, can prove to be quite versatile and offer extra features for various scenarios.
## Applying Icon To Text or Placeholder
Controls that Supports Placeholder, Can Assign the Icon To PlaceHolder or Text,
-Defaults to Placeholder but can be set to Text by Setting isPlaceHolder Parameter to False
+Defaults to Placeholder but can be set to Text by Setting TargetName Parameter to `Text`
+`xaml`
+```xml
+
+
+
+```
+
+`C#`
```csharp
new Entry().Icon(MaterialSharpIcons.ABC, isPlaceHolder: false).IconSize(20.0).IconColor(Colors.Aqua);
@@ -134,7 +143,7 @@ new SearchBar().Icon(MaterialSharpIcons.AddRoad, isPlaceHolder: false);
**Disclaimer:** It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release: **Label**, **Image**, **ImageButton**, **SearchBar**, **Editor**, and **Entry**. Additionally, the native **MauiIcon** control, when combined with C# markup, can prove to be quite versatile and offer extra features for various scenarios.
-## Custom OnPlatform and OnIdiom Usage
+## OnPlatform and OnIdiom Usage
`Xaml`
```xml
@@ -150,6 +159,94 @@ new MauiIcon().Icon(MaterialSharpIcons.ABC).OnIdioms(new List{"Desktop",
new MauiIcon().Icon(MaterialSharpIcons.AddRoad).OnPlatforms(new List{"WinUI", "Android"}).OnIdioms(new List{"Desktop", "Phone"});
```
+## Breaking Changes
+
+### Version 3 to 4
+
+ - Icon won't be applied to the Controls like Entry, SearchBar and etc.. by default Instead v4 would throw an Exception, Need to set **FontOverride** to true to apply the Icon to these Controls on Builder Extension Level or Control Level
+ - This Behavior can be reverted to Behavior of v3 by Using new `UseMauiIconsCore` Builder Extension and using `SetDefaultFontOverride` Method like Below
+
+```csharp
+ builder.UseMauiIconsCore(x =>
+ {
+ x.SetDefaultFontOverride(true);
+ })
+```
+
+ - Icon Size is Now Set to Control's FontSize by Default, Previously it was set to **30.0** by Default
+ - This Behavior can be reverted to Behavior of v3 by Using new `UseMauiIconsCore` Builder Extension and using `SetDefaultIconSize` Method like Below
+```csharp
+ builder.UseMauiIconsCore(x =>
+ {
+ x.SetDefaultIconSize(30.0);
+ })
+```
+---
+
+### Version 2 to 3
+
+ - Removal of **TypeArgument** and Built in OnPlatform and OnIdiom Support, Use MauiIcons Integrated [Custom OnPlatform and OnIdioms Feature](#custom-onplatform-and-onidiom-usage)
+ - Removal of **Dotnet 7** Support
+
+#### Nuget Package Changes
+
+- **`AathifMahir.Maui.MauiIcons.Material`** doesn't contain all the Variants anymore, Now only contains **Regular version** of Material Icons. Other Variants Decoupled into Seperate Packages Like Below
+ - [`AathifMahir.Maui.MauiIcons.Material.Outlined`](https://www.nuget.org/packages/AathifMahir.Maui.MauiIcons.Material.Outlined/)
+ - [`AathifMahir.Maui.MauiIcons.Material.Rounded`](https://www.nuget.org/packages/AathifMahir.Maui.MauiIcons.Material.Rounded/)
+ - [`AathifMahir.Maui.MauiIcons.Material.Sharp`](https://www.nuget.org/packages/AathifMahir.Maui.MauiIcons.Material.Sharp/)
+---
+
+### Version 1 to 2
+
+`Old (v1)`
+
+```xml
+xmlns:MaterialSharp="clr-namespace:MauiIcons.MaterialSharp;assembly=MauiIcons.MaterialSharp"
+
+
+```
+
+`New (v2)`
+
+```xml
+xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
+
+
+```
+
+## New Changes in v4
+
+ 1. We have a new way of Assigning/Setting Icons, Introducing New Attached Property for Icons,
+ The new **AttachedProperty** Brings in Support for **Triggers**, **Behaviors**, **Styles**, etc.. which is lacking on Classic Xaml Markup Extension, and also it's more cleaner and readable
+```xml
+/// Old
+
+
+// New
+
+```
+
+**Disclaimer**: The Old Xaml Markup Extension is still Supported and can be used, but it's recommended to use the new Attached Property for better support and readability and we have plans to deprecate the old Xaml Markup Extension in the future in favor of Attached Property
+
+### Example of Using Styles
+```xml
+
+
+
+```
+
+ 2. Introducing New `UseMauiIconsCore` Builder Extension for Setting Default Icon Size, Font Override, Default Font Auto Scaling and etc..
+ 3. Improved Built in OnPlatforms and OnIdioms with Binding Improvements and Enhanced Performance
+ 4. New [`OnClickAnimation`](https://github.com/AathifMahir/MauiIcons/#animation-usage) Support for MauiIcon Control
+
+
+## Advanced Usage
+
+The **.Net Maui Icons** library offers a wide range of features and capabilities, including the ability to customize how icons applied and which property it is applied too and etc. For more information on advanced usage, please refer to the [**Advanced Usage**](https://github.com/AathifMahir/MauiIcons/#advanced-usage)
+
+
# License
**MauiIcons.Material.Sharp**
@@ -158,4 +255,8 @@ MauiIcons.Material.Sharp is Licensed Under [MIT License](https://github.com/Aath
**Material Design Icons**
Material Design Icons is Licensed Under [Apache License 2.0](https://github.com/google/material-design-icons/blob/master/LICENSE).
+# Contribute
+
+If you wish to contribute to this project, please don't hesitate to create an [issue or request](https://github.com/AathifMahir/MauiIcons/issues). Your input and feedback are highly appreciated. Additionally, if you're interested in supporting the project by providing resources or [**becoming a sponsor**](https://github.com/sponsors/AathifMahir), your contributions would be welcomed and instrumental in its continued development and success. Thank you for your interest in contributing to this endeavor.
+
diff --git a/src/MauiIcons.Material/ReadMe.txt b/src/MauiIcons.Material/ReadMe.txt
index c662da96..bd97b1e8 100644
--- a/src/MauiIcons.Material/ReadMe.txt
+++ b/src/MauiIcons.Material/ReadMe.txt
@@ -38,9 +38,9 @@ new MauiIcon().Icon(MaterialIcons.AddRoad).IconColor(Colors.Purple);
Xaml Extension Usage:
-
+
-
+
----------------------------------------------------------------------------------------------
@@ -50,9 +50,7 @@ new ImageButton().Icon(MaterialIcons.ABC),
new Image().Icon(MaterialIcons.AddRoad),
-new Label().Icon(MaterialIcons.ABC).IconSize(40.0).IconColor(Colors.Red),
-
-new Entry().Icon(MaterialIcons.AddRoad).IconSize(20.0).IconColor(Colors.Aqua),
+new Button().Icon(MaterialIcons.ABC).IconSize(40.0).IconColor(Colors.Red),
Disclaimer: It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release:
diff --git a/src/MauiIcons.Material/ReleaseNotes.txt b/src/MauiIcons.Material/ReleaseNotes.txt
index 7579889d..bcb5274b 100644
--- a/src/MauiIcons.Material/ReleaseNotes.txt
+++ b/src/MauiIcons.Material/ReleaseNotes.txt
@@ -1,4 +1,13 @@
-v3.0.0
+v4.0.0
+• Various Enhancements and Fixes for MauiIcon Control
+• New Attached Property for Seamless Icon Integration
+• Styles and Triggers Support
+• New OnClick Animation Support for MauiIcon Control
+• Enhanced Global Customization Support using New `UseMauiIconsCore` Extension
+• Overall Fixes and Enhancements
+• Breaking Changes: [https://github.com/AathifMahir/MauiIcons/#breaking-changes]
+
+v3.0.0
• Critical Fixes for Xaml Markup Binding Support
• Breaking Changes: Removal of Dotnet 7 Support
• Breaking Changes: Removal of Maui OnPlatform and OnIdioms Support Instead Use MauiIcons Integrated Custom OnPlatforms and OnIdioms Feature
diff --git a/src/MauiIcons.Material/readme.md b/src/MauiIcons.Material/readme.md
index 556b470a..39fcfb29 100644
--- a/src/MauiIcons.Material/readme.md
+++ b/src/MauiIcons.Material/readme.md
@@ -21,6 +21,26 @@ public static class MauiProgram
}
```
+# Table of Contents
+
+- [Usage](#usage)
+- [Advanced Settings](#advanced-settings)
+- [New Changes in v4](#new-changes-in-v4)
+- [Workaround (Must Read)](#workaround)
+- [Built in Control Usage](#built-in-control-usage)
+- [Xaml Extension Usage](#xaml-extension-usage)
+- [C# Markup Usage](#c-markup-usage)
+- [Applying Icon To Text or Placeholder](#applying-icon-to-text-or-placeholder)
+- [OnPlatform and OnIdiom Usage](#onplatform-and-onidiom-usage)
+- [Breaking Changes](#breaking-changes)
+ - [Version 3 to 4](#version-3-to-4)
+ - [Version 2 to 3](#version-2-to-3)
+ - [Version 1 to 2](#version-1-to-2)
+- [Advanced Usage](#advanced-usage)
+- [License](#license)
+- [Contribute](#contribute)
+
+
# Usage
@@ -37,6 +57,19 @@ xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
using MauiIcons.Material;
```
+# Advanced Settings
+
+You can set the default icon size, font override, and default font auto-scaling using the `UseMauiIconsCore` builder extension as follows:
+
+```csharp
+builder.UseMauiIconsCore(x =>
+{
+ x.SetDefaultIconSize(30.0);
+ x.SetDefaultFontOverride(true);
+ x.SetDefaultFontAutoScaling(true);
+})
+```
+
## Workaround
if you came across this issue dotnet/maui#7503 when using new namespace, Make sure to create an discarded instance of MauiIcon in the codebehind like below
@@ -52,38 +85,6 @@ if you came across this issue dotnet/maui#7503 when using new namespace, Make su
```
-## Breaking Changes
-
-### Version 1 to 2
-
-`Old (v1)`
-
-```xml
-xmlns:material="clr-namespace:MauiIcons.Material;assembly=MauiIcons.Material"
-
-
-```
-
-`New (v2)`
-
-```xml
-xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
-
-
-```
-
-### Version 2 to 3
-
- - Removal of **TypeArgument** and Built in OnPlatform and OnIdiom Support, Use MauiIcons Integrated [Custom OnPlatform and OnIdioms Feature](#custom-onplatform-and-onidiom-usage)
- - Removal of **Dotnet 7** Support
-
-### Nuget Package Changes
-
-- **`AathifMahir.Maui.MauiIcons.Material`** doesn't contain all the Variants anymore, Now only contains **Regular version** of Material Icons. Other Variants Decoupled into Seperate Packages Like Below
- - [`AathifMahir.Maui.MauiIcons.Material.Outlined`](https://www.nuget.org/packages/AathifMahir.Maui.MauiIcons.Material.Outlined/)
- - [`AathifMahir.Maui.MauiIcons.Material.Rounded`](https://www.nuget.org/packages/AathifMahir.Maui.MauiIcons.Material.Rounded/)
- - [`AathifMahir.Maui.MauiIcons.Material.Sharp`](https://www.nuget.org/packages/AathifMahir.Maui.MauiIcons.Material.Sharp/)
-
## Built in Control Usage
@@ -103,35 +104,11 @@ All the Properties and Features of Built in Control, **[Check Here](https://gith
## Xaml Extension Usage
```xml
-
-
-
-```
+
-## Xaml Extension Data Binding Usage
+
-The below example, Make Sures that BindingContext Inside the Xaml Extension is Set to Root of this Page, Likewise make sure to set the BindingContext When using Binding Inside the MauiIcons Xaml Extension, Additionally This example Binds to MyIcon and MyColor Properties Which Present in Code Behind But Not Included in this Example.
-```xml
-
-
-
-
-
-
-
-
-
-
-
-
+
```
## C# Markup Usage
@@ -141,17 +118,23 @@ new ImageButton().Icon(MaterialIcons.AddRoad),
new Image().Icon(MaterialIcons.ABC),
-new Label().Icon(MaterialIcons.AddRoad).IconSize(40.0).IconColor(Colors.Red),
-
-new Entry().Icon(MaterialIcons.ABC).IconSize(20.0).IconColor(Colors.Aqua),
+new Button().Icon(MaterialIcons.AddRoad).IconSize(40.0).IconColor(Colors.Red)
```
**Disclaimer:** It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release: **Label**, **Image**, **ImageButton**, **SearchBar**, **Editor**, and **Entry**. Additionally, the native **MauiIcon** control, when combined with C# markup, can prove to be quite versatile and offer extra features for various scenarios.
## Applying Icon To Text or Placeholder
Controls that Supports Placeholder, Can Assign the Icon To PlaceHolder or Text,
-Defaults to Placeholder but can be set to Text by Setting isPlaceHolder Parameter to False
+Defaults to Placeholder but can be set to Text by Setting TargetName Parameter to `Text`
+
+`xaml`
+```xml
+
+
+```
+
+`C#`
```csharp
new Entry().Icon(MaterialIcons.ABC, isPlaceHolder: false).IconSize(20.0).IconColor(Colors.Aqua);
@@ -160,7 +143,7 @@ new SearchBar().Icon(MaterialIcons.AddRoad, isPlaceHolder: false);
**Disclaimer:** It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release: **Label**, **Image**, **ImageButton**, **SearchBar**, **Editor**, and **Entry**. Additionally, the native **MauiIcon** control, when combined with C# markup, can prove to be quite versatile and offer extra features for various scenarios.
-## Custom OnPlatform and OnIdiom Usage
+## OnPlatform and OnIdiom Usage
`Xaml`
```xml
@@ -176,6 +159,94 @@ new MauiIcon().Icon(MaterialIcons.ABC).OnIdioms(new List{"Desktop", "Pho
new MauiIcon().Icon(MaterialIcons.AddRoad).OnPlatforms(new List{"WinUI", "Android"}).OnIdioms(new List{"Desktop", "Phone"});
```
+## Breaking Changes
+
+### Version 3 to 4
+
+ - Icon won't be applied to the Controls like Entry, SearchBar and etc.. by default Instead v4 would throw an Exception, Need to set **FontOverride** to true to apply the Icon to these Controls on Builder Extension Level or Control Level
+ - This Behavior can be reverted to Behavior of v3 by Using new `UseMauiIconsCore` Builder Extension and using `SetDefaultFontOverride` Method like Below
+
+```csharp
+ builder.UseMauiIconsCore(x =>
+ {
+ x.SetDefaultFontOverride(true);
+ })
+```
+
+ - Icon Size is Now Set to Control's FontSize by Default, Previously it was set to **30.0** by Default
+ - This Behavior can be reverted to Behavior of v3 by Using new `UseMauiIconsCore` Builder Extension and using `SetDefaultIconSize` Method like Below
+```csharp
+ builder.UseMauiIconsCore(x =>
+ {
+ x.SetDefaultIconSize(30.0);
+ })
+```
+---
+
+### Version 2 to 3
+
+ - Removal of **TypeArgument** and Built in OnPlatform and OnIdiom Support, Use MauiIcons Integrated [Custom OnPlatform and OnIdioms Feature](#custom-onplatform-and-onidiom-usage)
+ - Removal of **Dotnet 7** Support
+
+#### Nuget Package Changes
+
+- **`AathifMahir.Maui.MauiIcons.Material`** doesn't contain all the Variants anymore, Now only contains **Regular version** of Material Icons. Other Variants Decoupled into Seperate Packages Like Below
+ - [`AathifMahir.Maui.MauiIcons.Material.Outlined`](https://www.nuget.org/packages/AathifMahir.Maui.MauiIcons.Material.Outlined/)
+ - [`AathifMahir.Maui.MauiIcons.Material.Rounded`](https://www.nuget.org/packages/AathifMahir.Maui.MauiIcons.Material.Rounded/)
+ - [`AathifMahir.Maui.MauiIcons.Material.Sharp`](https://www.nuget.org/packages/AathifMahir.Maui.MauiIcons.Material.Sharp/)
+---
+
+### Version 1 to 2
+
+`Old (v1)`
+
+```xml
+xmlns:material="clr-namespace:MauiIcons.Material;assembly=MauiIcons.Material"
+
+
+```
+
+`New (v2)`
+
+```xml
+xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
+
+
+```
+
+## New Changes in v4
+
+ 1. We have a new way of Assigning/Setting Icons, Introducing New Attached Property for Icons,
+ The new **AttachedProperty** Brings in Support for **Triggers**, **Behaviors**, **Styles**, etc.. which is lacking on Classic Xaml Markup Extension, and also it's more cleaner and readable
+```xml
+/// Old
+
+
+// New
+
+```
+
+**Disclaimer**: The Old Xaml Markup Extension is still Supported and can be used, but it's recommended to use the new Attached Property for better support and readability and we have plans to deprecate the old Xaml Markup Extension in the future in favor of Attached Property
+
+### Example of Using Styles
+```xml
+
+
+
+```
+
+ 2. Introducing New `UseMauiIconsCore` Builder Extension for Setting Default Icon Size, Font Override, Default Font Auto Scaling and etc..
+ 3. Improved Built in OnPlatforms and OnIdioms with Binding Improvements and Enhanced Performance
+ 4. New [`OnClickAnimation`](https://github.com/AathifMahir/MauiIcons/#animation-usage) Support for MauiIcon Control
+
+
+## Advanced Usage
+
+The **.Net Maui Icons** library offers a wide range of features and capabilities, including the ability to customize how icons applied and which property it is applied too and etc. For more information on advanced usage, please refer to the [**Advanced Usage**](https://github.com/AathifMahir/MauiIcons/#advanced-usage)
+
+
# License
**MauiIcons.Material**
@@ -184,4 +255,9 @@ MauiIcons.Material is Licensed Under [MIT License](https://github.com/AathifMahi
**Material Design Icons**
Material Design Icons is Licensed Under [Apache License 2.0](https://github.com/google/material-design-icons/blob/master/LICENSE).
+# Contribute
+
+If you wish to contribute to this project, please don't hesitate to create an [issue or request](https://github.com/AathifMahir/MauiIcons/issues). Your input and feedback are highly appreciated. Additionally, if you're interested in supporting the project by providing resources or [**becoming a sponsor**](https://github.com/sponsors/AathifMahir), your contributions would be welcomed and instrumental in its continued development and success. Thank you for your interest in contributing to this endeavor.
+
+
diff --git a/src/MauiIcons.Modules.UnitTest/Controls/MauiIconTest.cs b/src/MauiIcons.Modules.UnitTest/Controls/MauiIconTest.cs
index cfec566a..fea93539 100644
--- a/src/MauiIcons.Modules.UnitTest/Controls/MauiIconTest.cs
+++ b/src/MauiIcons.Modules.UnitTest/Controls/MauiIconTest.cs
@@ -375,7 +375,7 @@ public void IconAndSuffixBackgroundColorChanged()
mauiiIcon = new MauiIcon();
mauiiIcon.PropertyChanged += (sender, e) =>
{
- if (e.PropertyName == "IconAndSuffixBackgroundColor")
+ if (e.PropertyName == "BackgroundColor")
{
changedSignaled = true;
}
@@ -397,12 +397,12 @@ public void IconAndSuffixBackgroundColorChangedToNull()
Color assignedColor = null!;
// Act
- mauiiIcon = new MauiIcon() { IconAndSuffixBackgroundColor = Colors.Green };
- mauiiIcon.IconAndSuffixBackgroundColor = assignedColor;
+ mauiiIcon = new MauiIcon() { BackgroundColor = Colors.Green };
+ mauiiIcon.BackgroundColor = assignedColor;
// Assert
- mauiiIcon.IconAndSuffixBackgroundColor.Should().BeNull();
+ mauiiIcon.BackgroundColor.Should().BeNull();
}
[Fact]
@@ -480,7 +480,7 @@ public void IconSuffixChangedToNull()
// Act
mauiiIcon = new MauiIcon() { IconSuffix = suffix };
- mauiiIcon.IconSuffix = null;
+ mauiiIcon.IconSuffix = null!;
// Assert
@@ -521,7 +521,7 @@ public void IconFontFamilyChangedToNull()
// Act
mauiiIcon = new MauiIcon() { IconSuffixFontFamily = suffixFontFamily };
- mauiiIcon.IconSuffixFontFamily = null;
+ mauiiIcon.IconSuffixFontFamily = null!;
// Assert
diff --git a/src/MauiIcons.Modules.UnitTest/Extensions/MauiIconMarkupExtensionTests.cs b/src/MauiIcons.Modules.UnitTest/Extensions/MauiIconMarkupExtensionTests.cs
index 85d60280..1c1cbbf9 100644
--- a/src/MauiIcons.Modules.UnitTest/Extensions/MauiIconMarkupExtensionTests.cs
+++ b/src/MauiIcons.Modules.UnitTest/Extensions/MauiIconMarkupExtensionTests.cs
@@ -202,7 +202,7 @@ public void IconAndSuffixBackgroundColorChanged()
mauiiIcon = new MauiIcon();
mauiiIcon.PropertyChanged += (sender, e) =>
{
- if (e.PropertyName == "IconAndSuffixBackgroundColor")
+ if (e.PropertyName == "BackgroundColor")
{
changedSignaled = true;
}
@@ -211,8 +211,8 @@ public void IconAndSuffixBackgroundColorChanged()
// Assert
- mauiiIcon.IconAndSuffixBackgroundColor.Should().NotBeNull();
- mauiiIcon.IconAndSuffixBackgroundColor.Should().Be(assignedColor);
+ mauiiIcon.BackgroundColor.Should().NotBeNull();
+ mauiiIcon.BackgroundColor.Should().Be(assignedColor);
changedSignaled.Should().BeTrue();
}
@@ -307,7 +307,7 @@ public void IconSuffixChangedToNull()
// Act
mauiiIcon = new MauiIcon().IconSuffix(suffix);
- mauiiIcon.IconSuffix(null);
+ mauiiIcon.IconSuffix(null!);
// Assert
@@ -348,7 +348,7 @@ public void IconFontFamilyChangedToNull()
// Act
mauiiIcon = new MauiIcon().IconSuffixFontFamily(suffixFontFamily);
- mauiiIcon.IconSuffixFontFamily(null);
+ mauiiIcon.IconSuffixFontFamily(null!);
// Assert
diff --git a/src/MauiIcons.SegoeFluent/ReadMe.txt b/src/MauiIcons.SegoeFluent/ReadMe.txt
index 7e40a4dc..076aa38f 100644
--- a/src/MauiIcons.SegoeFluent/ReadMe.txt
+++ b/src/MauiIcons.SegoeFluent/ReadMe.txt
@@ -38,9 +38,9 @@ new MauiIcon().Icon(SegoeFluentIcons.AdjustHologram).IconColor(Colors.Purple);
Xaml Extension Usage:
-
+
-
+
----------------------------------------------------------------------------------------------
@@ -50,9 +50,7 @@ new ImageButton().Icon(SegoeFluentIcons.ActionCenterQuiet),
new Image().Icon(SegoeFluentIcons.AdjustHologram),
-new Label().Icon(SegoeFluentIcons.ActionCenterQuiet).IconSize(40.0).IconColor(Colors.Red),
-
-new Entry().Icon(SegoeFluentIcons.AdjustHologram).IconSize(20.0).IconColor(Colors.Aqua),
+new Button().Icon(SegoeFluentIcons.ActionCenterQuiet).IconSize(40.0).IconColor(Colors.Red),
Disclaimer: It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release:
diff --git a/src/MauiIcons.SegoeFluent/ReleaseNotes.txt b/src/MauiIcons.SegoeFluent/ReleaseNotes.txt
index 84ab66fa..1e53756d 100644
--- a/src/MauiIcons.SegoeFluent/ReleaseNotes.txt
+++ b/src/MauiIcons.SegoeFluent/ReleaseNotes.txt
@@ -1,4 +1,13 @@
-v3.0.0
+v4.0.0
+• Various Enhancements and Fixes for MauiIcon Control
+• New Attached Property for Seamless Icon Integration
+• Styles and Triggers Support
+• New OnClick Animation Support for MauiIcon Control
+• Enhanced Global Customization Support using New `UseMauiIconsCore` Extension
+• Overall Fixes and Enhancements
+• Breaking Changes: [https://github.com/AathifMahir/MauiIcons/#breaking-changes]
+
+v3.0.0
• Critical Fixes for Xaml Markup Binding Support
• Breaking Changes: Removal of Dotnet 7 Support
• Breaking Changes: Removal of Maui OnPlatform and OnIdioms Support Instead Use MauiIcons Integrated Custom OnPlatforms and OnIdioms Feature
diff --git a/src/MauiIcons.SegoeFluent/readme.md b/src/MauiIcons.SegoeFluent/readme.md
index 7452599d..d5953b96 100644
--- a/src/MauiIcons.SegoeFluent/readme.md
+++ b/src/MauiIcons.SegoeFluent/readme.md
@@ -15,12 +15,32 @@ public static class MauiProgram
{
var builder = MauiApp.CreateBuilder();
- // Initialise the .Net Maui Icons - Fluent
+ // Initialise the .Net Maui Icons - SegoeFluent
builder.UseMauiApp().UseSegoeFluentMauiIcons();
}
}
```
+# Table of Contents
+
+- [Usage](#usage)
+- [Advanced Settings](#advanced-settings)
+- [New Changes in v4](#new-changes-in-v4)
+- [Workaround (Must Read)](#workaround)
+- [Built in Control Usage](#built-in-control-usage)
+- [Xaml Extension Usage](#xaml-extension-usage)
+- [C# Markup Usage](#c-markup-usage)
+- [Applying Icon To Text or Placeholder](#applying-icon-to-text-or-placeholder)
+- [OnPlatform and OnIdiom Usage](#onplatform-and-onidiom-usage)
+- [Breaking Changes](#breaking-changes)
+ - [Version 3 to 4](#version-3-to-4)
+ - [Version 2 to 3](#version-2-to-3)
+ - [Version 1 to 2](#version-1-to-2)
+- [Advanced Usage](#advanced-usage)
+- [License](#license)
+- [Contribute](#contribute)
+
+
# Usage
@@ -37,6 +57,19 @@ xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
using MauiIcons.SegoeFluent;
```
+# Advanced Settings
+
+You can set the default icon size, font override, and default font auto-scaling using the `UseMauiIconsCore` builder extension as follows:
+
+```csharp
+builder.UseMauiIconsCore(x =>
+{
+ x.SetDefaultIconSize(30.0);
+ x.SetDefaultFontOverride(true);
+ x.SetDefaultFontAutoScaling(true);
+})
+```
+
## Workaround
if you came across this issue dotnet/maui#7503 when using new namespace, Make sure to create an discarded instance of MauiIcon in the codebehind like below
@@ -52,122 +85,162 @@ if you came across this issue dotnet/maui#7503 when using new namespace, Make su
```
-## Breaking Changes
-
-### Version 1 to 2
-
-`Old (v1)`
+## Built in Control Usage
+`Xaml`
```xml
-xmlns:segoeFluent="clr-namespace:MauiIcons.SegoeFluent;assembly=MauiIcons.SegoeFluent"
+
+```
+`C#`
+```csharp
+new MauiIcon() {Icon = SegoeFluent.GlobalNavButton, IconColor = Colors.Green};
-
+new MauiIcon().Icon(SegoeFluentIcons.People).IconColor(Colors.Purple);
```
-`New (v2)`
+All the Properties and Features of Built in Control, **[Check Here](https://github.com/AathifMahir/MauiIcons#properties)**
+
+## Xaml Extension Usage
```xml
-xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
+
-
+
+
+
```
-### Version 2 to 3
- - Removal of **TypeArgument** and Built in OnPlatform and OnIdiom Support, Use MauiIcons Integrated [Custom OnPlatform and OnIdioms Feature](#custom-onplatform-and-onidiom-usage)
- - Removal of **Dotnet 7** Support
+## C# Markup Usage
-## Built in Control Usage
+```csharp
+new ImageButton().Icon(SegoeFluentIcons.People),
-`Xaml`
+new Image().Icon(SegoeFluentIcons.Mail),
+
+new Button().Icon(SegoeFluentIcons.Share).IconSize(40.0).IconColor(Colors.Red)
+```
+
+**Disclaimer:** It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release: **Label**, **Image**, **ImageButton**, **SearchBar**, **Editor**, and **Entry**. Additionally, the native **MauiIcon** control, when combined with C# markup, can prove to be quite versatile and offer extra features for various scenarios.
+
+## Applying Icon To Text or Placeholder
+Controls that Supports Placeholder, Can Assign the Icon To PlaceHolder or Text,
+Defaults to Placeholder but can be set to Text by Setting TargetName Parameter to `Text`
+
+`xaml`
```xml
-
+
+
+
```
-`C#`
+
+`c#`
```csharp
-new MauiIcon() {Icon = SegoeFluent.ActionCenterQuiet, IconColor = Colors.Green};
+new Entry().Icon(SegoeFluentIcons.Share, targetName: "Text").IconSize(20.0).IconColor(Colors.Aqua);
-new MauiIcon().Icon(SegoeFluentIcons.AdjustHologram).IconColor(Colors.Purple);
+new SearchBar().Icon(SegoeFluentIcons.Mail, targetName: "Placeholder");
```
-All the Properties and Features of Built in Control, **[Check Here](https://github.com/AathifMahir/MauiIcons)**
+**Disclaimer:** It's important to note that we are Overriding Font on Input Control to Set the Icon that Could Cause Unexpected Behaviors and Rendering Issues as well.
+## OnPlatform and OnIdiom Usage
+`Xaml`
-## Xaml Extension Usage
```xml
-
+
+
+
+```
-
+`C#`
+```csharp
+new MauiIcon().Icon(SegoeFluentIcons.People).OnPlatforms(new List{"WinUI", "Android"});
+new MauiIcon().Icon(SegoeFluentIcons.Mail).OnIdioms(new List{"Desktop", "Phone"});
+new MauiIcon().Icon(SegoeFluentIcons.Favicon).OnPlatforms(new List{"WinUI", "Android"}).OnIdioms(new List{"Desktop", "Phone"});
```
-## Xaml Extension Data Binding Usage
+## Breaking Changes
-The below example, Make Sures that BindingContext Inside the Xaml Extension is Set to Root of this Page, Likewise make sure to set the BindingContext When using Binding Inside the MauiIcons Xaml Extension, Additionally This example Binds to MyIcon and MyColor Properties Which Present in Code Behind But Not Included in this Example.
-```xml
-
-
-
-
-
-
-
-
-
-
-
-
-```
+### Version 3 to 4
-## C# Markup Usage
+ - Icon won't be applied to the Controls like Entry, SearchBar and etc.. by default Instead v4 would throw an Exception, Need to set **FontOverride** to true to apply the Icon to these Controls on Builder Extension Level or Control Level
+ - This Behavior can be reverted to Behavior of v3 by Using new `UseMauiIconsCore` Builder Extension and using `SetDefaultFontOverride` Method like Below
```csharp
-new ImageButton().Icon(SegoeFluentIcons.ActionCenterQuiet),
+ builder.UseMauiIconsCore(x =>
+ {
+ x.SetDefaultFontOverride(true);
+ })
+```
-new Image().Icon(SegoeFluentIcons.AdjustHologram),
+ - Icon Size is Now Set to Control's FontSize by Default, Previously it was set to **30.0** by Default
+ - This Behavior can be reverted to Behavior of v3 by Using new `UseMauiIconsCore` Builder Extension and using `SetDefaultIconSize` Method like Below
+```csharp
+ builder.UseMauiIconsCore(x =>
+ {
+ x.SetDefaultIconSize(30.0);
+ })
+```
+---
-new Label().Icon(SegoeFluentIcons.ActionCenterQuiet).IconSize(40.0).IconColor(Colors.Red),
+### Version 2 to 3
-new Entry().Icon(SegoeFluentIcons.AdjustHologram).IconSize(20.0).IconColor(Colors.Aqua),
-```
+ - Removal of **TypeArgument** and Built in OnPlatform and OnIdiom Support, Use MauiIcons Integrated [OnPlatform and OnIdioms Feature](#onplatform-and-onidiom-usage)
+ - Removal of **Dotnet 7** Support
-**Disclaimer:** It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release: **Label**, **Image**, **ImageButton**, **SearchBar**, **Editor**, and **Entry**. Additionally, the native **MauiIcon** control, when combined with C# markup, can prove to be quite versatile and offer extra features for various scenarios.
+---
-## Applying Icon To Text or Placeholder
-Controls that Supports Placeholder, Can Assign the Icon To PlaceHolder or Text,
-Defaults to Placeholder but can be set to Text by Setting isPlaceHolder Parameter to False
+### Version 1 to 2
-```csharp
-new Entry().Icon(SegoeFluentIcons.AdjustHologram, isPlaceHolder: false).IconSize(20.0).IconColor(Colors.Aqua);
+`Old (v1)`
+
+```xml
+xmlns:SegoeFluent="clr-namespace:MauiIcons.SegoeFluent;assembly=MauiIcons.SegoeFluent"
-new SearchBar().Icon(SegoeFluentIcons.ActionCenterQuiet, isPlaceHolder: false);
+
```
-**Disclaimer:** It's important to note that not all controls are compatible with C# markup. We have conducted tests with the following controls in the current release: **Label**, **Image**, **ImageButton**, **SearchBar**, **Editor**, and **Entry**. Additionally, the native **MauiIcon** control, when combined with C# markup, can prove to be quite versatile and offer extra features for various scenarios.
+`New (v2)`
-## Custom OnPlatform and OnIdiom Usage
-`Xaml`
+```xml
+xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
+
+```
+
+## New Changes in v4
+
+ 1. We have a new way of Assigning/Setting Icons, Introducing New Attached Property for Icons,
+ The new **AttachedProperty** Brings in Support for **Triggers**, **Behaviors**, **Styles**, etc.. which is lacking on Classic Xaml Markup Extension, and also it's more cleaner and readable
```xml
-
-
-
+/// Old
+
+
+// New
+
```
-`C#`
-```csharp
-new MauiIcon().Icon(SegoeFluentIcons.ActionCenterQuiet).OnPlatforms(new List{"WinUI", "Android"});
-new MauiIcon().Icon(SegoeFluentIcons.AdjustHologram).OnIdioms(new List{"Desktop", "Phone"});
-new MauiIcon().Icon(SegoeFluentIcons.ActionCenterQuiet).OnPlatforms(new List{"WinUI", "Android"}).OnIdioms(new List{"Desktop", "Phone"});
+**Disclaimer**: The Old Xaml Markup Extension is still Supported and can be used, but it's recommended to use the new Attached Property for better support and readability and we have plans to deprecate the old Xaml Markup Extension in the future in favor of Attached Property
+
+### Example of Using Styles
+```xml
+
+
+
```
+ 2. Introducing New `UseMauiIconsCore` Builder Extension for Setting Default Icon Size, Font Override, Default Font Auto Scaling and etc..
+ 3. Improved Built in OnPlatforms and OnIdioms with Binding Improvements and Enhanced Performance
+ 4. New [`OnClickAnimation`](https://github.com/AathifMahir/MauiIcons/#animation-usage) Support for MauiIcon Control
+
+
+## Advanced Usage
+
+The **.Net Maui Icons** library offers a wide range of features and capabilities, including the ability to customize how icons applied and which property it is applied too and etc. For more information on advanced usage, please refer to the [**Advanced Usage**](https://github.com/AathifMahir/MauiIcons/#advanced-usage)
+
+
# License
**MauiIcons.SegoeFluent**
@@ -176,4 +249,7 @@ MauiIcons.SegoeFluent is Licensed Under [MIT License](https://github.com/AathifM
**Segoe Fluent Icons**
Segoe FLuent Icons is Licensed by Microsoft Under Couple of [License](https://learn.microsoft.com/en-us/typography/font-list/segoe-mdl2-assets).
+# Contribute
+
+If you wish to contribute to this project, please don't hesitate to create an [issue or request](https://github.com/AathifMahir/MauiIcons/issues). Your input and feedback are highly appreciated. Additionally, if you're interested in supporting the project by providing resources or [**becoming a sponsor**](https://github.com/sponsors/AathifMahir), your contributions would be welcomed and instrumental in its continued development and success. Thank you for your interest in contributing to this endeavor.