diff --git a/demo/Semi.Avalonia.Demo/Controls/ColorDetailControl.axaml b/demo/Semi.Avalonia.Demo/Controls/ColorDetailControl.axaml
index 038906c..ccfda64 100644
--- a/demo/Semi.Avalonia.Demo/Controls/ColorDetailControl.axaml
+++ b/demo/Semi.Avalonia.Demo/Controls/ColorDetailControl.axaml
@@ -2,7 +2,6 @@
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Semi.Avalonia.Demo.Controls">
- M5 7C3.89543 7 3 7.89543 3 9V19C3 20.1046 3.89543 21 5 21H15C16.1046 21 17 20.1046 17 19V9C17 7.89543 16.1046 7 15 7H5Z,M7 4C7 2.89543 7.89543 2 9 2H20C21.1046 2 22 2.89543 22 4V15C22 16.1046 21.1046 17 20 17H19V8C19 6 18 5 16 5H7V4Z
@@ -35,13 +34,13 @@
Grid.Row="1"
Grid.Column="1"
Classes="Tertiary"
+ Padding="8"
Command="{Binding $parent[controls:ColorDetailControl].Copy}"
CommandParameter="{x:Static controls:ColorDetailControl.KEY_ResourceKey}"
Theme="{DynamicResource BorderlessButton}">
@@ -83,13 +82,13 @@
Grid.Row="4"
Grid.Column="1"
Classes="Tertiary"
+ Padding="8"
Command="{Binding $parent[controls:ColorDetailControl].Copy}"
CommandParameter="{x:Static controls:ColorDetailControl.KEY_Hex}"
Theme="{DynamicResource BorderlessButton}">
@@ -111,13 +110,13 @@
Grid.Row="6"
Grid.Column="1"
Classes="Tertiary"
+ Padding="8"
Command="{Binding $parent[controls:ColorDetailControl].Copy}"
CommandParameter="{x:Static controls:ColorDetailControl.KEY_Opacity}"
Theme="{DynamicResource BorderlessButton}">
diff --git a/demo/Semi.Avalonia.Demo/Pages/IconDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/IconDemo.axaml
new file mode 100644
index 0000000..308f92f
--- /dev/null
+++ b/demo/Semi.Avalonia.Demo/Pages/IconDemo.axaml
@@ -0,0 +1,95 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo/Pages/IconDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/IconDemo.axaml.cs
new file mode 100644
index 0000000..8a5a032
--- /dev/null
+++ b/demo/Semi.Avalonia.Demo/Pages/IconDemo.axaml.cs
@@ -0,0 +1,47 @@
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Controls.Notifications;
+using Avalonia.Controls.Primitives;
+using Avalonia.Input.Platform;
+using Avalonia.Interactivity;
+using Avalonia.Threading;
+using Semi.Avalonia.Demo.ViewModels;
+
+namespace Semi.Avalonia.Demo.Pages;
+
+public partial class IconDemo : UserControl
+{
+ private IClipboard? _clipboard;
+ private WindowNotificationManager? _windowNotificationManager;
+
+ public IconDemo()
+ {
+ InitializeComponent();
+ this.DataContext = new IconDemoViewModel();
+ }
+
+ protected override async void OnApplyTemplate(TemplateAppliedEventArgs e)
+ {
+ base.OnApplyTemplate(e);
+ var vm = this.DataContext as IconDemoViewModel;
+ await Dispatcher.UIThread.InvokeAsync(() => { vm?.InitializeResources(); });
+ }
+
+ protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
+ {
+ base.OnAttachedToVisualTree(e);
+ var topLevel = TopLevel.GetTopLevel(this);
+ _windowNotificationManager = new WindowNotificationManager(topLevel) { MaxItems = 3 };
+ _clipboard = topLevel?.Clipboard;
+ }
+
+ private async void Button_Clicked(object sender, RoutedEventArgs e)
+ {
+ if (_clipboard is null) return;
+ if (sender is not Button { DataContext: IconItem s }) return;
+ await _clipboard.SetTextAsync(s.ResourceKey);
+ _windowNotificationManager?.Show(
+ new Notification("Copied", s.ResourceKey),
+ NotificationType.Success);
+ }
+}
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo/Pages/Overview.axaml b/demo/Semi.Avalonia.Demo/Pages/Overview.axaml
index e4a3608..b1aeaa8 100644
--- a/demo/Semi.Avalonia.Demo/Pages/Overview.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/Overview.axaml
@@ -31,12 +31,12 @@
+ Data="{StaticResource SemiIconSemiLogo}" />
+ Data="{StaticResource SemiIconPlus}" />
diff --git a/demo/Semi.Avalonia.Demo/Pages/PathIconDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/PathIconDemo.axaml
index e5fa352..558b841 100644
--- a/demo/Semi.Avalonia.Demo/Pages/PathIconDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/PathIconDemo.axaml
@@ -12,7 +12,7 @@
@@ -31,6 +31,6 @@
Height="{Binding #width.Value}"
Foreground="{DynamicResource SemiBlue6}"
BorderBrush="{DynamicResource SemiRed6}"
- Data="M12 3L2 12H5V20H19V12H22L12 3M13 18H11V16H13V18M13 14H11V8H13V14Z" />
+ Data="{StaticResource SemiIconHome}" />
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo/Pages/SplitViewDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/SplitViewDemo.axaml
index 7598b32..a0d873c 100644
--- a/demo/Semi.Avalonia.Demo/Pages/SplitViewDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/SplitViewDemo.axaml
@@ -11,11 +11,6 @@
-
-
- M5 2H19C20.6569 2 22 3.34315 22 5V19C22 20.6569 20.6569 22 19 22H5C3.34315 22 2 20.6569 2 19V5C2 3.34315 3.34315 2 5 2ZM6 4C5.44772 4 5 4.44772 5 5V19C5 19.5523 5.44772 20 6 20H9C9.55229 20 10 19.5523 10 19V5C10 4.44772 9.55229 4 9 4H6Z
-
-
diff --git a/demo/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml
index ed66fc1..d2be94a 100644
--- a/demo/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml
@@ -70,7 +70,7 @@
+ Data="{StaticResource SemiIconSidebar}" />
+ Data="{StaticResource SemiIconSun}" />
+ Data="{StaticResource SemiIconMoon}" />
diff --git a/demo/Semi.Avalonia.Demo/ViewModels/IconDemoViewModel.cs b/demo/Semi.Avalonia.Demo/ViewModels/IconDemoViewModel.cs
new file mode 100644
index 0000000..09e8fc8
--- /dev/null
+++ b/demo/Semi.Avalonia.Demo/ViewModels/IconDemoViewModel.cs
@@ -0,0 +1,70 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+using Avalonia.Media;
+using CommunityToolkit.Mvvm.ComponentModel;
+
+namespace Semi.Avalonia.Demo.ViewModels;
+
+public partial class IconDemoViewModel : ObservableObject
+{
+ private readonly IResourceDictionary? _resources =
+ AvaloniaXamlLoader.Load(new Uri("avares://Semi.Avalonia/Themes/Shared/Icon.axaml")) as ResourceDictionary;
+
+ private readonly Dictionary _filledIcons = new();
+ private readonly Dictionary _strokedIcons = new();
+
+ [ObservableProperty] private string? _searchText;
+
+ public ObservableCollection FilteredFilledIcons { get; set; } = [];
+ public ObservableCollection FilteredStrokedIcons { get; set; } = [];
+
+ public void InitializeResources()
+ {
+ if (_resources is null) return;
+
+ foreach (var key in _resources.Keys)
+ {
+ if (_resources[key] is not Geometry geometry) continue;
+ var icon = new IconItem { ResourceKey = key.ToString(), Geometry = geometry };
+
+ if (key.ToString().EndsWith("Stroked"))
+ {
+ _strokedIcons[key.ToString()] = icon;
+ }
+ else
+ {
+ _filledIcons[key.ToString()] = icon;
+ }
+
+ OnSearchTextChanged(string.Empty);
+ }
+ }
+
+ partial void OnSearchTextChanged(string? value)
+ {
+ var search = value?.ToLowerInvariant() ?? string.Empty;
+
+ FilteredFilledIcons.Clear();
+ foreach (var icon in _filledIcons.Values.Where(i => i.ResourceKey?.ToLowerInvariant().Contains(search) == true))
+ {
+ FilteredFilledIcons.Add(icon);
+ }
+
+ FilteredStrokedIcons.Clear();
+ foreach (var icon in
+ _strokedIcons.Values.Where(i => i.ResourceKey?.ToLowerInvariant().Contains(search) == true))
+ {
+ FilteredStrokedIcons.Add(icon);
+ }
+ }
+}
+
+public class IconItem
+{
+ public string? ResourceKey { get; set; }
+ public Geometry? Geometry { get; set; }
+}
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo/Views/MainView.axaml b/demo/Semi.Avalonia.Demo/Views/MainView.axaml
index 44ffb65..3d35910 100644
--- a/demo/Semi.Avalonia.Demo/Views/MainView.axaml
+++ b/demo/Semi.Avalonia.Demo/Views/MainView.axaml
@@ -17,11 +17,6 @@
- M12 21.5C10.65 20.65 8.2 20 6.5 20C4.85 20 3.15 20.3 1.75 21.05C1.65 21.1 1.6 21.1 1.5 21.1C1.25 21.1 1 20.85 1 20.6V6C1.6 5.55 2.25 5.25 3 5C4.11 4.65 5.33 4.5 6.5 4.5C8.45 4.5 10.55 4.9 12 6C13.45 4.9 15.55 4.5 17.5 4.5C18.67 4.5 19.89 4.65 21 5C21.75 5.25 22.4 5.55 23 6V20.6C23 20.85 22.75 21.1 22.5 21.1C22.4 21.1 22.35 21.1 22.25 21.05C20.85 20.3 19.15 20 17.5 20C15.8 20 13.35 20.65 12 21.5M12 8V19.5C13.35 18.65 15.8 18 17.5 18C18.7 18 19.9 18.15 21 18.5V7C19.9 6.65 18.7 6.5 17.5 6.5C15.8 6.5 13.35 7.15 12 8M13 11.5C14.11 10.82 15.6 10.5 17.5 10.5C18.41 10.5 19.26 10.59 20 10.78V9.23C19.13 9.08 18.29 9 17.5 9C15.73 9 14.23 9.28 13 9.84V11.5M17.5 11.67C15.79 11.67 14.29 11.93 13 12.46V14.15C14.11 13.5 15.6 13.16 17.5 13.16C18.54 13.16 19.38 13.24 20 13.4V11.9C19.13 11.74 18.29 11.67 17.5 11.67M20 14.57C19.13 14.41 18.29 14.33 17.5 14.33C15.67 14.33 14.17 14.6 13 15.13V16.82C14.11 16.16 15.6 15.83 17.5 15.83C18.54 15.83 19.38 15.91 20 16.07V14.57Z
- M12,2A10,10 0 0,0 2,12C2,16.42 4.87,20.17 8.84,21.5C9.34,21.58 9.5,21.27 9.5,21C9.5,20.77 9.5,20.14 9.5,19.31C6.73,19.91 6.14,17.97 6.14,17.97C5.68,16.81 5.03,16.5 5.03,16.5C4.12,15.88 5.1,15.9 5.1,15.9C6.1,15.97 6.63,16.93 6.63,16.93C7.5,18.45 8.97,18 9.54,17.76C9.63,17.11 9.89,16.67 10.17,16.42C7.95,16.17 5.62,15.31 5.62,11.5C5.62,10.39 6,9.5 6.65,8.79C6.55,8.54 6.2,7.5 6.75,6.15C6.75,6.15 7.59,5.88 9.5,7.17C10.29,6.95 11.15,6.84 12,6.84C12.85,6.84 13.71,6.95 14.5,7.17C16.41,5.88 17.25,6.15 17.25,6.15C17.8,7.5 17.45,8.54 17.35,8.79C18,9.5 18.38,10.39 18.38,11.5C18.38,15.32 16.04,16.16 13.81,16.41C14.17,16.72 14.5,17.33 14.5,18.26C14.5,19.6 14.5,20.68 14.5,21C14.5,21.27 14.66,21.59 15.17,21.5C19.14,20.16 22,16.42 22,12A10,10 0 0,0 12,2Z
- M12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23ZM17 15C17.476 15 17.9408 14.9525 18.3901 14.862C17.296 17.3011 14.8464 19 12 19C8.13401 19 5 15.866 5 12C5 8.60996 7.40983 5.78277 10.6099 5.13803C10.218 6.01173 10 6.98041 10 8C10 11.866 13.134 15 17 15Z
- M3.55 19.09L4.96 20.5L6.76 18.71L5.34 17.29M12 6C8.69 6 6 8.69 6 12S8.69 18 12 18 18 15.31 18 12C18 8.68 15.31 6 12 6M20 13H23V11H20M17.24 18.71L19.04 20.5L20.45 19.09L18.66 17.29M20.45 5L19.04 3.6L17.24 5.39L18.66 6.81M13 1H11V4H13M6.76 5.39L4.96 3.6L3.55 5L5.34 6.81L6.76 5.39M1 13H4V11H1M13 20H11V23H13
- M2 19.5C2 18.6716 2.67157 18 3.5 18H20.5C21.3284 18 22 18.6716 22 19.5C22 20.3284 21.3284 21 20.5 21H3.5C2.67157 21 2 20.3284 2 19.5ZM2 12C2 11.1716 2.67157 10.5 3.5 10.5H20.5C21.3284 10.5 22 11.1716 22 12C22 12.8284 21.3284 13.5 20.5 13.5H3.5C2.67157 13.5 2 12.8284 2 12ZM2 4.5C2 3.67157 2.67157 3 3.5 3H20.5C21.3284 3 22 3.67157 22 4.5C22 5.32843 21.3284 6 20.5 6H3.5C2.67157 6 2 5.32843 2 4.5Z
@@ -65,20 +60,20 @@
+ OnContent="{StaticResource SemiIconMoon}"
+ OffContent="{StaticResource SemiIconSun}" />