From 232e6e4b418023f90286ff502d7172f7e094b05b Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Sun, 4 Jun 2023 23:10:03 +0800
Subject: [PATCH 01/46] feat: upgrade to support wasm.
---
demo/Semi.Avalonia.Demo.Web/App.axaml | 8 ++++----
demo/Semi.Avalonia.Demo.Web/AppBundle/app.css | 9 ++++++++-
demo/Semi.Avalonia.Demo.Web/AppBundle/index.html | 1 -
demo/Semi.Avalonia.Demo.Web/AppBundle/main.js | 3 ---
demo/Semi.Avalonia.Demo.Web/Program.cs | 11 +++++------
.../Semi.Avalonia.Demo.Web.csproj | 11 +----------
6 files changed, 18 insertions(+), 25 deletions(-)
diff --git a/demo/Semi.Avalonia.Demo.Web/App.axaml b/demo/Semi.Avalonia.Demo.Web/App.axaml
index fe5d151..6b850fc 100644
--- a/demo/Semi.Avalonia.Demo.Web/App.axaml
+++ b/demo/Semi.Avalonia.Demo.Web/App.axaml
@@ -1,10 +1,10 @@
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
-
-
+
+
+
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo.Web/AppBundle/app.css b/demo/Semi.Avalonia.Demo.Web/AppBundle/app.css
index 027ea8f..a424538 100644
--- a/demo/Semi.Avalonia.Demo.Web/AppBundle/app.css
+++ b/demo/Semi.Avalonia.Demo.Web/AppBundle/app.css
@@ -1,4 +1,11 @@
-/* HTML styles for the splash screen */
+:root {
+ --sat: env(safe-area-inset-top);
+ --sar: env(safe-area-inset-right);
+ --sab: env(safe-area-inset-bottom);
+ --sal: env(safe-area-inset-left);
+}
+
+/* HTML styles for the splash screen */
.highlight {
color: white;
diff --git a/demo/Semi.Avalonia.Demo.Web/AppBundle/index.html b/demo/Semi.Avalonia.Demo.Web/AppBundle/index.html
index c90e26c..703ee35 100644
--- a/demo/Semi.Avalonia.Demo.Web/AppBundle/index.html
+++ b/demo/Semi.Avalonia.Demo.Web/AppBundle/index.html
@@ -10,7 +10,6 @@
-
diff --git a/demo/Semi.Avalonia.Demo.Web/AppBundle/main.js b/demo/Semi.Avalonia.Demo.Web/AppBundle/main.js
index 2426ede..0dbe2e4 100644
--- a/demo/Semi.Avalonia.Demo.Web/AppBundle/main.js
+++ b/demo/Semi.Avalonia.Demo.Web/AppBundle/main.js
@@ -1,5 +1,4 @@
import { dotnet } from './dotnet.js'
-import { registerAvaloniaModule } from './avalonia.js';
const is_browser = typeof window != "undefined";
if (!is_browser) throw new Error(`Expected to be running in a browser`);
@@ -9,8 +8,6 @@ const dotnetRuntime = await dotnet
.withApplicationArgumentsFromQuery()
.create();
-await registerAvaloniaModule(dotnetRuntime);
-
const config = dotnetRuntime.getConfig();
await dotnetRuntime.runMainAndExit(config.mainAssemblyName, [window.location.search]);
\ 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 37143f0..17e83a9 100644
--- a/demo/Semi.Avalonia.Demo.Web/Program.cs
+++ b/demo/Semi.Avalonia.Demo.Web/Program.cs
@@ -1,17 +1,16 @@
using System.Runtime.Versioning;
+using System.Threading.Tasks;
using Avalonia;
-using Avalonia.Media;
-using Semi.Avalonia.Demo.Web;
using Avalonia.Browser;
[assembly: SupportedOSPlatform("browser")]
+namespace Semi.Avalonia.Demo.Web;
+
internal partial class Program
{
- private static void Main(string[] args)
- {
- BuildAvaloniaApp(); //.SetupBrowserApp("out");
- }
+ private static async Task Main(string[] args) => await BuildAvaloniaApp()
+ .StartBrowserAppAsync("out");
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure();
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 9db7e5b..b169194 100644
--- a/demo/Semi.Avalonia.Demo.Web/Semi.Avalonia.Demo.Web.csproj
+++ b/demo/Semi.Avalonia.Demo.Web/Semi.Avalonia.Demo.Web.csproj
@@ -10,20 +10,11 @@
-
-
-
-
-
-
-
-
-
-
+
From ab8dacec4bec5bb4e8d980a21b73411a92efb6a9 Mon Sep 17 00:00:00 2001
From: rabbitism
Date: Wed, 5 Jul 2023 19:01:12 +0800
Subject: [PATCH 02/46] feat: update documentation.
---
README.md | 19 ++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)
diff --git a/README.md b/README.md
index 9050702..1df0117 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@ Avalonia Theme inspired by Semi Design
## Installation
```bash
-dotnet add package Semi.Avalonia --version 11.0.0-rc1
+dotnet add package Semi.Avalonia --version 11.0.0
```
Include Semi Design Styles in application:
@@ -23,8 +23,8 @@ That's all.
DataGrid and ColorPicker are distributed in separated packages. Please install if you need.
```bash
-dotnet add package Semi.Avalonia.ColorPicker --version 11.0.0-rc1
-dotnet add package Semi.Avalonia.DataGrid --version 11.0.0-rc1
+dotnet add package Semi.Avalonia.ColorPicker --version 11.0.0
+dotnet add package Semi.Avalonia.DataGrid --version 11.0.0
```
```xaml
@@ -42,20 +42,9 @@ https://github.com/irihitech/Semi.Avalonia/releases
| Semi Design Version | Avalonia Version |
|:--------------------|:-----------------|
-| 11.0.0-rc1 | 11.0.0-rc1.1 |
-| 0.1.0-preview3 | 11.0-preview4 |
-| 0.1.0-preview5.x | 11.0-preview5 |
-| 0.1.0-preview6.x | 11.0-preview6 |
-| 0.1.0-preview7.x | 11.0-preview7 |
-| 0.1.0-preview8.x | 11.0-preview8 |
-
-**NOTE**
-
-Semi Avalonia theme is moving forward together with Avalonia preview versions now. So new feature/fixes are not backported to previous preview versions. If you need a feature/fix for outdated avalonia preview version, please raise an issue so we can do that for you.
-
+| 11.0.0 | 11.0.0 |
## TODO
-* DataValidationErrors
* FocusAdorner
## Credits
From 8f5b9f6c47490caec9f5c8697f6f93517a157e8f Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Fri, 7 Jul 2023 17:21:56 +0800
Subject: [PATCH 03/46] fix: fix the wrong opacity values.
---
src/Semi.Avalonia.DataGrid/Dark.axaml | 4 ++--
src/Semi.Avalonia/Themes/Dark/ButtonSpinner.axaml | 2 +-
src/Semi.Avalonia/Themes/Dark/Calendar.axaml | 6 +++---
src/Semi.Avalonia/Themes/Dark/CalendarDatePicker.axaml | 2 +-
src/Semi.Avalonia/Themes/Dark/CaptionButtons.axaml | 2 +-
src/Semi.Avalonia/Themes/Dark/ComboBox.axaml | 2 +-
src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml | 4 ++--
src/Semi.Avalonia/Themes/Dark/Expander.axaml | 2 +-
src/Semi.Avalonia/Themes/Dark/ListBox.axaml | 2 +-
src/Semi.Avalonia/Themes/Dark/Menu.axaml | 4 ++--
src/Semi.Avalonia/Themes/Dark/TabItem.axaml | 2 +-
src/Semi.Avalonia/Themes/Dark/TextBlock.axaml | 2 +-
src/Semi.Avalonia/Themes/Dark/TreeView.axaml | 2 +-
13 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/src/Semi.Avalonia.DataGrid/Dark.axaml b/src/Semi.Avalonia.DataGrid/Dark.axaml
index ad74cb4..e8689c5 100644
--- a/src/Semi.Avalonia.DataGrid/Dark.axaml
+++ b/src/Semi.Avalonia.DataGrid/Dark.axaml
@@ -12,7 +12,7 @@
1
-
+
12 0 0 0
32
@@ -33,7 +33,7 @@
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/Themes/Dark/ButtonSpinner.axaml b/src/Semi.Avalonia/Themes/Dark/ButtonSpinner.axaml
index 5b19bad..96149dd 100644
--- a/src/Semi.Avalonia/Themes/Dark/ButtonSpinner.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/ButtonSpinner.axaml
@@ -6,7 +6,7 @@
-
+
3
diff --git a/src/Semi.Avalonia/Themes/Dark/Calendar.axaml b/src/Semi.Avalonia/Themes/Dark/Calendar.axaml
index 934e516..a87a6b3 100644
--- a/src/Semi.Avalonia/Themes/Dark/Calendar.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/Calendar.axaml
@@ -9,8 +9,8 @@
1
6
40
-
-
+
+
M16.2782 4.23933C16.864 4.82511 16.864 5.77486 16.2782 6.36065L10.6213 12.0175L16.2782 17.6744C16.864 18.2601 16.864 19.2099 16.2782 19.7957C15.6924 20.3815 14.7426 20.3815 14.1569 19.7957L7.43934 13.0782C6.85355 12.4924 6.85355 11.5426 7.43934 10.9568L14.1569 4.23933C14.7426 3.65354 15.6924 3.65354 16.2782 4.23933Z
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
@@ -44,7 +44,7 @@
-
+
240
250
diff --git a/src/Semi.Avalonia/Themes/Dark/CalendarDatePicker.axaml b/src/Semi.Avalonia/Themes/Dark/CalendarDatePicker.axaml
index a0d8a58..3c2ff1e 100644
--- a/src/Semi.Avalonia/Themes/Dark/CalendarDatePicker.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/CalendarDatePicker.axaml
@@ -1,6 +1,6 @@
-
+
M4 20V8H20V20H4ZM2 4C2 2.89543 2.89543 2 4 2H20C21.1046 2 22 2.89543 22 4V20C22 21.1046 21.1046 22 20 22H4C2.89543 22 2 21.1046 2 20V4ZM6 10.5C6 10.2239 6.22386 10 6.5 10H8.5C8.77614 10 9 10.2239 9 10.5V12.5C9 12.7761 8.77614 13 8.5 13H6.5C6.22386 13 6 12.7761 6 12.5V10.5ZM6.5 15C6.22386 15 6 15.2239 6 15.5V17.5C6 17.7761 6.22386 18 6.5 18H8.5C8.77614 18 9 17.7761 9 17.5V15.5C9 15.2239 8.77614 15 8.5 15H6.5ZM10.5 10.5C10.5 10.2239 10.7239 10 11 10H13C13.2761 10 13.5 10.2239 13.5 10.5V12.5C13.5 12.7761 13.2761 13 13 13H11C10.7239 13 10.5 12.7761 10.5 12.5V10.5ZM11 15C10.7239 15 10.5 15.2239 10.5 15.5V17.5C10.5 17.7761 10.7239 18 11 18H13C13.2761 18 13.5 17.7761 13.5 17.5V15.5C13.5 15.2239 13.2761 15 13 15H11ZM15 10.5C15 10.2239 15.2239 10 15.5 10H17.5C17.7761 10 18 10.2239 18 10.5V12.5C18 12.7761 17.7761 13 17.5 13H15.5C15.2239 13 15 12.7761 15 12.5V10.5ZM15.5 15C15.2239 15 15 15.2239 15 15.5V17.5C15 17.7761 15.2239 18 15.5 18H17.5C17.7761 18 18 17.7761 18 17.5V15.5C18 15.2239 17.7761 15 17.5 15H15.5Z
diff --git a/src/Semi.Avalonia/Themes/Dark/CaptionButtons.axaml b/src/Semi.Avalonia/Themes/Dark/CaptionButtons.axaml
index 6f17819..2b51f15 100644
--- a/src/Semi.Avalonia/Themes/Dark/CaptionButtons.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/CaptionButtons.axaml
@@ -10,5 +10,5 @@
-
+
diff --git a/src/Semi.Avalonia/Themes/Dark/ComboBox.axaml b/src/Semi.Avalonia/Themes/Dark/ComboBox.axaml
index fdcb458..4a5cb36 100644
--- a/src/Semi.Avalonia/Themes/Dark/ComboBox.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/ComboBox.axaml
@@ -9,7 +9,7 @@
3
-
+
diff --git a/src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml b/src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml
index 83c668d..f8a3916 100644
--- a/src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml
@@ -6,7 +6,7 @@
0 3 0 6
-
+
@@ -27,7 +27,7 @@
-
+
diff --git a/src/Semi.Avalonia/Themes/Dark/Expander.axaml b/src/Semi.Avalonia/Themes/Dark/Expander.axaml
index bcda685..3fa9be2 100644
--- a/src/Semi.Avalonia/Themes/Dark/Expander.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/Expander.axaml
@@ -5,7 +5,7 @@
-
+
diff --git a/src/Semi.Avalonia/Themes/Dark/ListBox.axaml b/src/Semi.Avalonia/Themes/Dark/ListBox.axaml
index aa73596..2bcface 100644
--- a/src/Semi.Avalonia/Themes/Dark/ListBox.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/ListBox.axaml
@@ -3,7 +3,7 @@
8 4
-
+
diff --git a/src/Semi.Avalonia/Themes/Dark/Menu.axaml b/src/Semi.Avalonia/Themes/Dark/Menu.axaml
index 7fbf015..60e54c9 100644
--- a/src/Semi.Avalonia/Themes/Dark/Menu.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/Menu.axaml
@@ -7,7 +7,7 @@
M19.637 16.4369C19.0513 17.0227 18.1015 17.0227 17.5157 16.4369L11.8589 10.7801L6.20202 16.4369C5.61623 17.0227 4.66648 17.0227 4.0807 16.4369C3.49491 15.8511 3.49491 14.9014 4.0807 14.3156L10.7982 7.59809C11.384 7.01231 12.3337 7.01231 12.9195 7.59809L19.637 14.3156C20.2228 14.9014 20.2228 15.8511 19.637 16.4369Z
M4.08045 7.59809C4.66624 7.01231 5.61599 7.01231 6.20177 7.59809L11.8586 13.2549L17.5155 7.59809C18.1013 7.01231 19.051 7.01231 19.6368 7.59809C20.2226 8.18388 20.2226 9.13363 19.6368 9.71941L12.9193 16.4369C12.3335 17.0227 11.3838 17.0227 10.798 16.4369L4.08045 9.71941C3.49467 9.13363 3.49467 8.18388 4.08045 7.59809Z
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
-
+
@@ -36,7 +36,7 @@
4 0
-
+
4 0
diff --git a/src/Semi.Avalonia/Themes/Dark/TabItem.axaml b/src/Semi.Avalonia/Themes/Dark/TabItem.axaml
index 05f09c4..1bd9440 100644
--- a/src/Semi.Avalonia/Themes/Dark/TabItem.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/TabItem.axaml
@@ -5,7 +5,7 @@
-
+
diff --git a/src/Semi.Avalonia/Themes/Dark/TextBlock.axaml b/src/Semi.Avalonia/Themes/Dark/TextBlock.axaml
index 9719a89..6d306af 100644
--- a/src/Semi.Avalonia/Themes/Dark/TextBlock.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/TextBlock.axaml
@@ -3,7 +3,7 @@
xmlns:sys="clr-namespace:System;assembly=System.Runtime">
-
+
diff --git a/src/Semi.Avalonia/Themes/Dark/TreeView.axaml b/src/Semi.Avalonia/Themes/Dark/TreeView.axaml
index d5d2507..8cd363b 100644
--- a/src/Semi.Avalonia/Themes/Dark/TreeView.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/TreeView.axaml
@@ -9,7 +9,7 @@
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
-
+
From 37daceca612285f24b7d5f161d1308ab838351e0 Mon Sep 17 00:00:00 2001
From: rabbitism
Date: Sat, 8 Jul 2023 00:06:11 +0800
Subject: [PATCH 04/46] feat: fix android start activity issue.
---
.../MainActivity.cs | 6 ++---
.../SplashActivity.cs | 22 -------------------
2 files changed, 3 insertions(+), 25 deletions(-)
delete mode 100644 demo/Semi.Avalonia.Demo.Android/SplashActivity.cs
diff --git a/demo/Semi.Avalonia.Demo.Android/MainActivity.cs b/demo/Semi.Avalonia.Demo.Android/MainActivity.cs
index 7906c4f..d037305 100644
--- a/demo/Semi.Avalonia.Demo.Android/MainActivity.cs
+++ b/demo/Semi.Avalonia.Demo.Android/MainActivity.cs
@@ -4,9 +4,9 @@ using Avalonia.Android;
namespace Semi.Avalonia.Demo.Android;
-[Activity(Label = "Semi.Avalonia.Demo.Android", Icon = "@drawable/Icon", Theme = "@style/MyTheme.NoActionBar",
- LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize)]
-public class MainActivity : AvaloniaMainActivity
+[Activity(Label = "Semi.Avalonia.Demo.Android", Icon = "@drawable/Icon", MainLauncher = true, Theme = "@style/MyTheme.NoActionBar",
+ LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)]
+public class MainActivity : AvaloniaMainActivity
{
}
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo.Android/SplashActivity.cs b/demo/Semi.Avalonia.Demo.Android/SplashActivity.cs
deleted file mode 100644
index 3186324..0000000
--- a/demo/Semi.Avalonia.Demo.Android/SplashActivity.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using Android.App;
-using Android.Content;
-using Avalonia;
-using Avalonia.Android;
-using Application = Android.App.Application;
-
-namespace Semi.Avalonia.Demo.Android;
-
-[Activity(Theme = "@style/MyTheme.Splash", MainLauncher = true, NoHistory = true)]
-public class SplashActivity: AvaloniaMainActivity
-{
- protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
- {
- return base.CustomizeAppBuilder(builder);
- }
-
- protected override void OnResume()
- {
- base.OnResume();
- StartActivity(new Intent(Application.Context, typeof(MainActivity)));
- }
-}
\ No newline at end of file
From 40d179d4b4c5ff64364c67fddfc6e23869fa3cd9 Mon Sep 17 00:00:00 2001
From: ImLuJian <504439788@qq.com>
Date: Sat, 8 Jul 2023 17:57:44 +0800
Subject: [PATCH 05/46] =?UTF-8?q?=E6=B7=BB=E5=8A=A0DRM=E5=90=AF=E5=8A=A8?=
=?UTF-8?q?=E6=96=B9=E5=BC=8F=EF=BC=8C=E5=9C=A8VM=E8=99=9A=E6=8B=9F?=
=?UTF-8?q?=E6=9C=BA=E4=B8=8A=E6=B5=8B=E8=AF=95=E4=BA=86=E4=B8=80=E4=B8=8B?=
=?UTF-8?q?Ubuntu18.04=20Server=EF=BC=8C=E5=8F=AF=E4=BB=A5=E5=90=AF?=
=?UTF-8?q?=E5=8A=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs | 5 +-
demo/Semi.Avalonia.Demo.Desktop/Program.cs | 73 +++++++++++++++++--
.../Semi.Avalonia.Demo.Desktop.csproj | 1 +
3 files changed, 70 insertions(+), 9 deletions(-)
diff --git a/demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs b/demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs
index e70ba74..b534e3f 100644
--- a/demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs
+++ b/demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs
@@ -1,7 +1,6 @@
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
-using Avalonia.Styling;
using Semi.Avalonia.Demo.Views;
namespace Semi.Avalonia.Demo.Desktop;
@@ -16,9 +15,9 @@ public partial class App : Application
public override void OnFrameworkInitializationCompleted()
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
- {
desktop.MainWindow = new MainWindow();
- }
+ else if (ApplicationLifetime is ISingleViewApplicationLifetime singleView)
+ singleView.MainView = new MainView();
base.OnFrameworkInitializationCompleted();
}
}
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo.Desktop/Program.cs b/demo/Semi.Avalonia.Demo.Desktop/Program.cs
index d42b109..59b34db 100644
--- a/demo/Semi.Avalonia.Demo.Desktop/Program.cs
+++ b/demo/Semi.Avalonia.Demo.Desktop/Program.cs
@@ -1,7 +1,9 @@
-using System;
-using Avalonia;
+using Avalonia;
using Avalonia.Dialogs;
using Avalonia.Media;
+using System;
+using System.Linq;
+using System.Threading;
namespace Semi.Avalonia.Demo.Desktop;
@@ -11,8 +13,10 @@ class Program
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
// yet and stuff might break.
[STAThread]
- public static void Main(string[] args) => BuildAvaloniaApp()
- .With(new FontManagerOptions
+ public static void Main(string[] args)
+ {
+ var builder = BuildAvaloniaApp();
+ builder.With(new FontManagerOptions
{
FontFallbacks = new[]
{
@@ -21,8 +25,54 @@ class Program
FontFamily = new FontFamily("Microsoft YaHei")
}
}
- })
- .StartWithClassicDesktopLifetime(args);
+ });
+
+ //DRM启动步骤(Ubuntu18.04Server版本 虚拟机测试OK)
+ //官方文档:https://docs.avaloniaui.net/docs/next/guides/platforms/rpi/running-on-raspbian-lite-via-drm
+
+ //1.Linux端运行命令
+ //sudo apt update
+ //sudo apt upgrade
+ //sudo reboot
+ //sudo apt - get install libgbm1 libgl1 - mesa - dri libegl1 - mesa libinput10
+
+ //2.安装测试工具测试(出现一个彩色立方体说明环境安装完成)
+ //sudo apt-get install kmscube
+ //sudo kmscube
+
+ //3.添加StartLinuxDrm代码
+
+ //4.发布程序,复制到Linux系统(安装.net,怎么运行这些省略)
+ //发布文件不要裁剪,如果裁剪会报错
+ //Unhandled exception. Avalonia.Markup.Xaml.XamlLoadException: No precompiled XAML found for avares
+ //://Semi.Avalonia/Themes/Light/Light.axaml (baseUri: avares://Semi.Avalonia/Themes/Index.axaml), m
+ //ake sure to specify x:Class and include your XAML file as AvaloniaResource
+
+ //5.运行
+
+ //运行报错点:
+ //Unhandled exception. System.TypeInitializationException: The type initializer for 'SkiaSharp.SKImageInfo' threw an exception.
+ //--->System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies.In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibSkiaSharp: cannot open shared object file: No such file or directory
+ //at SkiaSharp.SkiaApi.sk_colortype_get_default_8888()
+ //at SkiaSharp.SKImageInfo..cctor()
+
+ //解决方法:
+ //Linux命令行安装一下 apt-get install -y libfontconfig1
+ //网址:https://github.com/mono/SkiaSharp/issues/509
+
+ if (args.Contains("--drm"))
+ {
+ SilenceConsole();
+ builder.StartLinuxDrm(args: args, card: "/dev/dri/card0", scaling: 1);
+ }
+ else
+ {
+ builder.StartWithClassicDesktopLifetime(args);
+ }
+ }
+
+
+
// Avalonia configuration, don't remove; also used by visual designer.
public static AppBuilder BuildAvaloniaApp()
@@ -31,4 +81,15 @@ class Program
.UsePlatformDetect()
.With(new Win32PlatformOptions())
.LogToTrace();
+
+ private static void SilenceConsole()
+ {
+ new Thread(() =>
+ {
+ Console.CursorVisible = false;
+ while (true)
+ Console.ReadKey(true);
+ })
+ { IsBackground = true }.Start();
+ }
}
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..68489a2 100644
--- a/demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
+++ b/demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
@@ -23,6 +23,7 @@
+
From 1b7c30c55756cdd044d73f373578d405913d9ab2 Mon Sep 17 00:00:00 2001
From: ImLuJian <504439788@qq.com>
Date: Sun, 9 Jul 2023 09:24:41 +0800
Subject: [PATCH 06/46] =?UTF-8?q?=E6=B7=BB=E5=8A=A0DRM=E5=90=AF=E5=8A=A8de?=
=?UTF-8?q?mo=E5=92=8C=E4=BD=BF=E7=94=A8=E6=96=B9=E6=B3=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Semi.Avalonia.sln | 7 +++
demo/Semi.Avalonia.Demo.Drm/App.axaml | 14 +++++
demo/Semi.Avalonia.Demo.Drm/App.axaml.cs | 24 ++++++++
demo/Semi.Avalonia.Demo.Drm/Program.cs | 59 +++++++++++++++++++
.../Semi.Avalonia.Demo.Drm.csproj | 22 +++++++
demo/Semi.Avalonia.Demo.Drm/app.manifest | 18 ++++++
demo/Semi.Avalonia.Demo.Drm/使用方法.txt | 46 +++++++++++++++
7 files changed, 190 insertions(+)
create mode 100644 demo/Semi.Avalonia.Demo.Drm/App.axaml
create mode 100644 demo/Semi.Avalonia.Demo.Drm/App.axaml.cs
create mode 100644 demo/Semi.Avalonia.Demo.Drm/Program.cs
create mode 100644 demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj
create mode 100644 demo/Semi.Avalonia.Demo.Drm/app.manifest
create mode 100644 demo/Semi.Avalonia.Demo.Drm/使用方法.txt
diff --git a/Semi.Avalonia.sln b/Semi.Avalonia.sln
index a9245de..85b5a31 100644
--- a/Semi.Avalonia.sln
+++ b/Semi.Avalonia.sln
@@ -26,6 +26,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semi.Avalonia.ColorPicker",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semi.Avalonia.Demo.Android", "demo\Semi.Avalonia.Demo.Android\Semi.Avalonia.Demo.Android.csproj", "{0C81FC1C-5D2D-478A-9876-923A0C85EC2F}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Semi.Avalonia.Demo.Drm", "demo\Semi.Avalonia.Demo.Drm\Semi.Avalonia.Demo.Drm.csproj", "{86D93406-412A-4429-93B2-92AAD0407784}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -61,6 +63,10 @@ Global
{0C81FC1C-5D2D-478A-9876-923A0C85EC2F}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{0C81FC1C-5D2D-478A-9876-923A0C85EC2F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0C81FC1C-5D2D-478A-9876-923A0C85EC2F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {86D93406-412A-4429-93B2-92AAD0407784}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {86D93406-412A-4429-93B2-92AAD0407784}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {86D93406-412A-4429-93B2-92AAD0407784}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {86D93406-412A-4429-93B2-92AAD0407784}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -70,6 +76,7 @@ Global
{69A2C77D-6DB7-4AE4-B179-D1F5CF5E2DF0} = {43091528-9509-43CB-A003-9C5C11E96DD6}
{D789AEDB-EBDF-4450-8E8E-B4A03FB257B0} = {43091528-9509-43CB-A003-9C5C11E96DD6}
{0C81FC1C-5D2D-478A-9876-923A0C85EC2F} = {43091528-9509-43CB-A003-9C5C11E96DD6}
+ {86D93406-412A-4429-93B2-92AAD0407784} = {43091528-9509-43CB-A003-9C5C11E96DD6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7CA41ED3-2CED-40CC-AA21-28C3B42B1E86}
diff --git a/demo/Semi.Avalonia.Demo.Drm/App.axaml b/demo/Semi.Avalonia.Demo.Drm/App.axaml
new file mode 100644
index 0000000..40032b1
--- /dev/null
+++ b/demo/Semi.Avalonia.Demo.Drm/App.axaml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo.Drm/App.axaml.cs b/demo/Semi.Avalonia.Demo.Drm/App.axaml.cs
new file mode 100644
index 0000000..f436ee6
--- /dev/null
+++ b/demo/Semi.Avalonia.Demo.Drm/App.axaml.cs
@@ -0,0 +1,24 @@
+using Avalonia;
+using Avalonia.Controls.ApplicationLifetimes;
+using Avalonia.Markup.Xaml;
+using Semi.Avalonia.Demo.Views;
+
+namespace Semi.Avalonia.Demo.Drm
+{
+ public partial class App : Application
+ {
+ public override void Initialize()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+
+ public override void OnFrameworkInitializationCompleted()
+ {
+ if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
+ desktop.MainWindow = new MainWindow();
+ else if (ApplicationLifetime is ISingleViewApplicationLifetime singleView)
+ singleView.MainView = new MainView();
+ base.OnFrameworkInitializationCompleted();
+ }
+ }
+}
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo.Drm/Program.cs b/demo/Semi.Avalonia.Demo.Drm/Program.cs
new file mode 100644
index 0000000..45d2f66
--- /dev/null
+++ b/demo/Semi.Avalonia.Demo.Drm/Program.cs
@@ -0,0 +1,59 @@
+using Avalonia;
+using Avalonia.Dialogs;
+using Avalonia.Media;
+using System;
+using System.Linq;
+using System.Threading;
+
+namespace Semi.Avalonia.Demo.Drm
+{
+ internal class Program
+ {
+ // Initialization code. Don't use any Avalonia, third-party APIs or any
+ // SynchronizationContext-reliant code before AppMain is called: things aren't initialized
+ // yet and stuff might break.
+ [STAThread]
+ public static void Main(string[] args)
+ {
+ var builder = BuildAvaloniaApp();
+ builder.With(new FontManagerOptions
+ {
+ FontFallbacks = new[]
+ {
+ new FontFallback
+ {
+ FontFamily = new FontFamily("Microsoft YaHei")
+ }
+ }
+ });
+ if (args.Contains("--drm"))
+ {
+ SilenceConsole();
+ builder.StartLinuxDrm(args: args, card: "/dev/dri/card0", scaling: 1);
+ }
+ else
+ {
+ builder.StartWithClassicDesktopLifetime(args);
+ }
+ }
+
+ // Avalonia configuration, don't remove; also used by visual designer.
+ public static AppBuilder BuildAvaloniaApp()
+ => AppBuilder.Configure()
+ .UseManagedSystemDialogs()
+ .UsePlatformDetect()
+ .With(new Win32PlatformOptions())
+ .LogToTrace();
+
+ private static void SilenceConsole()
+ {
+ new Thread(() =>
+ {
+ Console.CursorVisible = false;
+ while (true)
+ Console.ReadKey(true);
+ })
+ { IsBackground = true }.Start();
+ }
+ }
+}
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj b/demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj
new file mode 100644
index 0000000..e61daa9
--- /dev/null
+++ b/demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj
@@ -0,0 +1,22 @@
+
+
+ WinExe
+ net7.0
+ enable
+ true
+ app.manifest
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/demo/Semi.Avalonia.Demo.Drm/app.manifest b/demo/Semi.Avalonia.Demo.Drm/app.manifest
new file mode 100644
index 0000000..938919a
--- /dev/null
+++ b/demo/Semi.Avalonia.Demo.Drm/app.manifest
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/demo/Semi.Avalonia.Demo.Drm/使用方法.txt b/demo/Semi.Avalonia.Demo.Drm/使用方法.txt
new file mode 100644
index 0000000..0e9445e
--- /dev/null
+++ b/demo/Semi.Avalonia.Demo.Drm/使用方法.txt
@@ -0,0 +1,46 @@
+DRM启动步骤(Ubuntu18.04Server版本 虚拟机测试OK)
+Avalonia官方参考文档:https://docs.avaloniaui.net/docs/next/guides/platforms/rpi/running-on-raspbian-lite-via-drm
+
+1.Linux端运行命令
+ sudo apt update
+ sudo apt upgrade
+ sudo reboot
+ sudo apt - get install libgbm1 libgl1 - mesa - dri libegl1 - mesa libinput10
+
+2.安装测试工具测试(出现一个彩色立方体说明环境安装完成)
+ sudo apt-get install kmscube
+ sudo kmscube
+
+3.安装.net运行时(参考网址:https://learn.microsoft.com/zh-cn/dotnet/core/install/linux?WT.mc_id=dotnet-35129-website)
+
+4.新建一个Avalonia项目,nuget里面添加Avalonia.LinuxFramebuffer包
+
+5.添加StartLinuxDrm代码(不知道怎么添加看Semi.Avalonia.Demo.Drm项目代码)
+
+6.发布程序到Linux(安装.net,怎么运行这些省略)
+
+7.运行 ./Semi.Avalonia.Demo.Drm --drm
+
+报错处理:
+
+1.报错内容
+ Unhandled exception. Avalonia.Markup.Xaml.XamlLoadException: No precompiled XAML found for avares
+ ://Semi.Avalonia/Themes/Light/Light.axaml (baseUri: avares://Semi.Avalonia/Themes/Index.axaml), m
+ ake sure to specify x:Class and include your XAML file as AvaloniaResource
+ 解决方法:
+ 如果使用Semi发布文件不要裁剪,如果裁剪会报错
+
+
+2.报错内容
+ Unhandled exception. System.TypeInitializationException: The type initializer for 'SkiaSharp.SKImageInfo' threw an exception.
+ --->System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies.In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibSkiaSharp: cannot open shared object file: No such file or directory
+ at SkiaSharp.SkiaApi.sk_colortype_get_default_8888()
+ at SkiaSharp.SKImageInfo..cctor()
+解决方法:
+ Linux命令行安装一下 apt-get install -y libfontconfig1
+ 参考网址:https://github.com/mono/SkiaSharp/issues/509
+
+3.报错内容
+ Permission denied
+解决方法:
+ sudo chmod +x ./Semi.Avalonia.Demo.Drm
\ No newline at end of file
From 112d1e3dd4292c9eb6df7a33f720bcec594e4d92 Mon Sep 17 00:00:00 2001
From: ImLuJian <504439788@qq.com>
Date: Sun, 9 Jul 2023 09:52:28 +0800
Subject: [PATCH 07/46] =?UTF-8?q?=E8=BF=98=E5=8E=9Fdesktop=E9=A1=B9?=
=?UTF-8?q?=E7=9B=AE=E7=9A=84=E6=96=87=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs | 4 +-
demo/Semi.Avalonia.Demo.Desktop/Program.cs | 67 ++------------------
2 files changed, 6 insertions(+), 65 deletions(-)
diff --git a/demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs b/demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs
index b534e3f..d5fe94a 100644
--- a/demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs
+++ b/demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs
@@ -15,9 +15,9 @@ public partial class App : Application
public override void OnFrameworkInitializationCompleted()
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
+ {
desktop.MainWindow = new MainWindow();
- else if (ApplicationLifetime is ISingleViewApplicationLifetime singleView)
- singleView.MainView = new MainView();
+ }
base.OnFrameworkInitializationCompleted();
}
}
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo.Desktop/Program.cs b/demo/Semi.Avalonia.Demo.Desktop/Program.cs
index 59b34db..e011c45 100644
--- a/demo/Semi.Avalonia.Demo.Desktop/Program.cs
+++ b/demo/Semi.Avalonia.Demo.Desktop/Program.cs
@@ -13,10 +13,8 @@ class Program
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
// yet and stuff might break.
[STAThread]
- public static void Main(string[] args)
- {
- var builder = BuildAvaloniaApp();
- builder.With(new FontManagerOptions
+ public static void Main(string[] args) => BuildAvaloniaApp()
+ .With(new FontManagerOptions
{
FontFallbacks = new[]
{
@@ -25,54 +23,8 @@ class Program
FontFamily = new FontFamily("Microsoft YaHei")
}
}
- });
-
- //DRM启动步骤(Ubuntu18.04Server版本 虚拟机测试OK)
- //官方文档:https://docs.avaloniaui.net/docs/next/guides/platforms/rpi/running-on-raspbian-lite-via-drm
-
- //1.Linux端运行命令
- //sudo apt update
- //sudo apt upgrade
- //sudo reboot
- //sudo apt - get install libgbm1 libgl1 - mesa - dri libegl1 - mesa libinput10
-
- //2.安装测试工具测试(出现一个彩色立方体说明环境安装完成)
- //sudo apt-get install kmscube
- //sudo kmscube
-
- //3.添加StartLinuxDrm代码
-
- //4.发布程序,复制到Linux系统(安装.net,怎么运行这些省略)
- //发布文件不要裁剪,如果裁剪会报错
- //Unhandled exception. Avalonia.Markup.Xaml.XamlLoadException: No precompiled XAML found for avares
- //://Semi.Avalonia/Themes/Light/Light.axaml (baseUri: avares://Semi.Avalonia/Themes/Index.axaml), m
- //ake sure to specify x:Class and include your XAML file as AvaloniaResource
-
- //5.运行
-
- //运行报错点:
- //Unhandled exception. System.TypeInitializationException: The type initializer for 'SkiaSharp.SKImageInfo' threw an exception.
- //--->System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies.In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibSkiaSharp: cannot open shared object file: No such file or directory
- //at SkiaSharp.SkiaApi.sk_colortype_get_default_8888()
- //at SkiaSharp.SKImageInfo..cctor()
-
- //解决方法:
- //Linux命令行安装一下 apt-get install -y libfontconfig1
- //网址:https://github.com/mono/SkiaSharp/issues/509
-
- if (args.Contains("--drm"))
- {
- SilenceConsole();
- builder.StartLinuxDrm(args: args, card: "/dev/dri/card0", scaling: 1);
- }
- else
- {
- builder.StartWithClassicDesktopLifetime(args);
- }
- }
-
-
-
+ })
+ .StartWithClassicDesktopLifetime(args);
// Avalonia configuration, don't remove; also used by visual designer.
public static AppBuilder BuildAvaloniaApp()
@@ -81,15 +33,4 @@ class Program
.UsePlatformDetect()
.With(new Win32PlatformOptions())
.LogToTrace();
-
- private static void SilenceConsole()
- {
- new Thread(() =>
- {
- Console.CursorVisible = false;
- while (true)
- Console.ReadKey(true);
- })
- { IsBackground = true }.Start();
- }
}
From 201610b9ab5c90e4dabae16ac66f4279dd8f51e1 Mon Sep 17 00:00:00 2001
From: rabbitism
Date: Sun, 9 Jul 2023 23:03:11 +0800
Subject: [PATCH 08/46] feat: update references.
---
.../Semi.Avalonia.Demo.Desktop.csproj | 1 -
demo/Semi.Avalonia.Demo.Drm/App.axaml | 13 +++++----
.../{使用方法.txt => 使用方法.md} | 27 +++++++++++--------
3 files changed, 22 insertions(+), 19 deletions(-)
rename demo/Semi.Avalonia.Demo.Drm/{使用方法.txt => 使用方法.md} (59%)
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 68489a2..4e0ff0e 100644
--- a/demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
+++ b/demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
@@ -23,7 +23,6 @@
-
diff --git a/demo/Semi.Avalonia.Demo.Drm/App.axaml b/demo/Semi.Avalonia.Demo.Drm/App.axaml
index 40032b1..d4ceb6d 100644
--- a/demo/Semi.Avalonia.Demo.Drm/App.axaml
+++ b/demo/Semi.Avalonia.Demo.Drm/App.axaml
@@ -2,13 +2,12 @@
x:Class="Semi.Avalonia.Demo.Drm.App"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:local="using:Semi.Avalonia.Demo.Desktop"
RequestedThemeVariant="Light">
-
-
-
-
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo.Drm/使用方法.txt b/demo/Semi.Avalonia.Demo.Drm/使用方法.md
similarity index 59%
rename from demo/Semi.Avalonia.Demo.Drm/使用方法.txt
rename to demo/Semi.Avalonia.Demo.Drm/使用方法.md
index 0e9445e..efe659a 100644
--- a/demo/Semi.Avalonia.Demo.Drm/使用方法.txt
+++ b/demo/Semi.Avalonia.Demo.Drm/使用方法.md
@@ -1,4 +1,7 @@
-DRM启动步骤(Ubuntu18.04Server版本 虚拟机测试OK)
+# DRM启动步骤
+
+(Ubuntu18.04Server版本 虚拟机测试OK)
+
Avalonia官方参考文档:https://docs.avaloniaui.net/docs/next/guides/platforms/rpi/running-on-raspbian-lite-via-drm
1.Linux端运行命令
@@ -21,26 +24,28 @@ Avalonia官方参考文档:https://docs.avaloniaui.net/docs/next/guides/platfo
7.运行 ./Semi.Avalonia.Demo.Drm --drm
-报错处理:
+## 报错处理:
+
+1. 报错内容
+
+>Unhandled exception. Avalonia.Markup.Xaml.XamlLoadException: No precompiled XAML found for avares://Semi.Avalonia/Themes/Light/Light.axaml (baseUri: avares://Semi.Avalonia/Themes/Index.axaml), make sure to specify x:Class and include your XAML file as AvaloniaResource
-1.报错内容
- Unhandled exception. Avalonia.Markup.Xaml.XamlLoadException: No precompiled XAML found for avares
- ://Semi.Avalonia/Themes/Light/Light.axaml (baseUri: avares://Semi.Avalonia/Themes/Index.axaml), m
- ake sure to specify x:Class and include your XAML file as AvaloniaResource
解决方法:
如果使用Semi发布文件不要裁剪,如果裁剪会报错
-2.报错内容
- Unhandled exception. System.TypeInitializationException: The type initializer for 'SkiaSharp.SKImageInfo' threw an exception.
- --->System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies.In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibSkiaSharp: cannot open shared object file: No such file or directory
+2. 报错内容
+>Unhandled exception. System.TypeInitializationException: The type initializer for 'SkiaSharp.SKImageInfo' threw an exception.**
+ **--->System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies.In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibSkiaSharp: cannot open shared object file: No such file or directory
at SkiaSharp.SkiaApi.sk_colortype_get_default_8888()
at SkiaSharp.SKImageInfo..cctor()
+
解决方法:
Linux命令行安装一下 apt-get install -y libfontconfig1
参考网址:https://github.com/mono/SkiaSharp/issues/509
-3.报错内容
- Permission denied
+3. 报错内容
+>Permission denied
+
解决方法:
sudo chmod +x ./Semi.Avalonia.Demo.Drm
\ No newline at end of file
From db7f199003d74565fdb05733541750a0336f139c Mon Sep 17 00:00:00 2001
From: rabbitism
Date: Sun, 9 Jul 2023 23:06:08 +0800
Subject: [PATCH 09/46] fix: fix version reference.
---
demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj b/demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj
index e61daa9..7accf7a 100644
--- a/demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj
+++ b/demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj
@@ -9,10 +9,10 @@
-
+
-
-
+
+
From b9a16e89d6490e978aff7878be764a31fdf01aef Mon Sep 17 00:00:00 2001
From: rabbitism
Date: Mon, 10 Jul 2023 00:22:02 +0800
Subject: [PATCH 10/46] feat: improve TextBlock demo.
---
demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml | 288 +++++++++++++-----
.../Pages/SelectableTextBlock.axaml | 161 ++++++++++
.../Pages/SelectableTextBlock.axaml.cs | 18 ++
.../Pages/TextBlockDemo.axaml | 224 +++++++++-----
demo/Semi.Avalonia.Demo/Views/MainView.axaml | 3 +
5 files changed, 546 insertions(+), 148 deletions(-)
create mode 100644 demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml
create mode 100644 demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml.cs
diff --git a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml
index d5adc3d..86dd7d1 100644
--- a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml
@@ -7,77 +7,219 @@
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+ Classes
+ -
+ Secondary
+ Tertiary
+ Quaternary
+ Warning
+ Danger
+ Success
+ Mark
+ Code
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Classes
+ H1
+ H2
+ H3
+ H4
+ H5
+ H6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml b/demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml
new file mode 100644
index 0000000..0de5617
--- /dev/null
+++ b/demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml
@@ -0,0 +1,161 @@
+
+
+
+
+
+
+
+
+ Classes
+ -
+ Secondary
+ Tertiary
+ Quaternary
+ Warning
+ Danger
+ Success
+ Mark
+ Underline
+ Delete
+
+ Text
+
+ Secondary
+
+
+ Tertiary
+
+
+ Quaternary
+
+
+ Warning
+
+
+ Danger
+
+
+ Success
+
+
+ Default Mark
+
+
+ Underline
+
+
+ Delete
+
+
+
+
+
+ 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/SelectableTextBlock.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml.cs
new file mode 100644
index 0000000..b4cc6d7
--- /dev/null
+++ b/demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml.cs
@@ -0,0 +1,18 @@
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+
+namespace Semi.Avalonia.Demo.Pages;
+
+public partial class SelectableTextBlockDemo : UserControl
+{
+ public SelectableTextBlockDemo()
+ {
+ InitializeComponent();
+ }
+
+ private void InitializeComponent()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+}
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo/Pages/TextBlockDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/TextBlockDemo.axaml
index 7aca219..019faf5 100644
--- a/demo/Semi.Avalonia.Demo/Pages/TextBlockDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/TextBlockDemo.axaml
@@ -7,82 +7,156 @@
d:DesignHeight="600"
d:DesignWidth="800"
mc:Ignorable="d">
-
-
- Styles for TextBlock
- Header 1
- Header 1
- Header 1
- Header 1
- Header 1
- Header 1
+
+
+
+
+
+
+
+ Classes
+ -
+ Secondary
+ Tertiary
+ Quaternary
+ Warning
+ Danger
+ Success
+ Mark
+ Underline
+ Delete
- Text
- Secondary
- Tertiary
- Quaternary
- Warning
- Warning disabled
- Danger
- Success
- Disabled
- Default Mark
- Underline
- Delete
- Underline and Delete
-
-
- Styles for SelectableTextBlock
- Header 1
- Header 1
- Header 1
- Header 1
- Header 1
- Header 1
+ Text
+
+ Secondary
+
+
+ Tertiary
+
+
+ Quaternary
+
+
+ Warning
+
+
+ Danger
+
+
+ Success
+
+
+ Default Mark
+
+
+ Underline
+
+
+ Delete
+
+
+
+
+
+ Classes
+ H1
+ H2
+ H3
+ H4
+ H5
+ H6
+
+ Header 1
+
+
+ Header 2
+
+
+ Header 3
+
+
+ Header 4
+
+
+ Header 5
+
+
+ Header 6
+
+
- Text
- Secondary
- Tertiary
- Quaternary
- Warning
- Warning disabled
- Danger
- Success
- Disabled
- Default Mark
- Underline
- Delete
- Underline and Delete
+
-
- Styles for Label
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/demo/Semi.Avalonia.Demo/Views/MainView.axaml b/demo/Semi.Avalonia.Demo/Views/MainView.axaml
index 13b37f7..a87d488 100644
--- a/demo/Semi.Avalonia.Demo/Views/MainView.axaml
+++ b/demo/Semi.Avalonia.Demo/Views/MainView.axaml
@@ -159,6 +159,9 @@
+
+
+
From c713888062a93c339b60506feb3deed769b8f478 Mon Sep 17 00:00:00 2001
From: rabbitism
Date: Mon, 10 Jul 2023 17:03:29 +0800
Subject: [PATCH 11/46] fix: fix textblock alignment.
---
demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml
index 86dd7d1..54dbba1 100644
--- a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml
@@ -17,7 +17,7 @@
-
From 7a483d6de38aa2af5973cdbe52a5c3f80793db80 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Mon, 10 Jul 2023 17:33:17 +0800
Subject: [PATCH 12/46] fix: delete binding.
---
demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml | 1 -
demo/Semi.Avalonia.Demo/Pages/TextBlockDemo.axaml | 1 -
2 files changed, 2 deletions(-)
diff --git a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml
index 54dbba1..7fddd0b 100644
--- a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml
@@ -101,7 +101,6 @@
Theme="{DynamicResource GroupBox}">
Classes
diff --git a/demo/Semi.Avalonia.Demo/Pages/TextBlockDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/TextBlockDemo.axaml
index 019faf5..1125ce4 100644
--- a/demo/Semi.Avalonia.Demo/Pages/TextBlockDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/TextBlockDemo.axaml
@@ -102,7 +102,6 @@
Theme="{DynamicResource GroupBox}">
Classes
From 86b437b3b09914fc1062f21440d308a1b5bb94dc Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Mon, 10 Jul 2023 17:37:19 +0800
Subject: [PATCH 13/46] fix: delete default height and width, fix
RowDefinitions.
---
.../Semi.Avalonia.Demo/Pages/HeaderedContentControlDemo.axaml | 2 +-
demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml | 2 ++
demo/Semi.Avalonia.Demo/Pages/TextBlockDemo.axaml | 2 ++
src/Semi.Avalonia/Controls/HeaderedContentControl.axaml | 4 +---
4 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/demo/Semi.Avalonia.Demo/Pages/HeaderedContentControlDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/HeaderedContentControlDemo.axaml
index d5c312b..07f7cfe 100644
--- a/demo/Semi.Avalonia.Demo/Pages/HeaderedContentControlDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/HeaderedContentControlDemo.axaml
@@ -6,7 +6,7 @@
x:Class="Semi.Avalonia.Demo.Pages.HeaderedContentControlDemo">
-
+
Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统。设计系统包含设计语言以及一整套可复用的前端组件,帮助设计师与开发者更容易地打造高质量的、用户体验一致的、符合设计规范的 Web 应用。
diff --git a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml
index 7fddd0b..e993eba 100644
--- a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml
@@ -23,6 +23,7 @@
-
-
@@ -23,7 +21,7 @@
BorderBrush="{TemplateBinding BorderBrush}"
CornerRadius="{TemplateBinding CornerRadius}"
BorderThickness="{TemplateBinding BorderThickness}">
-
+
Date: Tue, 11 Jul 2023 17:38:31 +0800
Subject: [PATCH 14/46] fix: label color order.
---
demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml | 72 ++--
src/Semi.Avalonia/Controls/Label.axaml | 320 +++++++++---------
src/Semi.Avalonia/Themes/Dark/Label.axaml | 122 +++----
3 files changed, 257 insertions(+), 257 deletions(-)
diff --git a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml
index e993eba..90f2676 100644
--- a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml
@@ -165,60 +165,60 @@
-
-
-
-
-
-
-
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Semi.Avalonia/Controls/Label.axaml b/src/Semi.Avalonia/Controls/Label.axaml
index 1f5945d..5848b77 100644
--- a/src/Semi.Avalonia/Controls/Label.axaml
+++ b/src/Semi.Avalonia/Controls/Label.axaml
@@ -20,60 +20,60 @@
-
-
-
-
-
-
-
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -162,7 +162,7 @@
-
+
@@ -203,45 +203,9 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Index.axaml b/src/Semi.Avalonia/Themes/Index.axaml
index 3e5ed36..86c4758 100644
--- a/src/Semi.Avalonia/Themes/Index.axaml
+++ b/src/Semi.Avalonia/Themes/Index.axaml
@@ -2,11 +2,11 @@
-
-
+
+
-
+
@@ -15,5 +15,4 @@
-
diff --git a/src/Semi.Avalonia/Themes/Light/Light.axaml b/src/Semi.Avalonia/Themes/Light/_index.axaml
similarity index 100%
rename from src/Semi.Avalonia/Themes/Light/Light.axaml
rename to src/Semi.Avalonia/Themes/Light/_index.axaml
diff --git a/src/Semi.Avalonia/Themes/LightTheme.axaml b/src/Semi.Avalonia/Themes/LightTheme.axaml
index c6b6155..00dced9 100644
--- a/src/Semi.Avalonia/Themes/LightTheme.axaml
+++ b/src/Semi.Avalonia/Themes/LightTheme.axaml
@@ -1,15 +1,14 @@
-
-
-
+
+
-
+
\ No newline at end of file
From 54bdd69b2ac10c7139ab65842ee7ba32d18c9c85 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Wed, 19 Jul 2023 03:29:23 +0800
Subject: [PATCH 20/46] fix: restore BoxShadows.
---
src/Semi.Avalonia/Themes/Dark/AutoCompleteBox.axaml | 1 +
src/Semi.Avalonia/Themes/Dark/Border.axaml | 1 +
src/Semi.Avalonia/Themes/Dark/CalendarDatePicker.axaml | 4 +---
src/Semi.Avalonia/Themes/Dark/ComboBox.axaml | 1 +
src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml | 2 ++
src/Semi.Avalonia/Themes/Dark/Flyout.axaml | 1 +
src/Semi.Avalonia/Themes/Dark/Menu.axaml | 1 +
src/Semi.Avalonia/Themes/Dark/NotificationCard.axaml | 1 +
src/Semi.Avalonia/Themes/Dark/Slider.axaml | 1 -
src/Semi.Avalonia/Themes/Dark/_index.axaml | 2 +-
src/Semi.Avalonia/Themes/Light/AutoCompleteBox.axaml | 1 +
src/Semi.Avalonia/Themes/Light/Border.axaml | 1 +
src/Semi.Avalonia/Themes/Light/CalendarDatePicker.axaml | 3 +--
src/Semi.Avalonia/Themes/Light/ComboBox.axaml | 1 +
src/Semi.Avalonia/Themes/Light/Flyout.axaml | 1 +
src/Semi.Avalonia/Themes/Light/Menu.axaml | 2 ++
src/Semi.Avalonia/Themes/Light/NotificationCard.axaml | 1 +
src/Semi.Avalonia/Themes/Light/_index.axaml | 2 +-
src/Semi.Avalonia/Themes/Shared/AutoCompleteBox.axaml | 1 -
src/Semi.Avalonia/Themes/Shared/Border.axaml | 1 -
src/Semi.Avalonia/Themes/Shared/CalendarDatePicker.axaml | 1 -
src/Semi.Avalonia/Themes/Shared/ComboBox.axaml | 1 -
src/Semi.Avalonia/Themes/Shared/DateTimePickerShared.axaml | 1 -
src/Semi.Avalonia/Themes/Shared/Flyout.axaml | 1 -
src/Semi.Avalonia/Themes/Shared/Menu.axaml | 1 -
src/Semi.Avalonia/Themes/Shared/NotificationCard.axaml | 1 -
src/Semi.Avalonia/Themes/Shared/Slider.axaml | 1 -
27 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/src/Semi.Avalonia/Themes/Dark/AutoCompleteBox.axaml b/src/Semi.Avalonia/Themes/Dark/AutoCompleteBox.axaml
index 3aba7b2..76fd6b9 100644
--- a/src/Semi.Avalonia/Themes/Dark/AutoCompleteBox.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/AutoCompleteBox.axaml
@@ -1,4 +1,5 @@
+ 0 0 8 0 #1AFFFFFF
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/Border.axaml b/src/Semi.Avalonia/Themes/Dark/Border.axaml
index 4684198..25d26fc 100644
--- a/src/Semi.Avalonia/Themes/Dark/Border.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/Border.axaml
@@ -1,4 +1,5 @@
+ 0 0 14 0 #1AFFFFFF
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/CalendarDatePicker.axaml b/src/Semi.Avalonia/Themes/Dark/CalendarDatePicker.axaml
index f24cd9e..962d533 100644
--- a/src/Semi.Avalonia/Themes/Dark/CalendarDatePicker.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/CalendarDatePicker.axaml
@@ -4,12 +4,10 @@
-
-
-
+ 0 0 8 0 #1AFFFFFF
diff --git a/src/Semi.Avalonia/Themes/Dark/ComboBox.axaml b/src/Semi.Avalonia/Themes/Dark/ComboBox.axaml
index 6c5ec25..29fc605 100644
--- a/src/Semi.Avalonia/Themes/Dark/ComboBox.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/ComboBox.axaml
@@ -14,6 +14,7 @@
+ 0 0 8 0 #1AFFFFFF
diff --git a/src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml b/src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml
index 87be000..6f0ecc8 100644
--- a/src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml
@@ -23,4 +23,6 @@
+
+ 0 0 8 0 #1AFFFFFF
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/Flyout.axaml b/src/Semi.Avalonia/Themes/Dark/Flyout.axaml
index e8f8b6b..87a6de1 100644
--- a/src/Semi.Avalonia/Themes/Dark/Flyout.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/Flyout.axaml
@@ -2,4 +2,5 @@
+ 0 0 8 0 #1AFFFFFF
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/Menu.axaml b/src/Semi.Avalonia/Themes/Dark/Menu.axaml
index fe48847..cd613ce 100644
--- a/src/Semi.Avalonia/Themes/Dark/Menu.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/Menu.axaml
@@ -4,6 +4,7 @@
+ 0 0 8 0 #1AFFFFFF
diff --git a/src/Semi.Avalonia/Themes/Dark/NotificationCard.axaml b/src/Semi.Avalonia/Themes/Dark/NotificationCard.axaml
index bdc2345..8c8e318 100644
--- a/src/Semi.Avalonia/Themes/Dark/NotificationCard.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/NotificationCard.axaml
@@ -6,4 +6,5 @@
+ 0 0 8 0 #1AFFFFFF
diff --git a/src/Semi.Avalonia/Themes/Dark/Slider.axaml b/src/Semi.Avalonia/Themes/Dark/Slider.axaml
index 4db1a0e..708dd36 100644
--- a/src/Semi.Avalonia/Themes/Dark/Slider.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/Slider.axaml
@@ -2,7 +2,6 @@
-
diff --git a/src/Semi.Avalonia/Themes/Dark/_index.axaml b/src/Semi.Avalonia/Themes/Dark/_index.axaml
index 7fbfa18..0fc69c4 100644
--- a/src/Semi.Avalonia/Themes/Dark/_index.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/_index.axaml
@@ -15,6 +15,7 @@
+
@@ -36,6 +37,5 @@
-
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/AutoCompleteBox.axaml b/src/Semi.Avalonia/Themes/Light/AutoCompleteBox.axaml
index 537edd9..7fb1210 100644
--- a/src/Semi.Avalonia/Themes/Light/AutoCompleteBox.axaml
+++ b/src/Semi.Avalonia/Themes/Light/AutoCompleteBox.axaml
@@ -1,4 +1,5 @@
+ 0 0 8 0 #1A000000
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/Border.axaml b/src/Semi.Avalonia/Themes/Light/Border.axaml
index d326fcb..affef76 100644
--- a/src/Semi.Avalonia/Themes/Light/Border.axaml
+++ b/src/Semi.Avalonia/Themes/Light/Border.axaml
@@ -1,4 +1,5 @@
+ 0 0 14 0 #1A000000
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/CalendarDatePicker.axaml b/src/Semi.Avalonia/Themes/Light/CalendarDatePicker.axaml
index fc2cb0d..fccdc95 100644
--- a/src/Semi.Avalonia/Themes/Light/CalendarDatePicker.axaml
+++ b/src/Semi.Avalonia/Themes/Light/CalendarDatePicker.axaml
@@ -3,12 +3,11 @@
-
-
+ 0 0 8 0 #1A000000
diff --git a/src/Semi.Avalonia/Themes/Light/ComboBox.axaml b/src/Semi.Avalonia/Themes/Light/ComboBox.axaml
index 4571c3f..46fe865 100644
--- a/src/Semi.Avalonia/Themes/Light/ComboBox.axaml
+++ b/src/Semi.Avalonia/Themes/Light/ComboBox.axaml
@@ -14,6 +14,7 @@
+ 0 0 8 0 #1A000000
diff --git a/src/Semi.Avalonia/Themes/Light/Flyout.axaml b/src/Semi.Avalonia/Themes/Light/Flyout.axaml
index a738a99..7e7d9fd 100644
--- a/src/Semi.Avalonia/Themes/Light/Flyout.axaml
+++ b/src/Semi.Avalonia/Themes/Light/Flyout.axaml
@@ -2,4 +2,5 @@
+ 0 0 8 0 #1A000000
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/Menu.axaml b/src/Semi.Avalonia/Themes/Light/Menu.axaml
index 80d1d52..b2347f8 100644
--- a/src/Semi.Avalonia/Themes/Light/Menu.axaml
+++ b/src/Semi.Avalonia/Themes/Light/Menu.axaml
@@ -4,6 +4,8 @@
+ 0 0 8 0 #1A000000
+
diff --git a/src/Semi.Avalonia/Themes/Light/NotificationCard.axaml b/src/Semi.Avalonia/Themes/Light/NotificationCard.axaml
index a3201eb..2f0f914 100644
--- a/src/Semi.Avalonia/Themes/Light/NotificationCard.axaml
+++ b/src/Semi.Avalonia/Themes/Light/NotificationCard.axaml
@@ -6,4 +6,5 @@
+ 0 0 8 0 #1A000000
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/_index.axaml b/src/Semi.Avalonia/Themes/Light/_index.axaml
index c6bf379..397d751 100644
--- a/src/Semi.Avalonia/Themes/Light/_index.axaml
+++ b/src/Semi.Avalonia/Themes/Light/_index.axaml
@@ -15,6 +15,7 @@
+
@@ -36,6 +37,5 @@
-
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Shared/AutoCompleteBox.axaml b/src/Semi.Avalonia/Themes/Shared/AutoCompleteBox.axaml
index 7b8d779..ee61e1d 100644
--- a/src/Semi.Avalonia/Themes/Shared/AutoCompleteBox.axaml
+++ b/src/Semi.Avalonia/Themes/Shared/AutoCompleteBox.axaml
@@ -1,5 +1,4 @@
- 0 0 8 0 #1AFFFFFF
1
4
6
diff --git a/src/Semi.Avalonia/Themes/Shared/Border.axaml b/src/Semi.Avalonia/Themes/Shared/Border.axaml
index 3e35801..ba9887f 100644
--- a/src/Semi.Avalonia/Themes/Shared/Border.axaml
+++ b/src/Semi.Avalonia/Themes/Shared/Border.axaml
@@ -3,5 +3,4 @@
20
4
1
- 0 0 14 0 #1AFFFFFF
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Shared/CalendarDatePicker.axaml b/src/Semi.Avalonia/Themes/Shared/CalendarDatePicker.axaml
index e743c10..7c4128b 100644
--- a/src/Semi.Avalonia/Themes/Shared/CalendarDatePicker.axaml
+++ b/src/Semi.Avalonia/Themes/Shared/CalendarDatePicker.axaml
@@ -2,7 +2,6 @@
M4 20V8H20V20H4ZM2 4C2 2.89543 2.89543 2 4 2H20C21.1046 2 22 2.89543 22 4V20C22 21.1046 21.1046 22 20 22H4C2.89543 22 2 21.1046 2 20V4ZM6 10.5C6 10.2239 6.22386 10 6.5 10H8.5C8.77614 10 9 10.2239 9 10.5V12.5C9 12.7761 8.77614 13 8.5 13H6.5C6.22386 13 6 12.7761 6 12.5V10.5ZM6.5 15C6.22386 15 6 15.2239 6 15.5V17.5C6 17.7761 6.22386 18 6.5 18H8.5C8.77614 18 9 17.7761 9 17.5V15.5C9 15.2239 8.77614 15 8.5 15H6.5ZM10.5 10.5C10.5 10.2239 10.7239 10 11 10H13C13.2761 10 13.5 10.2239 13.5 10.5V12.5C13.5 12.7761 13.2761 13 13 13H11C10.7239 13 10.5 12.7761 10.5 12.5V10.5ZM11 15C10.7239 15 10.5 15.2239 10.5 15.5V17.5C10.5 17.7761 10.7239 18 11 18H13C13.2761 18 13.5 17.7761 13.5 17.5V15.5C13.5 15.2239 13.2761 15 13 15H11ZM15 10.5C15 10.2239 15.2239 10 15.5 10H17.5C17.7761 10 18 10.2239 18 10.5V12.5C18 12.7761 17.7761 13 17.5 13H15.5C15.2239 13 15 12.7761 15 12.5V10.5ZM15.5 15C15.2239 15 15 15.2239 15 15.5V17.5C15 17.7761 15.2239 18 15.5 18H17.5C17.7761 18 18 17.7761 18 17.5V15.5C18 15.2239 17.7761 15 17.5 15H15.5Z
1
3
- 0 0 8 0 #1AFFFFFF
30
22
38
diff --git a/src/Semi.Avalonia/Themes/Shared/ComboBox.axaml b/src/Semi.Avalonia/Themes/Shared/ComboBox.axaml
index 7c83ebb..23cbd48 100644
--- a/src/Semi.Avalonia/Themes/Shared/ComboBox.axaml
+++ b/src/Semi.Avalonia/Themes/Shared/ComboBox.axaml
@@ -4,7 +4,6 @@
8 4
8 0
- 0 0 8 0 #1AFFFFFF
1
diff --git a/src/Semi.Avalonia/Themes/Shared/DateTimePickerShared.axaml b/src/Semi.Avalonia/Themes/Shared/DateTimePickerShared.axaml
index cb22130..7135f3e 100644
--- a/src/Semi.Avalonia/Themes/Shared/DateTimePickerShared.axaml
+++ b/src/Semi.Avalonia/Themes/Shared/DateTimePickerShared.axaml
@@ -8,7 +8,6 @@
30
- 0 0 8 0 #1AFFFFFF
16 0
8
diff --git a/src/Semi.Avalonia/Themes/Shared/Flyout.axaml b/src/Semi.Avalonia/Themes/Shared/Flyout.axaml
index 3495b17..62aff56 100644
--- a/src/Semi.Avalonia/Themes/Shared/Flyout.axaml
+++ b/src/Semi.Avalonia/Themes/Shared/Flyout.axaml
@@ -1,7 +1,6 @@
400
1
- 0 0 8 0 #1AFFFFFF
100
100
600
diff --git a/src/Semi.Avalonia/Themes/Shared/Menu.axaml b/src/Semi.Avalonia/Themes/Shared/Menu.axaml
index e6b4150..95188b1 100644
--- a/src/Semi.Avalonia/Themes/Shared/Menu.axaml
+++ b/src/Semi.Avalonia/Themes/Shared/Menu.axaml
@@ -5,7 +5,6 @@
1
8
- 0 0 8 0 #1AFFFFFF
6
16
100
diff --git a/src/Semi.Avalonia/Themes/Shared/NotificationCard.axaml b/src/Semi.Avalonia/Themes/Shared/NotificationCard.axaml
index 530a879..41c7039 100644
--- a/src/Semi.Avalonia/Themes/Shared/NotificationCard.axaml
+++ b/src/Semi.Avalonia/Themes/Shared/NotificationCard.axaml
@@ -2,7 +2,6 @@
320
1
6
- 0 0 8 0 #1AFFFFFF
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 23ZM14 7C14 8.10457 13.1046 9 12 9C10.8954 9 10 8.10457 10 7C10 5.89543 10.8954 5 12 5C13.1046 5 14 5.89543 14 7ZM9 10.75C9 10.3358 9.33579 10 9.75 10H12.5C13.0523 10 13.5 10.4477 13.5 11V16.5H14.25C14.6642 16.5 15 16.8358 15 17.25C15 17.6642 14.6642 18 14.25 18H9.75C9.33579 18 9 17.6642 9 17.25C9 16.8358 9.33579 16.5 9.75 16.5H10.5V11.5H9.75C9.33579 11.5 9 11.1642 9 10.75Z
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.8831 9.82235L11.6854 17.4112C11.4029 17.7806 10.965 17.9981 10.5 18C10.035 18.0019 9.59533 17.788 9.30982 17.421L5.81604 13.4209C5.30744 12.767 5.42524 11.8246 6.07916 11.316C6.73308 10.8074 7.67549 10.9252 8.1841 11.5791L10.4838 14.0439L15.5 8C16.0032 7.34193 16.9446 7.21641 17.6027 7.71964C18.2608 8.22287 18.3863 9.16428 17.8831 9.82235Z
M10.2268 2.3986L1.52616 19.0749C0.831449 20.4064 1.79747 22 3.29933 22H20.7007C22.2025 22 23.1686 20.4064 22.4739 19.0749L13.7732 2.3986C13.0254 0.965441 10.9746 0.965442 10.2268 2.3986ZM13.1415 14.0101C13.0603 14.5781 12.5739 15 12.0001 15C11.4263 15 10.9398 14.5781 10.8586 14.0101L10.2829 9.97992C10.1336 8.93495 10.9445 8.00002 12.0001 8.00002C13.0556 8.00002 13.8665 8.93495 13.7172 9.97992L13.1415 14.0101ZM13.5001 18.5C13.5001 19.3284 12.8285 20 12.0001 20C11.1716 20 10.5001 19.3284 10.5001 18.5C10.5001 17.6716 11.1716 17 12.0001 17C12.8285 17 13.5001 17.6716 13.5001 18.5Z
diff --git a/src/Semi.Avalonia/Themes/Shared/Slider.axaml b/src/Semi.Avalonia/Themes/Shared/Slider.axaml
index cfefeae..42c66a9 100644
--- a/src/Semi.Avalonia/Themes/Shared/Slider.axaml
+++ b/src/Semi.Avalonia/Themes/Shared/Slider.axaml
@@ -5,7 +5,6 @@
16
24
0
- 0 0 1 1 #1AFFFFFF
4
4
From 95c7b9a8072b98470cdd777dab4109e98906d243 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Wed, 19 Jul 2023 11:16:10 +0800
Subject: [PATCH 21/46] feat: extract non-theme resources of ColorPicker and
DataGrid.
---
src/Semi.Avalonia.ColorPicker/Dark.axaml | 32 ++--------------------
src/Semi.Avalonia.ColorPicker/Index.axaml | 4 +--
src/Semi.Avalonia.ColorPicker/Light.axaml | 31 ++-------------------
src/Semi.Avalonia.ColorPicker/Shared.axaml | 30 ++++++++++++++++++++
src/Semi.Avalonia.DataGrid/Dark.axaml | 17 ++----------
src/Semi.Avalonia.DataGrid/Index.axaml | 4 +--
src/Semi.Avalonia.DataGrid/Light.axaml | 15 +---------
src/Semi.Avalonia.DataGrid/Shared.axaml | 19 +++++++++++++
8 files changed, 60 insertions(+), 92 deletions(-)
create mode 100644 src/Semi.Avalonia.ColorPicker/Shared.axaml
create mode 100644 src/Semi.Avalonia.DataGrid/Shared.axaml
diff --git a/src/Semi.Avalonia.ColorPicker/Dark.axaml b/src/Semi.Avalonia.ColorPicker/Dark.axaml
index d60ed09..e96849e 100644
--- a/src/Semi.Avalonia.ColorPicker/Dark.axaml
+++ b/src/Semi.Avalonia.ColorPicker/Dark.axaml
@@ -1,8 +1,4 @@
-
-
+
@@ -11,39 +7,15 @@
- 600
- 16 4
- 70
-
- M6.92,19L5,17.08L13.06,9L15,10.94M20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L13.84,6.41L11.91,4.5L10.5,5.91L11.92,7.33L3,16.25V21H7.75L16.67,12.08L18.09,13.5L19.5,12.09L17.58,10.17L20.7,7.05C21.1,6.65 21.1,6 20.71,5.63Z
-
-
- M17.5,12A1.5,1.5 0 0,1 16,10.5A1.5,1.5 0 0,1 17.5,9A1.5,1.5 0 0,1 19,10.5A1.5,1.5 0 0,1 17.5,12M14.5,8A1.5,1.5 0 0,1 13,6.5A1.5,1.5 0 0,1 14.5,5A1.5,1.5 0 0,1 16,6.5A1.5,1.5 0 0,1 14.5,8M9.5,8A1.5,1.5 0 0,1 8,6.5A1.5,1.5 0 0,1 9.5,5A1.5,1.5 0 0,1 11,6.5A1.5,1.5 0 0,1 9.5,8M6.5,12A1.5,1.5 0 0,1 5,10.5A1.5,1.5 0 0,1 6.5,9A1.5,1.5 0 0,1 8,10.5A1.5,1.5 0 0,1 6.5,12M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A1.5,1.5 0 0,0 13.5,19.5C13.5,19.11 13.35,18.76 13.11,18.5C12.88,18.23 12.73,17.88 12.73,17.5A1.5,1.5 0 0,1 14.23,16H16A5,5 0 0,0 21,11C21,6.58 16.97,3 12,3Z
-
-
- M4 6.5C5.10457 6.5 6 5.60457 6 4.5C6 3.39543 5.10457 2.5 4 2.5C2.89543 2.5 2 3.39543 2 4.5C2 5.60457 2.89543 6.5 4 6.5ZM9.5 3C8.67157 3 8 3.67157 8 4.5C8 5.32843 8.67157 6 9.5 6H20.5C21.3284 6 22 5.32843 22 4.5C22 3.67157 21.3284 3 20.5 3H9.5ZM8 11.5C8 10.6716 8.67157 10 9.5 10H20.5C21.3284 10 22 10.6716 22 11.5C22 12.3284 21.3284 13 20.5 13H9.5C8.67157 13 8 12.3284 8 11.5ZM8 18.5C8 17.6716 8.67157 17 9.5 17H20.5C21.3284 17 22 17.6716 22 18.5C22 19.3284 21.3284 20 20.5 20H9.5C8.67157 20 8 19.3284 8 18.5ZM6 11.5C6 12.6046 5.10457 13.5 4 13.5C2.89543 13.5 2 12.6046 2 11.5C2 10.3954 2.89543 9.5 4 9.5C5.10457 9.5 6 10.3954 6 11.5ZM4 20.5C5.10457 20.5 6 19.6046 6 18.5C6 17.3954 5.10457 16.5 4 16.5C2.89543 16.5 2 17.3954 2 18.5C2 19.6046 2.89543 20.5 4 20.5Z
-
- 16
- 6
- 2
- 0 0 2 1 #FFFFFF
-
- 80
- 20
- 48
- 3
-
0 0 14 0 #1AFFFFFF
-
-
-
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia.ColorPicker/Index.axaml b/src/Semi.Avalonia.ColorPicker/Index.axaml
index d41f3b7..2af9525 100644
--- a/src/Semi.Avalonia.ColorPicker/Index.axaml
+++ b/src/Semi.Avalonia.ColorPicker/Index.axaml
@@ -1,5 +1,4 @@
-
@@ -8,7 +7,8 @@
+
-
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia.ColorPicker/Light.axaml b/src/Semi.Avalonia.ColorPicker/Light.axaml
index 928968e..6148e2f 100644
--- a/src/Semi.Avalonia.ColorPicker/Light.axaml
+++ b/src/Semi.Avalonia.ColorPicker/Light.axaml
@@ -1,8 +1,4 @@
-
-
+
@@ -11,38 +7,15 @@
- 600
- 16 4
- 70
-
- M6.92,19L5,17.08L13.06,9L15,10.94M20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L13.84,6.41L11.91,4.5L10.5,5.91L11.92,7.33L3,16.25V21H7.75L16.67,12.08L18.09,13.5L19.5,12.09L17.58,10.17L20.7,7.05C21.1,6.65 21.1,6 20.71,5.63Z
-
-
- M17.5,12A1.5,1.5 0 0,1 16,10.5A1.5,1.5 0 0,1 17.5,9A1.5,1.5 0 0,1 19,10.5A1.5,1.5 0 0,1 17.5,12M14.5,8A1.5,1.5 0 0,1 13,6.5A1.5,1.5 0 0,1 14.5,5A1.5,1.5 0 0,1 16,6.5A1.5,1.5 0 0,1 14.5,8M9.5,8A1.5,1.5 0 0,1 8,6.5A1.5,1.5 0 0,1 9.5,5A1.5,1.5 0 0,1 11,6.5A1.5,1.5 0 0,1 9.5,8M6.5,12A1.5,1.5 0 0,1 5,10.5A1.5,1.5 0 0,1 6.5,9A1.5,1.5 0 0,1 8,10.5A1.5,1.5 0 0,1 6.5,12M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A1.5,1.5 0 0,0 13.5,19.5C13.5,19.11 13.35,18.76 13.11,18.5C12.88,18.23 12.73,17.88 12.73,17.5A1.5,1.5 0 0,1 14.23,16H16A5,5 0 0,0 21,11C21,6.58 16.97,3 12,3Z
-
-
- M4 6.5C5.10457 6.5 6 5.60457 6 4.5C6 3.39543 5.10457 2.5 4 2.5C2.89543 2.5 2 3.39543 2 4.5C2 5.60457 2.89543 6.5 4 6.5ZM9.5 3C8.67157 3 8 3.67157 8 4.5C8 5.32843 8.67157 6 9.5 6H20.5C21.3284 6 22 5.32843 22 4.5C22 3.67157 21.3284 3 20.5 3H9.5ZM8 11.5C8 10.6716 8.67157 10 9.5 10H20.5C21.3284 10 22 10.6716 22 11.5C22 12.3284 21.3284 13 20.5 13H9.5C8.67157 13 8 12.3284 8 11.5ZM8 18.5C8 17.6716 8.67157 17 9.5 17H20.5C21.3284 17 22 17.6716 22 18.5C22 19.3284 21.3284 20 20.5 20H9.5C8.67157 20 8 19.3284 8 18.5ZM6 11.5C6 12.6046 5.10457 13.5 4 13.5C2.89543 13.5 2 12.6046 2 11.5C2 10.3954 2.89543 9.5 4 9.5C5.10457 9.5 6 10.3954 6 11.5ZM4 20.5C5.10457 20.5 6 19.6046 6 18.5C6 17.3954 5.10457 16.5 4 16.5C2.89543 16.5 2 17.3954 2 18.5C2 19.6046 2.89543 20.5 4 20.5Z
-
- 16
- 6
- 2
- 0 0 2 1 #1A000000
-
- 80
- 20
- 48
- 3
-
0 0 14 0 #1A000000
-
-
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia.ColorPicker/Shared.axaml b/src/Semi.Avalonia.ColorPicker/Shared.axaml
new file mode 100644
index 0000000..3338c4d
--- /dev/null
+++ b/src/Semi.Avalonia.ColorPicker/Shared.axaml
@@ -0,0 +1,30 @@
+
+ 600
+ 16 4
+ 70
+
+
+ M6.92,19L5,17.08L13.06,9L15,10.94M20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L13.84,6.41L11.91,4.5L10.5,5.91L11.92,7.33L3,16.25V21H7.75L16.67,12.08L18.09,13.5L19.5,12.09L17.58,10.17L20.7,7.05C21.1,6.65 21.1,6 20.71,5.63Z
+
+
+ M17.5,12A1.5,1.5 0 0,1 16,10.5A1.5,1.5 0 0,1 17.5,9A1.5,1.5 0 0,1 19,10.5A1.5,1.5 0 0,1 17.5,12M14.5,8A1.5,1.5 0 0,1 13,6.5A1.5,1.5 0 0,1 14.5,5A1.5,1.5 0 0,1 16,6.5A1.5,1.5 0 0,1 14.5,8M9.5,8A1.5,1.5 0 0,1 8,6.5A1.5,1.5 0 0,1 9.5,5A1.5,1.5 0 0,1 11,6.5A1.5,1.5 0 0,1 9.5,8M6.5,12A1.5,1.5 0 0,1 5,10.5A1.5,1.5 0 0,1 6.5,9A1.5,1.5 0 0,1 8,10.5A1.5,1.5 0 0,1 6.5,12M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A1.5,1.5 0 0,0 13.5,19.5C13.5,19.11 13.35,18.76 13.11,18.5C12.88,18.23 12.73,17.88 12.73,17.5A1.5,1.5 0 0,1 14.23,16H16A5,5 0 0,0 21,11C21,6.58 16.97,3 12,3Z
+
+
+ M4 6.5C5.10457 6.5 6 5.60457 6 4.5C6 3.39543 5.10457 2.5 4 2.5C2.89543 2.5 2 3.39543 2 4.5C2 5.60457 2.89543 6.5 4 6.5ZM9.5 3C8.67157 3 8 3.67157 8 4.5C8 5.32843 8.67157 6 9.5 6H20.5C21.3284 6 22 5.32843 22 4.5C22 3.67157 21.3284 3 20.5 3H9.5ZM8 11.5C8 10.6716 8.67157 10 9.5 10H20.5C21.3284 10 22 10.6716 22 11.5C22 12.3284 21.3284 13 20.5 13H9.5C8.67157 13 8 12.3284 8 11.5ZM8 18.5C8 17.6716 8.67157 17 9.5 17H20.5C21.3284 17 22 17.6716 22 18.5C22 19.3284 21.3284 20 20.5 20H9.5C8.67157 20 8 19.3284 8 18.5ZM6 11.5C6 12.6046 5.10457 13.5 4 13.5C2.89543 13.5 2 12.6046 2 11.5C2 10.3954 2.89543 9.5 4 9.5C5.10457 9.5 6 10.3954 6 11.5ZM4 20.5C5.10457 20.5 6 19.6046 6 18.5C6 17.3954 5.10457 16.5 4 16.5C2.89543 16.5 2 17.3954 2 18.5C2 19.6046 2.89543 20.5 4 20.5Z
+
+
+ 16
+ 6
+ 2
+ 0 0 2 1 #FFFFFF
+
+ 80
+ 20
+ 48
+ 3
+
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia.DataGrid/Dark.axaml b/src/Semi.Avalonia.DataGrid/Dark.axaml
index e8689c5..4af1cb1 100644
--- a/src/Semi.Avalonia.DataGrid/Dark.axaml
+++ b/src/Semi.Avalonia.DataGrid/Dark.axaml
@@ -1,29 +1,19 @@
-
- 12 0
- 32
- 1
- 1
- 12 0 0 0
- 32
+
- 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
- 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
@@ -31,13 +21,10 @@
-
- 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
- 1
-
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia.DataGrid/Index.axaml b/src/Semi.Avalonia.DataGrid/Index.axaml
index 98cabac..29ddeaa 100644
--- a/src/Semi.Avalonia.DataGrid/Index.axaml
+++ b/src/Semi.Avalonia.DataGrid/Index.axaml
@@ -1,5 +1,4 @@
-
@@ -8,7 +7,8 @@
+
-
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia.DataGrid/Light.axaml b/src/Semi.Avalonia.DataGrid/Light.axaml
index 7c29b49..d35acc6 100644
--- a/src/Semi.Avalonia.DataGrid/Light.axaml
+++ b/src/Semi.Avalonia.DataGrid/Light.axaml
@@ -1,29 +1,18 @@
-
- 12 0
- 32
- 1
- 1
- 12 0 0 0
- 32
- 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
- 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
@@ -32,12 +21,10 @@
- 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
- 1
-
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia.DataGrid/Shared.axaml b/src/Semi.Avalonia.DataGrid/Shared.axaml
new file mode 100644
index 0000000..7ae82b3
--- /dev/null
+++ b/src/Semi.Avalonia.DataGrid/Shared.axaml
@@ -0,0 +1,19 @@
+
+ 12 0
+
+ 32
+ 1
+ 1
+
+ 12 0 0 0
+ 32
+
+ 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
+ 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
+
+ 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
+
+ 1
+
\ No newline at end of file
From eaff3ebad007a7c8a69f7cb03898991ce89965a2 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Wed, 19 Jul 2023 11:50:30 +0800
Subject: [PATCH 22/46] fix: restore the missing resources.
---
src/Semi.Avalonia/Themes/Dark/DatePicker.axaml | 2 ++
src/Semi.Avalonia/Themes/Dark/DropDownButton.axaml | 2 ++
src/Semi.Avalonia/Themes/Dark/NumericUpDown.axaml | 2 ++
src/Semi.Avalonia/Themes/Dark/SplitButton.axaml | 2 ++
src/Semi.Avalonia/Themes/Dark/TabControl.axaml | 2 ++
src/Semi.Avalonia/Themes/Dark/TimePicker.axaml | 2 ++
src/Semi.Avalonia/Themes/Dark/_index.axaml | 6 ++++++
src/Semi.Avalonia/Themes/Light/DatePicker.axaml | 2 ++
src/Semi.Avalonia/Themes/Light/DropDownButton.axaml | 2 ++
src/Semi.Avalonia/Themes/Light/NumericUpDown.axaml | 2 ++
src/Semi.Avalonia/Themes/Light/SplitButton.axaml | 2 ++
src/Semi.Avalonia/Themes/Light/TabControl.axaml | 2 ++
src/Semi.Avalonia/Themes/Light/TimePicker.axaml | 2 ++
src/Semi.Avalonia/Themes/Light/_index.axaml | 6 ++++++
src/Semi.Avalonia/Themes/Shared/DataValidationErrors.axaml | 2 ++
src/Semi.Avalonia/Themes/Shared/GridSplitter.axaml | 2 ++
src/Semi.Avalonia/Themes/Shared/Palette.axaml | 2 ++
src/Semi.Avalonia/Themes/Shared/TabControl.axaml | 2 ++
src/Semi.Avalonia/Themes/Shared/Window.axaml | 2 ++
src/Semi.Avalonia/Themes/Shared/_index.axaml | 7 ++++++-
20 files changed, 52 insertions(+), 1 deletion(-)
create mode 100644 src/Semi.Avalonia/Themes/Dark/DatePicker.axaml
create mode 100644 src/Semi.Avalonia/Themes/Dark/DropDownButton.axaml
create mode 100644 src/Semi.Avalonia/Themes/Dark/NumericUpDown.axaml
create mode 100644 src/Semi.Avalonia/Themes/Dark/SplitButton.axaml
create mode 100644 src/Semi.Avalonia/Themes/Dark/TabControl.axaml
create mode 100644 src/Semi.Avalonia/Themes/Dark/TimePicker.axaml
create mode 100644 src/Semi.Avalonia/Themes/Light/DatePicker.axaml
create mode 100644 src/Semi.Avalonia/Themes/Light/DropDownButton.axaml
create mode 100644 src/Semi.Avalonia/Themes/Light/NumericUpDown.axaml
create mode 100644 src/Semi.Avalonia/Themes/Light/SplitButton.axaml
create mode 100644 src/Semi.Avalonia/Themes/Light/TabControl.axaml
create mode 100644 src/Semi.Avalonia/Themes/Light/TimePicker.axaml
create mode 100644 src/Semi.Avalonia/Themes/Shared/DataValidationErrors.axaml
create mode 100644 src/Semi.Avalonia/Themes/Shared/GridSplitter.axaml
create mode 100644 src/Semi.Avalonia/Themes/Shared/Palette.axaml
create mode 100644 src/Semi.Avalonia/Themes/Shared/TabControl.axaml
create mode 100644 src/Semi.Avalonia/Themes/Shared/Window.axaml
diff --git a/src/Semi.Avalonia/Themes/Dark/DatePicker.axaml b/src/Semi.Avalonia/Themes/Dark/DatePicker.axaml
new file mode 100644
index 0000000..d1981be
--- /dev/null
+++ b/src/Semi.Avalonia/Themes/Dark/DatePicker.axaml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/DropDownButton.axaml b/src/Semi.Avalonia/Themes/Dark/DropDownButton.axaml
new file mode 100644
index 0000000..d1981be
--- /dev/null
+++ b/src/Semi.Avalonia/Themes/Dark/DropDownButton.axaml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/NumericUpDown.axaml b/src/Semi.Avalonia/Themes/Dark/NumericUpDown.axaml
new file mode 100644
index 0000000..d1981be
--- /dev/null
+++ b/src/Semi.Avalonia/Themes/Dark/NumericUpDown.axaml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/SplitButton.axaml b/src/Semi.Avalonia/Themes/Dark/SplitButton.axaml
new file mode 100644
index 0000000..d1981be
--- /dev/null
+++ b/src/Semi.Avalonia/Themes/Dark/SplitButton.axaml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/TabControl.axaml b/src/Semi.Avalonia/Themes/Dark/TabControl.axaml
new file mode 100644
index 0000000..d1981be
--- /dev/null
+++ b/src/Semi.Avalonia/Themes/Dark/TabControl.axaml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/TimePicker.axaml b/src/Semi.Avalonia/Themes/Dark/TimePicker.axaml
new file mode 100644
index 0000000..d1981be
--- /dev/null
+++ b/src/Semi.Avalonia/Themes/Dark/TimePicker.axaml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Dark/_index.axaml b/src/Semi.Avalonia/Themes/Dark/_index.axaml
index 0fc69c4..5b328e6 100644
--- a/src/Semi.Avalonia/Themes/Dark/_index.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/_index.axaml
@@ -13,7 +13,9 @@
+
+
@@ -23,15 +25,19 @@
+
+
+
+
diff --git a/src/Semi.Avalonia/Themes/Light/DatePicker.axaml b/src/Semi.Avalonia/Themes/Light/DatePicker.axaml
new file mode 100644
index 0000000..d1981be
--- /dev/null
+++ b/src/Semi.Avalonia/Themes/Light/DatePicker.axaml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/DropDownButton.axaml b/src/Semi.Avalonia/Themes/Light/DropDownButton.axaml
new file mode 100644
index 0000000..d1981be
--- /dev/null
+++ b/src/Semi.Avalonia/Themes/Light/DropDownButton.axaml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/NumericUpDown.axaml b/src/Semi.Avalonia/Themes/Light/NumericUpDown.axaml
new file mode 100644
index 0000000..d1981be
--- /dev/null
+++ b/src/Semi.Avalonia/Themes/Light/NumericUpDown.axaml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/SplitButton.axaml b/src/Semi.Avalonia/Themes/Light/SplitButton.axaml
new file mode 100644
index 0000000..d1981be
--- /dev/null
+++ b/src/Semi.Avalonia/Themes/Light/SplitButton.axaml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/TabControl.axaml b/src/Semi.Avalonia/Themes/Light/TabControl.axaml
new file mode 100644
index 0000000..d1981be
--- /dev/null
+++ b/src/Semi.Avalonia/Themes/Light/TabControl.axaml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/TimePicker.axaml b/src/Semi.Avalonia/Themes/Light/TimePicker.axaml
new file mode 100644
index 0000000..d1981be
--- /dev/null
+++ b/src/Semi.Avalonia/Themes/Light/TimePicker.axaml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/_index.axaml b/src/Semi.Avalonia/Themes/Light/_index.axaml
index 397d751..3baba8f 100644
--- a/src/Semi.Avalonia/Themes/Light/_index.axaml
+++ b/src/Semi.Avalonia/Themes/Light/_index.axaml
@@ -13,7 +13,9 @@
+
+
@@ -23,15 +25,19 @@
+
+
+
+
diff --git a/src/Semi.Avalonia/Themes/Shared/DataValidationErrors.axaml b/src/Semi.Avalonia/Themes/Shared/DataValidationErrors.axaml
new file mode 100644
index 0000000..d1981be
--- /dev/null
+++ b/src/Semi.Avalonia/Themes/Shared/DataValidationErrors.axaml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Shared/GridSplitter.axaml b/src/Semi.Avalonia/Themes/Shared/GridSplitter.axaml
new file mode 100644
index 0000000..d1981be
--- /dev/null
+++ b/src/Semi.Avalonia/Themes/Shared/GridSplitter.axaml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Shared/Palette.axaml b/src/Semi.Avalonia/Themes/Shared/Palette.axaml
new file mode 100644
index 0000000..d1981be
--- /dev/null
+++ b/src/Semi.Avalonia/Themes/Shared/Palette.axaml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Shared/TabControl.axaml b/src/Semi.Avalonia/Themes/Shared/TabControl.axaml
new file mode 100644
index 0000000..d1981be
--- /dev/null
+++ b/src/Semi.Avalonia/Themes/Shared/TabControl.axaml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Shared/Window.axaml b/src/Semi.Avalonia/Themes/Shared/Window.axaml
new file mode 100644
index 0000000..d1981be
--- /dev/null
+++ b/src/Semi.Avalonia/Themes/Shared/Window.axaml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Shared/_index.axaml b/src/Semi.Avalonia/Themes/Shared/_index.axaml
index 12db9e4..249105f 100644
--- a/src/Semi.Avalonia/Themes/Shared/_index.axaml
+++ b/src/Semi.Avalonia/Themes/Shared/_index.axaml
@@ -1,5 +1,6 @@
+
@@ -11,10 +12,13 @@
+
+
+
@@ -29,6 +33,7 @@
+
@@ -37,6 +42,6 @@
-
+
\ No newline at end of file
From 98770145129751e3c560b84a0dd442dbd775a367 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Mon, 24 Jul 2023 18:02:22 +0800
Subject: [PATCH 23/46] feat: github pages.
---
.github/workflows/deploy.yml | 50 ++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
create mode 100644 .github/workflows/deploy.yml
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
new file mode 100644
index 0000000..bcd5bde
--- /dev/null
+++ b/.github/workflows/deploy.yml
@@ -0,0 +1,50 @@
+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/Debug/net7.0/browser-wasm/AppBundle
+on:
+ push:
+ branches: [ "deploy" ]
+ pull_request:
+ branches: [ "deploy" ]
+
+jobs:
+ deploy-to-github-pages:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Setup .NET Core SDK
+ uses: actions/setup-dotnet@v1.9.0
+
+ - name: Install wasm-tools
+ run: dotnet workload install wasm-tools wasm-experimental
+
+ - name: Install DotNetCompress
+ run: dotnet tool install --global DotNetCompress --version 2.0.0 --no-cache
+
+ - name: Publish .NET Project
+ run: dotnet publish $PROJECT_PATH -c Debug -o debug --nologo
+
+ - name: Change base-tag in index.html
+ run: sed -i 's///g' $OUTPUT_PATH/index.html
+
+ - 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
+
+ - name: Commit wwwroot to GitHub Pages
+ uses: JamesIves/github-pages-deploy-action@4.1.7
+ with:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ BRANCH: gh-pages
+ FOLDER: ${{ env.OUTPUT_PATH }}
From 5e94fd7bfab664475f869a4da3fe227db7493df8 Mon Sep 17 00:00:00 2001
From: rabbitism
Date: Tue, 25 Jul 2023 10:46:50 +0800
Subject: [PATCH 24/46] feat: change DataGrid demo data.
---
.../Pages/DataGridDemo.axaml | 224 ++++----
.../Pages/DataGridDemo.axaml.cs | 485 +-----------------
.../ViewModels/DataGridDemoViewModel.cs | 153 ++++++
3 files changed, 254 insertions(+), 608 deletions(-)
create mode 100644 demo/Semi.Avalonia.Demo/ViewModels/DataGridDemoViewModel.cs
diff --git a/demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml
index 44729f3..5a36e71 100644
--- a/demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml
@@ -5,122 +5,95 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:Semi.Avalonia.Demo.Pages"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels;assembly=Semi.Avalonia.Demo"
d:DesignHeight="450"
d:DesignWidth="800"
+ x:CompileBindings="True"
+ x:DataType="vm:DataGridDemoViewModel"
mc:Ignorable="d">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ x:DataType="vm:Song"
+ Binding="{Binding Title}"
+ Header="Title" />
+ Width="6*"
+ x:DataType="vm:Song"
+ Binding="{Binding Artist}"
+ Header="Artist" />
-
-
+ Width="6*"
+ x:DataType="vm:Song"
+ Binding="{Binding Album}"
+ Header="Album" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
-
+ Margin="8"
+ ItemsSource="{Binding GridData3}">
-
-
-
+
+
+
+
+ Text="{Binding CountOfComment}" />
@@ -174,17 +151,14 @@
+ Value="{Binding CountOfComment}" />
+
diff --git a/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/FilesPageViewModel.cs b/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/FilesPageViewModel.cs
new file mode 100644
index 0000000..933da57
--- /dev/null
+++ b/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/FilesPageViewModel.cs
@@ -0,0 +1,26 @@
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices;
+using CommunityToolkit.Mvvm.ComponentModel;
+
+namespace Semi.Avalonia.TreeDataGrid.Demo.ViewModels;
+
+public class FilesPageViewModel: ObservableObject
+{
+ public IList Drives { get; }
+ private string _selectedDrive;
+
+ public FilesPageViewModel()
+ {
+ Drives= DriveInfo.GetDrives().Select(x => x.Name).ToList();
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ {
+ _selectedDrive = "C:\\";
+ }
+ else
+ {
+ _selectedDrive = Drives.FirstOrDefault() ?? "/";
+ }
+ }
+}
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/MainViewModel.cs b/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/MainViewModel.cs
new file mode 100644
index 0000000..9d68af8
--- /dev/null
+++ b/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/MainViewModel.cs
@@ -0,0 +1,8 @@
+using CommunityToolkit.Mvvm.ComponentModel;
+
+namespace Semi.Avalonia.TreeDataGrid.Demo.ViewModels;
+
+public class MainViewModel: ObservableObject
+{
+
+}
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/SongsPageViewModel.cs b/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/SongsPageViewModel.cs
new file mode 100644
index 0000000..fc5fbd7
--- /dev/null
+++ b/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/SongsPageViewModel.cs
@@ -0,0 +1,152 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using Avalonia.Controls;
+using Avalonia.Controls.Models.TreeDataGrid;
+using CommunityToolkit.Mvvm.ComponentModel;
+
+namespace Semi.Avalonia.TreeDataGrid.Demo.ViewModels;
+
+public class SongsPageViewModel: ObservableObject
+{
+ private readonly ObservableCollection _songs;
+
+ public FlatTreeDataGridSource Songs { get; }
+
+ public SongsPageViewModel()
+ {
+ _songs = new ObservableCollection(Song.Songs);
+
+ Songs = new FlatTreeDataGridSource(_songs)
+ {
+ Columns =
+ {
+ new TextColumn("Title", a=>a.Title, (o, a) => o.Title = a, new GridLength(6, GridUnitType.Star)),
+ new TextColumn("Artist", a=>a.Artist, (o, a) => o.Artist = a, new GridLength(6, GridUnitType.Star)),
+ }
+ };
+ }
+
+}
+
+
+public class Song
+{
+ public string? Title { get; set; }
+ public string? Artist { get; set; }
+ public TimeSpan? Duration { get; set; }
+ public string? Album { get; set; }
+ public int CountOfComment { get; set; }
+ public string Url { get; set; }
+
+ public Song(string title, string artist, int m, int s, string album, int countOfComment, int netEaseId)
+ {
+ Title = title;
+ Artist = artist;
+ Duration = new TimeSpan(0, m, s);
+ Album = album;
+ CountOfComment = countOfComment;
+ Url = $"https://music.163.com/song?id={netEaseId}";
+
+ }
+
+ public static List Songs { get; set; } = new List()
+ {
+ new("好肚有肚(feat.李玲玉)", "熊猫堂ProducePandas", 2, 50, "A.S.I.A", 730, 1487039339),
+ new("荒诞秀", "熊猫堂ProducePandas", 3, 15, "A.S.I.A", 639, 1487037601),
+ new("长大", "熊猫堂ProducePandas", 4, 6, "A.S.I.A", 1114, 1487037690),
+ new("招财猫(feat.纪粹希(G-Tracy))", "熊猫堂ProducePandas", 3, 37, "A.S.I.A", 361, 1487039632),
+ new("千转", "熊猫堂ProducePandas", 4, 0, "A.S.I.A", 1115, 1477312398),
+ new("辣辣辣", "熊猫堂ProducePandas", 3, 24, "A.S.I.A", 1873, 1465043716),
+ new("碎碎念", "熊猫堂ProducePandas", 3, 25, "A.S.I.A", 676, 1474142064),
+ new("盘他", "熊猫堂ProducePandas", 2, 16, "A.S.I.A", 365, 1481652786),
+ new("Na Na Na", "熊猫堂ProducePandas", 3, 26, "A.S.I.A", 312, 1469022662),
+ new("Indigo", "熊猫堂ProducePandas", 3, 15, "A.S.I.A", 137, 1487039517),
+ new("饕餮人间", "熊猫堂ProducePandas", 3, 20, "饕餮人间", 1295, 1499584605),
+ new("七步咙咚呛", "熊猫堂ProducePandas", 3, 10, "七步咙咚呛", 175, 1809095152),
+ new("大惊小怪", "熊猫堂ProducePandas", 3, 32, "大惊小怪", 10420, 1847477425),
+ new("工具人", "熊猫堂ProducePandas", 2, 46, "大惊小怪", 1135, 1847476499),
+ new("以梦为马", "熊猫堂ProducePandas", 4, 19, "大惊小怪", 18361, 1836034373),
+ new("以梦为马(Piano Version)", "熊猫堂ProducePandas", 3, 4, "大惊小怪", 570, 1847477423),
+ new("The ONE", "熊猫堂ProducePandas", 2, 58, "The ONE", 1508, 1864329424),
+ new("The ONE(日文版)", "熊猫堂ProducePandas", 2, 57, "The ONE", 385, 1864329429),
+ new("以梦为马 (壮志骄阳版)", "熊猫堂ProducePandas", 4, 19, "以梦为马 (壮志骄阳版)", 161, 1865138896),
+ new("New Horse", "熊猫堂ProducePandas", 2, 30, "emo了", 643, 1887021307),
+ new("不例外", "熊猫堂ProducePandas", 3, 31, "emo了", 1818, 1887022665),
+ new("满意", "熊猫堂ProducePandas", 4, 32, "emo了", 1081, 1882433472),
+ new("就算与全世界为敌也要跟你在一起", "熊猫堂ProducePandas", 3, 32, "emo了", 2119, 1881759960),
+ new("The ONE", "熊猫堂ProducePandas", 2, 58, "emo了", 67, 1887022648),
+ new("口香糖", "熊猫堂ProducePandas", 3, 10, "emo了", 2181, 1885502254),
+ new("Suuuuuuper Mario", "熊猫堂ProducePandas", 3, 32, "emo了", 1010, 1887021318),
+ new("饕餮人间", "熊猫堂ProducePandas", 3, 22, "emo了", 109, 1887021320),
+ new("以梦为马 (壮志骄阳版)", "熊猫堂ProducePandas", 4, 21, "emo了", 34, 1887022666),
+ new("The ONE(日文版)", "熊猫堂ProducePandas", 2, 57, "emo了", 27, 1887022646),
+ new("满意(DJheap九天版)", "熊猫堂ProducePandas", 4, 31, "emo了", 31, 1901605941),
+ new("一眼万年", "熊猫堂ProducePandas", 3, 54, "一眼万年", 20, 1922599361),
+ new("冲刺", "熊猫堂ProducePandas", 3, 49, "冲刺吧", 1006, 1932878194),
+ new("滴答滴", "熊猫堂ProducePandas", 2, 30, "爱的赏味期限", 86, 1957515790),
+ new("热带季风", "熊猫堂ProducePandas", 2, 45, "爱的赏味期限", 212, 1957514964),
+ new("渣", "熊猫堂ProducePandas", 3, 28, "爱的赏味期限", 22, 1957514965),
+ new("独特", "熊猫堂ProducePandas", 3, 33, "爱的赏味期限", 62, 1957514966),
+ new("雨后", "熊猫堂ProducePandas", 4, 15, "爱的赏味期限", 23, 1957514967),
+ new("然后然后", "熊猫堂ProducePandas", 3, 50, "爱的赏味期限", 108, 1957514968),
+ new("丢", "熊猫堂ProducePandas", 3, 26, "爱的赏味期限", 30, 1957515792),
+ new("热带疾风(FACEVOID桃心连哥 Remix)", "熊猫堂ProducePandas", 3, 23, "爱的赏味期限", 55, 1957515793),
+ new("COSMIC ANTHEM -Japanese Ver.-", "熊猫堂ProducePandas", 3, 11, "COSMIC ANTHEM / 手紙", 0, 1977171493),
+ new("手紙 (「長大-You Raise Me Up-」-Japanese Ver.-)", "熊猫堂ProducePandas", 4, 11, "COSMIC ANTHEM / 手紙", 0,
+ 1977171494),
+ new("COSMIC ANTHEM -Chinese Ver.-", "熊猫堂ProducePandas", 3, 31, "COSMIC ANTHEM / 手紙", 0, 1977172202),
+ new("世界晚安", "熊猫堂ProducePandas", 2, 59, "世界晚安", 652, 1985063377),
+ new("世界晚安(泰文版)", "熊猫堂ProducePandas", 2, 59, "世界晚安", 134, 1987842504),
+ new("世界晚安(钢琴版)", "熊猫堂ProducePandas", 3, 2, "世界晚安", 76, 1990475933),
+ new("世界晚安(泰文钢琴版)", "熊猫堂ProducePandas", 3, 2, "世界晚安", 29, 1990475934),
+ new("世界晚安(DJ沈念版)", "熊猫堂ProducePandas", 3, 9, "世界晚安", 34, 2014263184),
+ new("世界晚安(钢琴配乐)", "熊猫堂ProducePandas", 2, 59, "世界晚安", 11, 2014263185),
+ new("明年也要好好长大", "熊猫堂ProducePandas", 3, 12, "明年也要好好长大", 0, 2010515162),
+ new("320万年前(DJ沈念版)", "熊猫堂ProducePandas", 3, 21, "320万年前", 8, 2055888636),
+ new("320万年前", "熊猫堂ProducePandas", 3, 7, "W.O.R.L.D.", 329, 2049770469),
+ new("隐德来希", "熊猫堂ProducePandas", 3, 3, "W.O.R.L.D.", 594, 2061317924),
+ new("孔明", "熊猫堂ProducePandas", 3, 59, "W.O.R.L.D.", 91, 2063175274),
+ new("锦鲤卟噜噜", "熊猫堂ProducePandas", 3, 5, "W.O.R.L.D.", 67, 2059208262),
+ new("指鹿为马", "熊猫堂ProducePandas", 3, 12, "W.O.R.L.D.", 74, 2063175272),
+ new("热带季风Remix", "熊猫堂ProducePandas", 3, 22, "W.O.R.L.D.", 23, 2063173319),
+ new("加州梦境", "熊猫堂ProducePandas", 2, 56, "W.O.R.L.D.", 1662, 2063173324),
+ new("渐进自由", "熊猫堂ProducePandas", 4, 19, "W.O.R.L.D.", 124, 2063173321),
+ new("世界所有的烂漫", "熊猫堂ProducePandas", 3, 30, "W.O.R.L.D.", 335, 2053388775),
+ };
+}
+
+public class SongViewModel: ObservableObject
+{
+ private string? _title;
+ private string? _artist;
+ private string? _album;
+ private int _countOfComment;
+ private bool? _isSelected;
+ public string? Title
+ {
+ get => _title;
+ set => SetProperty(ref _title, value);
+ }
+ public string? Artist
+ {
+ get => _artist;
+ set => SetProperty(ref _artist, value);
+ }
+ public string? Album
+ {
+ get => _album;
+ set => SetProperty(ref _album, value);
+ }
+ public int CountOfComment
+ {
+ get => _countOfComment;
+ set => SetProperty(ref _countOfComment, value);
+ }
+ public bool? IsSelected
+ {
+ get => _isSelected;
+ set => SetProperty(ref _isSelected, value);
+ }
+
+}
\ No newline at end of file
diff --git a/src/Semi.Avalonia.TreeDataGrid/Dark.axaml b/src/Semi.Avalonia.TreeDataGrid/Dark.axaml
index bd82d78..15d6fb6 100644
--- a/src/Semi.Avalonia.TreeDataGrid/Dark.axaml
+++ b/src/Semi.Avalonia.TreeDataGrid/Dark.axaml
@@ -1,11 +1,11 @@
-
-
-
+
+
+
-
-
-
+
+
+
diff --git a/src/Semi.Avalonia.TreeDataGrid/Light.axaml b/src/Semi.Avalonia.TreeDataGrid/Light.axaml
index bd82d78..6083873 100644
--- a/src/Semi.Avalonia.TreeDataGrid/Light.axaml
+++ b/src/Semi.Avalonia.TreeDataGrid/Light.axaml
@@ -1,11 +1,12 @@
-
-
-
+
+
+
-
-
-
+
+
+
+
diff --git a/src/Semi.Avalonia.TreeDataGrid/Shared.axaml b/src/Semi.Avalonia.TreeDataGrid/Shared.axaml
index cd04974..a053c3f 100644
--- a/src/Semi.Avalonia.TreeDataGrid/Shared.axaml
+++ b/src/Semi.Avalonia.TreeDataGrid/Shared.axaml
@@ -1,7 +1,11 @@
- M1875 1011l-787 787v-1798h-128v1798l-787 -787l-90 90l941 941l941 -941z
- M1965 947l-941 -941l-941 941l90 90l787 -787v1798h128v-1798l787 787z
+
+ 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
+
+ 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
M 1,0 10,10 l -9,10 -1,-1 L 8,10 -0,1 Z
- M0,1 L10,10 20,1 19,0 10,8 1,0 Z
+
+ 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/TreeDataGrid.axaml b/src/Semi.Avalonia.TreeDataGrid/TreeDataGrid.axaml
index c7f2555..95778ac 100644
--- a/src/Semi.Avalonia.TreeDataGrid/TreeDataGrid.axaml
+++ b/src/Semi.Avalonia.TreeDataGrid/TreeDataGrid.axaml
@@ -3,6 +3,11 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:conv="clr-namespace:Avalonia.Controls.Converters;assembly=Avalonia.Controls.TreeDataGrid">
+
+
+
+
+
@@ -47,17 +52,21 @@
-
-
+
+
+
+
-
+
+
-
-
+
@@ -118,12 +128,12 @@
-
-
From 4b2f390fa3f5db1f30f9acc5dbe4297140acd146 Mon Sep 17 00:00:00 2001
From: rabbitism
Date: Wed, 26 Jul 2023 02:50:01 +0800
Subject: [PATCH 30/46] feat: update
---
src/Semi.Avalonia.TreeDataGrid/Dark.axaml | 15 ++---
src/Semi.Avalonia.TreeDataGrid/Light.axaml | 14 ++---
.../TreeDataGrid.axaml | 61 +++++++++++--------
3 files changed, 50 insertions(+), 40 deletions(-)
diff --git a/src/Semi.Avalonia.TreeDataGrid/Dark.axaml b/src/Semi.Avalonia.TreeDataGrid/Dark.axaml
index 15d6fb6..f15e970 100644
--- a/src/Semi.Avalonia.TreeDataGrid/Dark.axaml
+++ b/src/Semi.Avalonia.TreeDataGrid/Dark.axaml
@@ -1,11 +1,12 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/src/Semi.Avalonia.TreeDataGrid/Light.axaml b/src/Semi.Avalonia.TreeDataGrid/Light.axaml
index 6083873..f15e970 100644
--- a/src/Semi.Avalonia.TreeDataGrid/Light.axaml
+++ b/src/Semi.Avalonia.TreeDataGrid/Light.axaml
@@ -1,12 +1,12 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/src/Semi.Avalonia.TreeDataGrid/TreeDataGrid.axaml b/src/Semi.Avalonia.TreeDataGrid/TreeDataGrid.axaml
index 95778ac..84d1158 100644
--- a/src/Semi.Avalonia.TreeDataGrid/TreeDataGrid.axaml
+++ b/src/Semi.Avalonia.TreeDataGrid/TreeDataGrid.axaml
@@ -10,7 +10,7 @@
-
+
-
-
+
-
+
-
@@ -179,7 +184,8 @@
IsChecked="{TemplateBinding Value,
Mode=TwoWay}"
IsEnabled="{Binding !IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}"
- IsThreeState="{TemplateBinding IsThreeState}" />
+ IsThreeState="{TemplateBinding IsThreeState}"
+ Theme="{DynamicResource SimpleCheckBox}" />
@@ -244,7 +250,7 @@
-
+
-
+
@@ -288,8 +298,7 @@
From 591c728d6954986a0ad9ab8ee455a4b7da3db338 Mon Sep 17 00:00:00 2001
From: rabbitism
Date: Wed, 26 Jul 2023 03:04:10 +0800
Subject: [PATCH 31/46] feat: fix dark color. add theme switch in demo. add
checkbox demo.
---
.../MainWindow.axaml | 13 ++++++++-----
.../MainWindow.axaml.cs | 13 +++++++++++++
.../ViewModels/SongsPageViewModel.cs | 19 +++++++++++++------
src/Semi.Avalonia.TreeDataGrid/Dark.axaml | 14 +++++++-------
.../TreeDataGrid.axaml | 2 ++
5 files changed, 43 insertions(+), 18 deletions(-)
diff --git a/demo/Semi.Avalonia.TreeDataGrid.Demo/MainWindow.axaml b/demo/Semi.Avalonia.TreeDataGrid.Demo/MainWindow.axaml
index f6abc32..18d2f7b 100644
--- a/demo/Semi.Avalonia.TreeDataGrid.Demo/MainWindow.axaml
+++ b/demo/Semi.Avalonia.TreeDataGrid.Demo/MainWindow.axaml
@@ -10,9 +10,12 @@
d:DesignWidth="800"
x:DataType="vm:SongsPageViewModel"
mc:Ignorable="d">
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/demo/Semi.Avalonia.TreeDataGrid.Demo/MainWindow.axaml.cs b/demo/Semi.Avalonia.TreeDataGrid.Demo/MainWindow.axaml.cs
index 8bb425e..264cf5f 100644
--- a/demo/Semi.Avalonia.TreeDataGrid.Demo/MainWindow.axaml.cs
+++ b/demo/Semi.Avalonia.TreeDataGrid.Demo/MainWindow.axaml.cs
@@ -1,4 +1,7 @@
+using Avalonia;
using Avalonia.Controls;
+using Avalonia.Interactivity;
+using Avalonia.Styling;
using Semi.Avalonia.TreeDataGrid.Demo.ViewModels;
namespace Semi.Avalonia.TreeDataGrid.Demo;
@@ -10,4 +13,14 @@ public partial class MainWindow : Window
InitializeComponent();
this.DataContext = new SongsPageViewModel();
}
+
+ private void Button_OnClick(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;
+ }
+ }
}
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/SongsPageViewModel.cs b/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/SongsPageViewModel.cs
index fc5fbd7..22c3035 100644
--- a/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/SongsPageViewModel.cs
+++ b/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/SongsPageViewModel.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
+using System.Linq;
using Avalonia.Controls;
using Avalonia.Controls.Models.TreeDataGrid;
using CommunityToolkit.Mvvm.ComponentModel;
@@ -9,20 +10,26 @@ namespace Semi.Avalonia.TreeDataGrid.Demo.ViewModels;
public class SongsPageViewModel: ObservableObject
{
- private readonly ObservableCollection _songs;
+ private readonly ObservableCollection _songs;
- public FlatTreeDataGridSource Songs { get; }
+ public FlatTreeDataGridSource Songs { get; }
public SongsPageViewModel()
{
- _songs = new ObservableCollection(Song.Songs);
+ _songs = new ObservableCollection(Song.Songs.Select(a => new SongViewModel()
+ {
+ Title = a.Title, Artist = a.Artist, Album = a.Album, CountOfComment = a.CountOfComment,
+ IsSelected = false
+ }));
- Songs = new FlatTreeDataGridSource(_songs)
+ Songs = new FlatTreeDataGridSource(_songs)
{
Columns =
{
- new TextColumn("Title", a=>a.Title, (o, a) => o.Title = a, new GridLength(6, GridUnitType.Star)),
- new TextColumn("Artist", a=>a.Artist, (o, a) => o.Artist = a, new GridLength(6, GridUnitType.Star)),
+ new CheckBoxColumn("IsSelected", a=>a.IsSelected, (model, b) => { model.IsSelected = b; }, new GridLength(72, GridUnitType.Pixel)),
+ new TextColumn("Title", a=>a.Title, (o, a) => o.Title = a, new GridLength(6, GridUnitType.Star)),
+ new TextColumn("Artist", a=>a.Artist, (o, a) => o.Artist = a, new GridLength(6, GridUnitType.Star)),
+ new TextColumn("Album", a=>a.Album, (o, a) => o.Album = a, new GridLength(6, GridUnitType.Star)),
}
};
}
diff --git a/src/Semi.Avalonia.TreeDataGrid/Dark.axaml b/src/Semi.Avalonia.TreeDataGrid/Dark.axaml
index f15e970..2f5ee54 100644
--- a/src/Semi.Avalonia.TreeDataGrid/Dark.axaml
+++ b/src/Semi.Avalonia.TreeDataGrid/Dark.axaml
@@ -1,12 +1,12 @@
-
-
-
+
+
+
-
-
-
-
+
+
+
+
diff --git a/src/Semi.Avalonia.TreeDataGrid/TreeDataGrid.axaml b/src/Semi.Avalonia.TreeDataGrid/TreeDataGrid.axaml
index 84d1158..e5db021 100644
--- a/src/Semi.Avalonia.TreeDataGrid/TreeDataGrid.axaml
+++ b/src/Semi.Avalonia.TreeDataGrid/TreeDataGrid.axaml
@@ -181,6 +181,8 @@
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
Date: Wed, 26 Jul 2023 16:42:17 +0800
Subject: [PATCH 32/46] feat: add hierarchical demo.
---
.../Converters/FileIconConverter.cs | 28 ++
.../MainWindow.axaml | 115 +++++-
.../MainWindow.axaml.cs | 12 +-
.../ViewModels/FilesPageViewModel.cs | 376 ++++++++++++++++++
.../ViewModels/MainViewModel.cs | 3 +-
.../ViewModels/SongsPageViewModel.cs | 35 +-
src/Semi.Avalonia.TreeDataGrid/Shared.axaml | 5 +-
.../TreeDataGrid.axaml | 16 +-
8 files changed, 569 insertions(+), 21 deletions(-)
create mode 100644 demo/Semi.Avalonia.TreeDataGrid.Demo/Converters/FileIconConverter.cs
diff --git a/demo/Semi.Avalonia.TreeDataGrid.Demo/Converters/FileIconConverter.cs b/demo/Semi.Avalonia.TreeDataGrid.Demo/Converters/FileIconConverter.cs
new file mode 100644
index 0000000..0ed4943
--- /dev/null
+++ b/demo/Semi.Avalonia.TreeDataGrid.Demo/Converters/FileIconConverter.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using Avalonia;
+using Avalonia.Data.Converters;
+using Avalonia.Media;
+using Avalonia.Metadata;
+
+namespace Semi.Avalonia.TreeDataGrid.Demo.Converters;
+
+public class FileIconConverter: IMultiValueConverter
+{
+ [Content]
+ public Dictionary Items { get; set; } = new Dictionary();
+
+ public object? Convert(IList values, Type targetType, object? parameter, CultureInfo culture)
+ {
+ if (values[0] is bool isDirectory && values[1] is bool isOpen)
+ {
+ if (!isDirectory)
+ {
+ return Items["file"];
+ }
+ return isOpen ? Items["folderOpen"] : Items["folderClosed"];
+ }
+ return AvaloniaProperty.UnsetValue;
+ }
+}
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.TreeDataGrid.Demo/MainWindow.axaml b/demo/Semi.Avalonia.TreeDataGrid.Demo/MainWindow.axaml
index 18d2f7b..a86cfd2 100644
--- a/demo/Semi.Avalonia.TreeDataGrid.Demo/MainWindow.axaml
+++ b/demo/Semi.Avalonia.TreeDataGrid.Demo/MainWindow.axaml
@@ -2,19 +2,128 @@
x:Class="Semi.Avalonia.TreeDataGrid.Demo.MainWindow"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:converters="clr-namespace:Semi.Avalonia.TreeDataGrid.Demo.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:Semi.Avalonia.TreeDataGrid.Demo.ViewModels;assembly=Semi.Avalonia.TreeDataGrid.Demo"
Title="Semi.Avalonia.TreeDataGrid.Demo"
d:DesignHeight="450"
d:DesignWidth="800"
- x:DataType="vm:SongsPageViewModel"
+ x:DataType="vm:MainViewModel"
mc:Ignorable="d">
+
+
+ M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z
+ M6.1,10L4,18V8H21A2,2 0 0,0 19,6H12L10,4H4A2,2 0 0,0 2,6V18A2,2 0 0,0 4,20H19C19.9,20 20.7,19.4 20.9,18.5L23.2,10H6.1M19,18H6L7.6,12H20.6L19,18Z
+ M20,18H4V8H20M20,6H12L10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6Z
+
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/demo/Semi.Avalonia.TreeDataGrid.Demo/MainWindow.axaml.cs b/demo/Semi.Avalonia.TreeDataGrid.Demo/MainWindow.axaml.cs
index 264cf5f..002823f 100644
--- a/demo/Semi.Avalonia.TreeDataGrid.Demo/MainWindow.axaml.cs
+++ b/demo/Semi.Avalonia.TreeDataGrid.Demo/MainWindow.axaml.cs
@@ -1,5 +1,6 @@
using Avalonia;
using Avalonia.Controls;
+using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Styling;
using Semi.Avalonia.TreeDataGrid.Demo.ViewModels;
@@ -11,7 +12,7 @@ public partial class MainWindow : Window
public MainWindow()
{
InitializeComponent();
- this.DataContext = new SongsPageViewModel();
+ this.DataContext = new MainViewModel();
}
private void Button_OnClick(object? sender, RoutedEventArgs e)
@@ -23,4 +24,13 @@ public partial class MainWindow : Window
app.RequestedThemeVariant = theme == ThemeVariant.Dark ? ThemeVariant.Light : ThemeVariant.Dark;
}
}
+
+ private void SelectedPath_KeyDown(object? sender, KeyEventArgs e)
+ {
+ if (e.Key == Key.Enter)
+ {
+ var vm = (MainViewModel)DataContext!;
+ vm.FilesContext.SelectedPath = ((TextBox)sender!).Text;
+ }
+ }
}
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/FilesPageViewModel.cs b/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/FilesPageViewModel.cs
index 933da57..f80e633 100644
--- a/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/FilesPageViewModel.cs
+++ b/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/FilesPageViewModel.cs
@@ -1,7 +1,14 @@
+using System;
using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
+using Avalonia.Controls;
+using Avalonia.Controls.Models.TreeDataGrid;
+using Avalonia.Controls.Selection;
+using Avalonia.Threading;
using CommunityToolkit.Mvvm.ComponentModel;
namespace Semi.Avalonia.TreeDataGrid.Demo.ViewModels;
@@ -10,6 +17,26 @@ public class FilesPageViewModel: ObservableObject
{
public IList Drives { get; }
private string _selectedDrive;
+ private string? _selectedPath;
+ private FileNodeViewModel? _root;
+ public string SelectedDrive
+ {
+ get => _selectedDrive;
+ set
+ {
+ SetProperty(ref _selectedDrive, value);
+ _root = new FileNodeViewModel(_selectedDrive, isDirectory: true, isRoot: true);
+ Source.Items = new[] { _root };
+ }
+ }
+
+ public string? SelectedPath
+ {
+ get => _selectedPath;
+ set => SetSelectedPath(value);
+ }
+
+ public HierarchicalTreeDataGridSource Source { get; }
public FilesPageViewModel()
{
@@ -22,5 +49,354 @@ public class FilesPageViewModel: ObservableObject
{
_selectedDrive = Drives.FirstOrDefault() ?? "/";
}
+
+ Source = new HierarchicalTreeDataGridSource(Array.Empty())
+ {
+ Columns =
+ {
+ new CheckBoxColumn(
+ null,
+ x => x.IsChecked,
+ (o, v) => o.IsChecked = v,
+ options: new()
+ {
+ CanUserResizeColumn = false,
+ }),
+ new HierarchicalExpanderColumn(
+ new TemplateColumn(
+ "Name",
+ "FileNameCell",
+ "FileNameEditCell",
+ new GridLength(1, GridUnitType.Star),
+ new()
+ {
+ CompareAscending = FileNodeViewModel.SortAscending(x => x.Name),
+ CompareDescending = FileNodeViewModel.SortDescending(x => x.Name),
+ IsTextSearchEnabled = true,
+ TextSearchValueSelector = x => x.Name
+ }),
+ x => x.Children,
+ x => x.HasChildren,
+ x => x.IsExpanded),
+ new TextColumn(
+ "Size",
+ x => x.Size,
+ options: new()
+ {
+ CompareAscending = FileNodeViewModel.SortAscending(x => x.Size),
+ CompareDescending = FileNodeViewModel.SortDescending(x => x.Size),
+ }),
+ new TextColumn(
+ "Modified",
+ x => x.Modified,
+ options: new()
+ {
+ CompareAscending = FileNodeViewModel.SortAscending(x => x.Modified),
+ CompareDescending = FileNodeViewModel.SortDescending(x => x.Modified),
+ }),
+ }
+ };
+ Source.RowSelection!.SingleSelect = false;
+ Source.RowSelection.SelectionChanged += SelectionChanged;
+ }
+
+ private void SelectionChanged(object? sender, TreeSelectionModelSelectionChangedEventArgs e)
+ {
+ var selectedPath = Source.RowSelection?.SelectedItem?.Path;
+ this.SetProperty(ref _selectedPath, selectedPath, nameof(SelectedPath));
+
+ foreach (var i in e.DeselectedItems)
+ System.Diagnostics.Trace.WriteLine($"Deselected '{i?.Path}'");
+ foreach (var i in e.SelectedItems)
+ System.Diagnostics.Trace.WriteLine($"Selected '{i?.Path}'");
+ }
+
+ private void SetSelectedPath(string? value)
+ {
+ if (string.IsNullOrEmpty(value))
+ {
+ Source.RowSelection!.Clear();
+ return;
+ }
+
+ var path = value;
+ var components = new Stack();
+ DirectoryInfo? d = null;
+
+ if (File.Exists(path))
+ {
+ var f = new FileInfo(path);
+ components.Push(f.Name);
+ d = f.Directory;
+ }
+ else if (Directory.Exists(path))
+ {
+ d = new DirectoryInfo(path);
+ }
+
+ while (d is not null)
+ {
+ components.Push(d.Name);
+ d = d.Parent;
+ }
+
+ var index = IndexPath.Unselected;
+
+ if (components.Count > 0)
+ {
+ var drive = components.Pop();
+ var driveIndex = Drives.FindIndex(x => string.Equals(x, drive, StringComparison.OrdinalIgnoreCase));
+
+ if (driveIndex >= 0)
+ SelectedDrive = Drives[driveIndex];
+
+ FileNodeViewModel? node = _root;
+ index = new IndexPath(0);
+
+ while (node is not null && components.Count > 0)
+ {
+ node.IsExpanded = true;
+
+ var component = components.Pop();
+ var i = node.Children.FindIndex(x => string.Equals(x.Name, component, StringComparison.OrdinalIgnoreCase));
+ node = i >= 0 ? node.Children[i] : null;
+ index = i >= 0 ? index.Append(i) : default;
+ }
+ }
+
+ Source.RowSelection!.SelectedIndex = index;
+ }
+}
+
+public class FileNodeViewModel: ObservableObject, IEditableObject
+{
+ private string _path;
+ private string _name;
+ private string? _undoName;
+ private long? _size;
+ private DateTimeOffset? _modified;
+ private FileSystemWatcher? _watcher;
+ private ObservableCollection? _children;
+ private bool _hasChildren = true;
+ private bool _isExpanded;
+
+ public FileNodeViewModel(
+ string path,
+ bool isDirectory,
+ bool isRoot = false)
+ {
+ _path = path;
+ _name = isRoot ? path : System.IO.Path.GetFileName(Path);
+ _isExpanded = isRoot;
+ IsDirectory = isDirectory;
+ HasChildren = isDirectory;
+
+ if (!isDirectory)
+ {
+ var info = new FileInfo(path);
+ Size = info.Length;
+ Modified = info.LastWriteTimeUtc;
+ }
+ }
+
+ public string Path
+ {
+ get => _path;
+ private set => SetProperty(ref _path, value);
+ }
+
+ public string Name
+ {
+ get => _name;
+ private set => SetProperty(ref _name, value);
+ }
+
+ public long? Size
+ {
+ get => _size;
+ private set => SetProperty(ref _size, value);
+ }
+
+ public DateTimeOffset? Modified
+ {
+ get => _modified;
+ private set => SetProperty(ref _modified, value);
+ }
+
+ public bool HasChildren
+ {
+ get => _hasChildren;
+ private set => SetProperty(ref _hasChildren, value);
+ }
+
+ public bool IsExpanded
+ {
+ get => _isExpanded;
+ set => SetProperty(ref _isExpanded, value);
+ }
+
+ public bool IsChecked { get; set; }
+ public bool IsDirectory { get; }
+ public IReadOnlyList Children => _children ??= LoadChildren();
+
+ private ObservableCollection LoadChildren()
+ {
+ if (!IsDirectory)
+ {
+ throw new NotSupportedException();
+ }
+
+ var options = new EnumerationOptions { IgnoreInaccessible = true };
+ var result = new ObservableCollection();
+
+ foreach (var d in Directory.EnumerateDirectories(Path, "*", options))
+ {
+ result.Add(new FileNodeViewModel(d, true));
+ }
+
+ foreach (var f in Directory.EnumerateFiles(Path, "*", options))
+ {
+ result.Add(new FileNodeViewModel(f, false));
+ }
+
+ _watcher = new FileSystemWatcher
+ {
+ Path = Path,
+ NotifyFilter = NotifyFilters.FileName | NotifyFilters.Size | NotifyFilters.LastWrite,
+ };
+
+ _watcher.Changed += OnChanged;
+ _watcher.Created += OnCreated;
+ _watcher.Deleted += OnDeleted;
+ _watcher.Renamed += OnRenamed;
+ _watcher.EnableRaisingEvents = true;
+
+ if (result.Count == 0)
+ HasChildren = false;
+
+ return result;
+ }
+
+ public static Comparison SortAscending(Func selector)
+ {
+ return (x, y) =>
+ {
+ if (x is null && y is null)
+ return 0;
+ else if (x is null)
+ return -1;
+ else if (y is null)
+ return 1;
+ if (x.IsDirectory == y.IsDirectory)
+ return Comparer.Default.Compare(selector(x), selector(y));
+ else if (x.IsDirectory)
+ return -1;
+ else
+ return 1;
+ };
+ }
+
+ public static Comparison SortDescending(Func selector)
+ {
+ return (x, y) =>
+ {
+ if (x is null && y is null)
+ return 0;
+ else if (x is null)
+ return 1;
+ else if (y is null)
+ return -1;
+ if (x.IsDirectory == y.IsDirectory)
+ return Comparer.Default.Compare(selector(y), selector(x));
+ else if (x.IsDirectory)
+ return -1;
+ else
+ return 1;
+ };
+ }
+
+ void IEditableObject.BeginEdit() => _undoName = _name;
+ void IEditableObject.CancelEdit() => _name = _undoName!;
+ void IEditableObject.EndEdit() => _undoName = null;
+
+ private void OnChanged(object sender, FileSystemEventArgs e)
+ {
+ if (e.ChangeType == WatcherChangeTypes.Changed && File.Exists(e.FullPath))
+ {
+ Dispatcher.UIThread.Post(() =>
+ {
+ foreach (var child in _children!)
+ {
+ if (child.Path == e.FullPath)
+ {
+ if (!child.IsDirectory)
+ {
+ var info = new FileInfo(e.FullPath);
+ child.Size = info.Length;
+ child.Modified = info.LastWriteTimeUtc;
+ }
+ break;
+ }
+ }
+ });
+ }
+ }
+
+ private void OnCreated(object sender, FileSystemEventArgs e)
+ {
+ Dispatcher.UIThread.Post(() =>
+ {
+ var node = new FileNodeViewModel(
+ e.FullPath,
+ File.GetAttributes(e.FullPath).HasFlag(FileAttributes.Directory));
+ _children!.Add(node);
+ });
+ }
+
+ private void OnDeleted(object sender, FileSystemEventArgs e)
+ {
+ Dispatcher.UIThread.Post(() =>
+ {
+ for (var i = 0; i < _children!.Count; ++i)
+ {
+ if (_children[i].Path == e.FullPath)
+ {
+ _children.RemoveAt(i);
+ System.Diagnostics.Debug.WriteLine($"Removed {e.FullPath}");
+ break;
+ }
+ }
+ });
+ }
+
+ private void OnRenamed(object sender, RenamedEventArgs e)
+ {
+ Dispatcher.UIThread.Post(() =>
+ {
+ foreach (var child in _children!)
+ {
+ if (child.Path == e.OldFullPath)
+ {
+ child.Path = e.FullPath;
+ child.Name = e.Name ?? string.Empty;
+ break;
+ }
+ }
+ });
+ }
+}
+
+internal static class ListExtensions
+{
+ public static int FindIndex(this IEnumerable source, Func predicate)
+ {
+ int i = 0;
+ foreach (var item in source)
+ {
+ if (predicate(item))
+ return i;
+ i++;
+ }
+ return -1;
}
}
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/MainViewModel.cs b/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/MainViewModel.cs
index 9d68af8..066bcb4 100644
--- a/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/MainViewModel.cs
+++ b/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/MainViewModel.cs
@@ -4,5 +4,6 @@ namespace Semi.Avalonia.TreeDataGrid.Demo.ViewModels;
public class MainViewModel: ObservableObject
{
-
+ public SongsPageViewModel SongsContext { get; } = new();
+ public FilesPageViewModel FilesContext { get; } = new();
}
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/SongsPageViewModel.cs b/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/SongsPageViewModel.cs
index 22c3035..11d2793 100644
--- a/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/SongsPageViewModel.cs
+++ b/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/SongsPageViewModel.cs
@@ -21,15 +21,21 @@ public class SongsPageViewModel: ObservableObject
Title = a.Title, Artist = a.Artist, Album = a.Album, CountOfComment = a.CountOfComment,
IsSelected = false
}));
-
+
Songs = new FlatTreeDataGridSource(_songs)
{
Columns =
{
- new CheckBoxColumn("IsSelected", a=>a.IsSelected, (model, b) => { model.IsSelected = b; }, new GridLength(72, GridUnitType.Pixel)),
- new TextColumn("Title", a=>a.Title, (o, a) => o.Title = a, new GridLength(6, GridUnitType.Star)),
- new TextColumn("Artist", a=>a.Artist, (o, a) => o.Artist = a, new GridLength(6, GridUnitType.Star)),
- new TextColumn("Album", a=>a.Album, (o, a) => o.Album = a, new GridLength(6, GridUnitType.Star)),
+ new CheckBoxColumn("IsSelected", a => a.IsSelected,
+ (model, b) => { model.IsSelected = b; }, new GridLength(108, GridUnitType.Pixel)),
+ new TextColumn("Title", a => a.Title, (o, a) => o.Title = a,
+ new GridLength(6, GridUnitType.Star)),
+ new TextColumn("Artist", a => a.Artist, (o, a) => o.Artist = a,
+ new GridLength(6, GridUnitType.Star)),
+ new TemplateColumn("Album", "AlbumCell", "AlbumEditCell",
+ new GridLength(6, GridUnitType.Star)),
+ new TemplateColumn("Comments", "CommentsCell", "CommentsEditCell",
+ new GridLength(6, GridUnitType.Star)),
}
};
}
@@ -57,6 +63,25 @@ public class Song
}
+ public static List Albums { get; set; } = new List()
+ {
+ "A.S.I.A",
+ "饕餮人间",
+ "七步咙咚呛",
+ "大惊小怪",
+ "The ONE",
+ "以梦为马 (壮志骄阳版)",
+ "emo了",
+ "一眼万年",
+ "冲刺吧",
+ "爱的赏味期限",
+ "COSMIC ANTHEM / 手紙",
+ "世界晚安",
+ "明年也要好好长大",
+ "320万年前",
+ "W.O.R.L.D.",
+ };
+
public static List Songs { get; set; } = new List()
{
new("好肚有肚(feat.李玲玉)", "熊猫堂ProducePandas", 2, 50, "A.S.I.A", 730, 1487039339),
diff --git a/src/Semi.Avalonia.TreeDataGrid/Shared.axaml b/src/Semi.Avalonia.TreeDataGrid/Shared.axaml
index a053c3f..168e7c3 100644
--- a/src/Semi.Avalonia.TreeDataGrid/Shared.axaml
+++ b/src/Semi.Avalonia.TreeDataGrid/Shared.axaml
@@ -4,8 +4,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
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
- M 1,0 10,10 l -9,10 -1,-1 L 8,10 -0,1 Z
-
- 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
-
+ 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
diff --git a/src/Semi.Avalonia.TreeDataGrid/TreeDataGrid.axaml b/src/Semi.Avalonia.TreeDataGrid/TreeDataGrid.axaml
index e5db021..e1dab7d 100644
--- a/src/Semi.Avalonia.TreeDataGrid/TreeDataGrid.axaml
+++ b/src/Semi.Avalonia.TreeDataGrid/TreeDataGrid.axaml
@@ -195,8 +195,9 @@
-
-
+
+
+
-
+ Foreground="{TemplateBinding Foreground}" />
-
@@ -263,7 +263,9 @@
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
From 17fa10333a3245a6456ffa3f904685cf6b1f5f7f Mon Sep 17 00:00:00 2001
From: rabbitism
Date: Wed, 26 Jul 2023 23:52:29 +0800
Subject: [PATCH 33/46] fix: fix number nullability.
---
.../ViewModels/SongsPageViewModel.cs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/SongsPageViewModel.cs b/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/SongsPageViewModel.cs
index 11d2793..2e91e43 100644
--- a/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/SongsPageViewModel.cs
+++ b/demo/Semi.Avalonia.TreeDataGrid.Demo/ViewModels/SongsPageViewModel.cs
@@ -49,7 +49,7 @@ public class Song
public string? Artist { get; set; }
public TimeSpan? Duration { get; set; }
public string? Album { get; set; }
- public int CountOfComment { get; set; }
+ public int? CountOfComment { get; set; }
public string Url { get; set; }
public Song(string title, string artist, int m, int s, string album, int countOfComment, int netEaseId)
@@ -153,7 +153,7 @@ public class SongViewModel: ObservableObject
private string? _title;
private string? _artist;
private string? _album;
- private int _countOfComment;
+ private int? _countOfComment;
private bool? _isSelected;
public string? Title
{
@@ -170,7 +170,7 @@ public class SongViewModel: ObservableObject
get => _album;
set => SetProperty(ref _album, value);
}
- public int CountOfComment
+ public int? CountOfComment
{
get => _countOfComment;
set => SetProperty(ref _countOfComment, value);
From 1c98ce4682bed9a9645d85d8087870533a4275ff Mon Sep 17 00:00:00 2001
From: rabbitism
Date: Thu, 27 Jul 2023 00:30:32 +0800
Subject: [PATCH 34/46] fix: fix identation, fix error theme in demo.
---
.../MainWindow.axaml | 12 +-
.../ViewModels/FilesPageViewModel.cs | 365 +++++++++---------
2 files changed, 191 insertions(+), 186 deletions(-)
diff --git a/demo/Semi.Avalonia.TreeDataGrid.Demo/MainWindow.axaml b/demo/Semi.Avalonia.TreeDataGrid.Demo/MainWindow.axaml
index a86cfd2..32c5e1d 100644
--- a/demo/Semi.Avalonia.TreeDataGrid.Demo/MainWindow.axaml
+++ b/demo/Semi.Avalonia.TreeDataGrid.Demo/MainWindow.axaml
@@ -112,10 +112,18 @@
-
+
+
+
+
+
-
@@ -84,8 +85,187 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
From a6fe50e6bc47a3ca34b9adf6dc3515d7c80e211c Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Mon, 14 Aug 2023 11:17:07 +0800
Subject: [PATCH 36/46] feat: transform style resources.
---
src/Semi.Avalonia/Controls/ListBox.axaml | 68 +++++++++----------
src/Semi.Avalonia/Themes/Dark/ListBox.axaml | 49 +++++++++++++
src/Semi.Avalonia/Themes/Light/ListBox.axaml | 50 ++++++++++++++
src/Semi.Avalonia/Themes/Shared/ListBox.axaml | 25 +++++++
4 files changed, 158 insertions(+), 34 deletions(-)
diff --git a/src/Semi.Avalonia/Controls/ListBox.axaml b/src/Semi.Avalonia/Controls/ListBox.axaml
index 5ba9a52..cc06cc2 100644
--- a/src/Semi.Avalonia/Controls/ListBox.axaml
+++ b/src/Semi.Avalonia/Controls/ListBox.axaml
@@ -120,11 +120,11 @@
-
-
-
-
-
+
+
+
+
+
-
@@ -167,8 +167,8 @@
ContentTemplate="{TemplateBinding ContentTemplate}"
Foreground="{TemplateBinding Foreground}"
RecognizesAccessKey="True"
- TextElement.FontSize="{DynamicResource RadioButtonFontSize}"
- TextElement.Foreground="{DynamicResource RadioButtonForeground}" />
+ TextElement.FontSize="{DynamicResource ListBoxItemRadioGroupFontSize}"
+ TextElement.Foreground="{DynamicResource ListBoxItemRadioGroupForeground}" />
@@ -178,8 +178,8 @@
diff --git a/src/Semi.Avalonia/Themes/Dark/ListBox.axaml b/src/Semi.Avalonia/Themes/Dark/ListBox.axaml
index 15a5cc8..f30abc8 100644
--- a/src/Semi.Avalonia/Themes/Dark/ListBox.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/ListBox.axaml
@@ -11,4 +11,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/ListBox.axaml b/src/Semi.Avalonia/Themes/Light/ListBox.axaml
index 8dbf5be..038ed4a 100644
--- a/src/Semi.Avalonia/Themes/Light/ListBox.axaml
+++ b/src/Semi.Avalonia/Themes/Light/ListBox.axaml
@@ -11,4 +11,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Shared/ListBox.axaml b/src/Semi.Avalonia/Themes/Shared/ListBox.axaml
index c920a66..8cb6391 100644
--- a/src/Semi.Avalonia/Themes/Shared/ListBox.axaml
+++ b/src/Semi.Avalonia/Themes/Shared/ListBox.axaml
@@ -1,4 +1,29 @@
8 4
3
+
+ 16
+ 6
+ 14
+ 0 2 8 0
+
+
+ 3
+
+ 3
+ 3
+
+ 600
+ 16 2
+ 16 4
+ 24 6
+
+ 12
+ 12
+ 14
+
+ 16 12
+
+ 3
+
\ No newline at end of file
From eef4e5b62a77a716947f5b7dc569ad0a6dcb477d Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Mon, 14 Aug 2023 16:50:50 +0800
Subject: [PATCH 37/46] feat: ButtonRadioGroupListBox, CardRadioGroupListBox,
PureCardRadioGroupListBox.
---
.../Pages/ListBoxDemo.axaml | 14 +
src/Semi.Avalonia/Controls/ListBox.axaml | 322 +++++++++++++++++-
2 files changed, 329 insertions(+), 7 deletions(-)
diff --git a/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml
index 97e0876..36593e1 100644
--- a/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml
@@ -28,6 +28,20 @@
ItemTemplate="{StaticResource PandaTemplate}"
ItemContainerTheme="{StaticResource PandaControlTheme}">
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Controls/ListBox.axaml b/src/Semi.Avalonia/Controls/ListBox.axaml
index cc06cc2..955c455 100644
--- a/src/Semi.Avalonia/Controls/ListBox.axaml
+++ b/src/Semi.Avalonia/Controls/ListBox.axaml
@@ -11,6 +11,7 @@
Item 4
+
@@ -39,7 +40,6 @@
-
@@ -113,7 +113,6 @@
-
@@ -188,7 +187,8 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
From 8a51f98532d577e783e079634c013eabf8bf53ff Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Mon, 14 Aug 2023 17:05:52 +0800
Subject: [PATCH 38/46] feat: separate resource dictionary.
---
src/Semi.Avalonia/Controls/ListBox.axaml | 158 ++++++++++--------
src/Semi.Avalonia/Themes/Dark/ListBox.axaml | 11 +-
src/Semi.Avalonia/Themes/Light/ListBox.axaml | 10 +-
src/Semi.Avalonia/Themes/Shared/ListBox.axaml | 9 +-
4 files changed, 101 insertions(+), 87 deletions(-)
diff --git a/src/Semi.Avalonia/Controls/ListBox.axaml b/src/Semi.Avalonia/Controls/ListBox.axaml
index 955c455..eb1c353 100644
--- a/src/Semi.Avalonia/Controls/ListBox.axaml
+++ b/src/Semi.Avalonia/Controls/ListBox.axaml
@@ -280,14 +280,15 @@
-
+
-
-
-
-
+
+
+
+
@@ -342,16 +345,16 @@
-
+
-
+
-
-
+
+
-
+
@@ -395,8 +398,8 @@
ContentTemplate="{TemplateBinding ContentTemplate}"
Foreground="{TemplateBinding Foreground}"
RecognizesAccessKey="True"
- TextElement.FontSize="{DynamicResource RadioButtonFontSize}"
- TextElement.Foreground="{DynamicResource RadioButtonForeground}" />
+ TextElement.FontSize="{DynamicResource ListBoxItemRadioGroupFontSize}"
+ TextElement.Foreground="{DynamicResource ListBoxItemRadioGroupForeground}" />
@@ -404,8 +407,8 @@
@@ -518,13 +531,13 @@
-
+
-
-
-
+
+
+
-
+
diff --git a/src/Semi.Avalonia/Themes/Dark/ListBox.axaml b/src/Semi.Avalonia/Themes/Dark/ListBox.axaml
index f30abc8..a06e53b 100644
--- a/src/Semi.Avalonia/Themes/Dark/ListBox.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/ListBox.axaml
@@ -1,4 +1,5 @@
+
@@ -11,8 +12,9 @@
+
-
+
@@ -40,9 +42,7 @@
-
-
-
+
@@ -50,14 +50,13 @@
+
-
-
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/ListBox.axaml b/src/Semi.Avalonia/Themes/Light/ListBox.axaml
index 038ed4a..080871e 100644
--- a/src/Semi.Avalonia/Themes/Light/ListBox.axaml
+++ b/src/Semi.Avalonia/Themes/Light/ListBox.axaml
@@ -1,4 +1,5 @@
+
@@ -11,6 +12,7 @@
+
@@ -40,9 +42,7 @@
-
-
-
+
@@ -50,15 +50,13 @@
-
+
-
-
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Shared/ListBox.axaml b/src/Semi.Avalonia/Themes/Shared/ListBox.axaml
index 8cb6391..8ef49a9 100644
--- a/src/Semi.Avalonia/Themes/Shared/ListBox.axaml
+++ b/src/Semi.Avalonia/Themes/Shared/ListBox.axaml
@@ -1,16 +1,16 @@
+
8 4
3
+
16
6
14
0 2 8 0
-
-
3
- 3
+
3
600
@@ -22,8 +22,7 @@
12
14
+
16 12
-
3
-
\ No newline at end of file
From a1e17b0e199d0a37dc9857858fc6dcaa54743cc8 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Mon, 14 Aug 2023 17:25:40 +0800
Subject: [PATCH 39/46] feat: description.
---
src/Semi.Avalonia/Themes/Dark/RadioButton.axaml | 7 +++----
src/Semi.Avalonia/Themes/Light/RadioButton.axaml | 8 +++-----
src/Semi.Avalonia/Themes/Shared/RadioButton.axaml | 5 +++--
3 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/src/Semi.Avalonia/Themes/Dark/RadioButton.axaml b/src/Semi.Avalonia/Themes/Dark/RadioButton.axaml
index f0a77ac..d4f2811 100644
--- a/src/Semi.Avalonia/Themes/Dark/RadioButton.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/RadioButton.axaml
@@ -1,4 +1,5 @@
+
@@ -20,7 +21,6 @@
-
@@ -29,7 +29,7 @@
-
+
@@ -37,14 +37,13 @@
+
-
-
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/RadioButton.axaml b/src/Semi.Avalonia/Themes/Light/RadioButton.axaml
index 97225ac..935597a 100644
--- a/src/Semi.Avalonia/Themes/Light/RadioButton.axaml
+++ b/src/Semi.Avalonia/Themes/Light/RadioButton.axaml
@@ -1,4 +1,5 @@
+
@@ -20,7 +21,6 @@
-
@@ -29,7 +29,7 @@
-
+
@@ -37,15 +37,13 @@
-
+
-
-
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Shared/RadioButton.axaml b/src/Semi.Avalonia/Themes/Shared/RadioButton.axaml
index df34b02..e3cefaa 100644
--- a/src/Semi.Avalonia/Themes/Shared/RadioButton.axaml
+++ b/src/Semi.Avalonia/Themes/Shared/RadioButton.axaml
@@ -1,10 +1,11 @@
+
16
6
14
0 2 8 0
-
+
3
3
@@ -19,7 +20,7 @@
12
14
+
16 12
-
3
\ No newline at end of file
From 430a7e56ca6923c16561bf5c0d5243b9f2d2da30 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Mon, 14 Aug 2023 18:49:33 +0800
Subject: [PATCH 40/46] feat: ListBox demo.
---
.../Pages/ListBoxDemo.axaml | 131 +++++++++++++-----
.../Pages/ListBoxDemo.axaml.cs | 15 +-
2 files changed, 98 insertions(+), 48 deletions(-)
diff --git a/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml
index 36593e1..87af391 100644
--- a/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml
@@ -8,40 +8,103 @@
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+ Avalonia
+ WPF
+
+
+
+
+
+
+
+
+
+ Avalonia
+ WPF
+
+
+
+
+
+ Small 1
+ Small 2
+
+
+
+
+ Small 1
+ Small 2
+
+
+
+
+
+
+ Default 1
+ Default 2
+
+
+
+
+ Default 1
+ Default 2
+
+
+
+
+
+
+ Small 1
+ Small 2
+
+
+
+
+ Small 1
+ Small 2
+
+
+
+
+
+
+ Avalonia
+ WPF
+
+
+
+
+ Avalonia
+ WPF
+
+
+
+
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml.cs
index 14734e0..2eb3e7d 100644
--- a/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml.cs
+++ b/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml.cs
@@ -11,18 +11,5 @@ public partial class ListBoxDemo : UserControl
InitializeComponent();
}
- public IEnumerable Items { get; set; } = new List
- {
- new() { Name = "Ding", IsAvailable = true },
- new() { Name = "Otter", IsAvailable = true },
- new() { Name = "Husky", IsAvailable = false },
- new() { Name = "Mr.17", IsAvailable = true },
- new() { Name = "Cass", IsAvailable = true },
- };
-}
-
-internal record Panda
-{
- public string Name { get; set; }
- public bool IsAvailable { get; set; }
+ public IEnumerable Items { get; set; } = new List { "Ding", "Otter", "Husky", "Mr.17", "Cass", };
}
\ No newline at end of file
From 6a4065f3b77a560dbe25f8176b191afb27cd94a6 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Wed, 16 Aug 2023 18:02:27 +0800
Subject: [PATCH 41/46] feat: CheckGroup.
---
.../Pages/ListBoxDemo.axaml | 47 +-
src/Semi.Avalonia/Controls/ListBox.axaml | 402 ++++++++++++++++++
2 files changed, 448 insertions(+), 1 deletion(-)
diff --git a/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml
index 87af391..7eda663 100644
--- a/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml
@@ -8,8 +8,13 @@
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
+
+
+
-
+
+
+
+
+
+
+
+ Avalonia
+ WPF
+
+
+
+ Avalonia
+ WPF
+
+
+
+ Avalonia
+ WPF
+
+
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Controls/ListBox.axaml b/src/Semi.Avalonia/Controls/ListBox.axaml
index eb1c353..c4451a3 100644
--- a/src/Semi.Avalonia/Controls/ListBox.axaml
+++ b/src/Semi.Avalonia/Controls/ListBox.axaml
@@ -91,6 +91,7 @@
+
@@ -594,4 +595,405 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
From 29dce1de5152d08f74a654a7e008b1a1f24a4363 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Wed, 16 Aug 2023 20:50:51 +0800
Subject: [PATCH 42/46] feat: transform style resources.
---
src/Semi.Avalonia/Controls/ListBox.axaml | 195 +++++++++---------
src/Semi.Avalonia/Themes/Dark/ListBox.axaml | 35 ++++
src/Semi.Avalonia/Themes/Light/ListBox.axaml | 35 ++++
src/Semi.Avalonia/Themes/Shared/ListBox.axaml | 18 ++
4 files changed, 191 insertions(+), 92 deletions(-)
diff --git a/src/Semi.Avalonia/Controls/ListBox.axaml b/src/Semi.Avalonia/Controls/ListBox.axaml
index c4451a3..d7634af 100644
--- a/src/Semi.Avalonia/Controls/ListBox.axaml
+++ b/src/Semi.Avalonia/Controls/ListBox.axaml
@@ -610,12 +610,12 @@
-
-
+
+
-
-
-
+
+
+
+ Width="{DynamicResource ListBoxItemCheckBoxGlyphWidth}"
+ Height="{DynamicResource ListBoxItemCheckBoxGlyphHeight}"
+ Foreground="{DynamicResource ListBoxItemCheckGlyphFill}" />
@@ -783,11 +787,11 @@
-
-
-
+
+
+
-
+
+ Width="{DynamicResource ListBoxItemCheckBoxGlyphWidth}"
+ Height="{DynamicResource ListBoxItemCheckBoxGlyphHeight}"
+ Foreground="{DynamicResource ListBoxItemCheckGlyphFill}" />
@@ -929,12 +938,12 @@
-
-
-
-
+
+
+
+
-
+
diff --git a/src/Semi.Avalonia/Themes/Dark/ListBox.axaml b/src/Semi.Avalonia/Themes/Dark/ListBox.axaml
index a06e53b..eabaf20 100644
--- a/src/Semi.Avalonia/Themes/Dark/ListBox.axaml
+++ b/src/Semi.Avalonia/Themes/Dark/ListBox.axaml
@@ -59,4 +59,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Light/ListBox.axaml b/src/Semi.Avalonia/Themes/Light/ListBox.axaml
index 080871e..553ad5f 100644
--- a/src/Semi.Avalonia/Themes/Light/ListBox.axaml
+++ b/src/Semi.Avalonia/Themes/Light/ListBox.axaml
@@ -59,4 +59,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Semi.Avalonia/Themes/Shared/ListBox.axaml b/src/Semi.Avalonia/Themes/Shared/ListBox.axaml
index 8ef49a9..4a86ea2 100644
--- a/src/Semi.Avalonia/Themes/Shared/ListBox.axaml
+++ b/src/Semi.Avalonia/Themes/Shared/ListBox.axaml
@@ -25,4 +25,22 @@
16 12
3
+
+
+ 14
+ 16
+ 16
+ 10
+ 10
+
+ 3
+ 1
+
+ M17.4111 7.30848C18.0692 7.81171 18.1947 8.75312 17.6915 9.41119L11.1915 17.9112C10.909 18.2806 10.4711 18.4981 10.0061 18.5C9.54105 18.5019 9.10143 18.288 8.81592 17.9209L5.31592 13.4209C4.80731 12.767 4.92512 11.8246 5.57904 11.316C6.23296 10.8074 7.17537 10.9252 7.68398 11.5791L9.98988 14.5438L15.3084 7.58884C15.8116 6.93077 16.7531 6.80525 17.4111 7.30848Z
+ M5 12.5C5 11.6716 5.67157 11 6.5 11H17.5C18.3284 11 19 11.6716 19 12.5C19 13.3284 18.3284 14 17.5 14H6.5C5.67157 14 5 13.3284 5 12.5Z
+
+
+ 1
+ 16
+ 3
\ No newline at end of file
From a2927266b43cde6c9d5ed1fecb342b9451799772 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Wed, 16 Aug 2023 21:04:30 +0800
Subject: [PATCH 43/46] feat: description.
---
.../Pages/ListBoxDemo.axaml | 29 +++++++++++--------
1 file changed, 17 insertions(+), 12 deletions(-)
diff --git a/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml
index 7eda663..bd7442f 100644
--- a/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml
@@ -5,14 +5,9 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Semi.Avalonia.Demo.Pages"
- d:DesignHeight="450"
+ d:DesignHeight="900"
d:DesignWidth="800"
mc:Ignorable="d">
-
-
-
+
Avalonia
@@ -35,14 +31,16 @@
Theme="{DynamicResource GroupBox}"
Header="RadioGroupListBox">
+
- Avalonia
- WPF
+ Avalonia
+ WPF
+
@@ -95,6 +93,7 @@
+
@@ -102,11 +101,12 @@
WPF
+
- Avalonia
- WPF
+ Avalonia
+ WPF
@@ -117,6 +117,7 @@
Header="CheckGroupListBox">
+
Avalonia
WPF
+
+
- Avalonia
- WPF
+ Avalonia
+ WPF
+
+
Date: Wed, 16 Aug 2023 23:28:16 +0800
Subject: [PATCH 44/46] feat: remove PureCardCheckGroupListBox because of
duplication.
---
.../Pages/ListBoxDemo.axaml | 12 ---
src/Semi.Avalonia/Controls/ListBox.axaml | 77 -------------------
2 files changed, 89 deletions(-)
diff --git a/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml
index bd7442f..ef6059e 100644
--- a/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml
@@ -140,18 +140,6 @@
Avalonia
WPF
-
-
-
-
- Avalonia
- WPF
-
diff --git a/src/Semi.Avalonia/Controls/ListBox.axaml b/src/Semi.Avalonia/Controls/ListBox.axaml
index d7634af..cb0be3e 100644
--- a/src/Semi.Avalonia/Controls/ListBox.axaml
+++ b/src/Semi.Avalonia/Controls/ListBox.axaml
@@ -930,81 +930,4 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
From d01f39e20d1c79770bb106c9bb4030ee59764d38 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Tue, 29 Aug 2023 23:46:57 +0800
Subject: [PATCH 45/46] misc: label order.
---
.../Semi.Avalonia.Demo/Pages/FlyoutDemo.axaml | 24 ++--
.../Pages/SelectableTextBlock.axaml | 2 +
src/Semi.Avalonia/Themes/Light/Label.axaml | 120 +++++++++---------
3 files changed, 74 insertions(+), 72 deletions(-)
diff --git a/demo/Semi.Avalonia.Demo/Pages/FlyoutDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/FlyoutDemo.axaml
index e7feb7e..c0960d3 100644
--- a/demo/Semi.Avalonia.Demo/Pages/FlyoutDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/FlyoutDemo.axaml
@@ -129,22 +129,22 @@
-
-
-
-
-
-
-
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml b/demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml
index 0de5617..90fa98f 100644
--- a/demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml
@@ -16,6 +16,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
From d54e4ab2b733c19e3a35d7d15ea74368fb918f41 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Wed, 30 Aug 2023 00:13:26 +0800
Subject: [PATCH 46/46] misc: extract App.axaml; Android demo display label.
---
demo/Semi.Avalonia.Demo.Android/App.axaml | 11 ---------
.../MainActivity.cs | 10 +++++---
.../Views/MainView.axaml | 11 ---------
.../Views/MainView.axaml.cs | 18 --------------
demo/Semi.Avalonia.Demo.Desktop/App.axaml | 13 ----------
demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs | 23 ------------------
demo/Semi.Avalonia.Demo.Drm/App.axaml | 13 ----------
demo/Semi.Avalonia.Demo.Drm/App.axaml.cs | 24 -------------------
demo/Semi.Avalonia.Demo.Web/App.axaml.cs | 23 ------------------
.../App.axaml | 2 +-
.../App.axaml.cs | 16 +++++++------
11 files changed, 17 insertions(+), 147 deletions(-)
delete mode 100644 demo/Semi.Avalonia.Demo.Android/App.axaml
delete mode 100644 demo/Semi.Avalonia.Demo.Android/Views/MainView.axaml
delete mode 100644 demo/Semi.Avalonia.Demo.Android/Views/MainView.axaml.cs
delete mode 100644 demo/Semi.Avalonia.Demo.Desktop/App.axaml
delete mode 100644 demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs
delete mode 100644 demo/Semi.Avalonia.Demo.Drm/App.axaml
delete mode 100644 demo/Semi.Avalonia.Demo.Drm/App.axaml.cs
delete mode 100644 demo/Semi.Avalonia.Demo.Web/App.axaml.cs
rename demo/{Semi.Avalonia.Demo.Web => Semi.Avalonia.Demo}/App.axaml (91%)
rename demo/{Semi.Avalonia.Demo.Android => Semi.Avalonia.Demo}/App.axaml.cs (53%)
diff --git a/demo/Semi.Avalonia.Demo.Android/App.axaml b/demo/Semi.Avalonia.Demo.Android/App.axaml
deleted file mode 100644
index 6387ef8..0000000
--- a/demo/Semi.Avalonia.Demo.Android/App.axaml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo.Android/MainActivity.cs b/demo/Semi.Avalonia.Demo.Android/MainActivity.cs
index d037305..03b691f 100644
--- a/demo/Semi.Avalonia.Demo.Android/MainActivity.cs
+++ b/demo/Semi.Avalonia.Demo.Android/MainActivity.cs
@@ -4,9 +4,13 @@ using Avalonia.Android;
namespace Semi.Avalonia.Demo.Android;
-[Activity(Label = "Semi.Avalonia.Demo.Android", Icon = "@drawable/Icon", MainLauncher = true, Theme = "@style/MyTheme.NoActionBar",
- LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)]
+[Activity(
+ Label = "Semi.Avalonia",
+ Theme = "@style/MyTheme.NoActionBar",
+ Icon = "@drawable/Icon",
+ MainLauncher = true,
+ LaunchMode = LaunchMode.SingleTop,
+ ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)]
public class MainActivity : AvaloniaMainActivity
{
-
}
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo.Android/Views/MainView.axaml b/demo/Semi.Avalonia.Demo.Android/Views/MainView.axaml
deleted file mode 100644
index 250500b..0000000
--- a/demo/Semi.Avalonia.Demo.Android/Views/MainView.axaml
+++ /dev/null
@@ -1,11 +0,0 @@
-
- Welcome to Avalonia!
-
diff --git a/demo/Semi.Avalonia.Demo.Android/Views/MainView.axaml.cs b/demo/Semi.Avalonia.Demo.Android/Views/MainView.axaml.cs
deleted file mode 100644
index dfc7f2d..0000000
--- a/demo/Semi.Avalonia.Demo.Android/Views/MainView.axaml.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using Avalonia;
-using Avalonia.Controls;
-using Avalonia.Markup.Xaml;
-
-namespace Semi.Avalonia.Demo.Android.Views;
-
-public partial class MainView : UserControl
-{
- public MainView()
- {
- InitializeComponent();
- }
-
- private void InitializeComponent()
- {
- AvaloniaXamlLoader.Load(this);
- }
-}
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo.Desktop/App.axaml b/demo/Semi.Avalonia.Demo.Desktop/App.axaml
deleted file mode 100644
index c12b782..0000000
--- a/demo/Semi.Avalonia.Demo.Desktop/App.axaml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs b/demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs
deleted file mode 100644
index d5fe94a..0000000
--- a/demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using Avalonia;
-using Avalonia.Controls.ApplicationLifetimes;
-using Avalonia.Markup.Xaml;
-using Semi.Avalonia.Demo.Views;
-
-namespace Semi.Avalonia.Demo.Desktop;
-
-public partial class App : Application
-{
- public override void Initialize()
- {
- AvaloniaXamlLoader.Load(this);
- }
-
- public override void OnFrameworkInitializationCompleted()
- {
- if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
- {
- desktop.MainWindow = new MainWindow();
- }
- base.OnFrameworkInitializationCompleted();
- }
-}
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo.Drm/App.axaml b/demo/Semi.Avalonia.Demo.Drm/App.axaml
deleted file mode 100644
index d4ceb6d..0000000
--- a/demo/Semi.Avalonia.Demo.Drm/App.axaml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo.Drm/App.axaml.cs b/demo/Semi.Avalonia.Demo.Drm/App.axaml.cs
deleted file mode 100644
index f436ee6..0000000
--- a/demo/Semi.Avalonia.Demo.Drm/App.axaml.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using Avalonia;
-using Avalonia.Controls.ApplicationLifetimes;
-using Avalonia.Markup.Xaml;
-using Semi.Avalonia.Demo.Views;
-
-namespace Semi.Avalonia.Demo.Drm
-{
- public partial class App : Application
- {
- public override void Initialize()
- {
- AvaloniaXamlLoader.Load(this);
- }
-
- public override void OnFrameworkInitializationCompleted()
- {
- if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
- desktop.MainWindow = new MainWindow();
- else if (ApplicationLifetime is ISingleViewApplicationLifetime singleView)
- singleView.MainView = new MainView();
- base.OnFrameworkInitializationCompleted();
- }
- }
-}
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo.Web/App.axaml.cs b/demo/Semi.Avalonia.Demo.Web/App.axaml.cs
deleted file mode 100644
index 5638d50..0000000
--- a/demo/Semi.Avalonia.Demo.Web/App.axaml.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using Avalonia;
-using Avalonia.Controls.ApplicationLifetimes;
-using Avalonia.Markup.Xaml;
-using Semi.Avalonia.Demo.Views;
-
-namespace Semi.Avalonia.Demo.Web;
-
-public partial class App : Application
-{
- public override void Initialize()
- {
- AvaloniaXamlLoader.Load(this);
- }
-
- public override void OnFrameworkInitializationCompleted()
- {
- if (ApplicationLifetime is ISingleViewApplicationLifetime singleViewPlatform)
- {
- singleViewPlatform.MainView = new MainView();
- }
- base.OnFrameworkInitializationCompleted();
- }
-}
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo.Web/App.axaml b/demo/Semi.Avalonia.Demo/App.axaml
similarity index 91%
rename from demo/Semi.Avalonia.Demo.Web/App.axaml
rename to demo/Semi.Avalonia.Demo/App.axaml
index 6b850fc..07879bb 100644
--- a/demo/Semi.Avalonia.Demo.Web/App.axaml
+++ b/demo/Semi.Avalonia.Demo/App.axaml
@@ -1,5 +1,5 @@
diff --git a/demo/Semi.Avalonia.Demo.Android/App.axaml.cs b/demo/Semi.Avalonia.Demo/App.axaml.cs
similarity index 53%
rename from demo/Semi.Avalonia.Demo.Android/App.axaml.cs
rename to demo/Semi.Avalonia.Demo/App.axaml.cs
index e68f7de..399c279 100644
--- a/demo/Semi.Avalonia.Demo.Android/App.axaml.cs
+++ b/demo/Semi.Avalonia.Demo/App.axaml.cs
@@ -1,10 +1,9 @@
using Avalonia;
-using Avalonia.Controls;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
using Semi.Avalonia.Demo.Views;
-namespace Semi.Avalonia.Demo.Android;
+namespace Semi.Avalonia.Demo;
public partial class App : Application
{
@@ -15,13 +14,16 @@ public partial class App : Application
public override void OnFrameworkInitializationCompleted()
{
- if (ApplicationLifetime is ISingleViewApplicationLifetime single)
+ switch (ApplicationLifetime)
{
- single.MainView = new MainView()
- {
-
- };
+ case IClassicDesktopStyleApplicationLifetime desktop:
+ desktop.MainWindow = new MainWindow();
+ break;
+ case ISingleViewApplicationLifetime singleView:
+ singleView.MainView = new MainView();
+ break;
}
+
base.OnFrameworkInitializationCompleted();
}
}
\ No newline at end of file