Skip to content

Commit

Permalink
Bump version to v2.1.0, add provider overriding to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
SKProCH committed Dec 9, 2023
1 parent 3c41c56 commit e384e4d
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Material.Icons.Avalonia/Material.Icons.Avalonia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<AssemblyOriginatorKeyFile>..\key.snk</AssemblyOriginatorKeyFile>
<PackageTags>material icons material-design google-material avalonia</PackageTags>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageVersion>2.0.1</PackageVersion>
<PackageVersion>2.1.0</PackageVersion>
<PackageReleaseNotes>
- Support for Avalonia 11.0.0-rc1.1
- Allows to override some icons data
</PackageReleaseNotes>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions Material.Icons.WPF/Material.Icons.WPF.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<PackageTags>material icons material-design google-material wpf</PackageTags>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>..\key.snk</AssemblyOriginatorKeyFile>
<Version>2.0.0</Version>
<PackageReleaseNotes>- Migrate to new API of resolving icons paths</PackageReleaseNotes>
<Version>2.1.0</Version>
<PackageReleaseNotes>- Allows to override some icons data</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
Expand Down
5 changes: 2 additions & 3 deletions Material.Icons/Material.Icons.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>material icons material-design google-material</PackageTags>
<RootNamespace>Material.Icons</RootNamespace>
<Version>2.0.18</Version>
<PackageReleaseNotes>- Icons set updated according to materialdesignicons.com at Sat, 09 Dec 2023 00:41:06 GMT
Check out changes at https://pictogrammers.com/library/mdi/history/</PackageReleaseNotes>
<Version>2.1.0</Version>
<PackageReleaseNotes>- Allows to override some icons data</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
Expand Down
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,32 @@ dotnet add package Material.Icons
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:
```csharp
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.
Expand Down

0 comments on commit e384e4d

Please sign in to comment.