diff --git a/demo/Ursa.Demo/Converters/IconNameToPathConverter.cs b/demo/Ursa.Demo/Converters/IconNameToPathConverter.cs index 5a602e8..4451895 100644 --- a/demo/Ursa.Demo/Converters/IconNameToPathConverter.cs +++ b/demo/Ursa.Demo/Converters/IconNameToPathConverter.cs @@ -26,6 +26,12 @@ public class IconNameToPathConverter: IValueConverter string s = paths[i % paths.Length]; return StreamGeometry.Parse(s); } + else if (value is string s) + { + int hash = s.GetHashCode(); + string path = paths[Math.Abs(hash) % paths.Length]; + return StreamGeometry.Parse(path); + } return AvaloniaProperty.UnsetValue; } diff --git a/demo/Ursa.Demo/Views/MainView.axaml b/demo/Ursa.Demo/Views/MainView.axaml index 956dbe4..664ef75 100644 --- a/demo/Ursa.Demo/Views/MainView.axaml +++ b/demo/Ursa.Demo/Views/MainView.axaml @@ -16,6 +16,9 @@ + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + @@ -33,9 +51,9 @@ Name="PART_Border" Grid.Row="0" MinHeight="32" - Cursor="Hand" Background="{TemplateBinding u:NavMenuItem.Background}" - CornerRadius="4"> + CornerRadius="4" + Cursor="Hand"> - + @@ -146,9 +164,13 @@ @@ -157,7 +179,7 @@ - +