Material.Icons.WPF
2.1.0
See the version list below for details.
dotnet add package Material.Icons.WPF --version 2.1.0
NuGet\Install-Package Material.Icons.WPF -Version 2.1.0
<PackageReference Include="Material.Icons.WPF" Version="2.1.0" />
paket add Material.Icons.WPF --version 2.1.0
#r "nuget: Material.Icons.WPF, 2.1.0"
// Install Material.Icons.WPF as a Cake Addin #addin nuget:?package=Material.Icons.WPF&version=2.1.0 // Install Material.Icons.WPF as a Cake Tool #tool nuget:?package=Material.Icons.WPF&version=2.1.0
Material.Icons
Parsed icons set from materialdesignicons.com and display control implementations for different GUI frameworks.
- All icons are always up-to-date because automatically updated every 6 hours.
- Small package size because icons are graphically encoded via SVG Path.
- Icon types are strongly typed enum, so your IDE will suggest available variants:
Structure
This project consists of 3 parts:
FAQ - frequently asked questions
Avalonia
Getting started
- Install Material.Icons.Avalonia nuget package:
dotnet add package Material.Icons.Avalonia
- Include styles in
App.xaml
(for2.0.0
version and higher):
For<Application xmlns:materialIcons="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia" ...> <Application.Styles> ... <materialIcons:MaterialIconStyles /> </Application.Styles> </Application>
1.*.*
:<Application ...> <Application.Styles> ... <StyleInclude Source="avares://Material.Icons.Avalonia/App.xaml" /> </Application.Styles> </Application>
Avalonia FuncUI (F#)
Getting started
- Install Material.Icons.Avalonia nuget package:
dotnet add package Material.Icons.Avalonia
- Import styles in Application (or if you use XAML check instructions for plain Avalonia)
type App() = inherit Application() override this.Initialize() = .. this.Styles.Add(MaterialIconStyles(null)) ..
- Create bindings for
MaterialIcon
namespace Avalonia.FuncUI.DSL [<AutoOpen>] module MaterialIcon = open Material.Icons open Material.Icons.Avalonia open Avalonia.FuncUI.Types open Avalonia.FuncUI.Builder let create (attrs: IAttr<MaterialIcon> list): IView<MaterialIcon> = ViewBuilder.Create<MaterialIcon>(attrs) type MaterialIcon with static member kind<'t when 't :> MaterialIcon>(value: MaterialIconKind) : IAttr<'t> = AttrBuilder<'t>.CreateProperty<MaterialIconKind>(MaterialIcon.KindProperty, value, ValueNone)
- Use
Button.create [ Button.content ( MaterialIcon.create [ MaterialIcon.kind MaterialIconKind.Export ] ) ]
WPF
Getting started
Install Material.Icons.WPF nuget package:
dotnet add package Material.Icons.WPF
Using
Add Material.Icons.WPF
namespace to the root element of your file (your IDE can suggest it or do it automatically):
xmlns:materialIcons="clr-namespace:Material.Icons.WPF;assembly=Material.Icons.WPF"
Use MaterialIcon
control:
<materialIcons:MaterialIcon Kind="Abacus" />
The Foreground
property controls the color of the icon.
Also, there is MaterialIconExt
which allows you to use is as the markup extension:
<Button Content="{materialIcons:MaterialIconExt Kind=Abacus}" />
Meta
Getting started
Install Material.Icons nuget package:
dotnet add package Material.Icons
Using
Icon types stored in Material.Icons.MaterialIconKind
enum.
We can resolve an icon path by using Material.Icons.MaterialIconDataProvider.GetData()
.
Adding your own icons
Currently, there is no way to add your own icons, as icons are enum and cannot be modified.
But you can override some existing icons to use your own data:
public class CustomIconProvider : MaterialIconDataProvider
{
public override string ProvideData(MaterialIconKind kind)
{
return kind switch
{
MaterialIconKind.TrophyVariant => "some SVG code",
_ => base.ProvideData(kind)
};
}
}
// When your application starts (e.g. in the Main method) replace MaterialIconDataProvider with your own
public static int Main(string[] args)
{
MaterialIconDataProvider.Instance = new CustomIconProvider(); // Settings custom provider
// Application startup code
// return BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
}
FAQ
How to change icon color?
- Change
Foreground
property.
How to update icons?
- You can manually set
Material.Icons
package version in your project file.
What about versioning policy?
- We use semver.
Any package with identical major and minor versions is compatible.
For example,1.0.0
and1.0.1
are compatible, but1.0.0
and1.1.0
might not be.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net6.0-windows7.0 is compatible. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net7.0-windows7.0 is compatible. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.1 is compatible. |
.NET Framework | net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETCoreApp 3.1
- Material.Icons (>= 2.1.0)
-
.NETFramework 4.6.1
- Material.Icons (>= 2.1.0)
-
net6.0-windows7.0
- Material.Icons (>= 2.1.0)
-
net7.0-windows7.0
- Material.Icons (>= 2.1.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Material.Icons.WPF:
Package | Downloads |
---|---|
MattEqualsCoder.MSURandomizer.UI
UI library with windows and controls for randomizing MSUs. |
|
Frank.Libraries.Wpf
A library of WPF controls and utilities for .NET 8.0 and later. Fundamentally, this library is a collection of controls and utilities that I have found useful in my own projects. I hope you find them useful as well. |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Material.Icons.WPF:
Repository | Stars |
---|---|
grzybeek/grzyClothTool
grzyClothTool is a free tool to create and manage GTA5 addon clothing packs
|
- Allows to override some icons data