diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index ba56bfb..16165d3 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -2,7 +2,7 @@ name: Deploy to GitHub Pages
env:
PROJECT_PATH: demo/Semi.Avalonia.Demo.Web/Semi.Avalonia.Demo.Web.csproj
- OUTPUT_PATH: demo/Semi.Avalonia.Demo.Web/bin/Release/net7.0/browser-wasm/AppBundle
+ OUTPUT_PATH: demo/Semi.Avalonia.Demo.Web/bin/Release/net8.0-browser/publish/wwwroot
on:
push:
branches: [ "action/deploy" ]
@@ -16,19 +16,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v4.1.1
- - name: Setup .NET 7
+ - name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
- dotnet-version: 7.0.405
+ dotnet-version: 8.0.x
- name: Install wasm-tools
- run: dotnet workload install wasm-tools wasm-tools-net7
-
- - name: Install DotNetCompress
- run: dotnet tool install --global DotNetCompress --version 3.0.0 --no-cache
+ run: dotnet workload install wasm-tools
- name: Publish .NET Project
- run: dotnet publish $PROJECT_PATH -c Release -o release --nologo
+ run: dotnet publish $PROJECT_PATH -c Release --nologo
- name: Change base-tag in index.html
run: sed -i 's///g' $OUTPUT_PATH/index.html
@@ -36,12 +33,6 @@ jobs:
- name: copy index.html to 404.html
run: cp $OUTPUT_PATH/index.html $OUTPUT_PATH/404.html
- - name: Compress Output using Brotli
- run: DotNetCompress -d $OUTPUT_PATH -p "*.dll" "*.js" "*.wasm" --format br --threads 4
-
- - name: Compress Output using GZip
- run: DotNetCompress -d $OUTPUT_PATH -p "*.dll" "*.js" "*.wasm" --format gz --threads 4
-
- name: Add .nojekyll file
run: touch $OUTPUT_PATH/.nojekyll
diff --git a/.github/workflows/Pack.yml b/.github/workflows/pack.yml
similarity index 97%
rename from .github/workflows/Pack.yml
rename to .github/workflows/pack.yml
index 6987468..5f0a4b5 100644
--- a/.github/workflows/Pack.yml
+++ b/.github/workflows/pack.yml
@@ -49,7 +49,7 @@ jobs:
run: dotnet restore
- name: Build
- run: dotnet publish ./demo/Semi.Avalonia.Demo.Android -c Release -f net7.0-android --no-restore
+ run: dotnet publish ./demo/Semi.Avalonia.Demo.Android -c Release -f net8.0-android --no-restore
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4.3.1
diff --git a/.run/SC-Single.run.xml b/.run/SC-Single.run.xml
index 1629fa5..269629d 100644
--- a/.run/SC-Single.run.xml
+++ b/.run/SC-Single.run.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo.Android/Semi.Avalonia.Demo.Android.csproj b/demo/Semi.Avalonia.Demo.Android/Semi.Avalonia.Demo.Android.csproj
index 47a4269..1d0eada 100644
--- a/demo/Semi.Avalonia.Demo.Android/Semi.Avalonia.Demo.Android.csproj
+++ b/demo/Semi.Avalonia.Demo.Android/Semi.Avalonia.Demo.Android.csproj
@@ -1,7 +1,7 @@
Exe
- net7.0-android
+ net8.0-android
21
com.irihitech.Semi.Avalonia
1
@@ -15,11 +15,11 @@
-
+
-
+
-
+
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo.Desktop/Roots.xml b/demo/Semi.Avalonia.Demo.Desktop/Roots.xml
new file mode 100644
index 0000000..7e2f055
--- /dev/null
+++ b/demo/Semi.Avalonia.Demo.Desktop/Roots.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj b/demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
index 4e0ff0e..d5a8648 100644
--- a/demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
+++ b/demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
@@ -1,7 +1,7 @@
WinExe
- net7.0
+ net8.0
enable
true
@@ -11,12 +11,17 @@
-->
+
+ true
+ true
+
+
app.manifest
-
+
-
+
diff --git a/demo/Semi.Avalonia.Demo.Desktop/rd.xml b/demo/Semi.Avalonia.Demo.Desktop/rd.xml
deleted file mode 100644
index 0133190..0000000
--- a/demo/Semi.Avalonia.Demo.Desktop/rd.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/demo/Semi.Avalonia.Demo.Web/AvaloniaAppBuilderExtensions.cs b/demo/Semi.Avalonia.Demo.Web/AvaloniaAppBuilderExtensions.cs
new file mode 100644
index 0000000..2d5a50f
--- /dev/null
+++ b/demo/Semi.Avalonia.Demo.Web/AvaloniaAppBuilderExtensions.cs
@@ -0,0 +1,16 @@
+using Avalonia;
+using Avalonia.Media;
+
+namespace Semi.Avalonia.Demo.Web;
+
+public static class AvaloniaAppBuilderExtensions
+{
+ private static string DefaultFontFamily => "avares://Semi.Avalonia.Demo.Web/Assets#Source Han Sans CN";
+
+ public static AppBuilder WithSourceHanSansCNFont(this AppBuilder builder) =>
+ builder.With(new FontManagerOptions
+ {
+ DefaultFamilyName = DefaultFontFamily,
+ FontFallbacks = new[] { new FontFallback { FontFamily = new FontFamily(DefaultFontFamily) } }
+ });
+}
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo.Web/Program.cs b/demo/Semi.Avalonia.Demo.Web/Program.cs
index 17e83a9..62d4e94 100644
--- a/demo/Semi.Avalonia.Demo.Web/Program.cs
+++ b/demo/Semi.Avalonia.Demo.Web/Program.cs
@@ -7,9 +7,10 @@ using Avalonia.Browser;
namespace Semi.Avalonia.Demo.Web;
-internal partial class Program
+internal sealed partial class Program
{
- private static async Task Main(string[] args) => await BuildAvaloniaApp()
+ private static Task Main(string[] args) => BuildAvaloniaApp()
+ .WithSourceHanSansCNFont()
.StartBrowserAppAsync("out");
public static AppBuilder BuildAvaloniaApp()
diff --git a/demo/Semi.Avalonia.Demo.Web/Semi.Avalonia.Demo.Web.csproj b/demo/Semi.Avalonia.Demo.Web/Semi.Avalonia.Demo.Web.csproj
index b169194..a97b8ce 100644
--- a/demo/Semi.Avalonia.Demo.Web/Semi.Avalonia.Demo.Web.csproj
+++ b/demo/Semi.Avalonia.Demo.Web/Semi.Avalonia.Demo.Web.csproj
@@ -1,20 +1,18 @@
-
+
- net7.0
- browser-wasm
- AppBundle\main.js
Exe
+ net8.0-browser
-
+
-
+
-
+
diff --git a/demo/Semi.Avalonia.Demo.Web/AppBundle/Logo.svg b/demo/Semi.Avalonia.Demo.Web/wwwroot/Logo.svg
similarity index 100%
rename from demo/Semi.Avalonia.Demo.Web/AppBundle/Logo.svg
rename to demo/Semi.Avalonia.Demo.Web/wwwroot/Logo.svg
diff --git a/demo/Semi.Avalonia.Demo.Web/AppBundle/app.css b/demo/Semi.Avalonia.Demo.Web/wwwroot/app.css
similarity index 100%
rename from demo/Semi.Avalonia.Demo.Web/AppBundle/app.css
rename to demo/Semi.Avalonia.Demo.Web/wwwroot/app.css
diff --git a/demo/Semi.Avalonia.Demo.Web/AppBundle/favicon.ico b/demo/Semi.Avalonia.Demo.Web/wwwroot/favicon.ico
similarity index 100%
rename from demo/Semi.Avalonia.Demo.Web/AppBundle/favicon.ico
rename to demo/Semi.Avalonia.Demo.Web/wwwroot/favicon.ico
diff --git a/demo/Semi.Avalonia.Demo.Web/AppBundle/index.html b/demo/Semi.Avalonia.Demo.Web/wwwroot/index.html
similarity index 86%
rename from demo/Semi.Avalonia.Demo.Web/AppBundle/index.html
rename to demo/Semi.Avalonia.Demo.Web/wwwroot/index.html
index 703ee35..8b9f68f 100644
--- a/demo/Semi.Avalonia.Demo.Web/AppBundle/index.html
+++ b/demo/Semi.Avalonia.Demo.Web/wwwroot/index.html
@@ -7,8 +7,8 @@
-
-
+
+
diff --git a/demo/Semi.Avalonia.Demo.Web/AppBundle/main.js b/demo/Semi.Avalonia.Demo.Web/wwwroot/main.js
similarity index 69%
rename from demo/Semi.Avalonia.Demo.Web/AppBundle/main.js
rename to demo/Semi.Avalonia.Demo.Web/wwwroot/main.js
index 0dbe2e4..a9de29f 100644
--- a/demo/Semi.Avalonia.Demo.Web/AppBundle/main.js
+++ b/demo/Semi.Avalonia.Demo.Web/wwwroot/main.js
@@ -1,4 +1,4 @@
-import { dotnet } from './dotnet.js'
+import { dotnet } from './_framework/dotnet.js'
const is_browser = typeof window != "undefined";
if (!is_browser) throw new Error(`Expected to be running in a browser`);
@@ -10,4 +10,4 @@ const dotnetRuntime = await dotnet
const config = dotnetRuntime.getConfig();
-await dotnetRuntime.runMainAndExit(config.mainAssemblyName, [window.location.search]);
\ No newline at end of file
+await dotnetRuntime.runMain(config.mainAssemblyName, [window.location.search]);
diff --git a/demo/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml
index 4f94211..2974962 100644
--- a/demo/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml
@@ -4,114 +4,176 @@
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:DesignWidth="800"
mc:Ignorable="d">
-
- Light (Default)
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ Light (Default)
+
+
+
+
+
+
+
+
+
+ Solid
+
+
+
+
+
+
+
+
+
+ Outline
+
+
+
+
+
+
+
+
+
+ Borderless
+
+
+
+
+
+
+
+
+
+ Disabled
+
+
+
+
+
+
+ Size Classes
+
+
+
+
+
+
+ DropDownButton
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ SplitButton
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ToggleSplitButton
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Solid
-
-
-
-
-
-
-
-
-
- Borderless
-
-
-
-
-
-
-
-
-
- DropDownButton
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml
index ef6059e..883338c 100644
--- a/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml
@@ -78,8 +78,8 @@
- Small 1
- Small 2
+ Large 1
+ Large 2
- Small 1
- Small 2
+ Large 1
+ Large 2
diff --git a/demo/Semi.Avalonia.Demo/Pages/ProgressBarDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ProgressBarDemo.axaml
index 77d164b..6585870 100644
--- a/demo/Semi.Avalonia.Demo/Pages/ProgressBarDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/ProgressBarDemo.axaml
@@ -155,7 +155,7 @@
Value="60" />
Success
Warning
Danger
- Danger
+ Disabled
Solid
@@ -27,10 +27,25 @@
Warning
Danger
- Danger
+ Disabled
+
+
+ Outline
+
+ Primary
+ Secondary
+ Tertiary
+ Success
+ Warning
+ Danger
+
+ Disabled
Borderless
@@ -42,11 +57,24 @@
Warning
Danger
- Danger
+ Disabled
+ Disabled
+
+
+
+
+
+
+ Size Classes
+
+ Small
+ Default
+ Large
+
-
+
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo/Pages/ToggleButtonDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ToggleButtonDemo.axaml
index 5701f79..a954a7b 100644
--- a/demo/Semi.Avalonia.Demo/Pages/ToggleButtonDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/ToggleButtonDemo.axaml
@@ -17,7 +17,7 @@
Success
Warning
Danger
- Danger
+ Disabled
@@ -28,18 +28,71 @@
Success
Warning
Danger
- Danger
+
+ Disabled
+
- Default
- Primary
- Secondary
- Tertiary
- Success
- Warning
- Danger
- Danger
+ Default
+
+ Primary
+
+
+ Secondary
+
+
+ Tertiary
+
+
+ Success
+
+
+ Warning
+
+
+ Danger
+
+
+ Disabled
+
+
+
+
+ Default
+ Checked
+ Indeterminate
+
+
+
+ Small
+ Default
+ Large
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml
index d48d7e2..d747949 100644
--- a/demo/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml
@@ -7,7 +7,7 @@
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
diff --git a/demo/Semi.Avalonia.Demo/Semi.Avalonia.Demo.csproj b/demo/Semi.Avalonia.Demo/Semi.Avalonia.Demo.csproj
index 8b1e2c3..27d6b44 100644
--- a/demo/Semi.Avalonia.Demo/Semi.Avalonia.Demo.csproj
+++ b/demo/Semi.Avalonia.Demo/Semi.Avalonia.Demo.csproj
@@ -4,10 +4,9 @@
enable
latest
-
+
-
@@ -19,8 +18,8 @@
-
-
-
+
+
+
diff --git a/demo/Semi.Avalonia.Demo/ViewModels/PaletteDemoViewModel.cs b/demo/Semi.Avalonia.Demo/ViewModels/PaletteDemoViewModel.cs
index 3c79a75..1646be8 100644
--- a/demo/Semi.Avalonia.Demo/ViewModels/PaletteDemoViewModel.cs
+++ b/demo/Semi.Avalonia.Demo/ViewModels/PaletteDemoViewModel.cs
@@ -47,8 +47,8 @@ public class PaletteDemoViewModel: ObservableObject
public PaletteDemoViewModel()
{
- _lightResourceDictionary = AvaloniaXamlLoader.Load(new Uri("avares://Semi.Avalonia/Themes/Light/Palette.axaml")) as ResourceDictionary;
- _darkResourceDictionary = AvaloniaXamlLoader.Load(new Uri("avares://Semi.Avalonia/Themes/Dark/Palette.axaml")) as ResourceDictionary;
+ _lightResourceDictionary = new Light.Palette();
+ _darkResourceDictionary = new Dark.Palette();
WeakReferenceMessenger.Default.Register(this, OnClickColorItem);
}
@@ -251,7 +251,7 @@ public static class ColorTokens
{
new ("SemiColorPrimary", "Primary"),
new ("SemiColorPrimaryPointerover", "Primary Pointerover"),
- new ("SemiColorPrimaryPressed", "Primary Pressed"),
+ new ("SemiColorPrimaryActive", "Primary Active"),
new ("SemiColorPrimaryDisabled", "Primary Disabled"),
new ("SemiColorPrimaryLight", "Primary Light"),
new ("SemiColorPrimaryLightPointerover", "Primary Light Pointerover"),
@@ -262,7 +262,7 @@ public static class ColorTokens
{
new ("SemiColorSecondary", "Secondary"),
new ("SemiColorSecondaryPointerover", "Secondary Pointerover"),
- new ("SemiColorSecondaryPressed", "Secondary Pressed"),
+ new ("SemiColorSecondaryActive", "Secondary Active"),
new ("SemiColorSecondaryDisabled", "Secondary Disabled"),
new ("SemiColorSecondaryLight", "Secondary Light"),
new ("SemiColorSecondaryLightPointerover", "Secondary Light Pointerover"),
@@ -273,7 +273,7 @@ public static class ColorTokens
{
new ("SemiColorTertiary", "Tertiary"),
new ("SemiColorTertiaryPointerover", "Tertiary Pointerover"),
- new ("SemiColorTertiaryPressed", "Tertiary Pressed"),
+ new ("SemiColorTertiaryActive", "Tertiary Active"),
new ("SemiColorTertiaryLight", "Tertiary Light"),
new ("SemiColorTertiaryLightPointerover", "Tertiary Light Pointerover"),
new ("SemiColorTertiaryLightActive", "Tertiary Light Active"),
@@ -283,7 +283,7 @@ public static class ColorTokens
{
new ("SemiColorInformation", "Information"),
new ("SemiColorInformationPointerover", "Information Pointerover"),
- new ("SemiColorInformationPressed", "Information Pressed"),
+ new ("SemiColorInformationActive", "Information Active"),
new ("SemiColorInformationDisabled", "Information Disabled"),
new ("SemiColorInformationLight", "Information Light"),
new ("SemiColorInformationLightPointerover", "Information Light Pointerover"),
@@ -294,7 +294,7 @@ public static class ColorTokens
{
new ("SemiColorSuccess", "Success"),
new ("SemiColorSuccessPointerover", "Success Pointerover"),
- new ("SemiColorSuccessPressed", "Success Pressed"),
+ new ("SemiColorSuccessActive", "Success Active"),
new ("SemiColorSuccessDisabled", "Success Disabled"),
new ("SemiColorSuccessLight", "Success Light"),
new ("SemiColorSuccessLightPointerover", "Success Light Pointerover"),
@@ -305,7 +305,7 @@ public static class ColorTokens
{
new ("SemiColorWarning", "Warning"),
new ("SemiColorWarningPointerover", "Warning Pointerover"),
- new ("SemiColorWarningPressed", "Warning Pressed"),
+ new ("SemiColorWarningActive", "Warning Active"),
new ("SemiColorWarningLight", "Warning Light"),
new ("SemiColorWarningLightPointerover", "Warning Light Pointerover"),
new ("SemiColorWarningLightActive", "Warning Light Active"),
@@ -315,7 +315,7 @@ public static class ColorTokens
{
new ("SemiColorDanger", "Danger"),
new ("SemiColorDangerPointerover", "Danger Pointerover"),
- new ("SemiColorDangerPressed", "Danger Pressed"),
+ new ("SemiColorDangerActive", "Danger Active"),
new ("SemiColorDangerLight", "Danger Light"),
new ("SemiColorDangerLightPointerover", "Danger Light Pointerover"),
new ("SemiColorDangerLightActive", "Danger Light Active"),
diff --git a/global.json b/global.json
index 7cd6a1f..dad2db5 100644
--- a/global.json
+++ b/global.json
@@ -1,6 +1,6 @@
{
"sdk": {
- "version": "7.0.0",
+ "version": "8.0.0",
"rollForward": "latestMajor",
"allowPrerelease": true
}
diff --git a/src/Package.props b/src/Package.props
index 66cac71..faeae7d 100644
--- a/src/Package.props
+++ b/src/Package.props
@@ -1,6 +1,6 @@
- net6.0;netstandard2.0
+ net6.0;net8.0;netstandard2.0
enable
latest
11.0.7.4
diff --git a/src/Semi.Avalonia.ColorPicker/Index.axaml b/src/Semi.Avalonia.ColorPicker/Index.axaml
index 2af9525..32b0f04 100644
--- a/src/Semi.Avalonia.ColorPicker/Index.axaml
+++ b/src/Semi.Avalonia.ColorPicker/Index.axaml
@@ -2,8 +2,8 @@
-
-
+
+
diff --git a/src/Semi.Avalonia.ColorPicker/Semi.Avalonia.ColorPicker.csproj b/src/Semi.Avalonia.ColorPicker/Semi.Avalonia.ColorPicker.csproj
index b99b666..4464c41 100644
--- a/src/Semi.Avalonia.ColorPicker/Semi.Avalonia.ColorPicker.csproj
+++ b/src/Semi.Avalonia.ColorPicker/Semi.Avalonia.ColorPicker.csproj
@@ -7,6 +7,10 @@
Update to 11.0.7
+
+ true
+
+
diff --git a/src/Semi.Avalonia.DataGrid/DataGrid.axaml b/src/Semi.Avalonia.DataGrid/DataGrid.axaml
index 7073ecf..e9a5a88 100644
--- a/src/Semi.Avalonia.DataGrid/DataGrid.axaml
+++ b/src/Semi.Avalonia.DataGrid/DataGrid.axaml
@@ -292,7 +292,7 @@
Name="BackgroundBorder"
Grid.RowSpan="2"
Grid.ColumnSpan="2"
- Margin="2"
+ Margin="{DynamicResource DataGridRowMargin}"
Background="{DynamicResource DataGridRowBackground}"
CornerRadius="3" />
-
-
+
+
diff --git a/src/Semi.Avalonia.DataGrid/Semi.Avalonia.DataGrid.csproj b/src/Semi.Avalonia.DataGrid/Semi.Avalonia.DataGrid.csproj
index c468a73..378f48d 100644
--- a/src/Semi.Avalonia.DataGrid/Semi.Avalonia.DataGrid.csproj
+++ b/src/Semi.Avalonia.DataGrid/Semi.Avalonia.DataGrid.csproj
@@ -1,12 +1,16 @@
-
+
Semi.Avalonia.DataGrid
Update to 11.0.7
+
+ true
+
+
diff --git a/src/Semi.Avalonia.DataGrid/Shared.axaml b/src/Semi.Avalonia.DataGrid/Shared.axaml
index f6f8ce3..17d1dfc 100644
--- a/src/Semi.Avalonia.DataGrid/Shared.axaml
+++ b/src/Semi.Avalonia.DataGrid/Shared.axaml
@@ -12,6 +12,7 @@
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
8 0
+ 2
M7.43934 19.7957C6.85355 19.2099 6.85355 18.2601 7.43934 17.6744L13.0962 12.0175L7.43934 6.36065C6.85355 5.77486 6.85355 4.82511 7.43934 4.23933C8.02513 3.65354 8.97487 3.65354 9.56066 4.23933L16.2782 10.9568C16.864 11.5426 16.864 12.4924 16.2782 13.0782L9.56066 19.7957C8.97487 20.3815 8.02513 20.3815 7.43934 19.7957Z
diff --git a/src/Semi.Avalonia.TreeDataGrid/Semi.Avalonia.TreeDataGrid.csproj b/src/Semi.Avalonia.TreeDataGrid/Semi.Avalonia.TreeDataGrid.csproj
index 76f6dc4..7bc1a05 100644
--- a/src/Semi.Avalonia.TreeDataGrid/Semi.Avalonia.TreeDataGrid.csproj
+++ b/src/Semi.Avalonia.TreeDataGrid/Semi.Avalonia.TreeDataGrid.csproj
@@ -14,6 +14,10 @@
11.0.0
+
+ true
+
+
diff --git a/src/Semi.Avalonia.TreeDataGrid/Shared.axaml b/src/Semi.Avalonia.TreeDataGrid/Shared.axaml
index 168e7c3..b48fab4 100644
--- a/src/Semi.Avalonia.TreeDataGrid/Shared.axaml
+++ b/src/Semi.Avalonia.TreeDataGrid/Shared.axaml
@@ -5,4 +5,5 @@
M6.45096 8.34102L11.247 2.86102C11.3408 2.75361 11.4566 2.66753 11.5865 2.60854C11.7163 2.54956 11.8573 2.51904 12 2.51904C12.1426 2.51904 12.2836 2.54956 12.4135 2.60854C12.5433 2.66753 12.6591 2.75361 12.753 2.86102L17.549 8.34102C18.115 8.98802 17.655 10 16.796 10H7.20396C6.34396 10 5.88496 8.98802 6.45096 8.34102Z
M9.65618 3.44015L18.6322 11.2454C19.0906 11.644 19.0906 12.356 18.6322 12.7546L9.65618 20.5598C9.00895 21.1226 8 20.6629 8 19.8052V4.19475C8 3.33705 9.00895 2.87734 9.65618 3.44015Z
+ 2
diff --git a/src/Semi.Avalonia.TreeDataGrid/TreeDataGrid.axaml b/src/Semi.Avalonia.TreeDataGrid/TreeDataGrid.axaml
index 3cf32a4..9a83369 100644
--- a/src/Semi.Avalonia.TreeDataGrid/TreeDataGrid.axaml
+++ b/src/Semi.Avalonia.TreeDataGrid/TreeDataGrid.axaml
@@ -149,7 +149,7 @@
@@ -239,8 +238,7 @@
DockPanel.Dock="Left">
@@ -287,8 +285,7 @@
+ Text="{TemplateBinding Value, Mode=TwoWay}" />
diff --git a/src/Semi.Avalonia/Controls/Button.axaml b/src/Semi.Avalonia/Controls/Button.axaml
index 594b759..1567ea0 100644
--- a/src/Semi.Avalonia/Controls/Button.axaml
+++ b/src/Semi.Avalonia/Controls/Button.axaml
@@ -2,9 +2,9 @@
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True">
-
-
-
+
+
+
@@ -76,7 +76,6 @@
@@ -186,7 +185,37 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Semi.Avalonia/Controls/Calendar.axaml b/src/Semi.Avalonia/Controls/Calendar.axaml
index 3efe8e0..14d3264 100644
--- a/src/Semi.Avalonia/Controls/Calendar.axaml
+++ b/src/Semi.Avalonia/Controls/Calendar.axaml
@@ -31,6 +31,7 @@
+
@@ -53,7 +54,7 @@
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
-
@@ -235,7 +234,37 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Semi.Avalonia/Controls/ProgressBar.axaml b/src/Semi.Avalonia/Controls/ProgressBar.axaml
index a7dbb9a..96cb05e 100644
--- a/src/Semi.Avalonia/Controls/ProgressBar.axaml
+++ b/src/Semi.Avalonia/Controls/ProgressBar.axaml
@@ -185,6 +185,10 @@
+
+
@@ -411,6 +415,10 @@
+
+
diff --git a/src/Semi.Avalonia/Controls/RepeatButton.axaml b/src/Semi.Avalonia/Controls/RepeatButton.axaml
index cad9922..7bb6f40 100644
--- a/src/Semi.Avalonia/Controls/RepeatButton.axaml
+++ b/src/Semi.Avalonia/Controls/RepeatButton.axaml
@@ -71,7 +71,6 @@
@@ -172,7 +171,37 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Semi.Avalonia/Controls/SplitButton.axaml b/src/Semi.Avalonia/Controls/SplitButton.axaml
index 66644d1..e58ebba 100644
--- a/src/Semi.Avalonia/Controls/SplitButton.axaml
+++ b/src/Semi.Avalonia/Controls/SplitButton.axaml
@@ -124,9 +124,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Semi.Avalonia/Controls/ToggleButton.axaml b/src/Semi.Avalonia/Controls/ToggleButton.axaml
index 3393064..fa2519b 100644
--- a/src/Semi.Avalonia/Controls/ToggleButton.axaml
+++ b/src/Semi.Avalonia/Controls/ToggleButton.axaml
@@ -67,6 +67,7 @@
@@ -242,12 +244,12 @@
+
+
+
+
+
+
+
+
+ ColumnDefinitions="Auto, *">
-
-
-
-
-
-
-
-
+ Grid.Column="0"
+ Grid.ColumnSpan="2"
+ TemplatedControl.IsTemplateFocusTarget="True" />
+
+
+
+
+
+
-
+
diff --git a/src/Semi.Avalonia/Locale/en-us.axaml.cs b/src/Semi.Avalonia/Locale/en-us.axaml.cs
new file mode 100644
index 0000000..f9a9730
--- /dev/null
+++ b/src/Semi.Avalonia/Locale/en-us.axaml.cs
@@ -0,0 +1,8 @@
+using Avalonia.Controls;
+
+namespace Semi.Avalonia.Locale;
+
+public class en_us: ResourceDictionary
+{
+
+}
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Locale/zh-cn.axaml.cs b/src/Semi.Avalonia/Locale/zh-cn.axaml.cs
new file mode 100644
index 0000000..530a7de
--- /dev/null
+++ b/src/Semi.Avalonia/Locale/zh-cn.axaml.cs
@@ -0,0 +1,8 @@
+using Avalonia.Controls;
+
+namespace Semi.Avalonia.Locale;
+
+public class zh_cn: ResourceDictionary
+{
+
+}
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Semi.Avalonia.csproj b/src/Semi.Avalonia/Semi.Avalonia.csproj
index a03e35d..a3c0d21 100644
--- a/src/Semi.Avalonia/Semi.Avalonia.csproj
+++ b/src/Semi.Avalonia/Semi.Avalonia.csproj
@@ -7,6 +7,10 @@
Update to 11.0.7
+
+ true
+
+
diff --git a/src/Semi.Avalonia/Themes/Dark/Button.axaml b/src/Semi.Avalonia/Themes/Dark/Button.axaml
index cf4be31..2f9ff5a 100644
--- a/src/Semi.Avalonia/Themes/Dark/Button.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/Button.axaml
@@ -2,7 +2,7 @@
-
+
@@ -11,7 +11,6 @@
-
@@ -69,8 +68,20 @@
+
+
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Semi.Avalonia/Themes/Dark/CheckBox.axaml b/src/Semi.Avalonia/Themes/Dark/CheckBox.axaml
index 4c4bb32..964a754 100644
--- a/src/Semi.Avalonia/Themes/Dark/CheckBox.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/CheckBox.axaml
@@ -9,7 +9,7 @@
-
+
diff --git a/src/Semi.Avalonia/Themes/Dark/Palette.axaml b/src/Semi.Avalonia/Themes/Dark/Palette.axaml
index d66c981..3bdef13 100644
--- a/src/Semi.Avalonia/Themes/Dark/Palette.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/Palette.axaml
@@ -1,4 +1,4 @@
-
+
#6C090B
#901110
@@ -326,6 +326,7 @@
+
@@ -334,6 +335,7 @@
+
+
@@ -350,6 +353,7 @@
+
@@ -358,6 +362,7 @@
+
@@ -366,6 +371,7 @@
+
@@ -373,6 +379,7 @@
+
diff --git a/src/Semi.Avalonia/Themes/Dark/Palette.axaml.cs b/src/Semi.Avalonia/Themes/Dark/Palette.axaml.cs
new file mode 100644
index 0000000..196931f
--- /dev/null
+++ b/src/Semi.Avalonia/Themes/Dark/Palette.axaml.cs
@@ -0,0 +1,9 @@
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+
+namespace Semi.Avalonia.Dark;
+
+public class Palette: ResourceDictionary
+{
+
+}
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/ProgressBar.axaml b/src/Semi.Avalonia/Themes/Dark/ProgressBar.axaml
index 6f40655..7b74afd 100644
--- a/src/Semi.Avalonia/Themes/Dark/ProgressBar.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/ProgressBar.axaml
@@ -9,5 +9,7 @@
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/TextBlock.axaml b/src/Semi.Avalonia/Themes/Dark/TextBlock.axaml
index a51facb..332d0b6 100644
--- a/src/Semi.Avalonia/Themes/Dark/TextBlock.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/TextBlock.axaml
@@ -7,10 +7,10 @@
-
-
-
-
+
+
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/ToggleButton.axaml b/src/Semi.Avalonia/Themes/Dark/ToggleButton.axaml
index 03d0391..3f05a77 100644
--- a/src/Semi.Avalonia/Themes/Dark/ToggleButton.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/ToggleButton.axaml
@@ -2,7 +2,6 @@
-
@@ -10,7 +9,7 @@
-
+
@@ -37,6 +36,7 @@
+
diff --git a/src/Semi.Avalonia/Themes/Dark/ToggleSwitch.axaml b/src/Semi.Avalonia/Themes/Dark/ToggleSwitch.axaml
index 0d3ce91..e087b2f 100644
--- a/src/Semi.Avalonia/Themes/Dark/ToggleSwitch.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/ToggleSwitch.axaml
@@ -4,12 +4,10 @@
-
+
-
+
-
-
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Index.axaml b/src/Semi.Avalonia/Themes/Index.axaml
index 701f381..2c354e6 100644
--- a/src/Semi.Avalonia/Themes/Index.axaml
+++ b/src/Semi.Avalonia/Themes/Index.axaml
@@ -2,8 +2,8 @@
-
-
+
+
diff --git a/src/Semi.Avalonia/Themes/Light/Button.axaml b/src/Semi.Avalonia/Themes/Light/Button.axaml
index 30bd3bc..ba9513c 100644
--- a/src/Semi.Avalonia/Themes/Light/Button.axaml
+++ b/src/Semi.Avalonia/Themes/Light/Button.axaml
@@ -2,7 +2,7 @@
-
+
@@ -11,7 +11,6 @@
-
@@ -69,8 +68,20 @@
+
+
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Semi.Avalonia/Themes/Light/CheckBox.axaml b/src/Semi.Avalonia/Themes/Light/CheckBox.axaml
index 4218bd6..321e720 100644
--- a/src/Semi.Avalonia/Themes/Light/CheckBox.axaml
+++ b/src/Semi.Avalonia/Themes/Light/CheckBox.axaml
@@ -11,7 +11,7 @@
-
+
diff --git a/src/Semi.Avalonia/Themes/Light/Palette.axaml b/src/Semi.Avalonia/Themes/Light/Palette.axaml
index a452166..a4f8376 100644
--- a/src/Semi.Avalonia/Themes/Light/Palette.axaml
+++ b/src/Semi.Avalonia/Themes/Light/Palette.axaml
@@ -1,4 +1,4 @@
-
+
#FEF2ED
#FEDDD2
@@ -326,6 +326,7 @@
+
@@ -334,6 +335,7 @@
+
@@ -342,6 +344,7 @@
+
@@ -349,6 +352,7 @@
+
@@ -357,6 +361,7 @@
+
@@ -365,6 +370,7 @@
+
@@ -372,6 +378,7 @@
+
diff --git a/src/Semi.Avalonia/Themes/Light/Palette.axaml.cs b/src/Semi.Avalonia/Themes/Light/Palette.axaml.cs
new file mode 100644
index 0000000..e391acb
--- /dev/null
+++ b/src/Semi.Avalonia/Themes/Light/Palette.axaml.cs
@@ -0,0 +1,9 @@
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+
+namespace Semi.Avalonia.Light;
+
+public class Palette: ResourceDictionary
+{
+
+}
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/ProgressBar.axaml b/src/Semi.Avalonia/Themes/Light/ProgressBar.axaml
index 2944dbb..ff03bf3 100644
--- a/src/Semi.Avalonia/Themes/Light/ProgressBar.axaml
+++ b/src/Semi.Avalonia/Themes/Light/ProgressBar.axaml
@@ -9,5 +9,7 @@
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/TextBlock.axaml b/src/Semi.Avalonia/Themes/Light/TextBlock.axaml
index c9329eb..4d5d389 100644
--- a/src/Semi.Avalonia/Themes/Light/TextBlock.axaml
+++ b/src/Semi.Avalonia/Themes/Light/TextBlock.axaml
@@ -7,10 +7,10 @@
-
-
-
+
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/ToggleButton.axaml b/src/Semi.Avalonia/Themes/Light/ToggleButton.axaml
index 595cd9e..2d27503 100644
--- a/src/Semi.Avalonia/Themes/Light/ToggleButton.axaml
+++ b/src/Semi.Avalonia/Themes/Light/ToggleButton.axaml
@@ -2,7 +2,6 @@
-
@@ -10,7 +9,7 @@
-
+
@@ -37,6 +36,7 @@
+
diff --git a/src/Semi.Avalonia/Themes/Light/ToggleSwitch.axaml b/src/Semi.Avalonia/Themes/Light/ToggleSwitch.axaml
index a01024b..f1807ce 100644
--- a/src/Semi.Avalonia/Themes/Light/ToggleSwitch.axaml
+++ b/src/Semi.Avalonia/Themes/Light/ToggleSwitch.axaml
@@ -6,10 +6,8 @@
-
+
-
-
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/SemiTheme.axaml b/src/Semi.Avalonia/Themes/SemiTheme.axaml
index 1b36b00..d078e7f 100644
--- a/src/Semi.Avalonia/Themes/SemiTheme.axaml
+++ b/src/Semi.Avalonia/Themes/SemiTheme.axaml
@@ -2,8 +2,8 @@
-
-
+
+
diff --git a/src/Semi.Avalonia/Themes/SemiTheme.axaml.cs b/src/Semi.Avalonia/Themes/SemiTheme.axaml.cs
index a2646cf..88268f3 100644
--- a/src/Semi.Avalonia/Themes/SemiTheme.axaml.cs
+++ b/src/Semi.Avalonia/Themes/SemiTheme.axaml.cs
@@ -4,15 +4,16 @@ using System.Globalization;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using Avalonia.Styling;
+using Semi.Avalonia.Locale;
namespace Semi.Avalonia;
public class SemiTheme: Styles
{
- private static readonly Dictionary _localeToResource = new()
+ private static readonly Dictionary _localeToResource = new()
{
- { new CultureInfo("zh-CN"), "avares://Semi.Avalonia/Locale/zh-CN.axaml" },
- { new CultureInfo("en-US"), "avares://Semi.Avalonia/Locale/en-US.axaml" },
+ { new CultureInfo("zh-cn"), new zh_cn() },
+ { new CultureInfo("en-us"), new en_us() },
};
private readonly IServiceProvider? sp;
@@ -30,26 +31,24 @@ public class SemiTheme: Styles
{
_locale = value;
var resource = TryGetLocaleResource(value);
- var d = AvaloniaXamlLoader.Load(sp, new Uri(resource)) as ResourceDictionary;
- if (d is null) return;
- foreach (var kv in d)
+ if(resource is null) return;
+ foreach (var kv in resource)
{
this.Resources.Add(kv);
}
}
}
- private static string TryGetLocaleResource(CultureInfo? locale)
+ private static ResourceDictionary? TryGetLocaleResource(CultureInfo? locale)
{
if (locale is null)
{
- return _localeToResource[new CultureInfo("zh-CN")];
+ return _localeToResource[new CultureInfo("zh-cn")];
}
-
if (_localeToResource.TryGetValue(locale, out var resource))
{
return resource;
}
- return _localeToResource[new CultureInfo("zh-CN")];
+ return _localeToResource[new CultureInfo("zh-cn")];
}
}
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Shared/ToggleSwitch.axaml b/src/Semi.Avalonia/Themes/Shared/ToggleSwitch.axaml
index 2212e67..16a1e78 100644
--- a/src/Semi.Avalonia/Themes/Shared/ToggleSwitch.axaml
+++ b/src/Semi.Avalonia/Themes/Shared/ToggleSwitch.axaml
@@ -8,6 +8,9 @@
18
12
24
+ 2 0 0 0
+ 1 0 0 0
+ 3 0 0 0
12
14