diff --git a/.github/workflows/pack-tree.yml b/.github/workflows/pack-tree.yml
new file mode 100644
index 00000000..1d2a6cd5
--- /dev/null
+++ b/.github/workflows/pack-tree.yml
@@ -0,0 +1,26 @@
+name: Pack TreeDataGrid Nuget
+
+on:
+ push:
+ branches: [ "action/pack-tree" ]
+ pull_request:
+ branches: [ "action/pack-tree" ]
+
+jobs:
+ nuget:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4.1.1
+
+ - name: Nuget Semi.Avalonia.TreeDataGrid
+ run: dotnet pack ./src/Semi.Avalonia.TreeDataGrid -o ./nugets
+
+ - name: Publish NuGet package
+ run: dotnet nuget push "./nugets/*.nupkg" --api-key ${{ secrets.NUGET_ORG_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
+
+ - name: Upload a Build Artifact
+ uses: actions/upload-artifact@v4.3.1
+ with:
+ name: nugets
+ path: ./nugets
diff --git a/.github/workflows/pack.yml b/.github/workflows/pack.yml
index 7882e331..e27e35a3 100644
--- a/.github/workflows/pack.yml
+++ b/.github/workflows/pack.yml
@@ -22,8 +22,8 @@ jobs:
- name: Nuget Semi.Avalonia.DataGrid
run: dotnet pack ./src/Semi.Avalonia.DataGrid -o ./nugets
- - name: Nuget Semi.Avalonia.TreeDataGrid
- run: dotnet pack ./src/Semi.Avalonia.TreeDataGrid -o ./nugets
+ - name: Publish NuGet package
+ run: dotnet nuget push "./nugets/*.nupkg" --api-key ${{ secrets.NUGET_ORG_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4.3.1
diff --git a/Semi.Avalonia.sln b/Semi.Avalonia.sln
index 827c0452..b7564d0b 100644
--- a/Semi.Avalonia.sln
+++ b/Semi.Avalonia.sln
@@ -12,6 +12,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution
src\Package.props = src\Package.props
EndProjectSection
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHub Action", "GitHub Action", "{318534A1-1CC3-40FB-B4AE-736F94465232}"
+ ProjectSection(SolutionItems) = preProject
+ .github\workflows\deploy.yml = .github\workflows\deploy.yml
+ .github\workflows\pack.yml = .github\workflows\pack.yml
+ .github\workflows\pack-tree.yml = .github\workflows\pack-tree.yml
+ .github\workflows\publish.yml = .github\workflows\publish.yml
+ EndProjectSection
+EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Demo", "Demo", "{43091528-9509-43CB-A003-9C5C11E96DD6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semi.Avalonia.Demo.Desktop", "demo\Semi.Avalonia.Demo.Desktop\Semi.Avalonia.Demo.Desktop.csproj", "{2ADCA724-2B6D-46EC-87F7-604D7918B89A}"
diff --git a/demo/Directory.Build.props b/demo/Directory.Build.props
index e25d59ce..2d2f46e3 100644
--- a/demo/Directory.Build.props
+++ b/demo/Directory.Build.props
@@ -2,5 +2,6 @@
enable
11.1.3
+ 8.3.2
diff --git a/demo/Semi.Avalonia.Demo.Desktop/Program.cs b/demo/Semi.Avalonia.Demo.Desktop/Program.cs
index e011c455..f6fb44db 100644
--- a/demo/Semi.Avalonia.Demo.Desktop/Program.cs
+++ b/demo/Semi.Avalonia.Demo.Desktop/Program.cs
@@ -16,13 +16,13 @@ class Program
public static void Main(string[] args) => BuildAvaloniaApp()
.With(new FontManagerOptions
{
- FontFallbacks = new[]
- {
+ FontFallbacks =
+ [
new FontFallback
{
FontFamily = new FontFamily("Microsoft YaHei")
}
- }
+ ]
})
.StartWithClassicDesktopLifetime(args);
diff --git a/demo/Semi.Avalonia.Demo.Web/Assets/Fonts/SourceHanSansCN-Bold.otf b/demo/Semi.Avalonia.Demo.Web/Assets/Fonts/SourceHanSansCN-Bold.otf
new file mode 100644
index 00000000..8e1e8694
Binary files /dev/null and b/demo/Semi.Avalonia.Demo.Web/Assets/Fonts/SourceHanSansCN-Bold.otf differ
diff --git a/demo/Semi.Avalonia.Demo.Web/Assets/SourceHanSansCN-Regular.otf b/demo/Semi.Avalonia.Demo.Web/Assets/Fonts/SourceHanSansCN-Regular.otf
similarity index 100%
rename from demo/Semi.Avalonia.Demo.Web/Assets/SourceHanSansCN-Regular.otf
rename to demo/Semi.Avalonia.Demo.Web/Assets/Fonts/SourceHanSansCN-Regular.otf
diff --git a/demo/Semi.Avalonia.Demo.Web/AvaloniaAppBuilderExtensions.cs b/demo/Semi.Avalonia.Demo.Web/AvaloniaAppBuilderExtensions.cs
index 2d5a50f1..29386d55 100644
--- a/demo/Semi.Avalonia.Demo.Web/AvaloniaAppBuilderExtensions.cs
+++ b/demo/Semi.Avalonia.Demo.Web/AvaloniaAppBuilderExtensions.cs
@@ -11,6 +11,6 @@ public static AppBuilder WithSourceHanSansCNFont(this AppBuilder builder) =>
builder.With(new FontManagerOptions
{
DefaultFamilyName = DefaultFontFamily,
- FontFallbacks = new[] { new FontFallback { FontFamily = new FontFamily(DefaultFontFamily) } }
+ FontFallbacks = [new FontFallback { FontFamily = new FontFamily(DefaultFontFamily) }]
});
}
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo/Controls/ColorDetailControl.axaml b/demo/Semi.Avalonia.Demo/Controls/ColorDetailControl.axaml
index 4dc7d42d..abcbd397 100644
--- a/demo/Semi.Avalonia.Demo/Controls/ColorDetailControl.axaml
+++ b/demo/Semi.Avalonia.Demo/Controls/ColorDetailControl.axaml
@@ -7,6 +7,7 @@
x:DataType="viewModels:ColorItemViewModel">
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
+
diff --git a/demo/Semi.Avalonia.Demo/Controls/FunctionalColorGroupControl.axaml b/demo/Semi.Avalonia.Demo/Controls/FunctionalColorGroupControl.axaml
index b3d46be0..2c74653b 100644
--- a/demo/Semi.Avalonia.Demo/Controls/FunctionalColorGroupControl.axaml
+++ b/demo/Semi.Avalonia.Demo/Controls/FunctionalColorGroupControl.axaml
@@ -6,15 +6,15 @@
x:CompileBindings="True"
x:DataType="viewModels:FunctionalColorGroupViewModel">
-
-
+
+
-
+ Theme="{DynamicResource TitleSelectableTextBlock}" />
@@ -129,4 +129,4 @@
-
+
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo/Controls/FunctionalColorGroupControl.cs b/demo/Semi.Avalonia.Demo/Controls/FunctionalColorGroupControl.cs
index 7a17deed..57b35877 100644
--- a/demo/Semi.Avalonia.Demo/Controls/FunctionalColorGroupControl.cs
+++ b/demo/Semi.Avalonia.Demo/Controls/FunctionalColorGroupControl.cs
@@ -4,33 +4,38 @@
namespace Semi.Avalonia.Demo.Controls;
-public class FunctionalColorGroupControl: TemplatedControl
+public class FunctionalColorGroupControl : TemplatedControl
{
- public static readonly StyledProperty TitleProperty = AvaloniaProperty.Register(
- nameof(Title));
+ public static readonly StyledProperty TitleProperty =
+ AvaloniaProperty.Register(nameof(Title));
+
public string? Title
{
get => GetValue(TitleProperty);
set => SetValue(TitleProperty, value);
}
-
- public static readonly DirectProperty LightColorsProperty = AvaloniaProperty.RegisterDirect(
- nameof(LightColors), o => o.LightColors, (o, v) => o.LightColors = v);
+
+ public static readonly DirectProperty LightColorsProperty =
+ AvaloniaProperty.RegisterDirect(nameof(LightColors),
+ o => o.LightColors, (o, v) => o.LightColors = v);
+
private IEnumerable? _lightColors;
+
public IEnumerable? LightColors
{
get => _lightColors;
set => SetAndRaise(LightColorsProperty, ref _lightColors, value);
}
-
- public static readonly DirectProperty DarkColorsProperty = AvaloniaProperty.RegisterDirect(
- nameof(DarkColors), o => o.DarkColors, (o, v) => o.DarkColors = v);
+
+ public static readonly DirectProperty DarkColorsProperty =
+ AvaloniaProperty.RegisterDirect(nameof(DarkColors),
+ o => o.DarkColors, (o, v) => o.DarkColors = v);
+
private IEnumerable? _darkColors;
+
public IEnumerable? DarkColors
{
get => _darkColors;
set => SetAndRaise(DarkColorsProperty, ref _darkColors, value);
}
-
-
}
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo/Controls/ShadowGroupControl.axaml b/demo/Semi.Avalonia.Demo/Controls/ShadowGroupControl.axaml
new file mode 100644
index 00000000..d06aea41
--- /dev/null
+++ b/demo/Semi.Avalonia.Demo/Controls/ShadowGroupControl.axaml
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo/Controls/ShadowGroupControl.cs b/demo/Semi.Avalonia.Demo/Controls/ShadowGroupControl.cs
new file mode 100644
index 00000000..bb59ab12
--- /dev/null
+++ b/demo/Semi.Avalonia.Demo/Controls/ShadowGroupControl.cs
@@ -0,0 +1,41 @@
+using System.Collections;
+using Avalonia;
+using Avalonia.Controls.Primitives;
+
+namespace Semi.Avalonia.Demo.Controls;
+
+public class ShadowGroupControl : TemplatedControl
+{
+ public static readonly StyledProperty TitleProperty =
+ AvaloniaProperty.Register(nameof(Title));
+
+ public string? Title
+ {
+ get => GetValue(TitleProperty);
+ set => SetValue(TitleProperty, value);
+ }
+
+ private IEnumerable? _lightShadows;
+
+ public static readonly DirectProperty LightShadowsProperty =
+ AvaloniaProperty.RegisterDirect(nameof(LightShadows),
+ o => o.LightShadows, (o, v) => o.LightShadows = v);
+
+ public IEnumerable? LightShadows
+ {
+ get => _lightShadows;
+ set => SetAndRaise(LightShadowsProperty, ref _lightShadows, value);
+ }
+
+ private IEnumerable? _darkShadows;
+
+ public static readonly DirectProperty DarkShadowsProperty =
+ AvaloniaProperty.RegisterDirect(nameof(DarkShadows),
+ o => o.DarkShadows, (o, v) => o.DarkShadows = v);
+
+ public IEnumerable? DarkShadows
+ {
+ get => _darkShadows;
+ set => SetAndRaise(DarkShadowsProperty, ref _darkShadows, value);
+ }
+}
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo/Pages/CarouselDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/CarouselDemo.axaml
index 6b419c06..d295307a 100644
--- a/demo/Semi.Avalonia.Demo/Pages/CarouselDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/CarouselDemo.axaml
@@ -8,20 +8,26 @@
d:DesignWidth="800"
mc:Ignorable="d">
-
-
-
-
-
-
+
@@ -35,39 +41,39 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
-
+
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo/Pages/ColorPickerDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ColorPickerDemo.axaml
index cb5dfaf9..3eb407d5 100644
--- a/demo/Semi.Avalonia.Demo/Pages/ColorPickerDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/ColorPickerDemo.axaml
@@ -19,42 +19,74 @@
-
+
+ Theme="{StaticResource SimpleColorView}" />
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
diff --git a/demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml
index d2c8add7..475c6af5 100644
--- a/demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml
@@ -101,7 +101,7 @@
-
+
diff --git a/demo/Semi.Avalonia.Demo/Pages/GridSplitter.axaml b/demo/Semi.Avalonia.Demo/Pages/GridSplitterDemo.axaml
similarity index 80%
rename from demo/Semi.Avalonia.Demo/Pages/GridSplitter.axaml
rename to demo/Semi.Avalonia.Demo/Pages/GridSplitterDemo.axaml
index 0928a67e..ef965c67 100644
--- a/demo/Semi.Avalonia.Demo/Pages/GridSplitter.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/GridSplitterDemo.axaml
@@ -1,5 +1,5 @@
diff --git a/demo/Semi.Avalonia.Demo/Pages/GridSplitter.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/GridSplitterDemo.axaml.cs
similarity index 71%
rename from demo/Semi.Avalonia.Demo/Pages/GridSplitter.axaml.cs
rename to demo/Semi.Avalonia.Demo/Pages/GridSplitterDemo.axaml.cs
index c317cf58..b3f1927b 100644
--- a/demo/Semi.Avalonia.Demo/Pages/GridSplitter.axaml.cs
+++ b/demo/Semi.Avalonia.Demo/Pages/GridSplitterDemo.axaml.cs
@@ -1,12 +1,11 @@
-using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages;
-public partial class GridSplitter : UserControl
+public partial class GridSplitterDemo : UserControl
{
- public GridSplitter()
+ public GridSplitterDemo()
{
InitializeComponent();
}
diff --git a/demo/Semi.Avalonia.Demo/Pages/HeaderedContentControlDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/HeaderedContentControlDemo.axaml
index af62a806..b778b13a 100644
--- a/demo/Semi.Avalonia.Demo/Pages/HeaderedContentControlDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/HeaderedContentControlDemo.axaml
@@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
+ mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="1450"
x:Class="Semi.Avalonia.Demo.Pages.HeaderedContentControlDemo">
@@ -27,12 +27,18 @@
GroupBox Theme
- Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统。设计系统包含设计语言以及一整套可复用的前端组件,帮助设计师与开发者更容易地打造高质量的、用户体验一致的、符合设计规范的 Web 应用。
+ HorizontalAlignment="Left"
+ MaxWidth="360">
+
+
+
+
+
+
+
+
+
diff --git a/demo/Semi.Avalonia.Demo/Pages/HyperlinkButtonDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/HyperlinkButtonDemo.axaml
index 897a75b0..10b774b5 100644
--- a/demo/Semi.Avalonia.Demo/Pages/HyperlinkButtonDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/HyperlinkButtonDemo.axaml
@@ -8,36 +8,22 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml
index 5b172502..250c7946 100644
--- a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml
@@ -4,7 +4,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- d:DesignHeight="450"
+ d:DesignHeight="800"
d:DesignWidth="800"
mc:Ignorable="d">
@@ -13,15 +13,13 @@
+
-
-
-
- Classes
- -
- Secondary
- Tertiary
- Quaternary
- Success
- Warning
- Danger
- Mark
- Code
-
+ RowDefinitions="*,*,*,*,*,*,*,*,*,*,*">
+ Classes
+ -
+ Secondary
+ Tertiary
+ Quaternary
+ Success
+ Warning
+ Danger
+ Mark
+ Code
+
-
+
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo/Pages/PaletteDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/PaletteDemo.axaml.cs
index 4ef2ecf5..70fb84be 100644
--- a/demo/Semi.Avalonia.Demo/Pages/PaletteDemo.axaml.cs
+++ b/demo/Semi.Avalonia.Demo/Pages/PaletteDemo.axaml.cs
@@ -13,17 +13,16 @@ public partial class PaletteDemo : UserControl
public PaletteDemo()
{
InitializeComponent();
-
+ this.DataContext = new PaletteDemoViewModel();
}
protected override async void OnApplyTemplate(TemplateAppliedEventArgs e)
{
base.OnApplyTemplate(e);
- PaletteDemoViewModel? vm = new PaletteDemoViewModel();
+ PaletteDemoViewModel? vm = this.DataContext as PaletteDemoViewModel;
await Dispatcher.UIThread.InvokeAsync(() =>
{
- vm.InitializeResources();
+ vm?.InitializeResources();
});
- DataContext = vm;
}
}
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo/Pages/PathIconDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/PathIconDemo.axaml
index 6e0214fb..e5fa3521 100644
--- a/demo/Semi.Avalonia.Demo/Pages/PathIconDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/PathIconDemo.axaml
@@ -7,16 +7,30 @@
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Foreground="{DynamicResource SemiBlue6}"
+ BorderBrush="{DynamicResource SemiRed6}"
+ Data="M12 3L2 12H5V20H19V12H22L12 3M13 18H11V16H13V18M13 14H11V8H13V14Z" />
-
+
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml b/demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml
index abeb7f3a..c353ef31 100644
--- a/demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml
@@ -4,13 +4,13 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- d:DesignHeight="450"
+ d:DesignHeight="600"
d:DesignWidth="800"
mc:Ignorable="d">
-
@@ -25,70 +25,76 @@
- Classes
- -
- Secondary
- Tertiary
- Quaternary
- Success
- Warning
- Danger
- Mark
- Underline
- Delete
+ RowDefinitions="*,*,*,*,*,*,*,*,*,*,*">
+
+
+
+ Classes
+ -
+ Secondary
+ Tertiary
+ Quaternary
+ Success
+ Warning
+ Danger
+ Mark
+ Underline
+ Delete
- Text
+ Text
Secondary
Tertiary
Quaternary
Success
Warning
Danger
Default Mark
Underline
Delete
@@ -104,53 +110,52 @@
Theme="{DynamicResource GroupBox}">
- Classes
- H1
- H2
- H3
- H4
- H5
- H6
+ RowDefinitions="*,*,*,*,*,*,*">
+ Classes
+ H1
+ H2
+ H3
+ H4
+ H5
+ H6
Header 1
Header 2
Header 3
Header 4
Header 5
diff --git a/demo/Semi.Avalonia.Demo/Pages/SplitViewDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/SplitViewDemo.axaml
index 7de95efc..7598b320 100644
--- a/demo/Semi.Avalonia.Demo/Pages/SplitViewDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/SplitViewDemo.axaml
@@ -114,20 +114,9 @@
ItemsSource="{Binding Songs}" />
-
-
-
-
-
-
diff --git a/demo/Semi.Avalonia.Demo/Pages/TextBlockDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/TextBlockDemo.axaml
index 5702698f..04f0fe35 100644
--- a/demo/Semi.Avalonia.Demo/Pages/TextBlockDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/TextBlockDemo.axaml
@@ -10,7 +10,7 @@
-
@@ -25,70 +25,70 @@
- Classes
- -
- Secondary
- Tertiary
- Quaternary
- Success
- Warning
- Danger
- Mark
- Underline
- Delete
+ RowDefinitions="*,*,*,*,*,*,*,*,*,*,*">
+ Classes
+ -
+ Secondary
+ Tertiary
+ Quaternary
+ Success
+ Warning
+ Danger
+ Mark
+ Underline
+ Delete
- Text
+ Text
Secondary
Tertiary
Quaternary
Success
Warning
Danger
Default Mark
Underline
Delete
@@ -105,58 +105,57 @@
- Classes
- H1
- H2
- H3
- H4
- H5
- H6
+ RowDefinitions="*,*,*,*,*,*,*">
+ Classes
+ H1
+ H2
+ H3
+ H4
+ H5
+ H6
Header 1
Header 2
Header 3
Header 4
Header 5
Header 6
-
diff --git a/demo/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml
index 1a238666..ed66fc17 100644
--- a/demo/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml
@@ -8,22 +8,23 @@
d:DesignWidth="800"
mc:Ignorable="d">
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -44,8 +45,8 @@
-
-
+
+
@@ -60,21 +61,35 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo/Semi.Avalonia.Demo.csproj b/demo/Semi.Avalonia.Demo/Semi.Avalonia.Demo.csproj
index cb9a6797..9e5c54a0 100644
--- a/demo/Semi.Avalonia.Demo/Semi.Avalonia.Demo.csproj
+++ b/demo/Semi.Avalonia.Demo/Semi.Avalonia.Demo.csproj
@@ -14,7 +14,7 @@
-
+
diff --git a/demo/Semi.Avalonia.Demo/Themes/TabMenu.axaml b/demo/Semi.Avalonia.Demo/Themes/TabMenu.axaml
index 12fc2df0..43e3b8e1 100644
--- a/demo/Semi.Avalonia.Demo/Themes/TabMenu.axaml
+++ b/demo/Semi.Avalonia.Demo/Themes/TabMenu.axaml
@@ -1,6 +1,6 @@
-
+
-
+
@@ -19,7 +22,8 @@
-
+
+
-
+
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo/Themes/ToggleButton.axaml b/demo/Semi.Avalonia.Demo/Themes/ToggleButton.axaml
deleted file mode 100644
index da8124cf..00000000
--- a/demo/Semi.Avalonia.Demo/Themes/ToggleButton.axaml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/demo/Semi.Avalonia.Demo/Themes/ToggleSwitch.axaml b/demo/Semi.Avalonia.Demo/Themes/ToggleSwitch.axaml
new file mode 100644
index 00000000..f3b04855
--- /dev/null
+++ b/demo/Semi.Avalonia.Demo/Themes/ToggleSwitch.axaml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo/ViewModels/PaletteDemoViewModel.cs b/demo/Semi.Avalonia.Demo/ViewModels/PaletteDemoViewModel.cs
index 1646be86..cf234541 100644
--- a/demo/Semi.Avalonia.Demo/ViewModels/PaletteDemoViewModel.cs
+++ b/demo/Semi.Avalonia.Demo/ViewModels/PaletteDemoViewModel.cs
@@ -2,25 +2,25 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Avalonia.Controls;
-using Avalonia.Markup.Xaml;
using Avalonia.Media;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Messaging;
namespace Semi.Avalonia.Demo.ViewModels;
-public class PaletteDemoViewModel: ObservableObject
+public class PaletteDemoViewModel : ObservableObject
{
private readonly string[] _predefinedColorNames =
- {
+ [
"Red", "Pink", "Purple", "Violet", "Indigo",
"Blue", "LightBlue", "Cyan", "Teal", "Green",
"LightGreen", "Lime", "Yellow", "Amber", "Orange",
"Grey"
- };
+ ];
+
private readonly IResourceDictionary? _lightResourceDictionary;
private readonly IResourceDictionary? _darkResourceDictionary;
-
+
private ColorItemViewModel _selectedColor = null!;
public ColorItemViewModel SelectedColor
@@ -28,26 +28,30 @@ public ColorItemViewModel SelectedColor
get => _selectedColor;
set => SetProperty(ref _selectedColor, value);
}
-
-
+
+
private ObservableCollection? _lightLists;
+
public ObservableCollection? LightLists
{
get => _lightLists;
set => SetProperty(ref _lightLists, value);
}
+
private ObservableCollection? _darkLists;
+
public ObservableCollection? DarkLists
{
get => _darkLists;
set => SetProperty(ref _darkLists, value);
}
- public ObservableCollection FunctionalColors { get; set; } = new();
+ public ObservableCollection FunctionalColors { get; set; } = [];
+ public ObservableCollection Shadows { get; set; } = [];
public PaletteDemoViewModel()
{
- _lightResourceDictionary = new Light.Palette();
+ _lightResourceDictionary = new Light.Palette();
_darkResourceDictionary = new Dark.Palette();
WeakReferenceMessenger.Default.Register(this, OnClickColorItem);
}
@@ -56,18 +60,20 @@ public void InitializeResources()
{
InitializePalette();
InitializeFunctionalColors();
+ InitializeShadows();
}
private void InitializePalette()
{
- LightLists = new ObservableCollection();
+ LightLists = [];
foreach (var color in _predefinedColorNames)
{
ColorListViewModel s = new ColorListViewModel();
s.Initialize(_lightResourceDictionary, color, true);
LightLists.Add(s);
}
- DarkLists = new ObservableCollection();
+
+ DarkLists = [];
foreach (var color in _predefinedColorNames)
{
ColorListViewModel s = new ColorListViewModel();
@@ -92,13 +98,19 @@ private void InitializeFunctionalColors()
FunctionalColors.Add(new FunctionalColorGroupViewModel("Border", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.BorderTokens));
FunctionalColors.Add(new FunctionalColorGroupViewModel("Disabled", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.DisabledTokens));
}
+
+ private void InitializeShadows()
+ {
+ Shadows.Add(new ShadowGroupViewModel("Shadow", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.ShadowTokens));
+ }
+
private void OnClickColorItem(PaletteDemoViewModel vm, ColorItemViewModel item)
{
SelectedColor = item;
}
}
-public class ColorListViewModel: ObservableObject
+public class ColorListViewModel : ObservableObject
{
private ObservableCollection? _colors;
@@ -115,17 +127,18 @@ public string? SeriesName
get => _seriesName;
set => SetProperty(ref _seriesName, value);
}
-
+
internal void Initialize(IResourceDictionary? resourceDictionary, string color, bool light)
{
if (resourceDictionary is null)
{
return;
}
+
SeriesName = color;
- Color = new ObservableCollection();
-
- for (int i = 0; i < 10; i++)
+ Color = [];
+
+ for (var i = 0; i < 10; i++)
{
var key = "Semi" + color + i;
if (resourceDictionary.TryGetValue(key, out var value))
@@ -136,7 +149,7 @@ internal void Initialize(IResourceDictionary? resourceDictionary, string color,
var item = new ColorItemViewModel(name, brush, key, light, i);
item.ColorResourceKey = item.ResourceKey + "Color";
Color.Add(item);
- }
+ }
}
}
}
@@ -144,15 +157,16 @@ internal void Initialize(IResourceDictionary? resourceDictionary, string color,
public class ColorItemViewModel : ObservableObject
{
-
private IBrush _brush = null!;
+
public IBrush Brush
{
get => _brush;
set => SetProperty(ref _brush, value);
}
-
+
private IBrush _textBrush = null!;
+
public IBrush TextBrush
{
get => _textBrush;
@@ -160,6 +174,7 @@ public IBrush TextBrush
}
private string _colorDisplayName = null!;
+
public string ColorDisplayName
{
get => _colorDisplayName;
@@ -189,8 +204,9 @@ public string Hex
get => _hex;
set => SetProperty(ref _hex, value);
}
-
- public ColorItemViewModel(string colorDisplayName, ISolidColorBrush brush, string resourceKey, bool light, int index)
+
+ public ColorItemViewModel(string colorDisplayName, ISolidColorBrush brush, string resourceKey, bool light,
+ int index)
{
ColorDisplayName = colorDisplayName;
Brush = brush;
@@ -210,22 +226,22 @@ public ColorItemViewModel(string colorDisplayName, ISolidColorBrush brush, strin
public class FunctionalColorGroupViewModel : ObservableObject
{
private string _title = null!;
+
public string Title
{
get => _title;
set => SetProperty(ref _title, value);
}
- public ObservableCollection LightColors { get; set; } = new();
- public ObservableCollection DarkColors { get; set; } = new();
+ public ObservableCollection LightColors { get; set; } = [];
+ public ObservableCollection DarkColors { get; set; } = [];
- public FunctionalColorGroupViewModel(string title, IResourceDictionary? lightDictionary, IResourceDictionary? darkDictionary, IReadOnlyList> tokens)
+ public FunctionalColorGroupViewModel(string title, IResourceDictionary? lightDictionary,
+ IResourceDictionary? darkDictionary, IReadOnlyList> tokens)
{
Title = title;
- foreach (var token in tokens)
+ foreach (var (key, name) in tokens)
{
- string key = token.Item1;
- string name = token.Item2;
if (lightDictionary?.TryGetValue(key, out var lightValue) ?? false)
{
if (lightValue is ISolidColorBrush lightBrush)
@@ -245,125 +261,203 @@ public FunctionalColorGroupViewModel(string title, IResourceDictionary? lightDic
}
}
+public class ShadowItemViewModel : ObservableObject
+{
+ private string _shadowDisplayName = null!;
+
+ public string ShadowDisplayName
+ {
+ get => _shadowDisplayName;
+ set => SetProperty(ref _shadowDisplayName, value);
+ }
+
+ private string _resourceKey = null!;
+
+ public string ResourceKey
+ {
+ get => _resourceKey;
+ set => SetProperty(ref _resourceKey, value);
+ }
+
+ private string _boxShadowValue = null!;
+
+ public string BoxShadowValue
+ {
+ get => _boxShadowValue;
+ set => SetProperty(ref _boxShadowValue, value);
+ }
+
+ public ShadowItemViewModel(string shadowDisplayName, BoxShadows boxShadows, string resourceKey)
+ {
+ ShadowDisplayName = shadowDisplayName;
+ ResourceKey = resourceKey;
+ BoxShadowValue = boxShadows.ToString();
+ }
+}
+
+public class ShadowGroupViewModel : ObservableObject
+{
+ private string _title = null!;
+
+ public string Title
+ {
+ get => _title;
+ set => SetProperty(ref _title, value);
+ }
+
+ public ObservableCollection LightShadows { get; set; } = [];
+ public ObservableCollection DarkShadows { get; set; } = [];
+
+
+ public ShadowGroupViewModel(string title, IResourceDictionary? lightDictionary,
+ IResourceDictionary? darkDictionary, IReadOnlyList> tokens)
+ {
+ Title = title;
+ foreach (var (key, name) in tokens)
+ {
+ if (lightDictionary?.TryGetValue(key, out var lightValue) ?? false)
+ {
+ if (lightValue is BoxShadows lightShadow)
+ {
+ LightShadows.Add(new ShadowItemViewModel(name, lightShadow, key));
+ }
+ }
+
+ if (darkDictionary?.TryGetValue(key, out var darkValue) ?? false)
+ {
+ if (darkValue is BoxShadows darkShadow)
+ {
+ DarkShadows.Add(new ShadowItemViewModel(name, darkShadow, key));
+ }
+ }
+ }
+ }
+}
+
public static class ColorTokens
{
public static IReadOnlyList> PrimaryTokens { get; } = new List>
{
- new ("SemiColorPrimary", "Primary"),
- new ("SemiColorPrimaryPointerover", "Primary Pointerover"),
- new ("SemiColorPrimaryActive", "Primary Active"),
- new ("SemiColorPrimaryDisabled", "Primary Disabled"),
- new ("SemiColorPrimaryLight", "Primary Light"),
- new ("SemiColorPrimaryLightPointerover", "Primary Light Pointerover"),
- new ("SemiColorPrimaryLightActive", "Primary Light Active"),
+ new("SemiColorPrimary", "Primary"),
+ new("SemiColorPrimaryPointerover", "Primary Pointerover"),
+ new("SemiColorPrimaryActive", "Primary Active"),
+ new("SemiColorPrimaryDisabled", "Primary Disabled"),
+ new("SemiColorPrimaryLight", "Primary Light"),
+ new("SemiColorPrimaryLightPointerover", "Primary Light Pointerover"),
+ new("SemiColorPrimaryLightActive", "Primary Light Active"),
};
public static IReadOnlyList> SecondaryTokens { get; } = new List>
{
- new ("SemiColorSecondary", "Secondary"),
- new ("SemiColorSecondaryPointerover", "Secondary Pointerover"),
- new ("SemiColorSecondaryActive", "Secondary Active"),
- new ("SemiColorSecondaryDisabled", "Secondary Disabled"),
- new ("SemiColorSecondaryLight", "Secondary Light"),
- new ("SemiColorSecondaryLightPointerover", "Secondary Light Pointerover"),
- new ("SemiColorSecondaryLightActive", "Secondary Light Active"),
+ new("SemiColorSecondary", "Secondary"),
+ new("SemiColorSecondaryPointerover", "Secondary Pointerover"),
+ new("SemiColorSecondaryActive", "Secondary Active"),
+ new("SemiColorSecondaryDisabled", "Secondary Disabled"),
+ new("SemiColorSecondaryLight", "Secondary Light"),
+ new("SemiColorSecondaryLightPointerover", "Secondary Light Pointerover"),
+ new("SemiColorSecondaryLightActive", "Secondary Light Active"),
};
-
+
public static IReadOnlyList> TertiaryTokens { get; } = new List>
{
- new ("SemiColorTertiary", "Tertiary"),
- new ("SemiColorTertiaryPointerover", "Tertiary Pointerover"),
- new ("SemiColorTertiaryActive", "Tertiary Active"),
- new ("SemiColorTertiaryLight", "Tertiary Light"),
- new ("SemiColorTertiaryLightPointerover", "Tertiary Light Pointerover"),
- new ("SemiColorTertiaryLightActive", "Tertiary Light Active"),
+ new("SemiColorTertiary", "Tertiary"),
+ new("SemiColorTertiaryPointerover", "Tertiary Pointerover"),
+ new("SemiColorTertiaryActive", "Tertiary Active"),
+ new("SemiColorTertiaryLight", "Tertiary Light"),
+ new("SemiColorTertiaryLightPointerover", "Tertiary Light Pointerover"),
+ new("SemiColorTertiaryLightActive", "Tertiary Light Active"),
};
-
+
public static IReadOnlyList> InformationTokens { get; } = new List>
{
- new ("SemiColorInformation", "Information"),
- new ("SemiColorInformationPointerover", "Information Pointerover"),
- new ("SemiColorInformationActive", "Information Active"),
- new ("SemiColorInformationDisabled", "Information Disabled"),
- new ("SemiColorInformationLight", "Information Light"),
- new ("SemiColorInformationLightPointerover", "Information Light Pointerover"),
- new ("SemiColorInformationLightActive", "Information Light Active"),
+ new("SemiColorInformation", "Information"),
+ new("SemiColorInformationPointerover", "Information Pointerover"),
+ new("SemiColorInformationActive", "Information Active"),
+ new("SemiColorInformationDisabled", "Information Disabled"),
+ new("SemiColorInformationLight", "Information Light"),
+ new("SemiColorInformationLightPointerover", "Information Light Pointerover"),
+ new("SemiColorInformationLightActive", "Information Light Active"),
};
-
+
public static IReadOnlyList> SuccessTokens { get; } = new List>
{
- new ("SemiColorSuccess", "Success"),
- new ("SemiColorSuccessPointerover", "Success Pointerover"),
- new ("SemiColorSuccessActive", "Success Active"),
- new ("SemiColorSuccessDisabled", "Success Disabled"),
- new ("SemiColorSuccessLight", "Success Light"),
- new ("SemiColorSuccessLightPointerover", "Success Light Pointerover"),
- new ("SemiColorSuccessLightActive", "Success Light Active"),
+ new("SemiColorSuccess", "Success"),
+ new("SemiColorSuccessPointerover", "Success Pointerover"),
+ new("SemiColorSuccessActive", "Success Active"),
+ new("SemiColorSuccessDisabled", "Success Disabled"),
+ new("SemiColorSuccessLight", "Success Light"),
+ new("SemiColorSuccessLightPointerover", "Success Light Pointerover"),
+ new("SemiColorSuccessLightActive", "Success Light Active"),
};
-
+
public static IReadOnlyList> WarningTokens { get; } = new List>
{
- new ("SemiColorWarning", "Warning"),
- new ("SemiColorWarningPointerover", "Warning Pointerover"),
- new ("SemiColorWarningActive", "Warning Active"),
- new ("SemiColorWarningLight", "Warning Light"),
- new ("SemiColorWarningLightPointerover", "Warning Light Pointerover"),
- new ("SemiColorWarningLightActive", "Warning Light Active"),
+ new("SemiColorWarning", "Warning"),
+ new("SemiColorWarningPointerover", "Warning Pointerover"),
+ new("SemiColorWarningActive", "Warning Active"),
+ new("SemiColorWarningLight", "Warning Light"),
+ new("SemiColorWarningLightPointerover", "Warning Light Pointerover"),
+ new("SemiColorWarningLightActive", "Warning Light Active"),
};
-
+
public static IReadOnlyList> DangerTokens { get; } = new List>
{
- new ("SemiColorDanger", "Danger"),
- new ("SemiColorDangerPointerover", "Danger Pointerover"),
- new ("SemiColorDangerActive", "Danger Active"),
- new ("SemiColorDangerLight", "Danger Light"),
- new ("SemiColorDangerLightPointerover", "Danger Light Pointerover"),
- new ("SemiColorDangerLightActive", "Danger Light Active"),
+ new("SemiColorDanger", "Danger"),
+ new("SemiColorDangerPointerover", "Danger Pointerover"),
+ new("SemiColorDangerActive", "Danger Active"),
+ new("SemiColorDangerLight", "Danger Light"),
+ new("SemiColorDangerLightPointerover", "Danger Light Pointerover"),
+ new("SemiColorDangerLightActive", "Danger Light Active"),
};
public static IReadOnlyList> TextTokens { get; } = new List>
{
- new ("SemiColorText0", "Text 0"),
- new ("SemiColorText1", "Text 1"),
- new ("SemiColorText2", "Text 2"),
- new ("SemiColorText3", "Text 3"),
+ new("SemiColorText0", "Text 0"),
+ new("SemiColorText1", "Text 1"),
+ new("SemiColorText2", "Text 2"),
+ new("SemiColorText3", "Text 3"),
};
-
+
public static IReadOnlyList> LinkTokens { get; } = new List>
{
- new ("SemiColorLink", "Link"),
- new ("SemiColorLinkPointerover", "Link Pointerover"),
- new ("SemiColorLinkActive", "Link Active"),
- new ("SemiColorLinkVisited", "Link Visited"),
+ new("SemiColorLink", "Link"),
+ new("SemiColorLinkPointerover", "Link Pointerover"),
+ new("SemiColorLinkActive", "Link Active"),
+ new("SemiColorLinkVisited", "Link Visited"),
};
-
+
public static IReadOnlyList> BackgroundTokens { get; } = new List>
{
- new ("SemiColorBackground0", "Background 0"),
- new ("SemiColorBackground1", "Background 1"),
- new ("SemiColorBackground2", "Background 2"),
- new ("SemiColorBackground3", "Background 3"),
- new ("SemiColorBackground4", "Background 4"),
+ new("SemiColorBackground0", "Background 0"),
+ new("SemiColorBackground1", "Background 1"),
+ new("SemiColorBackground2", "Background 2"),
+ new("SemiColorBackground3", "Background 3"),
+ new("SemiColorBackground4", "Background 4"),
};
-
+
public static IReadOnlyList> FillTokens { get; } = new List>
{
- new ("SemiColorFill0", "Fill 0"),
- new ("SemiColorFill1", "Fill 1"),
- new ("SemiColorFill2", "Fill 2"),
+ new("SemiColorFill0", "Fill 0"),
+ new("SemiColorFill1", "Fill 1"),
+ new("SemiColorFill2", "Fill 2"),
};
-
+
public static IReadOnlyList> BorderTokens { get; } = new List>
{
- new ("SemiColorBorder", "Border"),
+ new("SemiColorBorder", "Border"),
};
-
+
public static IReadOnlyList> DisabledTokens { get; } = new List>
{
- new ("SemiColorDisabledText", "Disabled Text"),
- new ("SemiColorDisabledBorder", "Disabled Border"),
- new ("SemiColorDisabledBackground", "Disabled Background"),
- new ("SemiColorDisabledFill", "Disabled Fill"),
+ new("SemiColorDisabledText", "Disabled Text"),
+ new("SemiColorDisabledBorder", "Disabled Border"),
+ new("SemiColorDisabledBackground", "Disabled Background"),
+ new("SemiColorDisabledFill", "Disabled Fill"),
+ };
+
+ public static IReadOnlyList> ShadowTokens { get; } = new List>
+ {
+ new("SemiColorShadow", "Shadow"),
+ new("SemiShadowElevated", "Shadow Elevated"),
};
-
}
\ 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 0c12b22d..961a24de 100644
--- a/demo/Semi.Avalonia.Demo/Views/MainView.axaml
+++ b/demo/Semi.Avalonia.Demo/Views/MainView.axaml
@@ -15,56 +15,84 @@
-
+
+ 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
-
-
-
+
+
+
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -126,7 +155,7 @@
-
+
@@ -209,4 +238,4 @@
-
+
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo/Views/MainView.axaml.cs b/demo/Semi.Avalonia.Demo/Views/MainView.axaml.cs
index b7e74a88..9285eb1f 100644
--- a/demo/Semi.Avalonia.Demo/Views/MainView.axaml.cs
+++ b/demo/Semi.Avalonia.Demo/Views/MainView.axaml.cs
@@ -1,10 +1,13 @@
using System;
-using System.Collections.ObjectModel;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using System.Windows.Input;
using Avalonia;
using Avalonia.Controls;
-using Avalonia.Interactivity;
+using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Styling;
using CommunityToolkit.Mvvm.ComponentModel;
+using CommunityToolkit.Mvvm.Input;
namespace Semi.Avalonia.Demo.Views;
@@ -15,62 +18,63 @@ public MainView()
InitializeComponent();
this.DataContext = new MainViewModel();
}
+}
- private void ToggleButton_OnIsCheckedChanged(object sender, RoutedEventArgs e)
- {
- var app = Application.Current;
- if (app is not null)
- {
- var theme = app.ActualThemeVariant;
- app.RequestedThemeVariant = theme == ThemeVariant.Dark ? ThemeVariant.Light : ThemeVariant.Dark;
- }
- }
+public partial class MainViewModel : ObservableObject
+{
+ public string DocumentationUrl => "https://docs.irihi.tech/semi";
+ public string RepoUrl => "https://github.com/irihitech/Semi.Avalonia";
+ public IReadOnlyList MenuItems { get; }
- private async void OpenRepository(object sender, RoutedEventArgs e)
+ public MainViewModel()
{
- var top = TopLevel.GetTopLevel(this);
- if (top is null) return;
- var launcher = top.Launcher;
- await launcher.LaunchUriAsync(new Uri("https://github.com/irihitech/Semi.Avalonia"));
+ MenuItems = [];
}
- private async void OpenDocumentation(object sender, RoutedEventArgs e)
+ [RelayCommand]
+ private void ToggleTheme()
{
- var top = TopLevel.GetTopLevel(this);
- if (top is null) return;
- var launcher = top.Launcher;
- await launcher.LaunchUriAsync(new Uri("https://docs.irihi.tech/semi"));
+ var app = Application.Current;
+ if (app is null) return;
+ var theme = app.ActualThemeVariant;
+ app.RequestedThemeVariant = theme == ThemeVariant.Dark ? ThemeVariant.Light : ThemeVariant.Dark;
}
-}
-public partial class MainViewModel: ObservableObject
-{
- public ObservableCollection Themes { get; } = new()
+ [RelayCommand]
+ private void SelectTheme(object? obj)
{
- new ThemeItem("Light", ThemeVariant.Light),
- new ThemeItem("Dark", ThemeVariant.Dark),
- new ThemeItem("Aquatic", SemiTheme.Aquatic),
- new ThemeItem("Desert", SemiTheme.Desert),
- new ThemeItem("Dust", SemiTheme.Dust),
- new ThemeItem("NightSky", SemiTheme.NightSky),
- };
-
- [ObservableProperty] private ThemeItem? _selectedTheme;
-
- partial void OnSelectedThemeChanged(ThemeItem? oldValue, ThemeItem? newValue)
- {
- if (newValue is null) return;
var app = Application.Current;
if (app is not null)
{
- app.RequestedThemeVariant = newValue.Theme;
+ app.RequestedThemeVariant = obj as ThemeVariant;
+ }
+ }
+
+ [RelayCommand]
+ private static async Task OpenUrl(string url)
+ {
+ var launcher = ResolveDefaultTopLevel()?.Launcher;
+ if (launcher is not null)
+ {
+ await launcher.LaunchUriAsync(new Uri(url));
}
}
-
+
+ private static TopLevel? ResolveDefaultTopLevel()
+ {
+ return Application.Current?.ApplicationLifetime switch
+ {
+ IClassicDesktopStyleApplicationLifetime desktopLifetime => desktopLifetime.MainWindow,
+ ISingleViewApplicationLifetime singleView => TopLevel.GetTopLevel(singleView.MainView),
+ _ => null
+ };
+ }
}
-public class ThemeItem(string name, ThemeVariant theme)
+public class MenuItemViewModel
{
- public string Name { get; set; } = name;
- public ThemeVariant Theme { get; set; } = theme;
+ public string? Header { get; set; }
+ public ICommand? Command { get; set; }
+ public object? CommandParameter { get; set; }
+ public IList? Items { get; set; }
}
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.TreeDataGrid.Demo/Program.cs b/demo/Semi.Avalonia.TreeDataGrid.Demo/Program.cs
index b71cf5e5..b0b60d90 100644
--- a/demo/Semi.Avalonia.TreeDataGrid.Demo/Program.cs
+++ b/demo/Semi.Avalonia.TreeDataGrid.Demo/Program.cs
@@ -1,5 +1,6 @@
using Avalonia;
using System;
+using Avalonia.Media;
namespace Semi.Avalonia.TreeDataGrid.Demo;
@@ -10,12 +11,21 @@ class Program
// yet and stuff might break.
[STAThread]
public static void Main(string[] args) => BuildAvaloniaApp()
+ .With(new FontManagerOptions
+ {
+ FontFallbacks =
+ [
+ new FontFallback
+ {
+ FontFamily = new FontFamily("Microsoft YaHei")
+ }
+ ]
+ })
.StartWithClassicDesktopLifetime(args);
// Avalonia configuration, don't remove; also used by visual designer.
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure()
.UsePlatformDetect()
- .WithInterFont()
.LogToTrace();
}
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.TreeDataGrid.Demo/Semi.Avalonia.TreeDataGrid.Demo.csproj b/demo/Semi.Avalonia.TreeDataGrid.Demo/Semi.Avalonia.TreeDataGrid.Demo.csproj
index 59312afa..9327faec 100644
--- a/demo/Semi.Avalonia.TreeDataGrid.Demo/Semi.Avalonia.TreeDataGrid.Demo.csproj
+++ b/demo/Semi.Avalonia.TreeDataGrid.Demo/Semi.Avalonia.TreeDataGrid.Demo.csproj
@@ -1,28 +1,29 @@
WinExe
- net6.0
+ net8.0
enable
true
+ latest
app.manifest
true
+
+
+
-
+
-
-
-
+
-
-
-
+
+
diff --git a/src/Semi.Avalonia.ColorPicker/Controls/ColorPicker.axaml b/src/Semi.Avalonia.ColorPicker/Controls/ColorPicker.axaml
index ea7d2a71..31cc5708 100644
--- a/src/Semi.Avalonia.ColorPicker/Controls/ColorPicker.axaml
+++ b/src/Semi.Avalonia.ColorPicker/Controls/ColorPicker.axaml
@@ -5,6 +5,7 @@
xmlns:converters="using:Avalonia.Controls.Converters"
xmlns:primitives="using:Avalonia.Controls.Primitives"
x:CompileBindings="True">
+
@@ -51,7 +52,6 @@
+
+
+
@@ -30,7 +31,7 @@
VerticalAlignment="Stretch"
Background="{DynamicResource ColorControlCheckeredBackgroundBrush}" />
+
+
diff --git a/src/Semi.Avalonia.ColorPicker/Controls/ColorSpectrum.axaml b/src/Semi.Avalonia.ColorPicker/Controls/ColorSpectrum.axaml
index 4bc308ed..2dcaaa83 100644
--- a/src/Semi.Avalonia.ColorPicker/Controls/ColorSpectrum.axaml
+++ b/src/Semi.Avalonia.ColorPicker/Controls/ColorSpectrum.axaml
@@ -4,6 +4,7 @@
xmlns:controls="using:Avalonia.Controls"
xmlns:converters="using:Avalonia.Controls.Converters"
x:CompileBindings="True">
+
@@ -15,16 +16,16 @@
- 0 0 14 0 #1AFFFFFF
+ inset 0 0 0 1 #1AFFFFFF, 0 4 14 #40000000
\ No newline at end of file
diff --git a/src/Semi.Avalonia.ColorPicker/Light.axaml b/src/Semi.Avalonia.ColorPicker/Light.axaml
index 6148e2f0..514b984a 100644
--- a/src/Semi.Avalonia.ColorPicker/Light.axaml
+++ b/src/Semi.Avalonia.ColorPicker/Light.axaml
@@ -17,5 +17,5 @@
- 0 0 14 0 #1A000000
+ 0 0 1 #4A000000, 0 4 14 #1A000000
\ No newline at end of file
diff --git a/src/Semi.Avalonia.DataGrid/DataGrid.axaml b/src/Semi.Avalonia.DataGrid/DataGrid.axaml
index 6a25ff39..0b3f116e 100644
--- a/src/Semi.Avalonia.DataGrid/DataGrid.axaml
+++ b/src/Semi.Avalonia.DataGrid/DataGrid.axaml
@@ -3,6 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:collections="using:Avalonia.Collections"
x:CompileBindings="True">
+
@@ -34,14 +35,14 @@
-
+
@@ -74,7 +75,7 @@
Foreground="{TemplateBinding Foreground}" />
@@ -203,7 +204,7 @@
TargetType="DataGridColumnHeader">
-
+
@@ -406,10 +407,11 @@
Margin="4,0,0,0"
Foreground="{TemplateBinding Foreground}"
IsVisible="{TemplateBinding IsPropertyNameVisible}" />
-
+ Content="{Binding Key}" />
+
diff --git a/src/Semi.Avalonia.TreeDataGrid/Index.axaml b/src/Semi.Avalonia.TreeDataGrid/Index.axaml
index f67ed3c3..9fd70b02 100644
--- a/src/Semi.Avalonia.TreeDataGrid/Index.axaml
+++ b/src/Semi.Avalonia.TreeDataGrid/Index.axaml
@@ -1,9 +1,10 @@
+
-
-
+
+
diff --git a/src/Semi.Avalonia.TreeDataGrid/Light.axaml b/src/Semi.Avalonia.TreeDataGrid/Light.axaml
index 73c6c8b3..f15e9700 100644
--- a/src/Semi.Avalonia.TreeDataGrid/Light.axaml
+++ b/src/Semi.Avalonia.TreeDataGrid/Light.axaml
@@ -1,4 +1,5 @@
+
diff --git a/src/Semi.Avalonia.TreeDataGrid/Semi.Avalonia.TreeDataGrid.csproj b/src/Semi.Avalonia.TreeDataGrid/Semi.Avalonia.TreeDataGrid.csproj
index efb7e6d4..fb6eff5f 100644
--- a/src/Semi.Avalonia.TreeDataGrid/Semi.Avalonia.TreeDataGrid.csproj
+++ b/src/Semi.Avalonia.TreeDataGrid/Semi.Avalonia.TreeDataGrid.csproj
@@ -4,14 +4,14 @@
net6.0
enable
latest
- Update to Avalonia 11.1-rc1
+ 11.0.10.1
+ Update to 11.0.10.1
IRIHI Technology Co., Ltd.
Avalonia Theme inspired by Semi Design.
https://github.com/irihitech/Semi.Avalonia
MIT
irihi.png
https://github.com/irihitech/Semi.Avalonia
- 11.0.0
@@ -19,7 +19,7 @@
-
+
diff --git a/src/Semi.Avalonia.TreeDataGrid/Shared.axaml b/src/Semi.Avalonia.TreeDataGrid/Shared.axaml
index dd2a475c..b48fab44 100644
--- a/src/Semi.Avalonia.TreeDataGrid/Shared.axaml
+++ b/src/Semi.Avalonia.TreeDataGrid/Shared.axaml
@@ -1,4 +1,5 @@
+
M17.549 15.659L12.753 21.139C12.6591 21.2464 12.5434 21.3325 12.4135 21.3915C12.2836 21.4505 12.1427 21.481 12 21.481C11.8574 21.481 11.7164 21.4505 11.5865 21.3915C11.4566 21.3325 11.3409 21.2464 11.247 21.139L6.45101 15.659C5.88501 15.011 6.34501 14 7.20401 14H16.796C17.656 14 18.115 15.012 17.549 15.659Z
diff --git a/src/Semi.Avalonia.TreeDataGrid/TreeDataGrid.axaml b/src/Semi.Avalonia.TreeDataGrid/TreeDataGrid.axaml
index c9e2cbe3..e3e98c2b 100644
--- a/src/Semi.Avalonia.TreeDataGrid/TreeDataGrid.axaml
+++ b/src/Semi.Avalonia.TreeDataGrid/TreeDataGrid.axaml
@@ -2,6 +2,7 @@
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:conv="clr-namespace:Avalonia.Controls.Converters;assembly=Avalonia.Controls.TreeDataGrid">
+
@@ -11,7 +12,7 @@
-
+
-
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Controls/AutoCompleteBox.axaml b/src/Semi.Avalonia/Controls/AutoCompleteBox.axaml
index 8aa84a6c..748d4366 100644
--- a/src/Semi.Avalonia/Controls/AutoCompleteBox.axaml
+++ b/src/Semi.Avalonia/Controls/AutoCompleteBox.axaml
@@ -9,9 +9,9 @@
-
-
-
+
+
+
@@ -27,12 +27,13 @@
Watermark="{TemplateBinding Watermark}" />
-
+
diff --git a/src/Semi.Avalonia/Controls/Border.axaml b/src/Semi.Avalonia/Controls/Border.axaml
index 53806cfb..9967017a 100644
--- a/src/Semi.Avalonia/Controls/Border.axaml
+++ b/src/Semi.Avalonia/Controls/Border.axaml
@@ -17,12 +17,12 @@
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/src/Semi.Avalonia/Controls/Button.axaml b/src/Semi.Avalonia/Controls/Button.axaml
index 27ce9d53..4c6be649 100644
--- a/src/Semi.Avalonia/Controls/Button.axaml
+++ b/src/Semi.Avalonia/Controls/Button.axaml
@@ -27,7 +27,7 @@
+
+
+
+
+
@@ -129,7 +134,6 @@
@@ -211,9 +215,9 @@
@@ -254,30 +258,32 @@
BasedOn="{StaticResource {x:Type Button}}"
TargetType="Button">
+
+
+
-
-
-
+
-
diff --git a/src/Semi.Avalonia/Controls/Calendar.axaml b/src/Semi.Avalonia/Controls/Calendar.axaml
index 15a6bbbf..c5a77092 100644
--- a/src/Semi.Avalonia/Controls/Calendar.axaml
+++ b/src/Semi.Avalonia/Controls/Calendar.axaml
@@ -65,8 +65,8 @@
Foreground="{TemplateBinding Foreground}"
Theme="{DynamicResource BorderlessButton}">
@@ -85,8 +85,8 @@
Foreground="{TemplateBinding Foreground}"
Theme="{DynamicResource BorderlessButton}">
@@ -95,7 +95,8 @@
Name="PART_MonthView"
Grid.Row="1"
HorizontalAlignment="Stretch"
- IsVisible="False">
+ IsVisible="False"
+ ColumnDefinitions="*,*,*,*,*,*,*">
@@ -105,33 +106,14 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ IsVisible="False"
+ ColumnDefinitions="*,*,*,*"
+ RowDefinitions="*,*,*" />
@@ -151,6 +133,7 @@
+
+
+
+
+
+
+
@@ -20,11 +25,11 @@
+ IsVisible="False" />
+ Focusable="False" />
+ Placement="BottomEdgeAlignedLeft"
+ PlacementTarget="{TemplateBinding}">
-
+ SelectedDate="{TemplateBinding SelectedDate, Mode=TwoWay}" />
@@ -139,7 +141,6 @@
diff --git a/src/Semi.Avalonia/Controls/CaptionButtons.axaml b/src/Semi.Avalonia/Controls/CaptionButtons.axaml
index 753cc3af..3389656d 100644
--- a/src/Semi.Avalonia/Controls/CaptionButtons.axaml
+++ b/src/Semi.Avalonia/Controls/CaptionButtons.axaml
@@ -2,6 +2,9 @@
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True">
+
+
+
@@ -43,31 +46,28 @@
Orientation="Horizontal"
Spacing="2"
TextElement.FontSize="10">
-
+
-
+
-
+
@@ -80,8 +80,7 @@
diff --git a/src/Semi.Avalonia/Controls/Carousel.axaml b/src/Semi.Avalonia/Controls/Carousel.axaml
index 4b48df4a..cf805c3a 100644
--- a/src/Semi.Avalonia/Controls/Carousel.axaml
+++ b/src/Semi.Avalonia/Controls/Carousel.axaml
@@ -1,9 +1,66 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -12,6 +69,7 @@
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
+ BringIntoViewOnFocusChange="True"
HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Hidden">
-
-
-
-
+
+
+
+
-
-
-
-
-
+
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
+
-
+
+
+
@@ -165,16 +192,15 @@
+ ItemsSource="{TemplateBinding ItemCount, Converter={x:Static converter:ItemConverter.ItemToObjectConverter}}"
+ IsVisible="{TemplateBinding ItemCount, Converter={x:Static converter:ItemConverter.ItemVisibleConverter}}"
+ SelectedIndex="{TemplateBinding SelectedIndex, Mode=TwoWay}">
@@ -185,30 +211,31 @@
Grid.Row="0"
Grid.RowSpan="2"
Grid.Column="0"
+ Theme="{DynamicResource CarouselButton}"
Margin="{DynamicResource CarouselButtonMargin}"
- VerticalAlignment="Center"
- Background="{DynamicResource CarouselButtonPointeroverForeground}"
- BorderBrush="{DynamicResource CarouselButtonPressedForeground}"
- Command="{Binding $parent[Carousel].Previous}"
Foreground="{DynamicResource CarouselButtonForeground}"
- Theme="{DynamicResource CarouselButton}" />
+ IsVisible="{TemplateBinding ItemCount, Converter={x:Static converter:ItemConverter.ItemVisibleConverter}}"
+ Command="{Binding $parent[Carousel].Previous}" />
+ IsVisible="{TemplateBinding ItemCount, Converter={x:Static converter:ItemConverter.ItemVisibleConverter}}"
+ Command="{Binding $parent[Carousel].Next}"
+ RenderTransform="rotate(180deg)" />
@@ -300,12 +287,10 @@
@@ -314,12 +299,10 @@
diff --git a/src/Semi.Avalonia/Controls/ContextMenu.axaml b/src/Semi.Avalonia/Controls/ContextMenu.axaml
index e3b2bbb6..e60ec28b 100644
--- a/src/Semi.Avalonia/Controls/ContextMenu.axaml
+++ b/src/Semi.Avalonia/Controls/ContextMenu.axaml
@@ -3,17 +3,17 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True">
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
@@ -23,97 +22,103 @@
BorderThickness="{TemplateBinding BorderThickness}"
BoxShadow="{DynamicResource DateTimePickerFlyoutBoxShadow}"
CornerRadius="{TemplateBinding CornerRadius}">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+
@@ -177,6 +182,7 @@
@@ -232,11 +237,11 @@
+ IsVisible="False" />
diff --git a/src/Semi.Avalonia/Controls/DateTimePickerShared.axaml b/src/Semi.Avalonia/Controls/DateTimePickerShared.axaml
index 6fa26a2f..b533dd5c 100644
--- a/src/Semi.Avalonia/Controls/DateTimePickerShared.axaml
+++ b/src/Semi.Avalonia/Controls/DateTimePickerShared.axaml
@@ -2,6 +2,8 @@
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True">
+
+
@@ -24,7 +26,6 @@
-
@@ -83,7 +80,7 @@
+
@@ -22,16 +23,16 @@
-
+
+
+
+
+
+
diff --git a/src/Semi.Avalonia/Controls/EmbeddableControlRoot.axaml b/src/Semi.Avalonia/Controls/EmbeddableControlRoot.axaml
index 09a16db2..a0465d46 100644
--- a/src/Semi.Avalonia/Controls/EmbeddableControlRoot.axaml
+++ b/src/Semi.Avalonia/Controls/EmbeddableControlRoot.axaml
@@ -1,4 +1,6 @@
+
+
diff --git a/src/Semi.Avalonia/Controls/Expander.axaml b/src/Semi.Avalonia/Controls/Expander.axaml
index b151aba3..febc7ebd 100644
--- a/src/Semi.Avalonia/Controls/Expander.axaml
+++ b/src/Semi.Avalonia/Controls/Expander.axaml
@@ -9,7 +9,7 @@
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
+ Theme="{DynamicResource InnerPathIcon}"
+ Margin="{DynamicResource ExpanderIconMargin}"
+ Data="{DynamicResource ExpanderIcon}">
@@ -64,19 +65,20 @@
+ IsVisible="{TemplateBinding IsExpanded,
+ Mode=TwoWay}" />
diff --git a/src/Semi.Avalonia/Controls/FlyoutPresenter.axaml b/src/Semi.Avalonia/Controls/FlyoutPresenter.axaml
index 18d96638..22e5c05b 100644
--- a/src/Semi.Avalonia/Controls/FlyoutPresenter.axaml
+++ b/src/Semi.Avalonia/Controls/FlyoutPresenter.axaml
@@ -3,24 +3,24 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
+
+
diff --git a/src/Semi.Avalonia/Controls/HeaderedContentControl.axaml b/src/Semi.Avalonia/Controls/HeaderedContentControl.axaml
index e70aeeed..19dad7ce 100644
--- a/src/Semi.Avalonia/Controls/HeaderedContentControl.axaml
+++ b/src/Semi.Avalonia/Controls/HeaderedContentControl.axaml
@@ -1,7 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -12,31 +36,31 @@
CornerRadius="{TemplateBinding CornerRadius}"
Background="{TemplateBinding Background}"
Padding="{TemplateBinding Padding}">
-
+
+ FontStyle="{TemplateBinding FontStyle}" />
+ FontStyle="{TemplateBinding FontStyle}" />
@@ -44,42 +68,46 @@
-
-
-
+
+
+
-
-
-
+ BorderThickness="{TemplateBinding BorderThickness}"
+ CornerRadius="{TemplateBinding CornerRadius}">
-
+
+ BorderBrush="{TemplateBinding BorderBrush}"
+ BorderThickness="{TemplateBinding BorderThickness, Converter={StaticResource SeparatorBorderMultiplier}}">
+
+
+
+
+
+
+
+ TextWrapping="Wrap" />
diff --git a/src/Semi.Avalonia/Controls/HyperlinkButton.axaml b/src/Semi.Avalonia/Controls/HyperlinkButton.axaml
index 87daa072..ecbc7401 100644
--- a/src/Semi.Avalonia/Controls/HyperlinkButton.axaml
+++ b/src/Semi.Avalonia/Controls/HyperlinkButton.axaml
@@ -1,118 +1,101 @@
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:CompileBindings="True">
+
+
+
+ 链接文本
+
+
+ 网页链接
+
+
+ OnlyIcon
+
+
+
-
-
-
+
-
+
-
-
+
-
-
-
+ Data="{DynamicResource HyperlinkButtonLinkGlyph}"
+ Foreground="{TemplateBinding Foreground}"
+ Width="{DynamicResource HyperlinkButtonLinkGlyphWidth}"
+ Height="{DynamicResource HyperlinkButtonLinkGlyphHeight}" />
-
+ RecognizesAccessKey="True" />
+
-
+
-
-
-
+
-
+
-
-
+
-
-
-
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Controls/Label.axaml b/src/Semi.Avalonia/Controls/Label.axaml
index 08967577..87043688 100644
--- a/src/Semi.Avalonia/Controls/Label.axaml
+++ b/src/Semi.Avalonia/Controls/Label.axaml
@@ -80,8 +80,8 @@
-
-
+
+
-
+
@@ -164,14 +164,14 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
@@ -122,69 +117,66 @@
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
-
+
+ TextWrapping="Wrap" />
-
-
-
-
-
-
-
-
@@ -286,18 +255,18 @@
-
+
+
+
+
+
-
-
-
-
-
+
@@ -350,21 +314,18 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
+
+ FontSize="{TemplateBinding FontSize}"
+ TextWrapping="Wrap" />
@@ -412,8 +377,8 @@
-
-
-
-
-
-
@@ -536,21 +469,22 @@
-
-
+
-
-
-
-
+
+
+
+
+
+
+ UseLayoutRounding="False"
+ TextWrapping="Wrap" />
-
+
@@ -608,55 +535,55 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
+
+ TemplatedControl.IsTemplateFocusTarget="True"
+ VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
-
+ Theme="{DynamicResource InnerPathIcon}"
+ Width="{DynamicResource CheckBoxBoxGlyphWidth}"
+ Height="{DynamicResource CheckBoxBoxGlyphHeight}"
+ Foreground="{DynamicResource CheckBoxGlyphFill}" />
+
@@ -667,116 +594,112 @@
@@ -789,12 +712,14 @@
-
+
-
-
-
+
+
+
+
+
-
+
+ Theme="{DynamicResource InnerPathIcon}"
+ Width="{DynamicResource CheckBoxBoxGlyphWidth}"
+ Height="{DynamicResource CheckBoxBoxGlyphHeight}"
+ Foreground="{DynamicResource CheckBoxGlyphFill}" />
+
-
@@ -845,91 +775,86 @@
-
diff --git a/src/Semi.Avalonia/Controls/ManagedFileChooser.axaml b/src/Semi.Avalonia/Controls/ManagedFileChooser.axaml
index e4613181..ba14dc42 100644
--- a/src/Semi.Avalonia/Controls/ManagedFileChooser.axaml
+++ b/src/Semi.Avalonia/Controls/ManagedFileChooser.axaml
@@ -6,6 +6,7 @@
xmlns:internal="clr-namespace:Avalonia.Dialogs.Internal;assembly=Avalonia.Dialogs"
xmlns:cvt="using:Avalonia.Controls.Converters"
x:CompileBindings="True">
+
M6,2H18A2,2 0 0,1 20,4V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2M12,4A6,6 0 0,0 6,10C6,13.31 8.69,16 12.1,16L11.22,13.77C10.95,13.29 11.11,12.68 11.59,12.4L12.45,11.9C12.93,11.63 13.54,11.79 13.82,12.27L15.74,14.69C17.12,13.59 18,11.9 18,10A6,6 0 0,0 12,4M12,9A1,1 0 0,1 13,10A1,1 0 0,1 12,11A1,1 0 0,1 11,10A1,1 0 0,1 12,9M7,18A1,1 0 0,0 6,19A1,1 0 0,0 7,20A1,1 0 0,0 8,19A1,1 0 0,0 7,18M12.09,13.27L14.58,19.58L17.17,18.08L12.95,12.77L12.09,13.27Z
-
+
@@ -38,8 +39,7 @@
@@ -49,7 +49,7 @@
@@ -58,12 +58,11 @@
DockPanel.Dock="Left"
Theme="{DynamicResource BorderlessButton}">
-
+
@@ -88,7 +87,7 @@
DockPanel.Dock="Left"
IsChecked="{Binding ShowHiddenFiles}" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -115,7 +109,6 @@
-
@@ -173,7 +166,7 @@
ContentTemplate="{TemplateBinding HeaderTemplate}"
RecognizesAccessKey="True" />
-
-
-
@@ -283,6 +266,7 @@
@@ -365,9 +349,6 @@
-
diff --git a/src/Semi.Avalonia/Controls/MenuFlyoutPresenter.axaml b/src/Semi.Avalonia/Controls/MenuFlyoutPresenter.axaml
index c727b68a..a51e3c66 100644
--- a/src/Semi.Avalonia/Controls/MenuFlyoutPresenter.axaml
+++ b/src/Semi.Avalonia/Controls/MenuFlyoutPresenter.axaml
@@ -18,17 +18,17 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
+
+
+
@@ -20,7 +20,48 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Controls/ProgressBar.axaml b/src/Semi.Avalonia/Controls/ProgressBar.axaml
index 2c68a422..65fea16f 100644
--- a/src/Semi.Avalonia/Controls/ProgressBar.axaml
+++ b/src/Semi.Avalonia/Controls/ProgressBar.axaml
@@ -104,7 +104,7 @@
-
+
-
+
@@ -145,7 +145,7 @@
+
diff --git a/src/Semi.Avalonia/Controls/RepeatButton.axaml b/src/Semi.Avalonia/Controls/RepeatButton.axaml
index ed8bafd1..65ee9916 100644
--- a/src/Semi.Avalonia/Controls/RepeatButton.axaml
+++ b/src/Semi.Avalonia/Controls/RepeatButton.axaml
@@ -22,7 +22,7 @@
+
+
+
+
+
@@ -124,7 +129,6 @@
@@ -206,9 +210,9 @@
@@ -249,12 +253,12 @@
BasedOn="{StaticResource {x:Type RepeatButton}}"
TargetType="RepeatButton">
diff --git a/src/Semi.Avalonia/Controls/ScrollViewer.axaml b/src/Semi.Avalonia/Controls/ScrollViewer.axaml
index e68d344c..431a776d 100644
--- a/src/Semi.Avalonia/Controls/ScrollViewer.axaml
+++ b/src/Semi.Avalonia/Controls/ScrollViewer.axaml
@@ -205,13 +205,13 @@
-
-
-
@@ -346,11 +346,11 @@
-
-
diff --git a/src/Semi.Avalonia/Controls/SelectableTextBlock.axaml b/src/Semi.Avalonia/Controls/SelectableTextBlock.axaml
index f37905ae..5e9572b6 100644
--- a/src/Semi.Avalonia/Controls/SelectableTextBlock.axaml
+++ b/src/Semi.Avalonia/Controls/SelectableTextBlock.axaml
@@ -13,11 +13,11 @@
-
-
-
-
-
+
+
+
+
+
diff --git a/src/Semi.Avalonia/Controls/Slider.axaml b/src/Semi.Avalonia/Controls/Slider.axaml
index af43caff..0e877d52 100644
--- a/src/Semi.Avalonia/Controls/Slider.axaml
+++ b/src/Semi.Avalonia/Controls/Slider.axaml
@@ -2,6 +2,7 @@
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True">
+
@@ -43,11 +44,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -153,7 +154,7 @@
diff --git a/src/Semi.Avalonia/Controls/SplitButton.axaml b/src/Semi.Avalonia/Controls/SplitButton.axaml
index 98e76d7a..4ce4fa16 100644
--- a/src/Semi.Avalonia/Controls/SplitButton.axaml
+++ b/src/Semi.Avalonia/Controls/SplitButton.axaml
@@ -25,7 +25,7 @@
-
-
-
-
+
+
+
+
@@ -149,6 +144,12 @@
@@ -233,6 +233,12 @@
BasedOn="{StaticResource {x:Type SplitButton}}"
TargetType="SplitButton">
diff --git a/src/Semi.Avalonia/Controls/SplitView.axaml b/src/Semi.Avalonia/Controls/SplitView.axaml
index f940c672..d97349f8 100644
--- a/src/Semi.Avalonia/Controls/SplitView.axaml
+++ b/src/Semi.Avalonia/Controls/SplitView.axaml
@@ -1,4 +1,6 @@
+
+
@@ -21,7 +23,7 @@
ClipToBounds="True"
ZIndex="100">
diff --git a/src/Semi.Avalonia/Controls/TabControl.axaml b/src/Semi.Avalonia/Controls/TabControl.axaml
index a408fd36..b10af869 100644
--- a/src/Semi.Avalonia/Controls/TabControl.axaml
+++ b/src/Semi.Avalonia/Controls/TabControl.axaml
@@ -2,6 +2,7 @@
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True">
+
@@ -32,10 +33,10 @@
-
-
diff --git a/src/Semi.Avalonia/Controls/TextBox.axaml b/src/Semi.Avalonia/Controls/TextBox.axaml
index 2c4314bb..19bdf0ae 100644
--- a/src/Semi.Avalonia/Controls/TextBox.axaml
+++ b/src/Semi.Avalonia/Controls/TextBox.axaml
@@ -24,25 +24,25 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -71,52 +74,56 @@
Name="PART_FirstSpacer"
Grid.Column="1"
Width="1"
- Margin="0,4"
HorizontalAlignment="Center"
Fill="{DynamicResource DateTimePickerSeparatorBackground}" />
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+
@@ -145,7 +152,7 @@
Margin="{TemplateBinding Padding}"
ColumnDefinitions="*, Auto">
@@ -252,11 +258,11 @@
+ IsVisible="False" />
diff --git a/src/Semi.Avalonia/Controls/TitleBar.axaml b/src/Semi.Avalonia/Controls/TitleBar.axaml
index 3fa988e3..cd172446 100644
--- a/src/Semi.Avalonia/Controls/TitleBar.axaml
+++ b/src/Semi.Avalonia/Controls/TitleBar.axaml
@@ -2,6 +2,7 @@
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True">
+
@@ -10,16 +11,16 @@
-
+
diff --git a/src/Semi.Avalonia/Controls/ToggleButton.axaml b/src/Semi.Avalonia/Controls/ToggleButton.axaml
index b069fa31..4acb73df 100644
--- a/src/Semi.Avalonia/Controls/ToggleButton.axaml
+++ b/src/Semi.Avalonia/Controls/ToggleButton.axaml
@@ -39,7 +39,7 @@
@@ -139,12 +144,9 @@
-
+
-
@@ -201,15 +221,16 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ BorderThickness="{DynamicResource ToggleSwitchDefaultBorderThickness}"
+ CornerRadius="{DynamicResource ToggleSwitchDefaultCornerRadius}">
@@ -307,26 +284,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Controls/Tooltip.axaml b/src/Semi.Avalonia/Controls/Tooltip.axaml
index 8e6b4055..080b8a1c 100644
--- a/src/Semi.Avalonia/Controls/Tooltip.axaml
+++ b/src/Semi.Avalonia/Controls/Tooltip.axaml
@@ -2,6 +2,7 @@
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True">
+
diff --git a/src/Semi.Avalonia/Controls/TreeView.axaml b/src/Semi.Avalonia/Controls/TreeView.axaml
index bccadaef..b404ba89 100644
--- a/src/Semi.Avalonia/Controls/TreeView.axaml
+++ b/src/Semi.Avalonia/Controls/TreeView.axaml
@@ -23,10 +23,10 @@
-
-
-
-
+
+
+
+
@@ -59,7 +59,7 @@
Left="True" />
-
+
-
-
-
-
-
+
+
+
+
+
-