AathifMahir.Maui.MauiIcons.Material 3.0.0

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package AathifMahir.Maui.MauiIcons.Material --version 3.0.0                
NuGet\Install-Package AathifMahir.Maui.MauiIcons.Material -Version 3.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AathifMahir.Maui.MauiIcons.Material" Version="3.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AathifMahir.Maui.MauiIcons.Material --version 3.0.0                
#r "nuget: AathifMahir.Maui.MauiIcons.Material, 3.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install AathifMahir.Maui.MauiIcons.Material as a Cake Addin
#addin nuget:?package=AathifMahir.Maui.MauiIcons.Material&version=3.0.0

// Install AathifMahir.Maui.MauiIcons.Material as a Cake Tool
#tool nuget:?package=AathifMahir.Maui.MauiIcons.Material&version=3.0.0                

.Net Maui Icons

The .NET MAUI Icons - Material library serves as a lightweight icon library, addressing icon and font icon management in .NET MAUI by offering controls that utilize the comprehensive open-source version of the Material Icon Collection, seamlessly integrated into the library. Check out the Repository for Docs

Get Started

In order to use the .NET MAUI Icons - Material you need to call the extension method in your MauiProgram.cs file as follows:

using MauiIcons.Material;

public static class MauiProgram
{
	public static MauiApp CreateMauiApp()
	{
		var builder = MauiApp.CreateBuilder();
		
		// Initialise the .Net Maui Icons - Material
		builder.UseMauiApp<App>().UseMaterialMauiIcons();
	}
}

Usage

In order to make use of the .Net Maui Icons - Material you can use the below namespace:

Xaml

xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"

C#

using MauiIcons.Material;

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


    public MainPage()
    {
        InitializeComponent();
        // Temporary Workaround for url styled namespace in xaml
        _ = new MauiIcon();
    }

Breaking Changes

Version 1 to 2

Old (v1)

xmlns:material="clr-namespace:MauiIcons.Material;assembly=MauiIcons.Material"

<material:MauiIcon Icon="ABC"/>

New (v2)

xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"

<mi:MauiIcon Icon="{mi:Material ABC}"/>

Version 2 to 3

Nuget Package Changes

Built in Control Usage

Xaml

<mi:MauiIcon Icon="{mi:Material AddRoad}"/>

C#

new MauiIcon() {Icon = MaterialIcons.AddRoad, IconColor = Colors.Green};

new MauiIcon().Icon(MaterialIcons.ABC).IconColor(Colors.Purple);

All the Properties and Features of Built in Control, Check Here

Xaml Extension Usage

<Image Aspect="Center" Source="{mi:Material Icon=ABC}"/>

<Label Text="{mi:Material Icon=AddRoad}"/>

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.

<ContentPage
    x:Class="MauiIcons.Sample.BindingPage"
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    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">
        <HorizontalStackLayout>
            <Label Text="{mi:Fluent BindingContext={x:Reference thisRoot}, Icon={Binding MyIcon}, IconColor={Binding MyColor}}" />
            <Image>
                <Image.Source>
                    <FontImageSource 
                    Glyph="{mi:Fluent BindingContext={x:Reference thisRoot}, 
                    Icon={Binding MyIcon}, IconColor={Binding MyColor}}" />
                </Image.Source>
            </Image>

            <ImageButton Source="{mi:Fluent BindingContext={x:Reference thisRoot}, Icon={Binding MyIcon}, IconColor={Binding MyColor}" />
        </HorizontalStackLayout>
</ContentPage>

C# Markup Usage

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),

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

new Entry().Icon(MaterialIcons.ABC, isPlaceHolder: false).IconSize(20.0).IconColor(Colors.Aqua);

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

Xaml

<mi:MauiIcon Icon="{mi:Material AddRoad}" OnPlatforms="WinUI, Android, MacCatalyst"/>
<mi:MauiIcon Icon="{mi:Material ABC}" OnIdioms="Desktop, Phone, Tablet"/>
<mi:MauiIcon Icon="{mi:Material AddRoad}" OnPlatforms="Android" OnIdioms="Phone"/>

C#

new MauiIcon().Icon(MaterialIcons.AddRoad).OnPlatforms(new List<string>{"WinUI", "Android"});
new MauiIcon().Icon(MaterialIcons.ABC).OnIdioms(new List<string>{"Desktop", "Phone"});
new MauiIcon().Icon(MaterialIcons.AddRoad).OnPlatforms(new List<string>{"WinUI", "Android"}).OnIdioms(new List<string>{"Desktop", "Phone"});

License

MauiIcons.Material MauiIcons.Material is Licensed Under MIT License.

Material Design Icons Material Design Icons is Licensed Under Apache License 2.0.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-android34.0 is compatible.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-ios17.2 is compatible.  net8.0-maccatalyst was computed.  net8.0-maccatalyst17.2 is compatible.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net8.0-windows10.0.19041 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on AathifMahir.Maui.MauiIcons.Material:

Package Downloads
ExtendedMauiControls

A powerful toolkit designed to extend simple controls and effortlessly create sophisticated, custom UI elements.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on AathifMahir.Maui.MauiIcons.Material:

Repository Stars
securefolderfs-community/SecureFolderFS
Powerful, secure, modern way to keep your files protected.
Version Downloads Last updated
4.0.0 775 10/17/2024
3.0.0 5,233 5/11/2024
2.2.5 318 5/6/2024 2.2.5 is deprecated because it has critical bugs.
2.2.0-pre 106 5/4/2024
2.1.5 2,856 4/1/2024
2.1.2 704 3/17/2024
2.1.1 935 2/1/2024
2.1.0 948 12/23/2023
2.0.0 1,645 11/17/2023
2.0.0-rc1.1 83 11/14/2023
1.2.1 2,729 8/15/2023
1.2.0 915 7/1/2023
1.2.0-pre 672 6/29/2023
1.1.5 681 6/17/2023
1.1.1 609 6/3/2023
1.1.0 787 3/10/2023
1.1.0-pre1 520 3/3/2023
1.0.1 785 12/7/2022
1.0.0 807 11/19/2022
0.2.0-pre2 518 11/8/2022
0.2.0-pre1 556 11/7/2022
0.1.1 828 11/8/2022
0.1.0 786 11/7/2022
0.1.0-pre9 576 11/4/2022
0.1.0-pre7 518 11/1/2022
0.1.0-pre6 580 10/31/2022

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

v2.2.5
• New and Improved Xaml Markup Extension with Binding Support

v2.1.5
• New and Improved Extension for MauiIcon C#

v2.1.2
• Minor Fixes and Improvements for Base Extension

v2.1.1
• Minor Patch on Issue #83

v2.1.0
• Docs Update

v2.0.0
• New Modular Core
• Major Core Control Enhancements
• Icon Suffix Support on Core Control
• Major Core Extension Enhanecements and Support for C# Markup Extension
• New C# Markup Extension for Maui Built in Controls
• New OnPlatform and OnIdioms Support
• Improved Docs

• Breaking Changes - https://github.com/AathifMahir/MauiIcons/#breaking-changes-from-v2
- Material Modules Does Only Includes Regular Variant
- Outlined Variant is Move to Seperate Package
AathifMahir.Maui.MauiIcons.Material.Outlined
- Rounded Variant is Move to Seperate Package
AathifMahir.Maui.MauiIcons.Material.Rounded
- Sharp Variant is Move to Seperate Package
AathifMahir.Maui.MauiIcons.Material.Sharp


v1.2.1
• Added Support for Vanilla Version of Dotnet to Unit Test the Project

v1.2.0
• Added Variant Support Base Control and Extension
• New and Improved Icon Control
• Material Icon Variant Support eg: Round, Outline, TwoTone

v1.1.5
• Added Icon Unicode Support for Icon Extension
• Added Direct Content Support
• Minor Enhancements and Fixes

v1.1.1
• Minor Enhancements and Fixes

v1.1.0
• Dotnet 7 Support
• Minor Enhancements and Fixes

v1.0.1
• Fixed Missing Cast

v1.0.0
• First Milestone Build and Production App Ready

v0.2.0-pre2
• Ported Critical Fix from Stable Build

v0.2.0-pre1
• Minor Enhancements and Fixes

v0.1.0
• First Stable Build
• Added New Attributes to Icon Extension
• Improvements to Documentation