Skip to content

Commit

Permalink
Fix bug with svg
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPulman committed Mar 13, 2023
1 parent 8822004 commit 952b8b5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ This is a simple implementation of the AppBarButton for WPF.

## Icon

The Icon is a enum that is used to find the icon in the `Assets\AppBar` folder. The icon is a 48x48 Canvas file.
The Icon is a enum that is used to find the icon in the `Assets\AppBar` folder. The icon is a 48x48 Canvas file. These start with ab_.
The icons begining with md_ are from the Material Design Icons. https://pictogrammers.com/library/mdi/

You can add your own icons by setting the IconData property with a suitable path of your choice.

Expand Down
2 changes: 1 addition & 1 deletion Version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json",
"version": "0.4",
"version": "0.4.1",
"publicReleaseRefSpec": [
"^refs/heads/master$",
"^refs/heads/main$"
Expand Down
2 changes: 1 addition & 1 deletion src/AppBarButton.WPF.TestApp/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
HorizontalAlignment="Left"
VerticalAlignment="Top"
Content="Acrobat"
Icon="md_abacus" />
Icon="md_abugida_devanagari" />
<appbarbtn:AppBarButton
HorizontalAlignment="Left"
VerticalAlignment="Top"
Expand Down
2 changes: 1 addition & 1 deletion src/AppBarButton.WPF/Controls/AppBarButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ where name.Equals($"CP.Assets.AppBar.appbar.{icon.ToString().Remove(0, 3).Replac
// find all embedded SVG icon files
var assembly = GetType().Assembly;
var iconResourceNames = from name in assembly.GetManifestResourceNames()
where name.Equals($"CP.Assets.svg.{icon.ToString().Remove(0, 3).Replace('_', '.')}.svg", System.StringComparison.Ordinal)
where name.Equals($"CP.Assets.svg.{icon.ToString().Remove(0, 3).Replace('_', '-')}.svg", System.StringComparison.Ordinal)
select name;

// load the resource stream
Expand Down

0 comments on commit 952b8b5

Please sign in to comment.