Compare commits

...

56 Commits

Author SHA1 Message Date
Zhang Dian
ac3dc1bbff misc: update .editorconfig to use UTF-8 without BOM. 2026-01-19 20:47:11 +08:00
Zhang Dian
9873d85603 misc: add .editorconfig. 2026-01-19 16:19:53 +08:00
Zhang Dian
4ef1520e64 fix: remove inline text decorations from Popup styles. 2026-01-16 17:40:11 +08:00
Dong Bin
5e751ccdbb Disable scroll chaining in AutoCompleteBox popup. (#716)
* feat: disable scroll chaining in popup.

* feat: disable scroll chaining in MenuScrollViewer
2026-01-09 15:45:00 +08:00
Dong Bin
13dcdbdd07 chore: mark old versions as EOL. (#715) 2026-01-04 23:42:51 +08:00
Zhang Dian
185fe8c984 fix: fix the reference version of TDG. 2025-12-30 16:33:43 +08:00
Zhang Dian
622c8c23b7 ci: add adroid workload. 2025-12-30 16:04:07 +08:00
Zhang Dian
104ba2f1f4 misc: bump version. 2025-12-30 15:26:35 +08:00
Zhang Dian
4895d2f51b fix: ClearButton shouble not be focusable. 2025-12-29 16:02:00 +08:00
Shatyuka
414736443d fix: controls under TextBox inheriting Ibeam cursor (#710) 2025-12-22 19:32:57 +08:00
Copilot
65d2f88cab Make DataGrid cell grid lines use dynamic resources for thickness (#666)
* Initial plan

* Implement dynamic resources for DataGrid grid line thickness and color

Co-authored-by: rabbitism <14807942+rabbitism@users.noreply.github.com>

* Revert DynamicResource to StaticResource for DataGridLineBrush in theme files

Co-authored-by: rabbitism <14807942+rabbitism@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rabbitism <14807942+rabbitism@users.noreply.github.com>
2025-12-16 17:08:07 +08:00
Zhang Dian
0a622772f4 ci: specify project path for dotnet restore in publish.yml. 2025-12-10 15:11:49 +08:00
Dong Bin
5ef8f7ddaf fix: replace icon resource include with semi:Icons in Index.axaml (#707) 2025-12-09 16:06:04 +08:00
Zhang Dian
ba9dd0a574 chore: turn on CPM & slnx. 2025-12-09 13:58:01 +08:00
Dong Bin
f784a2c927 fix: try to fix wasm deployment issue. (#698) 2025-11-17 11:23:45 +08:00
Zhang Dian
69cc9b9ca3 misc: bump version. 2025-11-15 15:18:45 +08:00
Zhang Dian
9226858cda misc: bump version. 2025-11-15 14:58:50 +08:00
Copilot
7f81aa3bde Sync upstream: Move ContentPresenter.RecognizesAccessKey to style setters (#696)
* Initial plan

* Move ContentPresenter.RecognizeAccessKey from local value to style

Co-authored-by: rabbitism <14807942+rabbitism@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rabbitism <14807942+rabbitism@users.noreply.github.com>
2025-11-12 20:08:34 +08:00
Dong Bin
bc37be16ac Merge pull request #695 from irihitech/AITag
Add AI style - Colorful & Gradient to TagLabel
2025-11-11 21:34:04 +08:00
Zhang Dian
7a831d35f7 feat: add AI style - Colorful & Gradient to TagLabel. 2025-11-11 19:06:17 +08:00
Dong Bin
5f8357ecbc Merge pull request #694 from irihitech/AIButton
add AI style - Colorful Button
2025-11-11 16:07:11 +08:00
Zhang Dian
4c7caa6dbf misc: revert SplitButton. 2025-11-11 15:50:32 +08:00
Zhang Dian
445b31893e feat: enhance button styles with AI Colorful classes and update ButtonDemo layout. 2025-11-11 15:20:36 +08:00
Zhang Dian
301a4e954c fix: NEW -> New. 2025-11-05 13:27:23 +08:00
Zhang Dian
dc80578c53 feat: add "NEW" label for AI Icons in IconDemo. 2025-11-05 13:24:21 +08:00
Zhang Dian
6c8825b3df Add AI icons & Excel, PDF, Word icons (#691)
* feat: add AI-related icons.

* feat: add AI icons to IconDemo and update view model.

* feat: rename icon files and update resource includes for consistency.

* feat: refactor IconDemo to use dynamic tab control for icons.

* fix: Filled Icons -> Fill Icons.

* misc: remove commas in icon Path.

* feat: add Excel, PDF, and Word icons.
2025-11-05 12:55:01 +08:00
Zhang Dian
aa105337fa Merge pull request #690 from irihitech/typo
PointerOver -> Pointerover
2025-11-04 14:53:17 +08:00
Copilot
f92b5f4373 Add AI-related color resources to theme palette and demo (#689)
* Initial plan

* Add AI-related color resources for Light and Dark themes

Co-authored-by: rabbitism <14807942+rabbitism@users.noreply.github.com>

* Fix gradient angle to correctly represent 278 degrees

Co-authored-by: rabbitism <14807942+rabbitism@users.noreply.github.com>

* Fix gradient angle and add AI resources to palette demo

Co-authored-by: rabbitism <14807942+rabbitism@users.noreply.github.com>

* Add AI General gradients section to palette demo UI

Co-authored-by: rabbitism <14807942+rabbitism@users.noreply.github.com>

* feat: unify gradient initialization.

* feat: add AI-related color resources for Light and Dark themes.

* feat: add AI-related color tokens to ColorTokens and PaletteDemo

* Rename AI token names from Ai to AI (capital)

Co-authored-by: rabbitism <14807942+rabbitism@users.noreply.github.com>

* fix: fix AI-related color tokens names.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rabbitism <14807942+rabbitism@users.noreply.github.com>
Co-authored-by: Dong Bin <popmessiah@hotmail.com>
Co-authored-by: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
2025-11-03 15:18:49 +08:00
Dong Bin
bbff875d9c Merge pull request #684 from irihitech/copilot/update-readme-compatibility
Update README to indicate 11.3.7 is only compatible with Avalonia 11.3.7
2025-10-19 19:58:04 +08:00
copilot-swe-agent[bot]
df75863ac5 Add version 11.3.7 to README compatibility tables
Co-authored-by: rabbitism <14807942+rabbitism@users.noreply.github.com>
2025-10-19 11:53:54 +00:00
copilot-swe-agent[bot]
c04e5e8579 Initial plan 2025-10-19 11:51:45 +00:00
Dong Bin
9fca51b30d Merge pull request #681 from irihitech/fix-679
Using ResourceDictionary.SetItems to improve Locale switching
2025-10-17 07:25:19 +08:00
Zhang Dian
0ea632437d fix: fix copilot comment. 2025-10-16 16:12:40 +08:00
Zhang Dian
c0277a7004 feat: using ResourceDictionary.SetItems to improve Locale switching. 2025-10-16 15:28:45 +08:00
Zhang Dian
2c527dc598 fix: fix README badges for ColorPicker, DataGrid, and TreeDataGrid. 2025-10-09 19:54:35 +08:00
Copilot
ab2cef9dc4 Add README files to NuGet packages (#677)
* Initial plan

* Add README files to NuGet packages for Semi.Avalonia, Semi.Avalonia.DataGrid, and Semi.Avalonia.ColorPicker

Co-authored-by: rabbitism <14807942+rabbitism@users.noreply.github.com>

* Restore Package.props import to reduce code duplication

Co-authored-by: rabbitism <14807942+rabbitism@users.noreply.github.com>

* Add README file to Semi.Avalonia.TreeDataGrid package

Co-authored-by: zdpcdt <54255897+zdpcdt@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rabbitism <14807942+rabbitism@users.noreply.github.com>
Co-authored-by: zdpcdt <54255897+zdpcdt@users.noreply.github.com>
2025-10-09 19:47:10 +08:00
Dong Bin
86daf6b428 Merge pull request #675 from zdpcdt/android
Upgrade to .NET 9.0 for Android and fix Fonts issue.
2025-10-07 17:21:20 +08:00
Zhang Dian
8f7cdf52b4 feat: upgrade to .NET 9.0 for Android and fix Fonts issue. 2025-10-07 15:35:12 +08:00
Zhang Dian
176430f95f fix: fix web demo issue#674.
upgrade web demo to .NET 9.0 and update GitHub Actions to use checkout@v5.
2025-10-07 13:20:31 +08:00
Zhang Dian
1062175204 misc: bump version. 2025-10-04 11:33:54 +08:00
Zhang Dian
0dda40d322 Merge pull request #672 from irihitech/split
ready for Avalonia 11.3.7
2025-10-04 11:30:33 +08:00
Zhang Dian
37feb8a9a7 feat: set HorizontalAlignment to Stretch for PanelPlacementSelector in SplitViewDemo. 2025-10-04 11:21:42 +08:00
Zhang Dian
c632c6c1f5 feat: upgrade Avalonia.Controls.DataGrid to 11.3.7. 2025-10-04 11:19:25 +08:00
Zhang Dian
be2b25a94b feat: implement IsEditable for ComboBox. 2025-10-04 11:11:07 +08:00
rabbitism
47c6899b94 fix: fix copilot comments. 2025-10-04 10:58:32 +08:00
rabbitism
975d14a36f feat: upgrade to 11.3.7, implement splitview changes. 2025-10-04 10:48:38 +08:00
Dong Bin
7a13de00a6 Merge pull request #669 from irihitech/trayicon
Designed a new TrayIcon and NativeMenu for macOS
2025-09-29 15:29:50 +08:00
Zhang Dian
f7ce4aef30 feat: update application icons for Android and Desktop projects. 2025-09-29 01:33:53 +08:00
Zhang Dian
f9a85734d1 feat: add Activate command to ApplicationViewModel and bind to TrayIcon. 2025-09-29 01:33:18 +08:00
Zhang Dian
9dd846f6be feat: add JumpTo functionality in ApplicationViewModel and integrate with menu. 2025-09-28 18:11:55 +08:00
Zhang Dian
5384de7b23 feat: update TrayIcon in macOS. 2025-09-28 16:29:02 +08:00
Dong Bin
7ccb6fd41a Merge pull request #668 from irihitech/clean
Reduce compile warning count
2025-09-27 14:27:15 +08:00
Zhang Dian
521ed1bd0f misc: reduce publish warning. 2025-09-26 02:10:19 +08:00
Zhang Dian
55d472300e misc: remove x:CompileBindings attribute from multiple XAML files. 2025-09-26 02:10:16 +08:00
Dong Bin
a45f50005c Merge pull request #667 from irihitech/variable
Add search functionality to VariablesDemo
2025-09-26 00:14:29 +08:00
Zhang Dian
cd9daf11da feat: add search functionality to VariablesDemo and update layout. 2025-09-25 18:46:24 +08:00
117 changed files with 5414 additions and 2094 deletions

1907
.editorconfig Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@ name: Deploy to GitHub Pages
env: env:
PROJECT_PATH: demo/Semi.Avalonia.Demo.Web/Semi.Avalonia.Demo.Web.csproj PROJECT_PATH: demo/Semi.Avalonia.Demo.Web/Semi.Avalonia.Demo.Web.csproj
OUTPUT_PATH: demo/Semi.Avalonia.Demo.Web/bin/Release/net8.0-browser/publish/wwwroot OUTPUT_PATH: demo/Semi.Avalonia.Demo.Web/bin/Release/net10.0-browser/publish/wwwroot
on: on:
workflow_dispatch: workflow_dispatch:
@@ -11,12 +11,13 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.1.1 uses: actions/checkout@v5
- name: Setup .NET 8 - name: Setup dotnet
uses: actions/setup-dotnet@v4 uses: actions/setup-dotnet@v5
with: with:
dotnet-version: 8.0.x dotnet-version: |
10.0.x
- name: Install wasm-tools - name: Install wasm-tools
run: dotnet workload install wasm-tools run: dotnet workload install wasm-tools

View File

@@ -31,7 +31,7 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.2.2 uses: actions/checkout@v5
- name: Get Version - name: Get Version
run: | run: |

View File

@@ -47,7 +47,7 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.2.2 uses: actions/checkout@v5
- name: Pack Semi.Avalonia - name: Pack Semi.Avalonia
if: ${{ inputs.Semi_Avalonia }} if: ${{ inputs.Semi_Avalonia }}

View File

@@ -75,7 +75,7 @@ jobs:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.2.2 uses: actions/checkout@v5
- name: Publish win-x64 - name: Publish win-x64
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o publish --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o publish --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
- name: Upload a Build Artifact - name: Upload a Build Artifact
@@ -91,7 +91,7 @@ jobs:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.2.2 uses: actions/checkout@v5
- name: Enable Native AOT in .csproj - name: Enable Native AOT in .csproj
run: sed -i 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj run: sed -i 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
- name: Publish win-x64 AOT - name: Publish win-x64 AOT
@@ -109,7 +109,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.2.2 uses: actions/checkout@v5
- name: Publish linux-x64 - name: Publish linux-x64
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r linux-x64 -c Release -o publish --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r linux-x64 -c Release -o publish --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
- name: Upload a Build Artifact - name: Upload a Build Artifact
@@ -125,7 +125,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.2.2 uses: actions/checkout@v5
- name: Enable Native AOT in .csproj - name: Enable Native AOT in .csproj
run: sed -i 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj run: sed -i 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
- name: Publish linux-x64 AOT - name: Publish linux-x64 AOT
@@ -143,7 +143,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.2.2 uses: actions/checkout@v5
- name: Publish linux-x64 DRM - name: Publish linux-x64 DRM
run: dotnet publish demo/Semi.Avalonia.Demo.Drm -r linux-x64 -c Release -o publish --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true run: dotnet publish demo/Semi.Avalonia.Demo.Drm -r linux-x64 -c Release -o publish --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
- name: Upload a Build Artifact - name: Upload a Build Artifact
@@ -159,7 +159,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.2.2 uses: actions/checkout@v5
- name: Enable Native AOT in .csproj - name: Enable Native AOT in .csproj
run: sed -i 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj run: sed -i 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj
- name: Publish linux-x64 AOT - name: Publish linux-x64 AOT
@@ -177,7 +177,7 @@ jobs:
runs-on: macos-latest runs-on: macos-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.2.2 uses: actions/checkout@v5
- name: Publish osx-arm64 - name: Publish osx-arm64
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r osx-arm64 -c Release -o publish --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r osx-arm64 -c Release -o publish --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
- name: Upload a Build Artifact - name: Upload a Build Artifact
@@ -193,7 +193,7 @@ jobs:
runs-on: macos-latest runs-on: macos-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.2.2 uses: actions/checkout@v5
- name: Enable Native AOT in .csproj - name: Enable Native AOT in .csproj
run: sed -i '' 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj run: sed -i '' 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
- name: Publish osx-arm64 AOT - name: Publish osx-arm64 AOT
@@ -211,13 +211,13 @@ jobs:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.2.2 uses: actions/checkout@v5
- name: CD Android - name: Install Android workload
run: cd demo/Semi.Avalonia.Demo.Android run: dotnet workload install android
- name: Restore Dependencies - name: Restore Dependencies
run: dotnet restore run: dotnet restore demo/Semi.Avalonia.Demo.Android
- name: Publish Android - name: Publish Android
run: dotnet publish demo/Semi.Avalonia.Demo.Android -c Release -f net8.0-android --no-restore -o publish /p:RuntimeIdentifier=android-arm64 run: dotnet publish demo/Semi.Avalonia.Demo.Android -c Release -f net10.0-android --no-restore -o publish /p:RuntimeIdentifier=android-arm64
- name: Upload a Build Artifact - name: Upload a Build Artifact
uses: actions/upload-artifact@v4.6.2 uses: actions/upload-artifact@v4.6.2
with: with:

View File

@@ -75,13 +75,12 @@ We offer limited free community support for Semi Avalonia and Ursa. If you have
## Version compatibility ## Version compatibility
| Semi Design Version | Avalonia Version | | Semi Avalonia Version | Avalonia Version |
|:--------------------|:-----------------| |:----------------------|:-----------------|
| 11.2.1 | >=11.2.1 | | 11.3.7 | >=11.3.7 |
| 11.2.0 | 11.2.0 | | 11.2.1 | >=11.2.1 |
| 11.1.0 | >=11.1.0 | | 11.2.0 | End of Life |
| 11.0.7 | >=11.0.7 | | 11.1.x | End of Life |
| 11.0.1 | <=11.0.6 |
## Credits ## Credits

View File

@@ -75,13 +75,12 @@ dotnet add package Semi.Avalonia.AvaloniaEdit
## 版本兼容性 ## 版本兼容性
| Semi Design Version | Avalonia Version | | Semi Avalonia Version | Avalonia Version |
|:--------------------|:-----------------| |:----------------------|:-----------------|
| 11.2.1 | >=11.2.1 | | 11.3.7 | >=11.3.7 |
| 11.2.0 | 11.2.0 | | 11.2.1 | >=11.2.1 |
| 11.1.0 | >=11.1.0 | | 11.2.0 | End of Life |
| 11.0.7 | >=11.0.7 | | 11.1.x | End of Life |
| 11.0.1 | <=11.0.6 |
## 致谢 ## 致谢

View File

@@ -1,99 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32929.385
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semi.Avalonia", "src\Semi.Avalonia\Semi.Avalonia.csproj", "{90D0B063-BC64-40AB-A56C-AC11909CF410}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution Files", "{B1E6A7D4-0AFB-4D32-9969-5FBDAC0CFF3E}"
ProjectSection(SolutionItems) = preProject
demo\Directory.Build.props = demo\Directory.Build.props
demo\global.json = demo\global.json
src\Package.props = src\Package.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHub Action", "GitHub Action", "{318534A1-1CC3-40FB-B4AE-736F94465232}"
ProjectSection(SolutionItems) = preProject
.github\workflows\deploy.yml = .github\workflows\deploy.yml
.github\workflows\pack.yml = .github\workflows\pack.yml
.github\workflows\pack-nightly.yml = .github\workflows\pack-nightly.yml
.github\workflows\publish.yml = .github\workflows\publish.yml
.github\workflows\release-tag.yml = .github\workflows\release-tag.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Demo", "Demo", "{43091528-9509-43CB-A003-9C5C11E96DD6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semi.Avalonia.Demo.Desktop", "demo\Semi.Avalonia.Demo.Desktop\Semi.Avalonia.Demo.Desktop.csproj", "{2ADCA724-2B6D-46EC-87F7-604D7918B89A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semi.Avalonia.Demo.Web", "demo\Semi.Avalonia.Demo.Web\Semi.Avalonia.Demo.Web.csproj", "{69A2C77D-6DB7-4AE4-B179-D1F5CF5E2DF0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semi.Avalonia.Demo", "demo\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj", "{D789AEDB-EBDF-4450-8E8E-B4A03FB257B0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semi.Avalonia.DataGrid", "src\Semi.Avalonia.DataGrid\Semi.Avalonia.DataGrid.csproj", "{8A90C292-8761-4F70-8E1F-EFC097FEADB3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semi.Avalonia.ColorPicker", "src\Semi.Avalonia.ColorPicker\Semi.Avalonia.ColorPicker.csproj", "{0B64C2F2-FDCD-48E4-AB9D-7CCC63B006CA}"
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
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Semi.Avalonia.TreeDataGrid", "src\Semi.Avalonia.TreeDataGrid\Semi.Avalonia.TreeDataGrid.csproj", "{398D2998-0835-41F5-99A3-608CAB8051E2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{90D0B063-BC64-40AB-A56C-AC11909CF410}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{90D0B063-BC64-40AB-A56C-AC11909CF410}.Debug|Any CPU.Build.0 = Debug|Any CPU
{90D0B063-BC64-40AB-A56C-AC11909CF410}.Release|Any CPU.ActiveCfg = Release|Any CPU
{90D0B063-BC64-40AB-A56C-AC11909CF410}.Release|Any CPU.Build.0 = Release|Any CPU
{2ADCA724-2B6D-46EC-87F7-604D7918B89A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2ADCA724-2B6D-46EC-87F7-604D7918B89A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2ADCA724-2B6D-46EC-87F7-604D7918B89A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2ADCA724-2B6D-46EC-87F7-604D7918B89A}.Release|Any CPU.Build.0 = Release|Any CPU
{69A2C77D-6DB7-4AE4-B179-D1F5CF5E2DF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{69A2C77D-6DB7-4AE4-B179-D1F5CF5E2DF0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{69A2C77D-6DB7-4AE4-B179-D1F5CF5E2DF0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{69A2C77D-6DB7-4AE4-B179-D1F5CF5E2DF0}.Release|Any CPU.Build.0 = Release|Any CPU
{D789AEDB-EBDF-4450-8E8E-B4A03FB257B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D789AEDB-EBDF-4450-8E8E-B4A03FB257B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D789AEDB-EBDF-4450-8E8E-B4A03FB257B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D789AEDB-EBDF-4450-8E8E-B4A03FB257B0}.Release|Any CPU.Build.0 = Release|Any CPU
{8A90C292-8761-4F70-8E1F-EFC097FEADB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8A90C292-8761-4F70-8E1F-EFC097FEADB3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8A90C292-8761-4F70-8E1F-EFC097FEADB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8A90C292-8761-4F70-8E1F-EFC097FEADB3}.Release|Any CPU.Build.0 = Release|Any CPU
{0B64C2F2-FDCD-48E4-AB9D-7CCC63B006CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0B64C2F2-FDCD-48E4-AB9D-7CCC63B006CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0B64C2F2-FDCD-48E4-AB9D-7CCC63B006CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0B64C2F2-FDCD-48E4-AB9D-7CCC63B006CA}.Release|Any CPU.Build.0 = Release|Any CPU
{0C81FC1C-5D2D-478A-9876-923A0C85EC2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0C81FC1C-5D2D-478A-9876-923A0C85EC2F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{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
{398D2998-0835-41F5-99A3-608CAB8051E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{398D2998-0835-41F5-99A3-608CAB8051E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{398D2998-0835-41F5-99A3-608CAB8051E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{398D2998-0835-41F5-99A3-608CAB8051E2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{2ADCA724-2B6D-46EC-87F7-604D7918B89A} = {43091528-9509-43CB-A003-9C5C11E96DD6}
{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}
EndGlobalSection
EndGlobal

28
Semi.Avalonia.slnx Normal file
View File

@@ -0,0 +1,28 @@
<Solution>
<Folder Name="/Demo/">
<Project Path="demo/Semi.Avalonia.Demo.Android/Semi.Avalonia.Demo.Android.csproj"/>
<Project Path="demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj"/>
<Project Path="demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj"/>
<Project Path="demo/Semi.Avalonia.Demo.Web/Semi.Avalonia.Demo.Web.csproj"/>
<Project Path="demo/Semi.Avalonia.Demo/Semi.Avalonia.Demo.csproj"/>
</Folder>
<Folder Name="/GitHub Action/">
<File Path=".github/workflows/deploy.yml"/>
<File Path=".github/workflows/pack-nightly.yml"/>
<File Path=".github/workflows/pack.yml"/>
<File Path=".github/workflows/publish.yml"/>
<File Path=".github/workflows/release-tag.yml"/>
</Folder>
<Folder Name="/Solution Items/Demo/">
<File Path="demo/Directory.Packages.props"/>
<File Path="demo/global.json"/>
</Folder>
<Folder Name="/Solution Items/Package/">
<File Path="src/Directory.Packages.props"/>
<File Path="src/Directory.Build.props"/>
</Folder>
<Project Path="src/Semi.Avalonia.ColorPicker/Semi.Avalonia.ColorPicker.csproj"/>
<Project Path="src/Semi.Avalonia.DataGrid/Semi.Avalonia.DataGrid.csproj"/>
<Project Path="src/Semi.Avalonia.TreeDataGrid/Semi.Avalonia.TreeDataGrid.csproj"/>
<Project Path="src/Semi.Avalonia/Semi.Avalonia.csproj"/>
</Solution>

View File

@@ -1,7 +0,0 @@
<Project>
<PropertyGroup>
<AvaloniaVersion>11.3.0</AvaloniaVersion>
<DataGridVersion>11.3.0</DataGridVersion>
<CommunityToolkitVersion>8.4.0</CommunityToolkitVersion>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,27 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<AvaloniaVersion>11.3.10</AvaloniaVersion>
<DataGridVersion>11.3.10</DataGridVersion>
<SkiaSharpVersion>3.119.1</SkiaSharpVersion>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Avalonia" Version="$(AvaloniaVersion)"/>
<PackageVersion Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
<PackageVersion Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
<PackageVersion Include="Avalonia.LinuxFramebuffer" Version="$(AvaloniaVersion)"/>
<PackageVersion Include="Avalonia.iOS" Version="$(AvaloniaVersion)" />
<PackageVersion Include="Avalonia.Browser" Version="$(AvaloniaVersion)" />
<PackageVersion Include="Avalonia.Android" Version="$(AvaloniaVersion)" />
<PackageVersion Include="Avalonia.Controls.ColorPicker" Version="$(AvaloniaVersion)"/>
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="$(DataGridVersion)"/>
<PackageVersion Include="SkiaSharp" Version="$(SkiaSharpVersion)"/>
<PackageVersion Include="SkiaSharp.NativeAssets.WebAssembly" Version="$(SkiaSharpVersion)"/>
<PackageVersion Include="Xamarin.AndroidX.Core.SplashScreen" Version="1.2.0"/>
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.0"/>
<PackageVersion Include="Irihi.Avalonia.Shared" Version="0.3.1"/>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,16 @@
using Avalonia;
using Avalonia.Media;
namespace Semi.Avalonia.Demo.Android;
public static class AvaloniaAppBuilderExtensions
{
private static string DefaultFontFamily => "avares://Semi.Avalonia.Demo.Android/Assets#Source Han Sans CN";
public static AppBuilder WithSourceHanSansCNFont(this AppBuilder builder) =>
builder.With(new FontManagerOptions
{
DefaultFamilyName = DefaultFontFamily,
FontFallbacks = [new FontFallback { FontFamily = new FontFamily(DefaultFontFamily) }]
});
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 717 B

View File

@@ -1,5 +1,6 @@
using Android.App; using Android.App;
using Android.Content.PM; using Android.Content.PM;
using Avalonia;
using Avalonia.Android; using Avalonia.Android;
namespace Semi.Avalonia.Demo.Android; namespace Semi.Avalonia.Demo.Android;
@@ -13,4 +14,9 @@ namespace Semi.Avalonia.Demo.Android;
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)] ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)]
public class MainActivity : AvaloniaMainActivity<App> public class MainActivity : AvaloniaMainActivity<App>
{ {
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
{
return base.CustomizeAppBuilder(builder)
.WithSourceHanSansCNFont();
}
} }

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net8.0-android</TargetFramework> <TargetFramework>net10.0-android</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion> <SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ApplicationId>com.irihitech.Semi.Avalonia</ApplicationId> <ApplicationId>com.irihitech.Semi.Avalonia</ApplicationId>
@@ -14,14 +14,13 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<AndroidResource Include="Icon.png"> <AndroidResource Include="Icon.png" Link="Resources\drawable\Icon.png"/>
<Link>Resources\drawable\Icon.png</Link> <AvaloniaResource Include="..\Fonts\*" Link="Assets\Fonts\%(Filename)%(Extension)" />
</AndroidResource>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia.Android" Version="$(AvaloniaVersion)"/> <PackageReference Include="Avalonia.Android"/>
<PackageReference Include="Xamarin.AndroidX.Core.SplashScreen" Version="1.0.1.1"/> <PackageReference Include="Xamarin.AndroidX.Core.SplashScreen"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -4,6 +4,7 @@
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport> <BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<ApplicationIcon>..\Semi.Avalonia.Demo\Assets\irihi.ico</ApplicationIcon>
<!-- Uncomment below to enable Native AOT compilation--> <!-- Uncomment below to enable Native AOT compilation-->
<!--<PublishAot>true</PublishAot>--> <!--<PublishAot>true</PublishAot>-->
</PropertyGroup> </PropertyGroup>
@@ -22,7 +23,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)"/> <PackageReference Include="Avalonia.Desktop"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -4,6 +4,7 @@
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport> <BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<ApplicationIcon>..\Semi.Avalonia.Demo\Assets\irihi.ico</ApplicationIcon>
<!-- Uncomment below to enable Native AOT compilation--> <!-- Uncomment below to enable Native AOT compilation-->
<!--<PublishAot>true</PublishAot>--> <!--<PublishAot>true</PublishAot>-->
</PropertyGroup> </PropertyGroup>
@@ -22,8 +23,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)"/> <PackageReference Include="Avalonia.Desktop"/>
<PackageReference Include="Avalonia.LinuxFramebuffer" Version="$(AvaloniaVersion)"/> <PackageReference Include="Avalonia.LinuxFramebuffer"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -1,17 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk.WebAssembly"> <Project Sdk="Microsoft.NET.Sdk.WebAssembly">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0-browser</TargetFramework> <TargetFramework>net10.0-browser</TargetFramework>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<AvaloniaResource Include="Assets\**"/> <AvaloniaResource Include="..\Fonts\*" Link="Assets\Fonts\%(Filename)%(Extension)" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia.Browser" Version="$(AvaloniaVersion)"/> <PackageReference Include="Avalonia.Browser"/>
<PackageReference Include="SkiaSharp"/>
<PackageReference Include="SkiaSharp.NativeAssets.WebAssembly"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -1,11 +1,11 @@
<Application <Application
Name="Semi Avalonia Demo"
x:Class="Semi.Avalonia.Demo.App" x:Class="Semi.Avalonia.Demo.App"
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True"
x:DataType="viewModels:ApplicationViewModel"
xmlns:semi="https://irihi.tech/semi" xmlns:semi="https://irihi.tech/semi"
xmlns:viewModels="clr-namespace:Semi.Avalonia.Demo.ViewModels"> xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
x:DataType="vm:ApplicationViewModel">
<Application.Styles> <Application.Styles>
<semi:SemiTheme Locale="zh-CN" /> <semi:SemiTheme Locale="zh-CN" />
<semi:SemiPopupAnimations /> <semi:SemiPopupAnimations />
@@ -20,12 +20,30 @@
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>
</Application.Resources> </Application.Resources>
<NativeMenu.Menu>
<NativeMenu>
<NativeMenuItem
Header="About Us"
Command="{Binding JumpToCommand}"
CommandParameter="{Binding $self.Header}" />
</NativeMenu>
</NativeMenu.Menu>
<TrayIcon.Icons> <TrayIcon.Icons>
<TrayIcons> <TrayIcons>
<TrayIcon Icon="/Assets/irihi.ico" MacOSProperties.IsTemplateIcon="true" ToolTipText="Semi Avalonia Demo"> <TrayIcon
Icon="{OnPlatform Default=/Assets/irihi.ico, macOS=/Assets/irihi2.ico}"
MacOSProperties.IsTemplateIcon="true"
Command="{Binding ActivateCommand}"
ToolTipText="Semi Avalonia Demo">
<TrayIcon.Menu> <TrayIcon.Menu>
<NativeMenu> <NativeMenu>
<NativeMenuItem Header="Exit" Command="{Binding ExitCommand}" /> <NativeMenuItem
Header="About Us"
Command="{Binding JumpToCommand}"
CommandParameter="{Binding $self.Header}" />
<NativeMenuItem
Header="Exit"
Command="{Binding ExitCommand}" />
</NativeMenu> </NativeMenu>
</TrayIcon.Menu> </TrayIcon.Menu>
</TrayIcon> </TrayIcon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 948 B

View File

@@ -79,6 +79,32 @@ public static class ColorTokens
new("SemiColorDangerLightActive", "Danger Light Active") new("SemiColorDangerLightActive", "Danger Light Active")
]; ];
public static IReadOnlyList<Tuple<string, string>> AIGeneralTokens { get; } =
[
new("SemiColorAIGeneral", "AI General"),
new("SemiColorAIGeneralPointerover", "AI General Pointerover"),
new("SemiColorAIGeneralActive", "AI General Active"),
new("SemiColorAIGeneralDisabled", "AI General Disabled")
];
public static IReadOnlyList<Tuple<string, string>> AIPurpleTokens { get; } =
[
new("SemiColorAIPurple", "AI Purple"),
new("SemiColorAIPurplePointerover", "AI Purple Pointerover"),
new("SemiColorAIPurpleActive", "AI Purple Active"),
new("SemiColorAIPurpleDisabled", "AI Purple Disabled")
];
public static IReadOnlyList<Tuple<string, string>> AIBackgroundTokens { get; } =
[
new("SemiColorAIBackgroundBottom", "AI Bottom Background"),
new("SemiColorAIBackgroundBottomPointerover", "AI Bottom Background Pointerover"),
new("SemiColorAIBackgroundBottomActive", "AI Bottom Background Active"),
new("SemiColorAIBackgroundTop", "AI Top Background"),
new("SemiColorAIBackgroundTopPointerover", "AI Top Background Pointerover"),
new("SemiColorAIBackgroundTopActive", "AI Top Background Active"),
];
public static IReadOnlyList<Tuple<string, string>> TextTokens { get; } = public static IReadOnlyList<Tuple<string, string>> TextTokens { get; } =
[ [
new("SemiColorText0", "Text 0"), new("SemiColorText0", "Text 0"),

View File

@@ -92,6 +92,12 @@ public class ColorDetailControl : TemplatedControl
Hex2 = hex2 as string; Hex2 = hex2 as string;
OpacityNumber = brush.Opacity.ToString(CultureInfo.InvariantCulture); OpacityNumber = brush.Opacity.ToString(CultureInfo.InvariantCulture);
} }
else
{
Hex = null;
Hex2 = null;
OpacityNumber = null;
}
} }
public async Task Copy(object o) public async Task Copy(object o)

View File

@@ -8,7 +8,6 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels" xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
x:DataType="vm:AboutUsViewModel" x:DataType="vm:AboutUsViewModel"
x:CompileBindings="True"
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">

View File

@@ -7,7 +7,6 @@
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels" xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
x:CompileBindings="False"
x:DataType="vm:AutoCompleteBoxDemoViewModel" x:DataType="vm:AutoCompleteBoxDemoViewModel"
mc:Ignorable="d"> mc:Ignorable="d">
<Design.DataContext> <Design.DataContext>
@@ -30,40 +29,40 @@
<AutoCompleteBox <AutoCompleteBox
Watermark="Please select a State" Watermark="Please select a State"
ValueMemberBinding="{Binding Name}" /> ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
<AutoCompleteBox <AutoCompleteBox
Classes="Large" Classes="Large"
ValueMemberBinding="{ReflectionBinding Name}" /> ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
<AutoCompleteBox <AutoCompleteBox
Classes="Small" Classes="Small"
ValueMemberBinding="{ReflectionBinding Name}" /> ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
<AutoCompleteBox <AutoCompleteBox
Classes="Bordered" Classes="Bordered"
ValueMemberBinding="{ReflectionBinding Name}" /> ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
<AutoCompleteBox <AutoCompleteBox
IsEnabled="False" IsEnabled="False"
Watermark="Disabled" Watermark="Disabled"
ValueMemberBinding="{ReflectionBinding Name}" /> ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
<AutoCompleteBox <AutoCompleteBox
InnerLeftContent="https://" InnerLeftContent="https://"
InnerRightContent=".com" InnerRightContent=".com"
ValueMemberBinding="{ReflectionBinding Name}" /> ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<AutoCompleteBox <AutoCompleteBox
Width="100" Width="100"
Classes="Large" Classes="Large"
Watermark="Large" Watermark="Large"
ValueMemberBinding="{ReflectionBinding Name}" /> ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
<AutoCompleteBox <AutoCompleteBox
Width="100" Width="100"
Watermark="Default" Watermark="Default"
ValueMemberBinding="{ReflectionBinding Name}" /> ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
<AutoCompleteBox <AutoCompleteBox
Width="100" Width="100"
Classes="Small" Classes="Small"
Watermark="Small" Watermark="Small"
ValueMemberBinding="{ReflectionBinding Name}" /> ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
@@ -71,17 +70,17 @@
Width="100" Width="100"
IsEnabled="False" IsEnabled="False"
Watermark="Disabled" Watermark="Disabled"
ValueMemberBinding="{ReflectionBinding Name}" /> ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
<AutoCompleteBox <AutoCompleteBox
Width="100" Width="100"
Classes="Bordered" Classes="Bordered"
Watermark="Bordered" Watermark="Bordered"
ValueMemberBinding="{ReflectionBinding Name}" /> ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
<AutoCompleteBox <AutoCompleteBox
Width="100" Width="100"
Classes="Bordered" Classes="Bordered"
IsEnabled="False" IsEnabled="False"
ValueMemberBinding="{ReflectionBinding Name}" /> ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>

View File

@@ -6,174 +6,369 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"> mc:Ignorable="d">
<ScrollViewer> <ScrollViewer>
<StackPanel HorizontalAlignment="Left" Spacing="20"> <StackPanel HorizontalAlignment="Left" Spacing="8">
<StackPanel.Styles> <StackPanel.Styles>
<Style Selector="SplitButton"> <Style Selector="SplitButton,DropDownButton,ToggleSplitButton">
<Setter Property="Flyout"> <Setter Property="Button.Flyout">
<MenuFlyout Placement="BottomEdgeAlignedRight"> <MenuFlyout>
<MenuItem Header="Submit All" />
<MenuItem Header="Submit Updated" />
</MenuFlyout>
</Setter>
</Style>
<Style Selector="DropDownButton">
<Setter Property="Flyout">
<MenuFlyout Placement="BottomEdgeAlignedRight">
<MenuItem Header="Submit All" />
<MenuItem Header="Submit Updated" />
</MenuFlyout>
</Setter>
</Style>
<Style Selector="ToggleSplitButton">
<Setter Property="Flyout">
<MenuFlyout Placement="BottomEdgeAlignedRight">
<MenuItem Header="Submit All" /> <MenuItem Header="Submit All" />
<MenuItem Header="Submit Updated" /> <MenuItem Header="Submit Updated" />
</MenuFlyout> </MenuFlyout>
</Setter> </Setter>
</Style> </Style>
</StackPanel.Styles> </StackPanel.Styles>
<HeaderedContentControl
Theme="{StaticResource GroupBox}">
<HeaderedContentControl.Header>
<StackPanel Spacing="8">
<TextBlock Text="Button/RepeatButton Theme" />
<WrapPanel ItemSpacing="4">
<TextBlock Text="Theme:" />
<Label Theme="{StaticResource TagLabel}" Classes="Blue Solid" Content="Light" />
<Label Theme="{StaticResource TagLabel}" Classes="Blue Solid" Content="Solid" />
<Label Theme="{StaticResource TagLabel}" Classes="Blue Solid" Content="Outline" />
<Label Theme="{StaticResource TagLabel}" Classes="Blue Solid" Content="Borderless" />
</WrapPanel>
<WrapPanel ItemSpacing="4">
<TextBlock Text="Classes:" />
<Label Theme="{StaticResource TagLabel}" Classes="Blue" Content="Primary" />
<Label Theme="{StaticResource TagLabel}" Classes="Blue" Content="Secondary" />
<Label Theme="{StaticResource TagLabel}" Classes="Blue" Content="Tertiary" />
<Label Theme="{StaticResource TagLabel}" Classes="Blue" Content="Success" />
<Label Theme="{StaticResource TagLabel}" Classes="Blue" Content="Warning" />
<Label Theme="{StaticResource TagLabel}" Classes="Blue" Content="Danger" />
</WrapPanel>
</StackPanel>
</HeaderedContentControl.Header>
<StackPanel HorizontalAlignment="Left" Spacing="16">
<WrapPanel ItemSpacing="16" LineSpacing="16">
<Button Content="Default" />
<Button Content="Primary" Classes="Primary" />
<Button Content="Secondary" Classes="Secondary" />
<Button Content="Tertiary" Classes="Tertiary" />
<Button Content="Success" Classes="Success" />
<Button Content="Warning" Classes="Warning" />
<Button Content="Danger" Classes="Danger" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<Button Content="Default" Theme="{StaticResource SolidButton}" />
<Button Content="Primary" Classes="Primary" Theme="{StaticResource SolidButton}" />
<Button Content="Secondary" Classes="Secondary" Theme="{StaticResource SolidButton}" />
<Button Content="Tertiary" Classes="Tertiary" Theme="{StaticResource SolidButton}" />
<Button Content="Success" Classes="Success" Theme="{StaticResource SolidButton}" />
<Button Content="Warning" Classes="Warning" Theme="{StaticResource SolidButton}" />
<Button Content="Danger" Classes="Danger" Theme="{StaticResource SolidButton}" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<Button Content="Default" Theme="{StaticResource OutlineButton}" />
<Button Content="Primary" Classes="Primary" Theme="{StaticResource OutlineButton}" />
<Button Content="Secondary" Classes="Secondary" Theme="{StaticResource OutlineButton}" />
<Button Content="Tertiary" Classes="Tertiary" Theme="{StaticResource OutlineButton}" />
<Button Content="Success" Classes="Success" Theme="{StaticResource OutlineButton}" />
<Button Content="Warning" Classes="Warning" Theme="{StaticResource OutlineButton}" />
<Button Content="Danger" Classes="Danger" Theme="{StaticResource OutlineButton}" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<Button Content="Default" Theme="{StaticResource BorderlessButton}" />
<Button Content="Primary" Classes="Primary" Theme="{StaticResource BorderlessButton}" />
<Button Content="Secondary" Classes="Secondary" Theme="{StaticResource BorderlessButton}" />
<Button Content="Tertiary" Classes="Tertiary" Theme="{StaticResource BorderlessButton}" />
<Button Content="Success" Classes="Success" Theme="{StaticResource BorderlessButton}" />
<Button Content="Warning" Classes="Warning" Theme="{StaticResource BorderlessButton}" />
<Button Content="Danger" Classes="Danger" Theme="{StaticResource BorderlessButton}" />
</WrapPanel>
</StackPanel>
</HeaderedContentControl>
<TextBlock>Light (Default)</TextBlock> <HeaderedContentControl
<StackPanel Orientation="Horizontal" Spacing="20"> Theme="{StaticResource GroupBox}"
<Button Classes="Primary">Primary</Button> Header="Prohibited Status">
<Button Classes="Secondary">Secondary</Button> <WrapPanel ItemSpacing="16" LineSpacing="16">
<Button Classes="Tertiary">Tertiary</Button> <Button Content="Light" IsEnabled="False" />
<Button Classes="Success">Success</Button> <Button Content="Solid" IsEnabled="False" Theme="{StaticResource SolidButton}" />
<Button Classes="Warning">Warning</Button> <Button Content="Outline" IsEnabled="False" Theme="{StaticResource OutlineButton}" />
<Button Classes="Danger">Danger</Button> <Button Content="Borderless" IsEnabled="False" Theme="{StaticResource BorderlessButton}" />
<Button Classes="Danger" IsEnabled="False">Disabled</Button> </WrapPanel>
</StackPanel> </HeaderedContentControl>
<TextBlock>Solid</TextBlock>
<StackPanel Orientation="Horizontal" Spacing="20">
<Button Classes="Primary" Theme="{DynamicResource SolidButton}">Primary</Button>
<Button Classes="Secondary" Theme="{DynamicResource SolidButton}">Secondary</Button>
<Button Classes="Tertiary" Theme="{DynamicResource SolidButton}">Tertiary</Button>
<Button Classes="Success" Theme="{DynamicResource SolidButton}">Success</Button>
<Button Classes="Warning" Theme="{DynamicResource SolidButton}">Warning</Button>
<Button Classes="Danger" Theme="{DynamicResource SolidButton}">Danger</Button>
<Button
Classes="Danger"
IsEnabled="False"
Theme="{DynamicResource SolidButton}">
Disabled
</Button>
</StackPanel>
<TextBlock>Outline</TextBlock>
<StackPanel Orientation="Horizontal" Spacing="20">
<Button Classes="Primary" Theme="{DynamicResource OutlineButton}">Primary</Button>
<Button Classes="Secondary" Theme="{DynamicResource OutlineButton}">Secondary</Button>
<Button Classes="Tertiary" Theme="{DynamicResource OutlineButton}">Tertiary</Button>
<Button Classes="Success" Theme="{DynamicResource OutlineButton}">Success</Button>
<Button Classes="Warning" Theme="{DynamicResource OutlineButton}">Warning</Button>
<Button Classes="Danger" Theme="{DynamicResource OutlineButton}">Danger</Button>
<Button Classes="Danger" Theme="{DynamicResource OutlineButton}" IsEnabled="False">Disabled</Button>
</StackPanel>
<TextBlock>Borderless</TextBlock>
<StackPanel Orientation="Horizontal" Spacing="20">
<Button Classes="Primary" Theme="{DynamicResource BorderlessButton}">Primary</Button>
<Button Classes="Secondary" Theme="{DynamicResource BorderlessButton}">Secondary</Button>
<Button Classes="Tertiary" Theme="{DynamicResource BorderlessButton}">Tertiary</Button>
<Button Classes="Success" Theme="{DynamicResource BorderlessButton}">Success</Button>
<Button Classes="Warning" Theme="{DynamicResource BorderlessButton}">Warning</Button>
<Button Classes="Danger" Theme="{DynamicResource BorderlessButton}">Danger</Button>
<Button
Classes="Danger"
IsEnabled="False"
Theme="{DynamicResource BorderlessButton}">
Disabled
</Button>
</StackPanel>
<TextBlock>Disabled</TextBlock>
<StackPanel Background="{DynamicResource SemiColorBackground1}" Orientation="Horizontal" Spacing="20">
<Button IsEnabled="False">Light</Button>
<Button IsEnabled="False" Theme="{DynamicResource SolidButton}">Solid</Button>
<Button IsEnabled="False" Theme="{DynamicResource OutlineButton}">Outline</Button>
<Button IsEnabled="False" Theme="{DynamicResource BorderlessButton}">Borderless</Button>
</StackPanel>
<TextBlock>Size Classes</TextBlock>
<StackPanel Orientation="Horizontal" Spacing="20">
<Button Classes="Primary Small">Small</Button>
<Button Classes="Primary">Default</Button>
<Button Classes="Primary Large">Large</Button>
</StackPanel>
<TextBlock>DropDownButton</TextBlock> <HeaderedContentControl
<StackPanel Orientation="Horizontal" Spacing="8"> Theme="{StaticResource GroupBox}">
<DropDownButton Content="Primary" /> <HeaderedContentControl.Header>
<DropDownButton Classes="Secondary" Content="Secondary" /> <StackPanel Spacing="8">
<DropDownButton Classes="Tertiary" Content="Tertiary" /> <WrapPanel ItemSpacing="4">
<DropDownButton Classes="Success" Content="Success" /> <TextBlock Text="Size Classes:" />
<DropDownButton Classes="Warning" Content="Warning" /> <Label Theme="{StaticResource TagLabel}" Classes="Blue" Content="Large" />
<DropDownButton Classes="Danger" Content="Danger" /> <Label Theme="{StaticResource TagLabel}" Classes="Blue" Content="Small" />
<DropDownButton </WrapPanel>
Classes="Danger" </StackPanel>
Content="Disabled" </HeaderedContentControl.Header>
IsEnabled="False" /> <WrapPanel ItemSpacing="16" LineSpacing="16">
</StackPanel> <Button Content="Large" Classes="Large" />
<StackPanel Orientation="Horizontal" Spacing="8"> <Button Content="Default" />
<DropDownButton Content="Default" Classes="Success" /> <Button Content="Small" Classes="Small" />
<DropDownButton Content="Solid" Theme="{DynamicResource SolidDropDownButton}" Classes="Success" /> </WrapPanel>
<DropDownButton Content="Outline" Theme="{DynamicResource OutlineDropDownButton}" Classes="Success" /> </HeaderedContentControl>
<DropDownButton Content="Borderless" Theme="{DynamicResource BorderlessDropDownButton}" Classes="Success" />
<DropDownButton Content="Default" Classes="Success" IsEnabled="False" />
<DropDownButton Content="Solid" Theme="{DynamicResource SolidDropDownButton}" Classes="Success" IsEnabled="False" />
<DropDownButton Content="Outline" Theme="{DynamicResource OutlineDropDownButton}" Classes="Success" IsEnabled="False" />
<DropDownButton Content="Borderless" Theme="{DynamicResource BorderlessDropDownButton}" Classes="Success" IsEnabled="False" />
</StackPanel>
<StackPanel Orientation="Horizontal" Spacing="8">
<DropDownButton Classes="Small" Content="Small" />
<DropDownButton Content="Default" />
<DropDownButton Classes="Large" Content="Large" />
</StackPanel>
<TextBlock>SplitButton</TextBlock> <HeaderedContentControl
<StackPanel Orientation="Horizontal" Spacing="8"> Theme="{StaticResource GroupBox}">
<SplitButton Content="Primary" /> <HeaderedContentControl.Header>
<SplitButton Classes="Secondary" Content="Secondary" /> <StackPanel Spacing="8">
<SplitButton Classes="Tertiary" Content="Tertiary" /> <TextBlock Text="AI style - Colorful Button" />
<SplitButton Classes="Success" Content="Success" /> <WrapPanel ItemSpacing="4">
<SplitButton Classes="Warning" Content="Warning" /> <TextBlock Text="Theme:" />
<SplitButton Classes="Danger" Content="Danger" /> <Label Theme="{StaticResource TagLabel}" Classes="Colorful Gradient Solid" Content="Light" />
<SplitButton Classes="Danger" Content="Disabled" IsEnabled="False" /> <Label Theme="{StaticResource TagLabel}" Classes="Colorful Gradient Solid" Content="Solid" />
</StackPanel> <Label Theme="{StaticResource TagLabel}" Classes="Colorful Gradient Solid" Content="Outline" />
<StackPanel Orientation="Horizontal" Spacing="8"> <Label Theme="{StaticResource TagLabel}" Classes="Colorful Gradient Solid" Content="Borderless" />
<SplitButton Content="Default" Classes="Success" /> </WrapPanel>
<SplitButton Content="Solid" Theme="{DynamicResource SolidSplitButton}" Classes="Success" /> <WrapPanel ItemSpacing="4">
<SplitButton Content="Outline" Theme="{DynamicResource OutlineSplitButton}" Classes="Success" /> <TextBlock Text="Classes:" />
<SplitButton Content="Borderless" Theme="{DynamicResource BorderlessSplitButton}" Classes="Success" /> <Label Theme="{StaticResource TagLabel}" Classes="Colorful Gradient" Content="Colorful Primary" />
<SplitButton Content="Default" Classes="Success" IsEnabled="False" /> <Label Theme="{StaticResource TagLabel}" Classes="Colorful Gradient" Content="Colorful Tertiary" />
<SplitButton Content="Solid" Theme="{DynamicResource SolidSplitButton}" Classes="Success" IsEnabled="False" /> </WrapPanel>
<SplitButton Content="Outline" Theme="{DynamicResource OutlineSplitButton}" Classes="Success" IsEnabled="False" /> </StackPanel>
<SplitButton Content="Borderless" Theme="{DynamicResource BorderlessSplitButton}" Classes="Success" IsEnabled="False" /> </HeaderedContentControl.Header>
</StackPanel> <StackPanel HorizontalAlignment="Left" Spacing="16">
<StackPanel Orientation="Horizontal" Spacing="8"> <WrapPanel ItemSpacing="16" LineSpacing="16">
<SplitButton Classes="Small" Content="Small" /> <Button Content="Primary" Classes="Colorful Primary" />
<SplitButton Content="Default" /> <Button Content="Tertiary" Classes="Colorful Tertiary" />
<SplitButton Classes="Large" Content="Large" /> <Button Content="Disabled" Classes="Colorful Primary" IsEnabled="False" />
</StackPanel> </WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<Button Content="Primary" Classes="Colorful Primary" Theme="{StaticResource SolidButton}" />
<Button Content="Tertiary" Classes="Colorful Tertiary" Theme="{StaticResource SolidButton}" />
<Button Content="Disabled" Classes="Colorful Primary" Theme="{StaticResource SolidButton}" IsEnabled="False" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<Button Content="Primary" Classes="Colorful Primary" Theme="{StaticResource OutlineButton}" />
<Button Content="Tertiary" Classes="Colorful Tertiary" Theme="{StaticResource OutlineButton}" />
<Button Content="Disabled" Classes="Colorful Primary" Theme="{StaticResource OutlineButton}" IsEnabled="False" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<Button Content="Primary" Classes="Colorful Primary" Theme="{StaticResource BorderlessButton}" />
<Button Content="Tertiary" Classes="Colorful Tertiary" Theme="{StaticResource BorderlessButton}" />
<Button Content="Disabled" Classes="Colorful Primary" Theme="{StaticResource BorderlessButton}" IsEnabled="False" />
</WrapPanel>
</StackPanel>
</HeaderedContentControl>
<TextBlock>ToggleSplitButton</TextBlock> <HeaderedContentControl
<StackPanel Orientation="Horizontal" Spacing="8"> Theme="{StaticResource GroupBox}" Header="DropDownButton">
<ToggleSplitButton Content="Primary" /> <StackPanel HorizontalAlignment="Left" Spacing="16">
<ToggleSplitButton Classes="Secondary" Content="Secondary" /> <WrapPanel ItemSpacing="16" LineSpacing="16">
<ToggleSplitButton Classes="Tertiary" Content="Tertiary" /> <DropDownButton Content="Default" />
<ToggleSplitButton Classes="Success" Content="Success" /> <DropDownButton Content="Primary" Classes="Primary" />
<ToggleSplitButton Classes="Warning" Content="Warning" /> <DropDownButton Content="Secondary" Classes="Secondary" />
<ToggleSplitButton Classes="Danger" Content="Danger" /> <DropDownButton Content="Tertiary" Classes="Tertiary" />
<ToggleSplitButton Classes="Danger" Content="Disabled" IsEnabled="False" /> <DropDownButton Content="Success" Classes="Success" />
</StackPanel> <DropDownButton Content="Warning" Classes="Warning" />
<StackPanel Orientation="Horizontal" Spacing="8"> <DropDownButton Content="Danger" Classes="Danger" />
<ToggleSplitButton Content="Default" Classes="Success" /> </WrapPanel>
<ToggleSplitButton Content="Checked" Classes="Success" IsChecked="True" /> <WrapPanel ItemSpacing="16" LineSpacing="16">
<ToggleSplitButton Content="Default" Classes="Success" IsEnabled="False" /> <DropDownButton Content="Default" Theme="{StaticResource SolidDropDownButton}" />
<ToggleSplitButton Content="Checked" Classes="Success" IsChecked="True" IsEnabled="False" /> <DropDownButton Content="Primary" Classes="Primary" Theme="{StaticResource SolidDropDownButton}" />
</StackPanel> <DropDownButton Content="Secondary" Classes="Secondary" Theme="{StaticResource SolidDropDownButton}" />
<StackPanel Orientation="Horizontal" Spacing="8"> <DropDownButton Content="Tertiary" Classes="Tertiary" Theme="{StaticResource SolidDropDownButton}" />
<ToggleSplitButton Classes="Small" Content="Small" /> <DropDownButton Content="Success" Classes="Success" Theme="{StaticResource SolidDropDownButton}" />
<ToggleSplitButton Content="Default" /> <DropDownButton Content="Warning" Classes="Warning" Theme="{StaticResource SolidDropDownButton}" />
<ToggleSplitButton Classes="Large" Content="Large" /> <DropDownButton Content="Danger" Classes="Danger" Theme="{StaticResource SolidDropDownButton}" />
</StackPanel> </WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<DropDownButton Content="Default" Theme="{StaticResource OutlineDropDownButton}" />
<DropDownButton Content="Primary" Classes="Primary" Theme="{StaticResource OutlineDropDownButton}" />
<DropDownButton Content="Secondary" Classes="Secondary" Theme="{StaticResource OutlineDropDownButton}" />
<DropDownButton Content="Tertiary" Classes="Tertiary" Theme="{StaticResource OutlineDropDownButton}" />
<DropDownButton Content="Success" Classes="Success" Theme="{StaticResource OutlineDropDownButton}" />
<DropDownButton Content="Warning" Classes="Warning" Theme="{StaticResource OutlineDropDownButton}" />
<DropDownButton Content="Danger" Classes="Danger" Theme="{StaticResource OutlineDropDownButton}" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<DropDownButton Content="Default" Theme="{StaticResource BorderlessDropDownButton}" />
<DropDownButton Content="Primary" Classes="Primary" Theme="{StaticResource BorderlessDropDownButton}" />
<DropDownButton Content="Secondary" Classes="Secondary" Theme="{StaticResource BorderlessDropDownButton}" />
<DropDownButton Content="Tertiary" Classes="Tertiary" Theme="{StaticResource BorderlessDropDownButton}" />
<DropDownButton Content="Success" Classes="Success" Theme="{StaticResource BorderlessDropDownButton}" />
<DropDownButton Content="Warning" Classes="Warning" Theme="{StaticResource BorderlessDropDownButton}" />
<DropDownButton Content="Danger" Classes="Danger" Theme="{StaticResource BorderlessDropDownButton}" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<DropDownButton Content="Light" IsEnabled="False" />
<DropDownButton Content="Solid" IsEnabled="False" Theme="{StaticResource SolidDropDownButton}" />
<DropDownButton Content="Outline" IsEnabled="False" Theme="{StaticResource OutlineDropDownButton}" />
<DropDownButton Content="Borderless" IsEnabled="False" Theme="{StaticResource BorderlessDropDownButton}" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<DropDownButton Content="Large" Classes="Large" />
<DropDownButton Content="Default" />
<DropDownButton Content="Small" Classes="Small" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<DropDownButton Content="Primary" Classes="Colorful Primary" />
<DropDownButton Content="Tertiary" Classes="Colorful Tertiary" />
<DropDownButton Content="Disabled" Classes="Colorful Primary" IsEnabled="False" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<DropDownButton Content="Primary" Classes="Colorful Primary" Theme="{StaticResource SolidDropDownButton}" />
<DropDownButton Content="Tertiary" Classes="Colorful Tertiary" Theme="{StaticResource SolidDropDownButton}" />
<DropDownButton Content="Disabled" Classes="Colorful Primary" Theme="{StaticResource SolidDropDownButton}" IsEnabled="False" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<DropDownButton Content="Primary" Classes="Colorful Primary" Theme="{StaticResource OutlineDropDownButton}" />
<DropDownButton Content="Tertiary" Classes="Colorful Tertiary" Theme="{StaticResource OutlineDropDownButton}" />
<DropDownButton Content="Disabled" Classes="Colorful Primary" Theme="{StaticResource OutlineDropDownButton}" IsEnabled="False" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<DropDownButton Content="Primary" Classes="Colorful Primary" Theme="{StaticResource BorderlessDropDownButton}" />
<DropDownButton Content="Tertiary" Classes="Colorful Tertiary" Theme="{StaticResource BorderlessDropDownButton}" />
<DropDownButton Content="Disabled" Classes="Colorful Primary" Theme="{StaticResource BorderlessDropDownButton}" IsEnabled="False" />
</WrapPanel>
</StackPanel>
</HeaderedContentControl>
<HeaderedContentControl
Theme="{StaticResource GroupBox}" Header="SplitButton">
<StackPanel HorizontalAlignment="Left" Spacing="16">
<WrapPanel ItemSpacing="16" LineSpacing="16">
<SplitButton Content="Default" />
<SplitButton Content="Primary" Classes="Primary" />
<SplitButton Content="Secondary" Classes="Secondary" />
<SplitButton Content="Tertiary" Classes="Tertiary" />
<SplitButton Content="Success" Classes="Success" />
<SplitButton Content="Warning" Classes="Warning" />
<SplitButton Content="Danger" Classes="Danger" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<SplitButton Content="Default" Theme="{StaticResource SolidSplitButton}" />
<SplitButton Content="Primary" Classes="Primary" Theme="{StaticResource SolidSplitButton}" />
<SplitButton Content="Secondary" Classes="Secondary" Theme="{StaticResource SolidSplitButton}" />
<SplitButton Content="Tertiary" Classes="Tertiary" Theme="{StaticResource SolidSplitButton}" />
<SplitButton Content="Success" Classes="Success" Theme="{StaticResource SolidSplitButton}" />
<SplitButton Content="Warning" Classes="Warning" Theme="{StaticResource SolidSplitButton}" />
<SplitButton Content="Danger" Classes="Danger" Theme="{StaticResource SolidSplitButton}" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<SplitButton Content="Default" Theme="{StaticResource OutlineSplitButton}" />
<SplitButton Content="Primary" Classes="Primary" Theme="{StaticResource OutlineSplitButton}" />
<SplitButton Content="Secondary" Classes="Secondary" Theme="{StaticResource OutlineSplitButton}" />
<SplitButton Content="Tertiary" Classes="Tertiary" Theme="{StaticResource OutlineSplitButton}" />
<SplitButton Content="Success" Classes="Success" Theme="{StaticResource OutlineSplitButton}" />
<SplitButton Content="Warning" Classes="Warning" Theme="{StaticResource OutlineSplitButton}" />
<SplitButton Content="Danger" Classes="Danger" Theme="{StaticResource OutlineSplitButton}" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<SplitButton Content="Default" Theme="{StaticResource BorderlessSplitButton}" />
<SplitButton Content="Primary" Classes="Primary" Theme="{StaticResource BorderlessSplitButton}" />
<SplitButton Content="Secondary" Classes="Secondary" Theme="{StaticResource BorderlessSplitButton}" />
<SplitButton Content="Tertiary" Classes="Tertiary" Theme="{StaticResource BorderlessSplitButton}" />
<SplitButton Content="Success" Classes="Success" Theme="{StaticResource BorderlessSplitButton}" />
<SplitButton Content="Warning" Classes="Warning" Theme="{StaticResource BorderlessSplitButton}" />
<SplitButton Content="Danger" Classes="Danger" Theme="{StaticResource BorderlessSplitButton}" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<SplitButton Content="Light" IsEnabled="False" />
<SplitButton Content="Solid" IsEnabled="False" Theme="{StaticResource SolidSplitButton}" />
<SplitButton Content="Outline" IsEnabled="False" Theme="{StaticResource OutlineSplitButton}" />
<SplitButton Content="Borderless" IsEnabled="False" Theme="{StaticResource BorderlessSplitButton}" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<SplitButton Content="Large" Classes="Large" />
<SplitButton Content="Default" />
<SplitButton Content="Small" Classes="Small" />
</WrapPanel>
</StackPanel>
</HeaderedContentControl>
<HeaderedContentControl
Theme="{StaticResource GroupBox}"
Header="ToggleSplitButton">
<StackPanel HorizontalAlignment="Left" Spacing="24">
<WrapPanel ItemSpacing="16" LineSpacing="16">
<ToggleSplitButton Content="Default" />
<ToggleSplitButton Classes="Primary" Content="Primary" />
<ToggleSplitButton Classes="Secondary" Content="Secondary" />
<ToggleSplitButton Classes="Tertiary" Content="Tertiary" />
<ToggleSplitButton Classes="Success" Content="Success" />
<ToggleSplitButton Classes="Warning" Content="Warning" />
<ToggleSplitButton Classes="Danger" Content="Danger" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<ToggleSplitButton Content="Default" IsChecked="True" />
<ToggleSplitButton Classes="Primary" Content="Primary" IsChecked="True" />
<ToggleSplitButton Classes="Secondary" Content="Secondary" IsChecked="True" />
<ToggleSplitButton Classes="Tertiary" Content="Tertiary" IsChecked="True" />
<ToggleSplitButton Classes="Success" Content="Success" IsChecked="True" />
<ToggleSplitButton Classes="Warning" Content="Warning" IsChecked="True" />
<ToggleSplitButton Classes="Danger" Content="Danger" IsChecked="True" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<ToggleSplitButton Content="Unchecked" Classes="Success" IsEnabled="False" />
<ToggleSplitButton Content="Checked" Classes="Success" IsChecked="True" IsEnabled="False" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<ToggleSplitButton Content="Large" Classes="Large" />
<ToggleSplitButton Content="Default" />
<ToggleSplitButton Content="Small" Classes="Small" />
</WrapPanel>
</StackPanel>
</HeaderedContentControl>
<HeaderedContentControl
Theme="{StaticResource GroupBox}" Header="ToggleButton">
<StackPanel HorizontalAlignment="Left" Spacing="16">
<WrapPanel ItemSpacing="16" LineSpacing="16">
<ToggleButton Content="Default" />
<ToggleButton Content="Primary" Classes="Primary" />
<ToggleButton Content="Secondary" Classes="Secondary" />
<ToggleButton Content="Tertiary" Classes="Tertiary" />
<ToggleButton Content="Success" Classes="Success" />
<ToggleButton Content="Warning" Classes="Warning" />
<ToggleButton Content="Danger" Classes="Danger" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<ToggleButton Content="Default" IsChecked="True" />
<ToggleButton Content="Primary" Classes="Primary" IsChecked="True" />
<ToggleButton Content="Secondary" Classes="Secondary" IsChecked="True" />
<ToggleButton Content="Tertiary" Classes="Tertiary" IsChecked="True" />
<ToggleButton Content="Success" Classes="Success" IsChecked="True" />
<ToggleButton Content="Warning" Classes="Warning" IsChecked="True" />
<ToggleButton Content="Danger" Classes="Danger" IsChecked="True" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<ToggleButton Content="Default" IsChecked="{x:Null}" IsThreeState="True" />
<ToggleButton Content="Primary" Classes="Primary" IsChecked="{x:Null}" IsThreeState="True" />
<ToggleButton Content="Secondary" Classes="Secondary" IsChecked="{x:Null}" IsThreeState="True" />
<ToggleButton Content="Tertiary" Classes="Tertiary" IsChecked="{x:Null}" IsThreeState="True" />
<ToggleButton Content="Success" Classes="Success" IsChecked="{x:Null}" IsThreeState="True" />
<ToggleButton Content="Warning" Classes="Warning" IsChecked="{x:Null}" IsThreeState="True" />
<ToggleButton Content="Danger" Classes="Danger" IsChecked="{x:Null}" IsThreeState="True" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<ToggleButton Content="Unchecked" IsEnabled="False" />
<ToggleButton Content="Checked" IsEnabled="False" IsChecked="True" />
<ToggleButton Content="Indeterminate" IsEnabled="False" IsChecked="{x:Null}" IsThreeState="True" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<ToggleButton Content="Large" Classes="Large" />
<ToggleButton Content="Default" />
<ToggleButton Content="Small" Classes="Small" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<ToggleButton Content="Primary" Classes="Colorful Primary" />
<ToggleButton Content="Tertiary" Classes="Colorful Tertiary" />
<ToggleButton Content="Disabled" Classes="Colorful Primary" IsEnabled="False" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<ToggleButton Content="Primary" Classes="Colorful Primary" IsChecked="True" />
<ToggleButton Content="Tertiary" Classes="Colorful Tertiary" IsChecked="True" />
<ToggleButton Content="Disabled" Classes="Colorful Primary" IsChecked="True" IsEnabled="False" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<ToggleButton Content="Primary" Classes="Colorful Primary" IsChecked="{x:Null}" IsThreeState="True" />
<ToggleButton Content="Tertiary" Classes="Colorful Tertiary" IsChecked="{x:Null}" IsThreeState="True" />
<ToggleButton Content="Disabled" Classes="Colorful Primary" IsChecked="{x:Null}" IsThreeState="True" IsEnabled="False" />
</WrapPanel>
</StackPanel>
</HeaderedContentControl>
</StackPanel> </StackPanel>
</ScrollViewer> </ScrollViewer>
</UserControl> </UserControl>

View File

@@ -8,6 +8,10 @@
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">
<StackPanel HorizontalAlignment="Left" Spacing="20"> <StackPanel HorizontalAlignment="Left" Spacing="20">
<StackPanel Orientation="Horizontal">
<ToggleSwitch Name="showSpinCheck" IsChecked="True" Content="Show Button Spinner" />
<ToggleSwitch Name="allowSpinCheck" IsChecked="True" Content="Allow Spin" />
</StackPanel>
<ButtonSpinner <ButtonSpinner
Height="30" Height="30"
AllowSpin="{Binding #allowSpinCheck.IsChecked}" AllowSpin="{Binding #allowSpinCheck.IsChecked}"

View File

@@ -7,46 +7,51 @@
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels" xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
d:DesignHeight="800" d:DesignHeight="800"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d"
x:DataType="vm:ComboBoxDemoViewModel">
<Design.DataContext> <Design.DataContext>
<vm:ComboBoxDemoViewModel /> <vm:ComboBoxDemoViewModel />
</Design.DataContext> </Design.DataContext>
<StackPanel Spacing="20"> <ScrollViewer>
<StackPanel.Styles> <StackPanel Spacing="20">
<Style Selector="ComboBox"> <StackPanel.Styles>
<Setter Property="Width" Value="300" /> <Style Selector="ComboBox">
<Setter Property="ItemsSource" Value="{Binding Items}" /> <Setter Property="Width" Value="300" />
</Style> <Setter Property="ItemsSource" Value="{Binding Items}" />
</StackPanel.Styles> </Style>
</StackPanel.Styles>
<ComboBox /> <ComboBox />
<ComboBox Classes="ClearButton" /> <ComboBox Classes="ClearButton" />
<ComboBox PlaceholderText="Please Select" /> <ComboBox PlaceholderText="Please Select" />
<ComboBox IsEnabled="False" /> <ComboBox IsEnabled="False" />
<ComboBox Classes="Large" IsEnabled="False" /> <ComboBox Classes="Large" IsEnabled="False" />
<ComboBox Classes="Small" /> <ComboBox Classes="Small" />
<ComboBox Classes="Bordered" /> <ComboBox Classes="Bordered" />
<ComboBox Classes="Bordered" IsEnabled="False" /> <ComboBox Classes="Bordered" IsEnabled="False" />
<ComboBox> <ComboBox>
<ComboBox.SelectionBoxItemTemplate> <ComboBox.SelectionBoxItemTemplate>
<DataTemplate DataType="x:String"> <DataTemplate DataType="x:String">
<ContentControl BorderThickness="1" <ContentControl BorderThickness="1"
BorderBrush="Gold" BorderBrush="Gold"
Content="{Binding}" /> Content="{Binding}" />
</DataTemplate> </DataTemplate>
</ComboBox.SelectionBoxItemTemplate> </ComboBox.SelectionBoxItemTemplate>
</ComboBox> </ComboBox>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<ComboBox Width="100" Classes="Large" PlaceholderText="Large" /> <ComboBox Width="100" Classes="Large" PlaceholderText="Large" />
<ComboBox Width="100" PlaceholderText="Default" /> <ComboBox Width="100" PlaceholderText="Default" />
<ComboBox Width="100" Classes="Small" PlaceholderText="Small" /> <ComboBox Width="100" Classes="Small" PlaceholderText="Small" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<ComboBox Width="100" IsEnabled="False" PlaceholderText="Disabled" />
<ComboBox Width="100" Classes="Bordered" PlaceholderText="Bordered" />
<ComboBox Width="100" Classes="Bordered" IsEnabled="False" />
</StackPanel>
<ToggleSwitch Name="toggle" IsChecked="True" Content="IsEditable" />
<ComboBox IsEditable="{Binding #toggle.IsChecked}" />
</StackPanel> </StackPanel>
</ScrollViewer>
<StackPanel Orientation="Horizontal">
<ComboBox Width="100" IsEnabled="False" PlaceholderText="Disabled" />
<ComboBox Width="100" Classes="Bordered" PlaceholderText="Bordered" />
<ComboBox Width="100" Classes="Bordered" IsEnabled="False" />
</StackPanel>
</StackPanel>
</UserControl> </UserControl>

View File

@@ -7,7 +7,6 @@
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels;assembly=Semi.Avalonia.Demo" xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels;assembly=Semi.Avalonia.Demo"
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
x:CompileBindings="True"
x:DataType="vm:DataGridDemoViewModel" x:DataType="vm:DataGridDemoViewModel"
mc:Ignorable="d"> mc:Ignorable="d">
<TabControl> <TabControl>

View File

@@ -8,7 +8,6 @@
xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages" xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
mc:Ignorable="d" d:DesignWidth="1000" d:DesignHeight="1450" mc:Ignorable="d" d:DesignWidth="1000" d:DesignHeight="1450"
x:DataType="vm:HighContrastDemoViewModel" x:DataType="vm:HighContrastDemoViewModel"
x:CompileBindings="True"
x:Class="Semi.Avalonia.Demo.Pages.HighContrastDemo"> x:Class="Semi.Avalonia.Demo.Pages.HighContrastDemo">
<Design.DataContext> <Design.DataContext>
<vm:HighContrastDemoViewModel /> <vm:HighContrastDemoViewModel />

View File

@@ -18,78 +18,67 @@
Text="{Binding SearchText}" Text="{Binding SearchText}"
Watermark="Input Icon Name" /> Watermark="Input Icon Name" />
<TabControl Grid.Row="1"> <TabControl
<TabItem Header="Filled Icons"> Grid.Row="1"
<ScrollViewer> Theme="{StaticResource LineTabControl}"
<ItemsControl ItemsSource="{Binding FilteredFilledIcons}"> ItemsSource="{Binding IconTabs}">
<ItemsControl.ItemsPanel> <TabControl.ItemTemplate>
<ItemsPanelTemplate> <DataTemplate>
<WrapPanel /> <WrapPanel ItemSpacing="5">
</ItemsPanelTemplate> <TextBlock Text="{Binding Header}" />
</ItemsControl.ItemsPanel> <Label
<ItemsControl.ItemTemplate> Theme="{StaticResource TagLabel}"
<DataTemplate> Classes="Purple"
<Button Theme="{DynamicResource OutlineButton}" IsVisible="{Binding Header,
Classes="Tertiary" Converter={x:Static ObjectConverters.Equal},
Padding="0" ConverterParameter='AI Icons'}"
Margin="10" Content="New" />
Width="200" </WrapPanel>
Height="120" </DataTemplate>
Click="Button_Clicked"> </TabControl.ItemTemplate>
<StackPanel Spacing="8">
<PathIcon
Theme="{DynamicResource InnerPathIcon}"
HorizontalAlignment="Center"
Classes="ExtraLarge"
Data="{Binding Geometry}" />
<TextBlock
HorizontalAlignment="Center"
FontSize="12"
FontWeight="Normal"
Text="{Binding ResourceKey}" />
</StackPanel>
</Button>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</TabItem>
<TabItem Header="Stroked Icons"> <TabControl.ContentTemplate>
<ScrollViewer> <DataTemplate DataType="vm:IconTab">
<ItemsControl ItemsSource="{Binding FilteredStrokedIcons}"> <ScrollViewer>
<ItemsControl.ItemsPanel> <ItemsControl
<ItemsPanelTemplate> Margin="0 10"
<WrapPanel /> ItemsSource="{Binding IconItems}">
</ItemsPanelTemplate> <ItemsControl.ItemsPanel>
</ItemsControl.ItemsPanel> <ItemsPanelTemplate>
<ItemsControl.ItemTemplate> <WrapPanel
<DataTemplate> ItemWidth="200"
<Button Theme="{DynamicResource OutlineButton}" ItemHeight="120"
Classes="Tertiary" ItemSpacing="10"
Padding="0" LineSpacing="10" />
Margin="10" </ItemsPanelTemplate>
Width="200" </ItemsControl.ItemsPanel>
Height="120" <ItemsControl.ItemTemplate>
Click="Button_Clicked"> <DataTemplate>
<StackPanel Spacing="8"> <Button Theme="{DynamicResource OutlineButton}"
<PathIcon Classes="Tertiary"
Theme="{DynamicResource InnerPathIcon}" Padding="0"
HorizontalAlignment="Center" HorizontalAlignment="Stretch"
Classes="ExtraLarge" VerticalAlignment="Stretch"
Data="{Binding Geometry}" /> Click="Button_Clicked">
<TextBlock <StackPanel Spacing="8">
HorizontalAlignment="Center" <PathIcon
FontSize="12" Theme="{DynamicResource InnerPathIcon}"
FontWeight="Normal" HorizontalAlignment="Center"
Text="{Binding ResourceKey}" /> Classes="ExtraLarge"
</StackPanel> Data="{Binding Geometry}" />
</Button> <TextBlock
</DataTemplate> HorizontalAlignment="Center"
</ItemsControl.ItemTemplate> FontSize="12"
</ItemsControl> FontWeight="Normal"
</ScrollViewer> Text="{Binding ResourceKey}" />
</TabItem> </StackPanel>
</Button>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</DataTemplate>
</TabControl.ContentTemplate>
</TabControl> </TabControl>
</Grid> </Grid>
</UserControl> </UserControl>

View File

@@ -8,14 +8,11 @@
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">
<ScrollViewer> <ScrollViewer>
<StackPanel HorizontalAlignment="Left" Spacing="20"> <StackPanel>
<StackPanel.Styles> <StackPanel.Styles>
<Style Selector="Label"> <Style Selector="Grid > TextBlock,Grid > Label">
<Setter Property="Margin" Value="4" /> <Setter Property="Layoutable.VerticalAlignment" Value="Center" />
</Style> <Setter Property="Layoutable.Margin" Value="4" />
<Style Selector="Grid > TextBlock">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Margin" Value="4" />
</Style> </Style>
</StackPanel.Styles> </StackPanel.Styles>
<ScrollViewer HorizontalScrollBarVisibility="Auto"> <ScrollViewer HorizontalScrollBarVisibility="Auto">
@@ -156,69 +153,89 @@
</HeaderedContentControl> </HeaderedContentControl>
</StackPanel> </StackPanel>
</ScrollViewer> </ScrollViewer>
<WrapPanel>
<Label Theme="{StaticResource TagLabel}">Label</Label> <HeaderedContentControl
<Label Classes="Large" Theme="{StaticResource TagLabel}">Large Label</Label> Margin="16"
<Label Classes="Circle" Theme="{StaticResource TagLabel}">Circle Label</Label> Header="Theme: TagLabel"
<Label Classes="Large Circle" Theme="{StaticResource TagLabel}">Large Circle Label</Label> Theme="{DynamicResource GroupBox}">
</WrapPanel> <ScrollViewer HorizontalScrollBarVisibility="Auto">
<WrapPanel> <StackPanel Orientation="Horizontal" Spacing="8">
<Label Classes="Red" Theme="{StaticResource TagLabel}">Red</Label> <StackPanel Spacing="4">
<Label Classes="Pink" Theme="{StaticResource TagLabel}">Pink</Label> <Label Classes="Red" Theme="{StaticResource TagLabel}">Red</Label>
<Label Classes="Purple" Theme="{StaticResource TagLabel}">Purple</Label> <Label Classes="Pink" Theme="{StaticResource TagLabel}">Pink</Label>
<Label Classes="Violet" Theme="{StaticResource TagLabel}">Violet</Label> <Label Classes="Purple" Theme="{StaticResource TagLabel}">Purple</Label>
<Label Classes="Indigo" Theme="{StaticResource TagLabel}">Indigo</Label> <Label Classes="Violet" Theme="{StaticResource TagLabel}">Violet</Label>
<Label Classes="Blue" Theme="{StaticResource TagLabel}">Blue</Label> <Label Classes="Indigo" Theme="{StaticResource TagLabel}">Indigo</Label>
<Label Classes="LightBlue" Theme="{StaticResource TagLabel}">LightBlue</Label> <Label Classes="Blue" Theme="{StaticResource TagLabel}">Blue</Label>
<Label Classes="Cyan" Theme="{StaticResource TagLabel}">Cyan</Label> <Label Classes="LightBlue" Theme="{StaticResource TagLabel}">LightBlue</Label>
<Label Classes="Teal" Theme="{StaticResource TagLabel}">Teal</Label> <Label Classes="Cyan" Theme="{StaticResource TagLabel}">Cyan</Label>
<Label Classes="Green" Theme="{StaticResource TagLabel}">Green</Label> <Label Classes="Teal" Theme="{StaticResource TagLabel}">Teal</Label>
<Label Classes="LightGreen" Theme="{StaticResource TagLabel}">LightGreen</Label> <Label Classes="Green" Theme="{StaticResource TagLabel}">Green</Label>
<Label Classes="Lime" Theme="{StaticResource TagLabel}">Lime</Label> <Label Classes="LightGreen" Theme="{StaticResource TagLabel}">LightGreen</Label>
<Label Classes="Yellow" Theme="{StaticResource TagLabel}">Yellow</Label> <Label Classes="Lime" Theme="{StaticResource TagLabel}">Lime</Label>
<Label Classes="Amber" Theme="{StaticResource TagLabel}">Amber</Label> <Label Classes="Yellow" Theme="{StaticResource TagLabel}">Yellow</Label>
<Label Classes="Orange" Theme="{StaticResource TagLabel}">Orange</Label> <Label Classes="Amber" Theme="{StaticResource TagLabel}">Amber</Label>
<Label Classes="Grey" Theme="{StaticResource TagLabel}">Grey</Label> <Label Classes="Orange" Theme="{StaticResource TagLabel}">Orange</Label>
<Label Classes="White" Theme="{StaticResource TagLabel}">White</Label> <Label Classes="Grey" Theme="{StaticResource TagLabel}">Grey</Label>
</WrapPanel> <Label Classes="White" Theme="{StaticResource TagLabel}">White</Label>
<WrapPanel> </StackPanel>
<Label Classes="Ghost Red" Theme="{StaticResource TagLabel}">Red</Label> <StackPanel Spacing="4">
<Label Classes="Ghost Pink" Theme="{StaticResource TagLabel}">Pink</Label> <Label Classes="Ghost Red" Theme="{StaticResource TagLabel}">Red</Label>
<Label Classes="Ghost Purple" Theme="{StaticResource TagLabel}">Purple</Label> <Label Classes="Ghost Pink" Theme="{StaticResource TagLabel}">Pink</Label>
<Label Classes="Ghost Violet" Theme="{StaticResource TagLabel}">Violet</Label> <Label Classes="Ghost Purple" Theme="{StaticResource TagLabel}">Purple</Label>
<Label Classes="Ghost Indigo" Theme="{StaticResource TagLabel}">Indigo</Label> <Label Classes="Ghost Violet" Theme="{StaticResource TagLabel}">Violet</Label>
<Label Classes="Ghost Blue" Theme="{StaticResource TagLabel}">Blue</Label> <Label Classes="Ghost Indigo" Theme="{StaticResource TagLabel}">Indigo</Label>
<Label Classes="Ghost LightBlue" Theme="{StaticResource TagLabel}">LightBlue</Label> <Label Classes="Ghost Blue" Theme="{StaticResource TagLabel}">Blue</Label>
<Label Classes="Ghost Cyan" Theme="{StaticResource TagLabel}">Cyan</Label> <Label Classes="Ghost LightBlue" Theme="{StaticResource TagLabel}">LightBlue</Label>
<Label Classes="Ghost Teal" Theme="{StaticResource TagLabel}">Teal</Label> <Label Classes="Ghost Cyan" Theme="{StaticResource TagLabel}">Cyan</Label>
<Label Classes="Ghost Green" Theme="{StaticResource TagLabel}">Green</Label> <Label Classes="Ghost Teal" Theme="{StaticResource TagLabel}">Teal</Label>
<Label Classes="Ghost LightGreen" Theme="{StaticResource TagLabel}">LightGreen</Label> <Label Classes="Ghost Green" Theme="{StaticResource TagLabel}">Green</Label>
<Label Classes="Ghost Lime" Theme="{StaticResource TagLabel}">Lime</Label> <Label Classes="Ghost LightGreen" Theme="{StaticResource TagLabel}">LightGreen</Label>
<Label Classes="Ghost Yellow" Theme="{StaticResource TagLabel}">Yellow</Label> <Label Classes="Ghost Lime" Theme="{StaticResource TagLabel}">Lime</Label>
<Label Classes="Ghost Amber" Theme="{StaticResource TagLabel}">Amber</Label> <Label Classes="Ghost Yellow" Theme="{StaticResource TagLabel}">Yellow</Label>
<Label Classes="Ghost Orange" Theme="{StaticResource TagLabel}">Orange</Label> <Label Classes="Ghost Amber" Theme="{StaticResource TagLabel}">Amber</Label>
<Label Classes="Ghost Grey" Theme="{StaticResource TagLabel}">Grey</Label> <Label Classes="Ghost Orange" Theme="{StaticResource TagLabel}">Orange</Label>
<Label Classes="Ghost White" Theme="{StaticResource TagLabel}">White</Label> <Label Classes="Ghost Grey" Theme="{StaticResource TagLabel}">Grey</Label>
</WrapPanel> <Label Classes="Ghost White" Theme="{StaticResource TagLabel}">White</Label>
<WrapPanel> </StackPanel>
<Label Classes="Solid Red" Theme="{StaticResource TagLabel}">Red</Label> <StackPanel Spacing="4">
<Label Classes="Solid Pink" Theme="{StaticResource TagLabel}">Pink</Label> <Label Classes="Solid Red" Theme="{StaticResource TagLabel}">Red</Label>
<Label Classes="Solid Purple" Theme="{StaticResource TagLabel}">Purple</Label> <Label Classes="Solid Pink" Theme="{StaticResource TagLabel}">Pink</Label>
<Label Classes="Solid Violet" Theme="{StaticResource TagLabel}">Violet</Label> <Label Classes="Solid Purple" Theme="{StaticResource TagLabel}">Purple</Label>
<Label Classes="Solid Indigo" Theme="{StaticResource TagLabel}">Indigo</Label> <Label Classes="Solid Violet" Theme="{StaticResource TagLabel}">Violet</Label>
<Label Classes="Solid Blue" Theme="{StaticResource TagLabel}">Blue</Label> <Label Classes="Solid Indigo" Theme="{StaticResource TagLabel}">Indigo</Label>
<Label Classes="Solid LightBlue" Theme="{StaticResource TagLabel}">LightBlue</Label> <Label Classes="Solid Blue" Theme="{StaticResource TagLabel}">Blue</Label>
<Label Classes="Solid Cyan" Theme="{StaticResource TagLabel}">Cyan</Label> <Label Classes="Solid LightBlue" Theme="{StaticResource TagLabel}">LightBlue</Label>
<Label Classes="Solid Teal" Theme="{StaticResource TagLabel}">Teal</Label> <Label Classes="Solid Cyan" Theme="{StaticResource TagLabel}">Cyan</Label>
<Label Classes="Solid Green" Theme="{StaticResource TagLabel}">Green</Label> <Label Classes="Solid Teal" Theme="{StaticResource TagLabel}">Teal</Label>
<Label Classes="Solid LightGreen" Theme="{StaticResource TagLabel}">LightGreen</Label> <Label Classes="Solid Green" Theme="{StaticResource TagLabel}">Green</Label>
<Label Classes="Solid Lime" Theme="{StaticResource TagLabel}">Lime</Label> <Label Classes="Solid LightGreen" Theme="{StaticResource TagLabel}">LightGreen</Label>
<Label Classes="Solid Yellow" Theme="{StaticResource TagLabel}">Yellow</Label> <Label Classes="Solid Lime" Theme="{StaticResource TagLabel}">Lime</Label>
<Label Classes="Solid Amber" Theme="{StaticResource TagLabel}">Amber</Label> <Label Classes="Solid Yellow" Theme="{StaticResource TagLabel}">Yellow</Label>
<Label Classes="Solid Orange" Theme="{StaticResource TagLabel}">Orange</Label> <Label Classes="Solid Amber" Theme="{StaticResource TagLabel}">Amber</Label>
<Label Classes="Solid Grey" Theme="{StaticResource TagLabel}">Grey</Label> <Label Classes="Solid Orange" Theme="{StaticResource TagLabel}">Orange</Label>
<Label Classes="Solid White" Theme="{StaticResource TagLabel}">White</Label> <Label Classes="Solid Grey" Theme="{StaticResource TagLabel}">Grey</Label>
</WrapPanel> <Label Classes="Solid White" Theme="{StaticResource TagLabel}">White</Label>
</StackPanel>
<StackPanel Spacing="4">
<Label Classes="Colorful Gradient" Theme="{DynamicResource TagLabel}">Light</Label>
<Label Classes="Colorful Gradient Ghost" Theme="{DynamicResource TagLabel}">Ghost</Label>
<Label Classes="Colorful Gradient Solid" Theme="{DynamicResource TagLabel}">Solid</Label>
</StackPanel>
<StackPanel Spacing="4">
<Label Classes="Colorful" Theme="{DynamicResource TagLabel}">Light</Label>
<Label Classes="Colorful Ghost" Theme="{DynamicResource TagLabel}">Ghost</Label>
<Label Classes="Colorful Solid" Theme="{DynamicResource TagLabel}">Solid</Label>
</StackPanel>
<StackPanel Spacing="4">
<Label Theme="{StaticResource TagLabel}">Label</Label>
<Label Classes="Large" Theme="{StaticResource TagLabel}">Large Label</Label>
<Label Classes="Circle" Theme="{StaticResource TagLabel}">Circle Label</Label>
<Label Classes="Large Circle" Theme="{StaticResource TagLabel}">Large Circle Label</Label>
</StackPanel>
</StackPanel>
</ScrollViewer>
</HeaderedContentControl>
</StackPanel> </StackPanel>
</ScrollViewer> </ScrollViewer>
</UserControl> </UserControl>

View File

@@ -27,7 +27,8 @@ public partial class NotificationDemo : UserControl
if (sender is RadioButton b && b.Content is string s) if (sender is RadioButton b && b.Content is string s)
{ {
Enum.TryParse<NotificationPosition>(s, out var t); Enum.TryParse<NotificationPosition>(s, out var t);
_manager.Position = t; if (_manager is not null)
_manager.Position = t;
} }
} }

View File

@@ -8,7 +8,6 @@
xmlns:viewModels="clr-namespace:Semi.Avalonia.Demo.ViewModels" xmlns:viewModels="clr-namespace:Semi.Avalonia.Demo.ViewModels"
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
x:CompileBindings="True"
x:DataType="viewModels:PaletteDemoViewModel" x:DataType="viewModels:PaletteDemoViewModel"
mc:Ignorable="d"> mc:Ignorable="d">
<Design.DataContext> <Design.DataContext>

View File

@@ -8,7 +8,6 @@
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
x:DataType="vm:RefreshContainerDemoViewModel" x:DataType="vm:RefreshContainerDemoViewModel"
x:CompileBindings="True"
mc:Ignorable="d"> mc:Ignorable="d">
<DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Top"> <DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Top">
<Label DockPanel.Dock="Top">A control that supports pull to refresh</Label> <Label DockPanel.Dock="Top">A control that supports pull to refresh</Label>

View File

@@ -1,80 +0,0 @@
<UserControl
x:Class="Semi.Avalonia.Demo.Pages.RepeatButtonDemo"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<StackPanel HorizontalAlignment="Left" Spacing="20">
<TextBlock>Light (Default)</TextBlock>
<StackPanel Orientation="Horizontal" Spacing="20">
<RepeatButton Classes="Primary">Primary</RepeatButton>
<RepeatButton Classes="Secondary">Secondary</RepeatButton>
<RepeatButton Classes="Tertiary">Tertiary</RepeatButton>
<RepeatButton Classes="Success">Success</RepeatButton>
<RepeatButton Classes="Warning">Warning</RepeatButton>
<RepeatButton Classes="Danger">Danger</RepeatButton>
<RepeatButton Classes="Danger" IsEnabled="False">Disabled</RepeatButton>
</StackPanel>
<TextBlock>Solid</TextBlock>
<StackPanel Orientation="Horizontal" Spacing="20">
<RepeatButton Classes="Primary" Theme="{DynamicResource SolidRepeatButton}">Primary</RepeatButton>
<RepeatButton Classes="Secondary" Theme="{DynamicResource SolidRepeatButton}">Secondary</RepeatButton>
<RepeatButton Classes="Tertiary" Theme="{DynamicResource SolidRepeatButton}">Tertiary</RepeatButton>
<RepeatButton Classes="Success" Theme="{DynamicResource SolidRepeatButton}">Success</RepeatButton>
<RepeatButton Classes="Warning" Theme="{DynamicResource SolidRepeatButton}">Warning</RepeatButton>
<RepeatButton Classes="Danger" Theme="{DynamicResource SolidRepeatButton}">Danger</RepeatButton>
<RepeatButton
Classes="Danger"
IsEnabled="False"
Theme="{DynamicResource SolidRepeatButton}">
Disabled
</RepeatButton>
</StackPanel>
<TextBlock>Outline</TextBlock>
<StackPanel Orientation="Horizontal" Spacing="20">
<RepeatButton Classes="Primary" Theme="{DynamicResource OutlineRepeatButton}">Primary</RepeatButton>
<RepeatButton Classes="Secondary" Theme="{DynamicResource OutlineRepeatButton}">Secondary</RepeatButton>
<RepeatButton Classes="Tertiary" Theme="{DynamicResource OutlineRepeatButton}">Tertiary</RepeatButton>
<RepeatButton Classes="Success" Theme="{DynamicResource OutlineRepeatButton}">Success</RepeatButton>
<RepeatButton Classes="Warning" Theme="{DynamicResource OutlineRepeatButton}">Warning</RepeatButton>
<RepeatButton Classes="Danger" Theme="{DynamicResource OutlineRepeatButton}">Danger</RepeatButton>
<RepeatButton
Classes="Danger"
IsEnabled="False"
Theme="{DynamicResource OutlineRepeatButton}">
Disabled
</RepeatButton>
</StackPanel>
<TextBlock>Borderless</TextBlock>
<StackPanel Orientation="Horizontal" Spacing="20">
<RepeatButton Classes="Primary" Theme="{DynamicResource BorderlessRepeatButton}">Primary</RepeatButton>
<RepeatButton Classes="Secondary" Theme="{DynamicResource BorderlessRepeatButton}">Secondary</RepeatButton>
<RepeatButton Classes="Tertiary" Theme="{DynamicResource BorderlessRepeatButton}">Tertiary</RepeatButton>
<RepeatButton Classes="Success" Theme="{DynamicResource BorderlessRepeatButton}">Success</RepeatButton>
<RepeatButton Classes="Warning" Theme="{DynamicResource BorderlessRepeatButton}">Warning</RepeatButton>
<RepeatButton Classes="Danger" Theme="{DynamicResource BorderlessRepeatButton}">Danger</RepeatButton>
<RepeatButton
Classes="Danger"
IsEnabled="False"
Theme="{DynamicResource BorderlessRepeatButton}">
Disabled
</RepeatButton>
</StackPanel>
<TextBlock>Disabled</TextBlock>
<StackPanel Background="{DynamicResource SemiColorBackground1}" Orientation="Horizontal" Spacing="20">
<Button IsEnabled="False">Light</Button>
<Button IsEnabled="False" Theme="{DynamicResource SolidButton}">Solid</Button>
<Button IsEnabled="False" Theme="{DynamicResource OutlineButton}">Outline</Button>
<Button IsEnabled="False" Theme="{DynamicResource BorderlessButton}">Borderless</Button>
</StackPanel>
<TextBlock>Size Classes</TextBlock>
<StackPanel Orientation="Horizontal" Spacing="20">
<RepeatButton Classes="Small">Small</RepeatButton>
<RepeatButton>Default</RepeatButton>
<RepeatButton Classes="Large">Large</RepeatButton>
</StackPanel>
</StackPanel>
</UserControl>

View File

@@ -1,11 +0,0 @@
using Avalonia.Controls;
namespace Semi.Avalonia.Demo.Pages;
public partial class RepeatButtonDemo : UserControl
{
public RepeatButtonDemo()
{
InitializeComponent();
}
}

View File

@@ -7,276 +7,187 @@
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels" xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
d:DesignHeight="1000" d:DesignHeight="1000"
d:DesignWidth="800" d:DesignWidth="800"
x:DataType="vm:SplitViewDemoViewModel"
mc:Ignorable="d"> mc:Ignorable="d">
<Design.DataContext> <Design.DataContext>
<vm:SplitViewDemoViewModel /> <vm:SplitViewDemoViewModel />
</Design.DataContext> </Design.DataContext>
<Border> <Border>
<Grid ColumnDefinitions="*,400"> <Grid ColumnDefinitions="*,400">
<Border Grid.Column="1" VerticalAlignment="Top" Margin="10 0 0 0"> <Border
<Grid RowDefinitions="*, *, *, *, *, *" ColumnDefinitions="Auto, *"> Grid.Column="1"
Margin="10,0,0,0"
VerticalAlignment="Top">
<Grid ColumnDefinitions="Auto, *" RowDefinitions="*, *, *, *, *, *">
<Label <Label
Grid.Row="0" Grid.Column="0" Grid.Row="0"
Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Content="IsPaneOpen" /> Content="IsPaneOpen" />
<ToggleSwitch <ToggleSwitch
Grid.Row="0" Grid.Column="1" Name="PaneOpenButton"
Name="PaneOpenButton" /> Grid.Row="0"
Grid.Column="1" />
<Label <Label
Grid.Row="1" Grid.Column="0" Grid.Row="1"
Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Content="UseLightDismissOverlayMode" /> Content="UseLightDismissOverlayMode" />
<ToggleSwitch <ToggleSwitch
Grid.Row="1" Grid.Column="1" Name="UseLightDismissOverlayModeButton"
Name="UseLightDismissOverlayModeButton" /> Grid.Row="1"
Grid.Column="1" />
<Label <Label
Grid.Row="2" Grid.Column="0" Grid.Row="2"
Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Content="Placement" /> Content="Placement" />
<ToggleSwitch <ComboBox
Grid.Row="2" Grid.Column="1" Grid.Row="2"
Name="PanePlacementButton" Grid.Column="1"
OffContent="Left" Name="PanelPlacementSelector"
OnContent="Right" /> HorizontalAlignment="Stretch"
ItemsSource="{x:Static vm:SplitViewDemoViewModel.Placements}"
SelectedItem="{x:Static SplitViewPanePlacement.Left}"
/>
<Label <Label
Grid.Row="3" Grid.Column="0" Grid.Row="3"
Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Content="DisplayMode" /> Content="DisplayMode" />
<ComboBox <ComboBox
Grid.Row="3" Grid.Column="1"
Name="DisplayModeSelector" Name="DisplayModeSelector"
Grid.Row="3"
Grid.Column="1"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
ItemsSource="{x:Static vm:SplitViewDemoViewModel.DisplayModes}" ItemsSource="{x:Static vm:SplitViewDemoViewModel.DisplayModes}"
SelectedItem="{x:Static SplitViewDisplayMode.CompactInline}" /> SelectedItem="{x:Static SplitViewDisplayMode.CompactInline}" />
<Label <Label
Grid.Row="4" Grid.Column="0" Grid.Row="4"
Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Content="{Binding #CompactPaneLengthSlider.Value, StringFormat='{}CompactPaneLength: {0}'}" /> Content="{Binding #CompactPaneLengthSlider.Value, StringFormat='{}CompactPaneLength: {0}'}" />
<Slider <Slider
Grid.Row="4" Grid.Column="1"
Name="CompactPaneLengthSlider" Name="CompactPaneLengthSlider"
Grid.Row="4"
Grid.Column="1"
IsSnapToTickEnabled="True"
Maximum="128" Maximum="128"
Minimum="0" Minimum="0"
TickFrequency="1" TickFrequency="1"
IsSnapToTickEnabled="True"
Value="48" /> Value="48" />
<Label <Label
Grid.Row="5" Grid.Column="0" Grid.Row="5"
Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Content="{Binding #OpenPaneLengthSlider.Value,StringFormat='{}OpenPaneLength: {0}'}" /> Content="{Binding #OpenPaneLengthSlider.Value, StringFormat='{}OpenPaneLength: {0}'}" />
<Slider <Slider
Grid.Row="5" Grid.Column="1"
Name="OpenPaneLengthSlider" Name="OpenPaneLengthSlider"
Grid.Row="5"
Grid.Column="1"
IsSnapToTickEnabled="True"
Maximum="500" Maximum="500"
Minimum="128" Minimum="128"
TickFrequency="1" TickFrequency="1"
IsSnapToTickEnabled="True"
Value="256" /> Value="256" />
</Grid> </Grid>
</Border> </Border>
<TabControl Grid.Column="0"> <SplitView
<TabItem Header="Default"> Grid.Column="0"
<Border Name="SplitView"
BorderBrush="{DynamicResource SemiGrey1}" CompactPaneLength="{Binding #CompactPaneLengthSlider.Value}"
BorderThickness="1"> DisplayMode="{Binding #DisplayModeSelector.SelectedItem}"
<SplitView IsPaneOpen="{Binding #PaneOpenButton.IsChecked, Mode=TwoWay}"
Name="SplitView" OpenPaneLength="{Binding #OpenPaneLengthSlider.Value}"
IsPaneOpen="{Binding #PaneOpenButton.IsChecked,Mode=TwoWay}" PanePlacement="{Binding #PanelPlacementSelector.SelectedItem}"
UseLightDismissOverlayMode="{Binding #UseLightDismissOverlayModeButton.IsChecked}" UseLightDismissOverlayMode="{Binding #UseLightDismissOverlayModeButton.IsChecked}">
PanePlacement="{Binding #PanePlacementButton.IsChecked}" <SplitView.Background>
DisplayMode="{Binding #DisplayModeSelector.SelectedItem}" <LinearGradientBrush StartPoint="0%,0%" EndPoint="0%,100%">
CompactPaneLength="{Binding #CompactPaneLengthSlider.Value}" <GradientStop Offset="0" Color="#6b4c1b" />
OpenPaneLength="{Binding #OpenPaneLengthSlider.Value}"> <GradientStop Offset="1" Color="#291e10" />
<SplitView.Background> </LinearGradientBrush>
<LinearGradientBrush StartPoint="0%,0%" EndPoint="0%,100%"> </SplitView.Background>
<GradientStop Color="#6b4c1b" Offset="0" /> <SplitView.Pane>
<GradientStop Color="#291e10" Offset="1" /> <Grid RowDefinitions="Auto,*,Auto">
</LinearGradientBrush> <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="8 12">
</SplitView.Background> <ToggleSwitch
<SplitView.Pane> Content="{StaticResource SemiIconSidebar}"
<Grid RowDefinitions="Auto,*,Auto"> IsChecked="{Binding #SplitView.IsPaneOpen}"
<TextBlock Theme="{DynamicResource IconBorderlessToggleSwitch}" />
Grid.Row="0" <TextBlock
Name="PaneHeader" Name="PaneHeader"
Margin="8,12" VerticalAlignment="Center"
FontWeight="Bold" Margin="8 0"
Text="Playlist" /> FontWeight="Bold"
<ListBox Text="Playlist" />
Grid.Row="1" </StackPanel>
ItemsSource="{Binding Songs}" />
<ToggleSwitch <ListBox Grid.Row="1" ItemsSource="{Binding Songs}" />
Grid.Row="2"
Theme="{DynamicResource IconBorderlessToggleSwitch}" </Grid>
Content="{StaticResource SemiIconSidebar}" </SplitView.Pane>
HorizontalAlignment="Left"
IsChecked="{Binding #SplitView.IsPaneOpen}" />
</Grid>
</SplitView.Pane>
<Panel> <Panel>
<Panel.Styles> <Panel.Styles>
<Style Selector="Image#AlbumCover"> <Style Selector="Image#AlbumCover">
<Style.Animations> <Style.Animations>
<Animation IterationCount="Infinite" Duration="0:0:40"> <Animation IterationCount="Infinite" Duration="0:0:40">
<KeyFrame Cue="0%"> <KeyFrame Cue="0%">
<Setter Property="RotateTransform.Angle" Value="0" /> <Setter Property="RotateTransform.Angle" Value="0" />
</KeyFrame> </KeyFrame>
<KeyFrame Cue="100%"> <KeyFrame Cue="100%">
<Setter Property="RotateTransform.Angle" Value="360" /> <Setter Property="RotateTransform.Angle" Value="360" />
</KeyFrame> </KeyFrame>
</Animation> </Animation>
</Style.Animations> </Style.Animations>
</Style> </Style>
</Panel.Styles> </Panel.Styles>
<Image <Image
Source="/Assets/WORLD.png" Name="AlbumCover"
Name="AlbumCover" Width="200"
Width="200" Height="200"
Height="200" /> Source="/Assets/WORLD.png" />
<Arc <Arc
Width="290" Width="290"
Height="290" Height="290"
StartAngle="0" StartAngle="0"
SweepAngle="360" StrokeJoin="Round"
StrokeJoin="Round" StrokeLineCap="Round"
StrokeLineCap="Round" StrokeThickness="45"
StrokeThickness="45"> SweepAngle="360">
<Arc.Stroke> <Arc.Stroke>
<LinearGradientBrush StartPoint="0%,0%" EndPoint="100%,0%"> <LinearGradientBrush StartPoint="0%,0%" EndPoint="100%,0%">
<GradientStop Color="#010101" Offset="0" /> <GradientStop Offset="0" Color="#010101" />
<GradientStop Color="#363636" Offset="0.5" /> <GradientStop Offset="0.5" Color="#363636" />
<GradientStop Color="#010101" Offset="1" /> <GradientStop Offset="1" Color="#010101" />
</LinearGradientBrush> </LinearGradientBrush>
</Arc.Stroke> </Arc.Stroke>
</Arc> </Arc>
<Arc <Arc
Width="294" Width="294"
Height="294" Height="294"
StartAngle="0" StartAngle="0"
SweepAngle="360" Stroke="Black"
StrokeJoin="Round" StrokeJoin="Round"
StrokeLineCap="Round" StrokeLineCap="Round"
StrokeThickness="4" StrokeThickness="4"
Stroke="Black" /> SweepAngle="360" />
<Arc <Arc
Width="310" Width="310"
Height="310" Height="310"
StartAngle="0" Opacity="0.1"
SweepAngle="360" StartAngle="0"
StrokeJoin="Round" Stroke="#C6CACD"
StrokeLineCap="Round" StrokeJoin="Round"
StrokeThickness="10" StrokeLineCap="Round"
Stroke="#C6CACD" StrokeThickness="10"
Opacity="0.1" /> SweepAngle="360" />
</Panel> </Panel>
</SplitView>
</SplitView>
</Border>
</TabItem>
<TabItem Header="VerticalSplitView">
<Border
BorderBrush="{DynamicResource SemiGrey1}"
BorderThickness="1">
<SplitView
Name="SplitView2"
Theme="{DynamicResource VerticalSplitView}"
IsPaneOpen="{Binding #PaneOpenButton.IsChecked,Mode=TwoWay}"
UseLightDismissOverlayMode="{Binding #UseLightDismissOverlayModeButton.IsChecked}"
PanePlacement="{Binding #PanePlacementButton.IsChecked}"
DisplayMode="{Binding #DisplayModeSelector.SelectedItem}"
CompactPaneLength="{Binding #CompactPaneLengthSlider.Value}"
OpenPaneLength="{Binding #OpenPaneLengthSlider.Value}">
<SplitView.Background>
<LinearGradientBrush StartPoint="0%,0%" EndPoint="0%,100%">
<GradientStop Color="#6b4c1b" Offset="0" />
<GradientStop Color="#291e10" Offset="1" />
</LinearGradientBrush>
</SplitView.Background>
<SplitView.Pane>
<Grid RowDefinitions="Auto,Auto,*">
<ToggleSwitch
Grid.Row="0"
Theme="{DynamicResource IconBorderlessToggleSwitch}"
Content="{StaticResource SemiIconSidebar}"
HorizontalAlignment="Left"
IsChecked="{Binding #SplitView2.IsPaneOpen}" />
<TextBlock
Grid.Row="1"
Margin="8,12"
FontWeight="Bold"
Text="Playlist" />
<ListBox
Grid.Row="2"
ItemsSource="{Binding Songs}" />
</Grid>
</SplitView.Pane>
<Panel>
<Panel.Styles>
<Style Selector="Image#AlbumCover2">
<Style.Animations>
<Animation IterationCount="Infinite" Duration="0:0:40">
<KeyFrame Cue="0%">
<Setter Property="RotateTransform.Angle" Value="0" />
</KeyFrame>
<KeyFrame Cue="100%">
<Setter Property="RotateTransform.Angle" Value="360" />
</KeyFrame>
</Animation>
</Style.Animations>
</Style>
</Panel.Styles>
<Image
Source="/Assets/WORLD.png"
Name="AlbumCover2"
Width="200"
Height="200" />
<Arc
Width="290"
Height="290"
StartAngle="0"
SweepAngle="360"
StrokeJoin="Round"
StrokeLineCap="Round"
StrokeThickness="45">
<Arc.Stroke>
<LinearGradientBrush StartPoint="0%,0%" EndPoint="100%,0%">
<GradientStop Color="#010101" Offset="0" />
<GradientStop Color="#363636" Offset="0.5" />
<GradientStop Color="#010101" Offset="1" />
</LinearGradientBrush>
</Arc.Stroke>
</Arc>
<Arc
Width="294"
Height="294"
StartAngle="0"
SweepAngle="360"
StrokeJoin="Round"
StrokeLineCap="Round"
StrokeThickness="4"
Stroke="Black" />
<Arc
Width="310"
Height="310"
StartAngle="0"
SweepAngle="360"
StrokeJoin="Round"
StrokeLineCap="Round"
StrokeThickness="10"
Stroke="#C6CACD"
Opacity="0.1" />
</Panel>
</SplitView>
</Border>
</TabItem>
</TabControl>
</Grid> </Grid>
</Border> </Border>
</UserControl> </UserControl>

View File

@@ -7,7 +7,6 @@
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels;assembly=Semi.Avalonia.Demo" xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels;assembly=Semi.Avalonia.Demo"
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
x:CompileBindings="True"
x:DataType="vm:TabControlDemoViewModel" x:DataType="vm:TabControlDemoViewModel"
mc:Ignorable="d"> mc:Ignorable="d">
<ScrollViewer> <ScrollViewer>

View File

@@ -5,7 +5,6 @@
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels" xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Semi.Avalonia.Demo.Pages.TabStripDemo" x:Class="Semi.Avalonia.Demo.Pages.TabStripDemo"
x:CompileBindings="True"
x:DataType="vm:TabStripDemoViewModel"> x:DataType="vm:TabStripDemoViewModel">
<Design.DataContext> <Design.DataContext>
<vm:TabStripDemoViewModel /> <vm:TabStripDemoViewModel />

View File

@@ -1,98 +0,0 @@
<UserControl
x:Class="Semi.Avalonia.Demo.Pages.ToggleButtonDemo"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<StackPanel Spacing="20">
<TextBlock Text="Toggle Button (Default)" />
<StackPanel Orientation="Horizontal" Spacing="20">
<ToggleButton>Default</ToggleButton>
<ToggleButton Classes="Primary">Primary</ToggleButton>
<ToggleButton Classes="Secondary">Secondary</ToggleButton>
<ToggleButton Classes="Tertiary">Tertiary</ToggleButton>
<ToggleButton Classes="Success">Success</ToggleButton>
<ToggleButton Classes="Warning">Warning</ToggleButton>
<ToggleButton Classes="Danger">Danger</ToggleButton>
<ToggleButton Classes="Danger" IsEnabled="False">Disabled</ToggleButton>
</StackPanel>
<TextBlock Text="Toggle Button Checked State" />
<StackPanel Orientation="Horizontal" Spacing="20">
<ToggleButton IsChecked="True">Default</ToggleButton>
<ToggleButton Classes="Primary" IsChecked="True">Primary</ToggleButton>
<ToggleButton Classes="Secondary" IsChecked="True">Secondary</ToggleButton>
<ToggleButton Classes="Tertiary" IsChecked="True">Tertiary</ToggleButton>
<ToggleButton Classes="Success" IsChecked="True">Success</ToggleButton>
<ToggleButton Classes="Warning" IsChecked="True">Warning</ToggleButton>
<ToggleButton Classes="Danger" IsChecked="True">Danger</ToggleButton>
<ToggleButton
Classes="Danger"
IsChecked="True"
IsEnabled="False">
Disabled
</ToggleButton>
</StackPanel>
<TextBlock Text="Toggle Button Three State" />
<StackPanel Orientation="Horizontal" Spacing="20">
<ToggleButton IsChecked="{x:Null}" IsThreeState="True">Default</ToggleButton>
<ToggleButton
Classes="Primary"
IsChecked="{x:Null}"
IsThreeState="True">
Primary
</ToggleButton>
<ToggleButton
Classes="Secondary"
IsChecked="{x:Null}"
IsThreeState="True">
Secondary
</ToggleButton>
<ToggleButton
Classes="Tertiary"
IsChecked="{x:Null}"
IsThreeState="True">
Tertiary
</ToggleButton>
<ToggleButton
Classes="Success"
IsChecked="{x:Null}"
IsThreeState="True">
Success
</ToggleButton>
<ToggleButton
Classes="Warning"
IsChecked="{x:Null}"
IsThreeState="True">
Warning
</ToggleButton>
<ToggleButton
Classes="Danger"
IsChecked="{x:Null}"
IsThreeState="True">
Danger
</ToggleButton>
<ToggleButton
Classes="Danger"
IsChecked="{x:Null}"
IsEnabled="False"
IsThreeState="True">
Disabled
</ToggleButton>
</StackPanel>
<TextBlock Text="Toggle Button Disabled State" />
<StackPanel Background="{DynamicResource SemiColorBackground1}" Orientation="Horizontal" Spacing="20">
<ToggleButton IsThreeState="True" IsEnabled="False">Default</ToggleButton>
<ToggleButton IsThreeState="True" IsEnabled="False" IsChecked="True">Checked</ToggleButton>
<ToggleButton IsThreeState="True" IsEnabled="False" IsChecked="{x:Null}">Indeterminate</ToggleButton>
</StackPanel>
<TextBlock Text="Toggle Button Size" />
<StackPanel Orientation="Horizontal" Spacing="20">
<ToggleButton Classes="Small" IsThreeState="True">Small</ToggleButton>
<ToggleButton IsThreeState="True">Default</ToggleButton>
<ToggleButton Classes="Large" IsThreeState="True">Large</ToggleButton>
</StackPanel>
</StackPanel>
</UserControl>

View File

@@ -1,11 +0,0 @@
using Avalonia.Controls;
namespace Semi.Avalonia.Demo.Pages;
public partial class ToggleButtonDemo : UserControl
{
public ToggleButtonDemo()
{
InitializeComponent();
}
}

View File

@@ -6,7 +6,6 @@
xmlns:converters="clr-namespace:Semi.Avalonia.Demo.Converters" xmlns:converters="clr-namespace:Semi.Avalonia.Demo.Converters"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Semi.Avalonia.Demo.Pages.TreeDataGridDemo" x:Class="Semi.Avalonia.Demo.Pages.TreeDataGridDemo"
x:CompileBindings="True"
x:DataType="vm:TreeDataGridDemoViewModel"> x:DataType="vm:TreeDataGridDemoViewModel">
<UserControl.Resources> <UserControl.Resources>
<converters:FileIconConverter x:Key="FileIconConverter"> <converters:FileIconConverter x:Key="FileIconConverter">

View File

@@ -14,10 +14,9 @@ public partial class TreeDataGridDemo : UserControl
private void SelectedPath_KeyDown(object? sender, KeyEventArgs e) private void SelectedPath_KeyDown(object? sender, KeyEventArgs e)
{ {
if (e.Key == Key.Enter) if (e.Key == Key.Enter && DataContext is TreeDataGridDemoViewModel vm)
{ {
var vm = DataContext as TreeDataGridDemoViewModel; vm.FilesContext.SelectedPath = (sender as TextBox)?.Text;
vm.FilesContext.SelectedPath = (sender as TextBox)!.Text;
} }
} }
} }

View File

@@ -8,7 +8,6 @@
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.Pages" xmlns:vm="clr-namespace:Semi.Avalonia.Demo.Pages"
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
x:CompileBindings="True"
x:DataType="vm:TreeViewVm" x:DataType="vm:TreeViewVm"
mc:Ignorable="d"> mc:Ignorable="d">

View File

@@ -21,33 +21,40 @@ public class TreeViewVm : ObservableObject
public TreeViewVm() public TreeViewVm()
{ {
Items = new ObservableCollection<TreeViewItemVm>() Items =
{ [
new TreeViewItemVm() { Name = "Item 1", Id = "1" }, new TreeViewItemVm { Name = "Item 1", Id = "1" },
new TreeViewItemVm() { Name = "Item 2", Id = "2" }, new TreeViewItemVm { Name = "Item 2", Id = "2" },
new TreeViewItemVm() new TreeViewItemVm
{ {
Name = "Item 3", Id = "3", Items = new ObservableCollection<TreeViewItemVm>() Name = "Item 3", Id = "3", Items =
{ [
new TreeViewItemVm() { Name = "Item 3.1", Id = "3.1" }, new TreeViewItemVm { Name = "Item 3.1", Id = "3.1" },
new TreeViewItemVm() { Name = "Item 3.2", Id = "3.2" }, new TreeViewItemVm { Name = "Item 3.2", Id = "3.2" },
new TreeViewItemVm() { Name = "Item 3.3", Id = "3.3" }, new TreeViewItemVm { Name = "Item 3.3", Id = "3.3" }
}, ],
}, }
};
MultipleLevelItems = new(); ];
for (int i = 1; i < 6; i++)
MultipleLevelItems = [];
for (var i = 1; i < 6; i++)
{ {
FirstItem firstItem = new FirstItem { Id = i, Name = $"FirstItem {i}" }; var firstItem = new FirstItem
firstItem.SecondItems = new();
for (int j = 1; j < 6; j++)
{ {
SecondItem secondItem = new SecondItem { Id = j, Name = $"SecondItem {j}" }; Id = i, Name = $"FirstItem {i}",
secondItem.ThirdItemItems = new(); SecondItems = []
for (int k = 1; k < 6; k++) };
for (var j = 1; j < 6; j++)
{
var secondItem = new SecondItem
{ {
ThirdItem thirdItem = new ThirdItem { Id = k, Name = $"ThirdItem {k}" }; Id = j, Name = $"SecondItem {j}",
ThirdItemItems = []
};
for (var k = 1; k < 6; k++)
{
var thirdItem = new ThirdItem { Id = k, Name = $"ThirdItem {k}" };
secondItem.ThirdItemItems.Add(thirdItem); secondItem.ThirdItemItems.Add(thirdItem);
} }
@@ -61,9 +68,9 @@ public class TreeViewVm : ObservableObject
public partial class TreeViewItemVm : ObservableObject public partial class TreeViewItemVm : ObservableObject
{ {
public ObservableCollection<TreeViewItemVm> Items { get; set; } public ObservableCollection<TreeViewItemVm> Items { get; set; } = [];
public string Name { get; set; } public string? Name { get; set; }
public string Id { get; set; } public string? Id { get; set; }
} }
public class ItemBase public class ItemBase

View File

@@ -6,89 +6,99 @@
xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages" xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Semi.Avalonia.Demo.Pages.VariablesDemo" x:Class="Semi.Avalonia.Demo.Pages.VariablesDemo"
x:DataType="vm:VariablesDemoViewModel" x:DataType="vm:VariablesDemoViewModel">
x:CompileBindings="True">
<Design.DataContext> <Design.DataContext>
<vm:VariablesDemoViewModel /> <vm:VariablesDemoViewModel />
</Design.DataContext> </Design.DataContext>
<DataGrid <Grid RowDefinitions="Auto, *">
Margin="8" <TextBox
CanUserReorderColumns="True" Grid.Row="0"
CanUserResizeColumns="True" Width="600"
CanUserSortColumns="True" Margin="8"
HeadersVisibility="All" Classes="ClearButton"
IsReadOnly="True" Text="{Binding SearchText}"
ItemsSource="{Binding GridData}"> Watermark="Input Variable Category/ResourceKey/Type/Value/Description" />
<DataGrid.Columns>
<DataGridTemplateColumn <DataGrid
Width="300" Grid.Row="1"
x:DataType="vm:VariableItem" Margin="8"
Header="ResourceKey"> CanUserReorderColumns="True"
<DataGridTemplateColumn.CellTemplate> CanUserResizeColumns="True"
<DataTemplate DataType="vm:VariableItem"> CanUserSortColumns="True"
<SelectableTextBlock HeadersVisibility="All"
Margin="12,0" IsReadOnly="True"
VerticalAlignment="Center" ItemsSource="{Binding GridData}">
Text="{Binding ResourceKey}" /> <DataGrid.Columns>
</DataTemplate> <DataGridTemplateColumn
</DataGridTemplateColumn.CellTemplate> Width="300"
</DataGridTemplateColumn> x:DataType="vm:VariableItem"
<DataGridTemplateColumn Header="ResourceKey">
Width="200" <DataGridTemplateColumn.CellTemplate>
x:DataType="vm:VariableItem" <DataTemplate DataType="vm:VariableItem">
Header="Type"> <SelectableTextBlock
<DataGridTemplateColumn.CellTemplate> Margin="12,0"
<DataTemplate DataType="vm:VariableItem"> VerticalAlignment="Center"
<SelectableTextBlock Text="{Binding ResourceKey}" />
Margin="12,0" </DataTemplate>
VerticalAlignment="Center" </DataGridTemplateColumn.CellTemplate>
Text="{Binding Type.Name}" /> </DataGridTemplateColumn>
</DataTemplate> <DataGridTemplateColumn
</DataGridTemplateColumn.CellTemplate> Width="200"
</DataGridTemplateColumn> x:DataType="vm:VariableItem"
<DataGridTemplateColumn Header="Type">
Width="200" <DataGridTemplateColumn.CellTemplate>
x:DataType="vm:VariableItem" <DataTemplate DataType="vm:VariableItem">
Header="Value"> <SelectableTextBlock
<DataGridTemplateColumn.CellTemplate> Margin="12,0"
<DataTemplate DataType="vm:VariableItem"> VerticalAlignment="Center"
<SelectableTextBlock Text="{Binding Type.Name}" />
Margin="12,0" </DataTemplate>
VerticalAlignment="Center" </DataGridTemplateColumn.CellTemplate>
Text="{Binding Value}" </DataGridTemplateColumn>
TextWrapping="Wrap" /> <DataGridTemplateColumn
</DataTemplate> Width="200"
</DataGridTemplateColumn.CellTemplate> x:DataType="vm:VariableItem"
</DataGridTemplateColumn> Header="Value">
<DataGridTemplateColumn <DataGridTemplateColumn.CellTemplate>
Width="*" <DataTemplate DataType="vm:VariableItem">
x:DataType="vm:VariableItem" <SelectableTextBlock
Header="Description"> Margin="12,0"
<DataGridTemplateColumn.CellTemplate> VerticalAlignment="Center"
<DataTemplate DataType="vm:VariableItem"> Text="{Binding Value}"
<SelectableTextBlock TextWrapping="Wrap" />
Margin="12,0" </DataTemplate>
VerticalAlignment="Center" </DataGridTemplateColumn.CellTemplate>
Text="{Binding Description}" </DataGridTemplateColumn>
TextWrapping="Wrap" /> <DataGridTemplateColumn
</DataTemplate> Width="*"
</DataGridTemplateColumn.CellTemplate> x:DataType="vm:VariableItem"
</DataGridTemplateColumn> Header="Description">
<DataGridTemplateColumn <DataGridTemplateColumn.CellTemplate>
Width="100" <DataTemplate DataType="vm:VariableItem">
x:DataType="vm:VariableItem" <SelectableTextBlock
Header="CopyText" Margin="12,0"
SortMemberPath="Duration"> VerticalAlignment="Center"
<DataGridTemplateColumn.CellTemplate> Text="{Binding Description}"
<DataTemplate DataType="vm:VariableItem"> TextWrapping="Wrap" />
<Button </DataTemplate>
Command="{Binding $parent[pages:VariablesDemo].Copy}" </DataGridTemplateColumn.CellTemplate>
CommandParameter="{Binding CopyText}" </DataGridTemplateColumn>
Theme="{DynamicResource IconBorderlessButton}" <DataGridTemplateColumn
Content="{StaticResource SemiIconCopy}" /> Width="100"
</DataTemplate> x:DataType="vm:VariableItem"
</DataGridTemplateColumn.CellTemplate> Header="CopyText"
</DataGridTemplateColumn> SortMemberPath="Duration">
</DataGrid.Columns> <DataGridTemplateColumn.CellTemplate>
</DataGrid> <DataTemplate DataType="vm:VariableItem">
<Button
Command="{Binding $parent[pages:VariablesDemo].Copy}"
CommandParameter="{Binding CopyText}"
Theme="{DynamicResource IconBorderlessButton}"
Content="{StaticResource SemiIconCopy}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</Grid>
</UserControl> </UserControl>

View File

@@ -3,6 +3,7 @@
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@@ -10,16 +11,16 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)"/> <PackageReference Include="Avalonia"/>
<PackageReference Include="Avalonia.Controls.ColorPicker" Version="$(AvaloniaVersion)"/> <PackageReference Include="Avalonia.Controls.ColorPicker"/>
<PackageReference Include="Avalonia.Controls.DataGrid" Version="$(DataGridVersion)"/> <PackageReference Include="Avalonia.Controls.DataGrid"/>
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)"> <PackageReference Include="Avalonia.Diagnostics">
<IncludeAssets Condition="'$(Configuration)' != 'Debug'">None</IncludeAssets> <IncludeAssets Condition="'$(Configuration)' != 'Debug'">None</IncludeAssets>
<PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets> <PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets>
</PackageReference> </PackageReference>
<PackageReference Include="CommunityToolkit.Mvvm" Version="$(CommunityToolkitVersion)"/> <PackageReference Include="CommunityToolkit.Mvvm"/>
<PackageReference Include="Irihi.Avalonia.Shared" Version="0.3.0" /> <PackageReference Include="Irihi.Avalonia.Shared"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -1,8 +1,7 @@
<ResourceDictionary <ResourceDictionary
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Semi.Avalonia.Demo.Controls" xmlns:controls="clr-namespace:Semi.Avalonia.Demo.Controls">
x:CompileBindings="True">
<ControlTheme x:Key="{x:Type controls:ColorDetailControl}" TargetType="controls:ColorDetailControl"> <ControlTheme x:Key="{x:Type controls:ColorDetailControl}" TargetType="controls:ColorDetailControl">
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="controls:ColorDetailControl"> <ControlTemplate TargetType="controls:ColorDetailControl">

View File

@@ -1,8 +1,7 @@
<ResourceDictionary <ResourceDictionary
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Semi.Avalonia.Demo.Controls" xmlns:controls="using:Semi.Avalonia.Demo.Controls">
x:CompileBindings="True">
<Design.PreviewWith> <Design.PreviewWith>
<controls:ColorItemControl /> <controls:ColorItemControl />
</Design.PreviewWith> </Design.PreviewWith>

View File

@@ -4,7 +4,6 @@
xmlns:controls="clr-namespace:Semi.Avalonia.Demo.Controls" xmlns:controls="clr-namespace:Semi.Avalonia.Demo.Controls"
xmlns:viewModels="clr-namespace:Semi.Avalonia.Demo.ViewModels" xmlns:viewModels="clr-namespace:Semi.Avalonia.Demo.ViewModels"
xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages" xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
x:CompileBindings="True"
x:DataType="viewModels:FunctionalColorGroupViewModel"> x:DataType="viewModels:FunctionalColorGroupViewModel">
<ControlTheme x:Key="{x:Type controls:FunctionalColorGroupControl}" TargetType="controls:FunctionalColorGroupControl"> <ControlTheme x:Key="{x:Type controls:FunctionalColorGroupControl}" TargetType="controls:FunctionalColorGroupControl">
<Setter Property="Template"> <Setter Property="Template">

View File

@@ -4,7 +4,6 @@
xmlns:controls="clr-namespace:Semi.Avalonia.Demo.Controls" xmlns:controls="clr-namespace:Semi.Avalonia.Demo.Controls"
xmlns:viewModels="clr-namespace:Semi.Avalonia.Demo.ViewModels" xmlns:viewModels="clr-namespace:Semi.Avalonia.Demo.ViewModels"
xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages" xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
x:CompileBindings="True"
x:DataType="viewModels:ShadowGroupViewModel"> x:DataType="viewModels:ShadowGroupViewModel">
<ControlTheme x:Key="{x:Type controls:ShadowGroupControl}" TargetType="controls:ShadowGroupControl"> <ControlTheme x:Key="{x:Type controls:ShadowGroupControl}" TargetType="controls:ShadowGroupControl">
<Setter Property="Template"> <Setter Property="Template">

View File

@@ -1,12 +1,37 @@
using Avalonia; using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.ApplicationLifetimes; using Avalonia.Controls.ApplicationLifetimes;
using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input; using CommunityToolkit.Mvvm.Input;
using CommunityToolkit.Mvvm.Messaging;
namespace Semi.Avalonia.Demo.ViewModels; namespace Semi.Avalonia.Demo.ViewModels;
public partial class ApplicationViewModel : ObservableObject public partial class ApplicationViewModel : ObservableObject
{ {
[RelayCommand]
private void Activate()
{
if (Application.Current?.ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop) return;
var mainWindow = desktop.MainWindow;
if (mainWindow is not null && !mainWindow.IsActive)
{
if (mainWindow.WindowState is WindowState.Minimized)
{
mainWindow.WindowState = WindowState.Normal;
}
mainWindow.Activate();
}
}
[RelayCommand]
private void JumpTo(string header)
{
Activate();
WeakReferenceMessenger.Default.Send(header, "JumpTo");
}
[RelayCommand] [RelayCommand]
private void Exit() private void Exit()
{ {

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Linq; using System.Linq;
using Avalonia.Controls; using Avalonia.Controls;
@@ -9,20 +10,21 @@ namespace Semi.Avalonia.Demo.ViewModels;
public partial class IconDemoViewModel : ObservableObject public partial class IconDemoViewModel : ObservableObject
{ {
private readonly IResourceDictionary? _resources = new Icons(); private readonly Icons _resources = new();
private readonly Dictionary<string, IconItem> _filledIcons = new(); private readonly Dictionary<string, IconItem> _fillIcons = new();
private readonly Dictionary<string, IconItem> _strokedIcons = new(); private readonly Dictionary<string, IconItem> _strokedIcons = new();
private readonly Dictionary<string, IconItem> _aiIcons = new();
[ObservableProperty] private string? _searchText; [ObservableProperty] private string? _searchText;
public ObservableCollection<IconItem> FilteredFilledIcons { get; set; } = []; public ObservableCollection<IconTab> IconTabs { get; } = [];
public ObservableCollection<IconItem> FilteredFillIcons { get; set; } = [];
public ObservableCollection<IconItem> FilteredStrokedIcons { get; set; } = []; public ObservableCollection<IconItem> FilteredStrokedIcons { get; set; } = [];
public ObservableCollection<IconItem> FilteredAIIcons { get; set; } = [];
public void InitializeResources() public void InitializeResources()
{ {
if (_resources is null) return;
foreach (var provider in _resources.MergedDictionaries) foreach (var provider in _resources.MergedDictionaries)
{ {
if (provider is not ResourceDictionary dic) continue; if (provider is not ResourceDictionary dic) continue;
@@ -30,40 +32,60 @@ public partial class IconDemoViewModel : ObservableObject
foreach (var key in dic.Keys) foreach (var key in dic.Keys)
{ {
if (dic[key] is not Geometry geometry) continue; if (dic[key] is not Geometry geometry) continue;
var resourceKey = key.ToString() ?? string.Empty;
var icon = new IconItem var icon = new IconItem
{ {
ResourceKey = key.ToString(), ResourceKey = resourceKey,
Geometry = geometry Geometry = geometry
}; };
if (key.ToString().EndsWith("Stroked")) if (resourceKey.StartsWith("SemiIconAI"))
_strokedIcons[key.ToString().ToLowerInvariant()] = icon; _aiIcons[resourceKey] = icon;
else if (resourceKey.EndsWith("Stroked", StringComparison.InvariantCultureIgnoreCase))
_strokedIcons[resourceKey] = icon;
else else
_filledIcons[key.ToString().ToLowerInvariant()] = icon; _fillIcons[resourceKey] = icon;
} }
} }
OnSearchTextChanged(string.Empty); OnSearchTextChanged(string.Empty);
IconTabs.Clear();
IconTabs.Add(new IconTab("Fill Icons", FilteredFillIcons));
IconTabs.Add(new IconTab("Stroked Icons", FilteredStrokedIcons));
IconTabs.Add(new IconTab("AI Icons", FilteredAIIcons));
} }
partial void OnSearchTextChanged(string? value) partial void OnSearchTextChanged(string? value)
{ {
var search = value?.ToLowerInvariant() ?? string.Empty; var search = string.IsNullOrWhiteSpace(value) ? string.Empty : value.Trim();
FilteredFilledIcons.Clear(); FilteredFillIcons.Clear();
foreach (var pair in _filledIcons.Where(i => i.Key.Contains(search))) foreach (var pair in _fillIcons.Where(kv => kv.Key.Contains(search, StringComparison.InvariantCultureIgnoreCase)))
{ {
FilteredFilledIcons.Add(pair.Value); FilteredFillIcons.Add(pair.Value);
} }
FilteredStrokedIcons.Clear(); FilteredStrokedIcons.Clear();
foreach (var pair in _strokedIcons.Where(i => i.Key.Contains(search))) foreach (var pair in _strokedIcons.Where(kv => kv.Key.Contains(search, StringComparison.InvariantCultureIgnoreCase)))
{ {
FilteredStrokedIcons.Add(pair.Value); FilteredStrokedIcons.Add(pair.Value);
} }
FilteredAIIcons.Clear();
foreach (var pair in _aiIcons.Where(kv => kv.Key.Contains(search, StringComparison.InvariantCultureIgnoreCase)))
{
FilteredAIIcons.Add(pair.Value);
}
} }
} }
public class IconTab(string header, ObservableCollection<IconItem> iconItems)
{
public string Header { get; set; } = header;
public ObservableCollection<IconItem> IconItems { get; set; } = iconItems;
}
public class IconItem public class IconItem
{ {
public string? ResourceKey { get; set; } public string? ResourceKey { get; set; }

View File

@@ -19,7 +19,7 @@ public partial class PaletteDemoViewModel : ObservableObject
"Red", "Pink", "Purple", "Violet", "Indigo", "Red", "Pink", "Purple", "Violet", "Indigo",
"Blue", "LightBlue", "Cyan", "Teal", "Green", "Blue", "LightBlue", "Cyan", "Teal", "Green",
"LightGreen", "Lime", "Yellow", "Amber", "Orange", "LightGreen", "Lime", "Yellow", "Amber", "Orange",
"Grey" "Grey", "AIPurple"
]; ];
private readonly IResourceDictionary? _lightResourceDictionary; private readonly IResourceDictionary? _lightResourceDictionary;
@@ -61,6 +61,38 @@ public partial class PaletteDemoViewModel : ObservableObject
s.Initialize(_darkResourceDictionary, color, false); s.Initialize(_darkResourceDictionary, color, false);
DarkLists.Add(s); DarkLists.Add(s);
} }
InitializeAIGeneralGradients();
}
private void InitializeAIGeneralGradients()
{
if (_lightResourceDictionary is null || _darkResourceDictionary is null) return;
ColorListViewModel lightGradients = new ColorListViewModel { SeriesName = "AI General" };
ColorListViewModel darkGradients = new ColorListViewModel { SeriesName = "AI General" };
for (var i = 0; i < 10; i++)
{
var key = $"SemiAIGeneral{i}";
if (_lightResourceDictionary.TryGetValue(key, out var lightValue) && lightValue is IBrush lightBrush)
{
var name = $"AI General {i}";
var item = new ColorItemViewModel(name, lightBrush, key, true, i);
lightGradients.Color.Add(item);
}
if (_darkResourceDictionary.TryGetValue(key, out var darkValue) && darkValue is IBrush darkBrush)
{
var name = $"AI General {i}";
var item = new ColorItemViewModel(name, darkBrush, key, false, i);
darkGradients.Color.Add(item);
}
}
LightLists.Add(lightGradients);
DarkLists.Add(darkGradients);
} }
private void InitializeFunctionalColors() private void InitializeFunctionalColors()
@@ -79,6 +111,12 @@ public partial class PaletteDemoViewModel : ObservableObject
"Warning", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.WarningTokens)); "Warning", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.WarningTokens));
FunctionalColors.Add(new FunctionalColorGroupViewModel( FunctionalColors.Add(new FunctionalColorGroupViewModel(
"Danger", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.DangerTokens)); "Danger", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.DangerTokens));
FunctionalColors.Add(new FunctionalColorGroupViewModel(
"AI General", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.AIGeneralTokens));
FunctionalColors.Add(new FunctionalColorGroupViewModel(
"AI Purple", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.AIPurpleTokens));
FunctionalColors.Add(new FunctionalColorGroupViewModel(
"AI Background", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.AIBackgroundTokens));
FunctionalColors.Add(new FunctionalColorGroupViewModel( FunctionalColors.Add(new FunctionalColorGroupViewModel(
"Text", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.TextTokens)); "Text", _lightResourceDictionary, _darkResourceDictionary, ColorTokens.TextTokens));
FunctionalColors.Add(new FunctionalColorGroupViewModel( FunctionalColors.Add(new FunctionalColorGroupViewModel(
@@ -142,14 +180,24 @@ public partial class ColorItemViewModel : ObservableObject
<StaticResource x:Key="" ResourceKey="{ResourceKey}" /> <StaticResource x:Key="" ResourceKey="{ResourceKey}" />
"""; """;
public ColorItemViewModel(string colorDisplayName, ISolidColorBrush brush, string resourceKey, bool light, public ColorItemViewModel(string colorDisplayName, IBrush brush, string resourceKey, bool light,
int index) int index)
{ {
ColorDisplayName = colorDisplayName; ColorDisplayName = colorDisplayName;
Brush = brush; Brush = brush;
ResourceKey = resourceKey; ResourceKey = resourceKey;
var hex = ColorConverter.ToHex.Convert(brush.Color, typeof(string), false, CultureInfo.InvariantCulture);
Hex = hex as string ?? string.Empty; // Only calculate hex for solid color brushes
if (brush is ISolidColorBrush solidBrush)
{
var hex = ColorConverter.ToHex.Convert(solidBrush.Color, typeof(string), false, CultureInfo.InvariantCulture);
Hex = hex as string ?? string.Empty;
}
else
{
Hex = string.Empty;
}
if ((light && index < 5) || (!light && index >= 5)) if ((light && index < 5) || (!light && index >= 5))
{ {
TextBrush = Brushes.Black; TextBrush = Brushes.Black;
@@ -175,7 +223,7 @@ public partial class FunctionalColorGroupViewModel : ObservableObject
{ {
if (lightDictionary?.TryGetValue(key, out var lightValue) ?? false) if (lightDictionary?.TryGetValue(key, out var lightValue) ?? false)
{ {
if (lightValue is ISolidColorBrush lightBrush) if (lightValue is IBrush lightBrush)
{ {
LightColors.Add(new ColorItemViewModel(name, lightBrush, key, true, 0)); LightColors.Add(new ColorItemViewModel(name, lightBrush, key, true, 0));
} }
@@ -183,7 +231,7 @@ public partial class FunctionalColorGroupViewModel : ObservableObject
if (darkDictionary?.TryGetValue(key, out var darkValue) ?? false) if (darkDictionary?.TryGetValue(key, out var darkValue) ?? false)
{ {
if (darkValue is ISolidColorBrush darkBrush) if (darkValue is IBrush darkBrush)
{ {
DarkColors.Add(new ColorItemViewModel(name, darkBrush, key, true, 0)); DarkColors.Add(new ColorItemViewModel(name, darkBrush, key, true, 0));
} }

View File

@@ -26,4 +26,12 @@ public class SplitViewDemoViewModel : ObservableObject
SplitViewDisplayMode.Overlay, SplitViewDisplayMode.Overlay,
SplitViewDisplayMode.CompactOverlay, SplitViewDisplayMode.CompactOverlay,
]; ];
public static ObservableCollection<SplitViewPanePlacement> Placements { get; set; } =
[
SplitViewPanePlacement.Left,
SplitViewPanePlacement.Right,
SplitViewPanePlacement.Top,
SplitViewPanePlacement.Bottom
];
} }

View File

@@ -19,9 +19,15 @@ public partial class FilesPageViewModel : ObservableObject
public IList<string> Drives { get; } public IList<string> Drives { get; }
public HierarchicalTreeDataGridSource<FileNodeViewModel> Source { get; } public HierarchicalTreeDataGridSource<FileNodeViewModel> Source { get; }
[ObservableProperty] private string _selectedDrive; [ObservableProperty] private string _selectedDrive;
[ObservableProperty] private string? _selectedPath; private string? _selectedPath;
[ObservableProperty] private FileNodeViewModel? _root; [ObservableProperty] private FileNodeViewModel? _root;
public string? SelectedPath
{
get => _selectedPath;
set => SetSelectedPath(value);
}
partial void OnSelectedDriveChanged(string value) partial void OnSelectedDriveChanged(string value)
{ {
Root = new FileNodeViewModel(value, true, true); Root = new FileNodeViewModel(value, true, true);
@@ -31,11 +37,6 @@ public partial class FilesPageViewModel : ObservableObject
} }
} }
partial void OnSelectedPathChanged(string? value)
{
SetSelectedPath(value);
}
public FilesPageViewModel() public FilesPageViewModel()
{ {
Drives = DriveInfo.GetDrives().Select(x => x.Name).ToList(); Drives = DriveInfo.GetDrives().Select(x => x.Name).ToList();
@@ -48,7 +49,7 @@ public partial class FilesPageViewModel : ObservableObject
SelectedDrive = Drives.FirstOrDefault() ?? "/"; SelectedDrive = Drives.FirstOrDefault() ?? "/";
} }
Source = new HierarchicalTreeDataGridSource<FileNodeViewModel>(Array.Empty<FileNodeViewModel>()) Source = new HierarchicalTreeDataGridSource<FileNodeViewModel>([])
{ {
Columns = Columns =
{ {
@@ -108,16 +109,14 @@ public partial class FilesPageViewModel : ObservableObject
foreach (var i in e.SelectedItems) foreach (var i in e.SelectedItems)
Trace.WriteLine($"Selected '{i?.Path}'"); Trace.WriteLine($"Selected '{i?.Path}'");
} }
private void SetSelectedPath(string? path)
private void SetSelectedPath(string? value)
{ {
if (string.IsNullOrEmpty(value)) if (string.IsNullOrEmpty(path))
{ {
Source.RowSelection!.Clear(); Source.RowSelection!.Clear();
return; return;
} }
var path = value;
var components = new Stack<string>(); var components = new Stack<string>();
DirectoryInfo? d = null; DirectoryInfo? d = null;
@@ -148,7 +147,7 @@ public partial class FilesPageViewModel : ObservableObject
if (driveIndex >= 0) if (driveIndex >= 0)
SelectedDrive = Drives[driveIndex]; SelectedDrive = Drives[driveIndex];
FileNodeViewModel? node = _root; var node = Root;
index = new IndexPath(0); index = new IndexPath(0);
while (node is not null && components.Count > 0) while (node is not null && components.Count > 0)
@@ -162,7 +161,7 @@ public partial class FilesPageViewModel : ObservableObject
} }
} }
Source.Items = [Root]; Source.Items = [Root!];
Source.RowSelection!.SelectedIndex = index; Source.RowSelection!.SelectedIndex = index;
} }
} }
@@ -275,8 +274,8 @@ public partial class FileNodeViewModel : ObservableObject, IEditableObject
}; };
} }
void IEditableObject.BeginEdit() => _undoName = _name; void IEditableObject.BeginEdit() => _undoName = Name;
void IEditableObject.CancelEdit() => _name = _undoName!; void IEditableObject.CancelEdit() => Name = _undoName ?? string.Empty;
void IEditableObject.EndEdit() => _undoName = null; void IEditableObject.EndEdit() => _undoName = null;
private void OnChanged(object sender, FileSystemEventArgs e) private void OnChanged(object sender, FileSystemEventArgs e)

View File

@@ -10,9 +10,10 @@ using Semi.Avalonia.Tokens;
namespace Semi.Avalonia.Demo.ViewModels; namespace Semi.Avalonia.Demo.ViewModels;
public class VariablesDemoViewModel : ObservableObject public partial class VariablesDemoViewModel : ObservableObject
{ {
public DataGridCollectionView GridData { get; set; } public DataGridCollectionView GridData { get; set; }
[ObservableProperty] private string _searchText = string.Empty;
public VariablesDemoViewModel() public VariablesDemoViewModel()
{ {
@@ -30,7 +31,7 @@ public class VariablesDemoViewModel : ObservableObject
GridData.GroupDescriptions.Add(new DataGridPathGroupDescription(nameof(VariableItem.Category))); GridData.GroupDescriptions.Add(new DataGridPathGroupDescription(nameof(VariableItem.Category)));
} }
private static string GetValueString(object? value) private static string? GetValueString(object? value)
{ {
if (value is null) return string.Empty; if (value is null) return string.Empty;
@@ -45,6 +46,28 @@ public class VariablesDemoViewModel : ObservableObject
}; };
} }
partial void OnSearchTextChanged(string value)
{
if (string.IsNullOrWhiteSpace(value))
{
GridData.Filter = _ => true;
GridData.Refresh();
return;
}
var search = value.Trim();
GridData.Filter = item =>
{
if (item is not VariableItem variableItem) return false;
return (variableItem.Category?.Contains(search, StringComparison.InvariantCultureIgnoreCase) ?? false) ||
(variableItem.ResourceKey?.Contains(search, StringComparison.InvariantCultureIgnoreCase) ?? false) ||
(variableItem.Value?.Contains(search, StringComparison.InvariantCultureIgnoreCase) ?? false) ||
(variableItem.Type?.Name.Contains(search, StringComparison.InvariantCultureIgnoreCase) ?? false) ||
(variableItem.Description?.Contains(search, StringComparison.InvariantCultureIgnoreCase) ?? false);
};
GridData.Refresh();
}
private static List<VariableItem> Tokens { get; set; } = private static List<VariableItem> Tokens { get; set; } =
[ [
new("Height", "SemiHeightControlSmall"), new("Height", "SemiHeightControlSmall"),
@@ -55,6 +78,11 @@ public class VariablesDemoViewModel : ObservableObject
new("Icon Size", "SemiWidthIconMedium"), new("Icon Size", "SemiWidthIconMedium"),
new("Icon Size", "SemiWidthIconLarge"), new("Icon Size", "SemiWidthIconLarge"),
new("Icon Size", "SemiWidthIconExtraLarge"), new("Icon Size", "SemiWidthIconExtraLarge"),
new("Border CornerRadius Spacing", "SemiBorderRadiusSpacingExtraSmall"),
new("Border CornerRadius Spacing", "SemiBorderRadiusSpacingSmall"),
new("Border CornerRadius Spacing", "SemiBorderRadiusSpacingMedium"),
new("Border CornerRadius Spacing", "SemiBorderRadiusSpacingLarge"),
new("Border CornerRadius Spacing", "SemiBorderRadiusSpacingFull"),
new("Border CornerRadius", "SemiBorderRadiusExtraSmall"), new("Border CornerRadius", "SemiBorderRadiusExtraSmall"),
new("Border CornerRadius", "SemiBorderRadiusSmall"), new("Border CornerRadius", "SemiBorderRadiusSmall"),
new("Border CornerRadius", "SemiBorderRadiusMedium"), new("Border CornerRadius", "SemiBorderRadiusMedium"),

View File

@@ -8,7 +8,6 @@
xmlns:views="clr-namespace:Semi.Avalonia.Demo.Views" xmlns:views="clr-namespace:Semi.Avalonia.Demo.Views"
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
x:CompileBindings="True"
x:DataType="views:MainViewModel" x:DataType="views:MainViewModel"
mc:Ignorable="d"> mc:Ignorable="d">
<UserControl.Resources> <UserControl.Resources>
@@ -162,15 +161,9 @@
<TabItem Header="Button"> <TabItem Header="Button">
<pages:ButtonDemo /> <pages:ButtonDemo />
</TabItem> </TabItem>
<TabItem Header="RepeatButton">
<pages:RepeatButtonDemo />
</TabItem>
<TabItem Header="HyperlinkButton"> <TabItem Header="HyperlinkButton">
<pages:HyperlinkButtonDemo /> <pages:HyperlinkButtonDemo />
</TabItem> </TabItem>
<TabItem Header="ToggleButton">
<pages:ToggleButtonDemo />
</TabItem>
<TabItem Header="CheckBox"> <TabItem Header="CheckBox">
<pages:CheckBoxDemo /> <pages:CheckBoxDemo />
</TabItem> </TabItem>

View File

@@ -9,6 +9,7 @@ using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Styling; using Avalonia.Styling;
using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input; using CommunityToolkit.Mvvm.Input;
using CommunityToolkit.Mvvm.Messaging;
namespace Semi.Avalonia.Demo.Views; namespace Semi.Avalonia.Demo.Views;
@@ -18,6 +19,19 @@ public partial class MainView : UserControl
{ {
InitializeComponent(); InitializeComponent();
this.DataContext = new MainViewModel(); this.DataContext = new MainViewModel();
WeakReferenceMessenger.Default.Register<string, string>(this, "JumpTo", MessageHandler);
}
private void MessageHandler(object _, string message)
{
foreach (var item in tab.ItemsView)
{
if (item is TabItem tabItem && tabItem.Header is not null && tabItem.Header.Equals(message))
{
tab.SelectedItem = tabItem;
break;
}
}
} }
} }
@@ -76,97 +90,97 @@ public partial class MainViewModel : ObservableObject
{ {
Header = "简体中文", Header = "简体中文",
Command = SelectLocaleCommand, Command = SelectLocaleCommand,
CommandParameter = new CultureInfo("zh-cn") CommandParameter = new CultureInfo("zh-CN")
}, },
new MenuItemViewModel new MenuItemViewModel
{ {
Header = "English", Header = "English",
Command = SelectLocaleCommand, Command = SelectLocaleCommand,
CommandParameter = new CultureInfo("en-us") CommandParameter = new CultureInfo("en-US")
}, },
new MenuItemViewModel new MenuItemViewModel
{ {
Header = "日本語", Header = "日本語",
Command = SelectLocaleCommand, Command = SelectLocaleCommand,
CommandParameter = new CultureInfo("ja-jp") CommandParameter = new CultureInfo("ja-JP")
}, },
new MenuItemViewModel new MenuItemViewModel
{ {
Header = "한국어", Header = "한국어",
Command = SelectLocaleCommand, Command = SelectLocaleCommand,
CommandParameter = new CultureInfo("ko-kr") CommandParameter = new CultureInfo("ko-KR")
}, },
new MenuItemViewModel new MenuItemViewModel
{ {
Header = "English (UK)", Header = "English (UK)",
Command = SelectLocaleCommand, Command = SelectLocaleCommand,
CommandParameter = new CultureInfo("en-gb") CommandParameter = new CultureInfo("en-GB")
}, },
new MenuItemViewModel new MenuItemViewModel
{ {
Header = "Italiano", Header = "Italiano",
Command = SelectLocaleCommand, Command = SelectLocaleCommand,
CommandParameter = new CultureInfo("it-it") CommandParameter = new CultureInfo("it-IT")
}, },
new MenuItemViewModel new MenuItemViewModel
{ {
Header = "Italiano (Switzerland)", Header = "Italiano (Switzerland)",
Command = SelectLocaleCommand, Command = SelectLocaleCommand,
CommandParameter = new CultureInfo("it-ch") CommandParameter = new CultureInfo("it-CH")
}, },
new MenuItemViewModel new MenuItemViewModel
{ {
Header = "Nederlands", Header = "Nederlands",
Command = SelectLocaleCommand, Command = SelectLocaleCommand,
CommandParameter = new CultureInfo("nl-nl") CommandParameter = new CultureInfo("nl-NL")
}, },
new MenuItemViewModel new MenuItemViewModel
{ {
Header = "Nederlands (Belgium)", Header = "Nederlands (Belgium)",
Command = SelectLocaleCommand, Command = SelectLocaleCommand,
CommandParameter = new CultureInfo("nl-be") CommandParameter = new CultureInfo("nl-BE")
}, },
new MenuItemViewModel new MenuItemViewModel
{ {
Header = "Українська", Header = "Українська",
Command = SelectLocaleCommand, Command = SelectLocaleCommand,
CommandParameter = new CultureInfo("uk-ua") CommandParameter = new CultureInfo("uk-UA")
}, },
new MenuItemViewModel new MenuItemViewModel
{ {
Header = "Русский", Header = "Русский",
Command = SelectLocaleCommand, Command = SelectLocaleCommand,
CommandParameter = new CultureInfo("ru-ru") CommandParameter = new CultureInfo("ru-RU")
}, },
new MenuItemViewModel new MenuItemViewModel
{ {
Header = "繁體中文", Header = "繁體中文",
Command = SelectLocaleCommand, Command = SelectLocaleCommand,
CommandParameter = new CultureInfo("zh-tw") CommandParameter = new CultureInfo("zh-TW")
}, },
new MenuItemViewModel new MenuItemViewModel
{ {
Header = "Deutsch", Header = "Deutsch",
Command = SelectLocaleCommand, Command = SelectLocaleCommand,
CommandParameter = new CultureInfo("de-de") CommandParameter = new CultureInfo("de-DE")
}, },
new MenuItemViewModel new MenuItemViewModel
{ {
Header = "Español", Header = "Español",
Command = SelectLocaleCommand, Command = SelectLocaleCommand,
CommandParameter = new CultureInfo("es-es") CommandParameter = new CultureInfo("es-ES")
}, },
new MenuItemViewModel new MenuItemViewModel
{ {
Header = "Polski", Header = "Polski",
Command = SelectLocaleCommand, Command = SelectLocaleCommand,
CommandParameter = new CultureInfo("pl-pl") CommandParameter = new CultureInfo("pl-PL")
}, },
new MenuItemViewModel new MenuItemViewModel
{ {
Header = "Français", Header = "Français",
Command = SelectLocaleCommand, Command = SelectLocaleCommand,
CommandParameter = new CultureInfo("fr-fr") CommandParameter = new CultureInfo("fr-FR")
}, },
] ]
} }
@@ -233,4 +247,4 @@ public class MenuItemViewModel
public ICommand? Command { get; set; } public ICommand? Command { get; set; }
public object? CommandParameter { get; set; } public object? CommandParameter { get; set; }
public IList<MenuItemViewModel>? Items { get; set; } public IList<MenuItemViewModel>? Items { get; set; }
} }

View File

@@ -1,17 +1,22 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<Version>11.2.1.10</Version> <AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
<IsAotCompatible>true</IsAotCompatible>
</PropertyGroup>
<PropertyGroup>
<Authors>IRIHI Technology Co., Ltd.</Authors> <Authors>IRIHI Technology Co., Ltd.</Authors>
<Description>Avalonia Theme inspired by Semi Design.</Description> <Description>Avalonia Theme inspired by Semi Design.</Description>
<RepositoryUrl>https://github.com/irihitech/Semi.Avalonia</RepositoryUrl> <RepositoryUrl>https://github.com/irihitech/Semi.Avalonia</RepositoryUrl>
<PackageProjectUrl>https://github.com/irihitech/Semi.Avalonia</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression> <PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIcon>irihi.png</PackageIcon> <PackageIcon>irihi.png</PackageIcon>
<PackageProjectUrl>https://github.com/irihitech/Semi.Avalonia</PackageProjectUrl> <PackageReadmeFile>README.md</PackageReadmeFile>
<AvaloniaVersion>11.2.1</AvaloniaVersion>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@@ -0,0 +1,13 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<AvaloniaVersion>11.3.7</AvaloniaVersion>
<DataGridVersion>11.3.7</DataGridVersion>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Avalonia" Version="$(AvaloniaVersion)"/>
<PackageVersion Include="Avalonia.Controls.ColorPicker" Version="$(AvaloniaVersion)"/>
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="$(DataGridVersion)"/>
<PackageVersion Include="Avalonia.Controls.TreeDataGrid" Version="11.1.1"/>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,50 @@
# Semi.Avalonia.ColorPicker
[![Semi Avalonia ColorPicker](https://img.shields.io/nuget/v/Semi.Avalonia.ColorPicker.svg?color=red&style=flat-square)](https://www.nuget.org/packages/Semi.Avalonia.ColorPicker/)
[![Semi Avalonia ColorPicker](https://img.shields.io/nuget/dt/Semi.Avalonia.ColorPicker.svg?style=flat-square)](https://www.nuget.org/packages/Semi.Avalonia.ColorPicker/)
Avalonia ColorPicker Theme inspired by Semi Design
This package provides Semi Design theming for the Avalonia ColorPicker control.
## Installation
```bash
dotnet add package Semi.Avalonia.ColorPicker
```
## Prerequisites
This package requires the main Semi.Avalonia theme to be installed:
```bash
dotnet add package Semi.Avalonia
```
## Usage
Include the ColorPicker theme in your application:
```xaml
<Application
...
xmlns:semi="https://irihi.tech/semi">
<Application.Styles>
<semi:SemiTheme Locale="zh-CN" />
<semi:ColorPickerSemiTheme />
</Application.Styles>
</Application>
```
## Resources
- [Documentation](https://docs.irihi.tech/semi/)
- [Repository](https://github.com/irihitech/Semi.Avalonia)
- [Online Demo](https://irihitech.github.io/Semi.Avalonia/)
- [Download Demo](https://github.com/irihitech/Semi.Avalonia/releases)
## Credits
[Semi Design](https://semi.design/)
[Avalonia](https://github.com/AvaloniaUI/Avalonia)

View File

@@ -1,18 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<Import Project="../Package.props"/>
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<Version>11.3.7.2</Version>
<PackageReleaseNotes>Update to Semi.Avalonia.ColorPicker 11.3.7.2</PackageReleaseNotes>
<Title>Semi.Avalonia.ColorPicker</Title> <Title>Semi.Avalonia.ColorPicker</Title>
<PackageReleaseNotes>Update to Semi.Avalonia.ColorPicker 11.2.1.10</PackageReleaseNotes>
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
<IsAotCompatible>true</IsAotCompatible>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia.Controls.ColorPicker" Version="$(AvaloniaVersion)"/> <PackageReference Include="Avalonia.Controls.ColorPicker"/>
<None Include="README.md" Pack="true" PackagePath="\"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -86,7 +86,7 @@
<Rectangle <Rectangle
Name="PART_RightGridLine" Name="PART_RightGridLine"
Grid.Column="1" Grid.Column="1"
Width="1" Width="{DynamicResource DataGridGridLineThickness}"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
Fill="{DynamicResource DataGridLineBrush}" /> Fill="{DynamicResource DataGridLineBrush}" />
</Grid> </Grid>
@@ -145,7 +145,7 @@
<Rectangle <Rectangle
Name="VerticalSeparator" Name="VerticalSeparator"
Grid.Column="1" Grid.Column="1"
Width="1" Width="{DynamicResource DataGridGridLineThickness}"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
Fill="{TemplateBinding SeparatorBrush}" Fill="{TemplateBinding SeparatorBrush}"
IsVisible="{TemplateBinding AreSeparatorsVisible}" /> IsVisible="{TemplateBinding AreSeparatorsVisible}" />
@@ -209,7 +209,7 @@
<Rectangle <Rectangle
Grid.Row="0" Grid.Row="0"
Grid.RowSpan="2" Grid.RowSpan="2"
Height="1" Height="{DynamicResource DataGridGridLineThickness}"
VerticalAlignment="Bottom" VerticalAlignment="Bottom"
Fill="{DynamicResource DataGridLineBrush}" Fill="{DynamicResource DataGridLineBrush}"
StrokeThickness="1" /> StrokeThickness="1" />
@@ -250,7 +250,7 @@
Grid.Row="2" Grid.Row="2"
Grid.Column="0" Grid.Column="0"
Grid.ColumnSpan="2" Grid.ColumnSpan="2"
Height="1" Height="{DynamicResource DataGridGridLineThickness}"
Margin="1,0,1,0" Margin="1,0,1,0"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
Fill="{TemplateBinding SeparatorBrush}" Fill="{TemplateBinding SeparatorBrush}"
@@ -315,7 +315,7 @@
Name="PART_BottomGridLine" Name="PART_BottomGridLine"
Grid.Row="2" Grid.Row="2"
Grid.Column="1" Grid.Column="1"
Height="1" Height="{DynamicResource DataGridGridLineThickness}"
HorizontalAlignment="Stretch" /> HorizontalAlignment="Stretch" />
</DataGridFrozenGrid> </DataGridFrozenGrid>
</Border> </Border>
@@ -452,7 +452,7 @@
Grid.Row="1" Grid.Row="1"
Grid.Column="0" Grid.Column="0"
Grid.ColumnSpan="5" Grid.ColumnSpan="5"
Height="1" Height="{DynamicResource DataGridGridLineThickness}"
Fill="{DynamicResource DataGridLineBrush}" /> Fill="{DynamicResource DataGridLineBrush}" />
</DataGridFrozenGrid> </DataGridFrozenGrid>
</ControlTemplate> </ControlTemplate>
@@ -498,7 +498,7 @@
Grid.Row="0" Grid.Row="0"
Grid.Column="0" Grid.Column="0"
Grid.ColumnSpan="3" Grid.ColumnSpan="3"
Height="1" Height="{DynamicResource DataGridGridLineThickness}"
VerticalAlignment="Bottom" VerticalAlignment="Bottom"
Fill="{DynamicResource DataGridLineBrush}" /> Fill="{DynamicResource DataGridLineBrush}" />

View File

@@ -0,0 +1,50 @@
# Semi.Avalonia.DataGrid
[![Semi Avalonia DataGrid](https://img.shields.io/nuget/v/Semi.Avalonia.DataGrid.svg?color=red&style=flat-square)](https://www.nuget.org/packages/Semi.Avalonia.DataGrid/)
[![Semi Avalonia DataGrid](https://img.shields.io/nuget/dt/Semi.Avalonia.DataGrid.svg?style=flat-square)](https://www.nuget.org/packages/Semi.Avalonia.DataGrid/)
Avalonia DataGrid Theme inspired by Semi Design
This package provides Semi Design theming for the Avalonia DataGrid control.
## Installation
```bash
dotnet add package Semi.Avalonia.DataGrid
```
## Prerequisites
This package requires the main Semi.Avalonia theme to be installed:
```bash
dotnet add package Semi.Avalonia
```
## Usage
Include the DataGrid theme in your application:
```xaml
<Application
...
xmlns:semi="https://irihi.tech/semi">
<Application.Styles>
<semi:SemiTheme Locale="zh-CN" />
<semi:DataGridSemiTheme />
</Application.Styles>
</Application>
```
## Resources
- [Documentation](https://docs.irihi.tech/semi/)
- [Repository](https://github.com/irihitech/Semi.Avalonia)
- [Online Demo](https://irihitech.github.io/Semi.Avalonia/)
- [Download Demo](https://github.com/irihitech/Semi.Avalonia/releases)
## Credits
[Semi Design](https://semi.design/)
[Avalonia](https://github.com/AvaloniaUI/Avalonia)

View File

@@ -2,27 +2,14 @@
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks> <TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<Nullable>enable</Nullable> <Version>11.3.7.2</Version>
<LangVersion>latest</LangVersion> <PackageReleaseNotes>Update to Semi.Avalonia.DataGrid 11.3.7.2</PackageReleaseNotes>
<Version>11.2.1.10</Version>
<PackageReleaseNotes>Update to Semi.Avalonia.DataGrid 11.2.1.10</PackageReleaseNotes>
<Authors>IRIHI Technology Co., Ltd.</Authors>
<Description>Avalonia Theme inspired by Semi Design.</Description>
<RepositoryUrl>https://github.com/irihitech/Semi.Avalonia</RepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIcon>irihi.png</PackageIcon>
<PackageProjectUrl>https://github.com/irihitech/Semi.Avalonia</PackageProjectUrl>
<Title>Semi.Avalonia.DataGrid</Title> <Title>Semi.Avalonia.DataGrid</Title>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
<IsAotCompatible>true</IsAotCompatible>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.2.1"/> <PackageReference Include="Avalonia.Controls.DataGrid"/>
<None Include="..\..\irihi.png" Pack="true" PackagePath="\" Link="Properties\irihi.png"/> <None Include="README.md" Pack="true" PackagePath="\"/>
<None Include="..\..\LICENSE" Pack="true" PackagePath="\" Link="Properties\LICENSE"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -19,4 +19,7 @@
<StaticResource x:Key="DataGridRowGroupHeaderVisualStrokeThickness" ResourceKey="SemiBorderSpacingControl" /> <StaticResource x:Key="DataGridRowGroupHeaderVisualStrokeThickness" ResourceKey="SemiBorderSpacingControl" />
<StaticResource x:Key="DataGridDisabledCornerRadius" ResourceKey="SemiBorderRadiusSmall" /> <StaticResource x:Key="DataGridDisabledCornerRadius" ResourceKey="SemiBorderRadiusSmall" />
<!-- Grid line thickness -->
<x:Double x:Key="DataGridGridLineThickness">1</x:Double>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,10 +1,10 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StaticResource x:Key="TreeDataGridGridLinesBrush" ResourceKey="SemiColorBorder" /> <StaticResource x:Key="TreeDataGridGridLinesBrush" ResourceKey="SemiColorBorder" />
<StaticResource x:Key="TreeDataGridHeaderPointerOverBackground" ResourceKey="SemiColorFill1" /> <StaticResource x:Key="TreeDataGridHeaderPointeroverBackground" ResourceKey="SemiColorFill1" />
<StaticResource x:Key="TreeDataGridHeaderPressedBackground" ResourceKey="SemiColorFill2" /> <StaticResource x:Key="TreeDataGridHeaderPressedBackground" ResourceKey="SemiColorFill2" />
<SolidColorBrush x:Key="TreeDataGridHeaderPointerOverBorderBrush" Color="Transparent" /> <SolidColorBrush x:Key="TreeDataGridHeaderPointeroverBorderBrush" Color="Transparent" />
<SolidColorBrush x:Key="TreeDataGridHeaderPressedBorderBrush" Color="Transparent" /> <SolidColorBrush x:Key="TreeDataGridHeaderPressedBorderBrush" Color="Transparent" />
<StaticResource x:Key="TreeDataGridHeaderPointerOverForeground" ResourceKey="SemiColorText1" /> <StaticResource x:Key="TreeDataGridHeaderPointeroverForeground" ResourceKey="SemiColorText1" />
<StaticResource x:Key="TreeDataGridHeaderPressedForeground" ResourceKey="SemiColorText0" /> <StaticResource x:Key="TreeDataGridHeaderPressedForeground" ResourceKey="SemiColorText0" />
<StaticResource x:Key="TreeDataGridCellSelectedBackground" ResourceKey="SemiColorPrimaryLight" /> <StaticResource x:Key="TreeDataGridCellSelectedBackground" ResourceKey="SemiColorPrimaryLight" />
<StaticResource x:Key="TreeDataGridColumnHeaderForeground" ResourceKey="SemiColorText2" /> <StaticResource x:Key="TreeDataGridColumnHeaderForeground" ResourceKey="SemiColorText2" />

View File

@@ -1,10 +1,10 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StaticResource x:Key="TreeDataGridGridLinesBrush" ResourceKey="SemiColorBorder" /> <StaticResource x:Key="TreeDataGridGridLinesBrush" ResourceKey="SemiColorBorder" />
<StaticResource x:Key="TreeDataGridHeaderPointerOverBackground" ResourceKey="SemiColorFill1" /> <StaticResource x:Key="TreeDataGridHeaderPointeroverBackground" ResourceKey="SemiColorFill1" />
<StaticResource x:Key="TreeDataGridHeaderPressedBackground" ResourceKey="SemiColorFill2" /> <StaticResource x:Key="TreeDataGridHeaderPressedBackground" ResourceKey="SemiColorFill2" />
<SolidColorBrush x:Key="TreeDataGridHeaderPointerOverBorderBrush" Color="Transparent" /> <SolidColorBrush x:Key="TreeDataGridHeaderPointeroverBorderBrush" Color="Transparent" />
<SolidColorBrush x:Key="TreeDataGridHeaderPressedBorderBrush" Color="Transparent" /> <SolidColorBrush x:Key="TreeDataGridHeaderPressedBorderBrush" Color="Transparent" />
<StaticResource x:Key="TreeDataGridHeaderPointerOverForeground" ResourceKey="SemiColorText1" /> <StaticResource x:Key="TreeDataGridHeaderPointeroverForeground" ResourceKey="SemiColorText1" />
<StaticResource x:Key="TreeDataGridHeaderPressedForeground" ResourceKey="SemiColorText0" /> <StaticResource x:Key="TreeDataGridHeaderPressedForeground" ResourceKey="SemiColorText0" />
<StaticResource x:Key="TreeDataGridCellSelectedBackground" ResourceKey="SemiColorPrimaryLight" /> <StaticResource x:Key="TreeDataGridCellSelectedBackground" ResourceKey="SemiColorPrimaryLight" />
<StaticResource x:Key="TreeDataGridColumnHeaderForeground" ResourceKey="SemiColorText2" /> <StaticResource x:Key="TreeDataGridColumnHeaderForeground" ResourceKey="SemiColorText2" />

View File

@@ -0,0 +1,50 @@
# Semi.Avalonia.TreeDataGrid
[![Semi Avalonia TreeDataGrid](https://img.shields.io/nuget/v/Semi.Avalonia.TreeDataGrid.svg?color=red&style=flat-square)](https://www.nuget.org/packages/Semi.Avalonia.TreeDataGrid/)
[![Semi Avalonia TreeDataGrid](https://img.shields.io/nuget/dt/Semi.Avalonia.TreeDataGrid.svg?style=flat-square)](https://www.nuget.org/packages/Semi.Avalonia.TreeDataGrid/)
Avalonia TreeDataGrid Theme inspired by Semi Design
This package provides Semi Design theming for the Avalonia TreeDataGrid control.
## Installation
```bash
dotnet add package Semi.Avalonia.TreeDataGrid
```
## Prerequisites
This package requires the main Semi.Avalonia theme to be installed:
```bash
dotnet add package Semi.Avalonia
```
## Usage
Include the TreeDataGrid theme in your application:
```xaml
<Application
...
xmlns:semi="https://irihi.tech/semi">
<Application.Styles>
<semi:SemiTheme Locale="zh-CN" />
<semi:TreeDataGridSemiTheme />
</Application.Styles>
</Application>
```
## Resources
- [Documentation](https://docs.irihi.tech/semi/)
- [Repository](https://github.com/irihitech/Semi.Avalonia)
- [Online Demo](https://irihitech.github.io/Semi.Avalonia/)
- [Download Demo](https://github.com/irihitech/Semi.Avalonia/releases)
## Credits
[Semi Design](https://semi.design/)
[Avalonia](https://github.com/AvaloniaUI/Avalonia)

View File

@@ -2,26 +2,14 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable> <Version>11.1.1.1</Version>
<LangVersion>latest</LangVersion> <PackageReleaseNotes>Update to Semi.Avalonia.TreeDataGrid 11.1.1.1</PackageReleaseNotes>
<Version>11.0.10.4</Version> <Title>Semi.Avalonia.TreeDataGrid</Title>
<PackageReleaseNotes>Update to 11.0.10.4</PackageReleaseNotes>
<Authors>IRIHI Technology Co., Ltd.</Authors>
<Description>Avalonia Theme inspired by Semi Design.</Description>
<RepositoryUrl>https://github.com/irihitech/Semi.Avalonia</RepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIcon>irihi.png</PackageIcon>
<PackageProjectUrl>https://github.com/irihitech/Semi.Avalonia</PackageProjectUrl>
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
<IsAotCompatible>true</IsAotCompatible>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia.Controls.TreeDataGrid" Version="11.0.10"/> <PackageReference Include="Avalonia.Controls.TreeDataGrid"/>
<None Include="..\..\irihi.png" Pack="true" PackagePath="\" Link="Properties\irihi.png"/> <None Include="README.md" Pack="true" PackagePath="\"/>
<None Include="..\..\LICENSE" Pack="true" PackagePath="\" Link="Properties\LICENSE"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -1,7 +1,8 @@
<ResourceDictionary <ResourceDictionary
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:conv="clr-namespace:Avalonia.Controls.Converters;assembly=Avalonia.Controls.TreeDataGrid"> xmlns:conv="clr-namespace:Avalonia.Controls.Converters;assembly=Avalonia.Controls.TreeDataGrid"
x:CompileBindings="True">
<Design.PreviewWith> <Design.PreviewWith>
<StackPanel Margin="20"> <StackPanel Margin="20">
<TreeDataGridColumnHeader Header="123" /> <TreeDataGridColumnHeader Header="123" />
@@ -112,9 +113,9 @@
</Setter> </Setter>
<Style Selector="^:pointerover /template/ Border#DataGridBorder"> <Style Selector="^:pointerover /template/ Border#DataGridBorder">
<Setter Property="Background" Value="{DynamicResource TreeDataGridHeaderPointerOverBackground}" /> <Setter Property="Background" Value="{DynamicResource TreeDataGridHeaderPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource TreeDataGridHeaderPointerOverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource TreeDataGridHeaderPointeroverBorderBrush}" />
<Setter Property="TextBlock.Foreground" Value="{DynamicResource TreeDataGridHeaderPointerOverForeground}" /> <Setter Property="TextBlock.Foreground" Value="{DynamicResource TreeDataGridHeaderPointeroverForeground}" />
</Style> </Style>
<Style Selector="^:pressed /template/ Border#DataGridBorder"> <Style Selector="^:pressed /template/ Border#DataGridBorder">

View File

@@ -85,7 +85,8 @@
Foreground="{TemplateBinding Foreground}" Foreground="{TemplateBinding Foreground}"
ItemTemplate="{TemplateBinding ItemTemplate}" ItemTemplate="{TemplateBinding ItemTemplate}"
ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Auto" /> ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.IsScrollChainingEnabled="False" />
</Border> </Border>
</Popup> </Popup>
</Panel> </Panel>

View File

@@ -1,11 +1,97 @@
<ResourceDictionary <ResourceDictionary
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- Button Theme Key: Light, Solid, Outline, Borderless; Default is Light --> <!-- Theme: Light, Solid, Outline, Borderless; Default is Light -->
<!-- Button Default Classes: Primary, Secondary, Tertiary, Success, Warning, Danger; Default is Primary --> <!-- Color Classes: Primary, Secondary, Tertiary, Success, Warning, Danger; Default is Primary -->
<!-- State: default, pointerover, pressed, disabled --> <!-- Size Classes: Large, Small -->
<!-- AI style Classes: Colorful -->
<!-- PseudoClasses: :pointerover, :pressed, :disabled -->
<Design.PreviewWith>
<StackPanel Margin="16" Spacing="16">
<WrapPanel ItemSpacing="16">
<Button Content="Default" />
<Button Content="Primary" Classes="Primary" />
<Button Content="Secondary" Classes="Secondary" />
<Button Content="Tertiary" Classes="Tertiary" />
<Button Content="Success" Classes="Success" />
<Button Content="Warning" Classes="Warning" />
<Button Content="Danger" Classes="Danger" />
<Button Content="Disabled" Classes="Danger" IsEnabled="False" />
</WrapPanel>
<WrapPanel ItemSpacing="16">
<Button Content="Default" Theme="{DynamicResource SolidButton}" />
<Button Content="Primary" Classes="Primary" Theme="{DynamicResource SolidButton}" />
<Button Content="Secondary" Classes="Secondary" Theme="{DynamicResource SolidButton}" />
<Button Content="Tertiary" Classes="Tertiary" Theme="{DynamicResource SolidButton}" />
<Button Content="Success" Classes="Success" Theme="{DynamicResource SolidButton}" />
<Button Content="Warning" Classes="Warning" Theme="{DynamicResource SolidButton}" />
<Button Content="Danger" Classes="Danger" Theme="{DynamicResource SolidButton}" />
<Button Content="Disabled" Classes="Danger" Theme="{DynamicResource SolidButton}" IsEnabled="False" />
</WrapPanel>
<WrapPanel ItemSpacing="16">
<Button Content="Default" Theme="{DynamicResource OutlineButton}" />
<Button Content="Primary" Classes="Primary" Theme="{DynamicResource OutlineButton}" />
<Button Content="Secondary" Classes="Secondary" Theme="{DynamicResource OutlineButton}" />
<Button Content="Tertiary" Classes="Tertiary" Theme="{DynamicResource OutlineButton}" />
<Button Content="Success" Classes="Success" Theme="{DynamicResource OutlineButton}" />
<Button Content="Warning" Classes="Warning" Theme="{DynamicResource OutlineButton}" />
<Button Content="Danger" Classes="Danger" Theme="{DynamicResource OutlineButton}" />
<Button Content="Disabled" Classes="Danger" Theme="{DynamicResource OutlineButton}" IsEnabled="False" />
</WrapPanel>
<WrapPanel ItemSpacing="16">
<Button Content="Default" Theme="{DynamicResource BorderlessButton}" />
<Button Content="Primary" Classes="Primary" Theme="{DynamicResource BorderlessButton}" />
<Button Content="Secondary" Classes="Secondary" Theme="{DynamicResource BorderlessButton}" />
<Button Content="Tertiary" Classes="Tertiary" Theme="{DynamicResource BorderlessButton}" />
<Button Content="Success" Classes="Success" Theme="{DynamicResource BorderlessButton}" />
<Button Content="Warning" Classes="Warning" Theme="{DynamicResource BorderlessButton}" />
<Button Content="Danger" Classes="Danger" Theme="{DynamicResource BorderlessButton}" />
<Button Content="Disabled" Classes="Danger" Theme="{DynamicResource BorderlessButton}" IsEnabled="False" />
</WrapPanel>
<WrapPanel ItemSpacing="16">
<Button Content="Default" Classes="Colorful" />
<Button Content="Primary" Classes="Colorful Primary" />
<Button Content="Secondary" Classes="Colorful Secondary" />
<Button Content="Tertiary" Classes="Colorful Tertiary" />
<Button Content="Success" Classes="Colorful Success" />
<Button Content="Warning" Classes="Colorful Warning" />
<Button Content="Danger" Classes="Colorful Danger" />
<Button Content="Disabled" Classes="Colorful Primary" IsEnabled="False" />
</WrapPanel>
<WrapPanel ItemSpacing="16">
<Button Content="Default" Classes="Colorful" Theme="{DynamicResource SolidButton}" />
<Button Content="Primary" Classes="Colorful Primary" Theme="{DynamicResource SolidButton}" />
<Button Content="Secondary" Classes="Colorful Secondary" Theme="{DynamicResource SolidButton}" />
<Button Content="Tertiary" Classes="Colorful Tertiary" Theme="{DynamicResource SolidButton}" />
<Button Content="Success" Classes="Colorful Success" Theme="{DynamicResource SolidButton}" />
<Button Content="Warning" Classes="Colorful Warning" Theme="{DynamicResource SolidButton}" />
<Button Content="Danger" Classes="Colorful Danger" Theme="{DynamicResource SolidButton}" />
<Button Content="Disabled" Classes="Colorful Primary" Theme="{DynamicResource SolidButton}" IsEnabled="False" />
</WrapPanel>
<WrapPanel ItemSpacing="16">
<Button Content="Default" Classes="Colorful" Theme="{DynamicResource OutlineButton}" />
<Button Content="Primary" Classes="Colorful Primary" Theme="{DynamicResource OutlineButton}" />
<Button Content="Secondary" Classes="Colorful Secondary" Theme="{DynamicResource OutlineButton}" />
<Button Content="Tertiary" Classes="Colorful Tertiary" Theme="{DynamicResource OutlineButton}" />
<Button Content="Success" Classes="Colorful Success" Theme="{DynamicResource OutlineButton}" />
<Button Content="Warning" Classes="Colorful Warning" Theme="{DynamicResource OutlineButton}" />
<Button Content="Danger" Classes="Colorful Danger" Theme="{DynamicResource OutlineButton}" />
<Button Content="Disabled" Classes="Colorful Primary" Theme="{DynamicResource OutlineButton}" IsEnabled="False" />
</WrapPanel>
<WrapPanel ItemSpacing="16">
<Button Content="Default" Classes="Colorful" Theme="{DynamicResource BorderlessButton}" />
<Button Content="Primary" Classes="Colorful Primary" Theme="{DynamicResource BorderlessButton}" />
<Button Content="Secondary" Classes="Colorful Secondary" Theme="{DynamicResource BorderlessButton}" />
<Button Content="Tertiary" Classes="Colorful Tertiary" Theme="{DynamicResource BorderlessButton}" />
<Button Content="Success" Classes="Colorful Success" Theme="{DynamicResource BorderlessButton}" />
<Button Content="Warning" Classes="Colorful Warning" Theme="{DynamicResource BorderlessButton}" />
<Button Content="Danger" Classes="Colorful Danger" Theme="{DynamicResource BorderlessButton}" />
<Button Content="Disabled" Classes="Colorful Primary" Theme="{DynamicResource BorderlessButton}" IsEnabled="False" />
</WrapPanel>
</StackPanel>
</Design.PreviewWith>
<!-- Button Light -->
<ControlTheme x:Key="{x:Type Button}" TargetType="Button"> <ControlTheme x:Key="{x:Type Button}" TargetType="Button">
<Setter Property="Padding" Value="{DynamicResource ButtonDefaultPadding}" /> <Setter Property="Padding" Value="{DynamicResource ButtonDefaultPadding}" />
<Setter Property="MinHeight" Value="{DynamicResource ButtonDefaultHeight}" /> <Setter Property="MinHeight" Value="{DynamicResource ButtonDefaultHeight}" />
@@ -37,7 +123,6 @@
CornerRadius="{TemplateBinding CornerRadius}" CornerRadius="{TemplateBinding CornerRadius}"
Content="{TemplateBinding Content}" Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplate="{TemplateBinding ContentTemplate}"
RecognizesAccessKey="True"
TextElement.FontSize="{TemplateBinding FontSize}" TextElement.FontSize="{TemplateBinding FontSize}"
TextElement.FontWeight="{TemplateBinding FontWeight}" TextElement.FontWeight="{TemplateBinding FontWeight}"
UseLayoutRounding="False" /> UseLayoutRounding="False" />
@@ -47,6 +132,7 @@
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{TemplateBinding Background}" /> <Setter Property="Background" Value="{TemplateBinding Background}" />
<Setter Property="BorderBrush" Value="{TemplateBinding BorderBrush}" /> <Setter Property="BorderBrush" Value="{TemplateBinding BorderBrush}" />
<Setter Property="RecognizesAccessKey" Value="True" />
</Style> </Style>
<Style Selector="^.Primary /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^.Primary /template/ ContentPresenter#PART_ContentPresenter">
@@ -68,6 +154,12 @@
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDangerForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDangerForeground}" />
</Style> </Style>
<Style Selector="^.Colorful">
<Style Selector="^.Primary /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultColorfulPrimaryForeground}" />
</Style>
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPointeroverBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonDefaultPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPointeroverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPointeroverBorderBrush}" />
@@ -209,6 +301,39 @@
</Style> </Style>
</Style> </Style>
<Style Selector="^.Colorful">
<Style Selector="^.Primary">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidColorfulPrimaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidColorfulPrimaryBackground}" />
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidColorfulPrimaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidColorfulPrimaryPointeroverBackground}" />
</Style>
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidColorfulPrimaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidColorfulPrimaryPressedBackground}" />
</Style>
</Style>
<Style Selector="^.Tertiary">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidColorfulTertiaryForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidColorfulTertiaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidColorfulTertiaryBackground}" />
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidColorfulTertiaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidColorfulTertiaryPointeroverBackground}" />
</Style>
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidColorfulTertiaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidColorfulTertiaryPressedBackground}" />
</Style>
</Style>
</Style>
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidDisabledForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonSolidDisabledForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidDisabledBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidDisabledBackground}" />
@@ -241,6 +366,14 @@
<Style Selector="^.Danger /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^.Danger /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineDangerBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineDangerBorderBrush}" />
</Style> </Style>
<Style Selector="^.Colorful">
<Style Selector="^.Primary /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonOutlineColorfulPrimaryForeground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineColorfulPrimaryBorderBrush}" />
</Style>
</Style>
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" />
@@ -261,7 +394,6 @@
<Setter Property="Background" Value="{DynamicResource ButtonBorderlessBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonBorderlessBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderlessBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderlessBorderBrush}" />
</Style> </Style>
</ControlTheme> </ControlTheme>
<ControlTheme x:Key="InnerIconButton" TargetType="Button"> <ControlTheme x:Key="InnerIconButton" TargetType="Button">

View File

@@ -171,7 +171,7 @@
<Setter Property="BorderBrush" Value="Transparent" /> <Setter Property="BorderBrush" Value="Transparent" />
</Style> </Style>
<Style Selector="^:pointerover /template/ Border#Background"> <Style Selector="^:pointerover /template/ Border#Background">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointerOverBackground}" /> <Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointeroverBackground}" />
<Setter Property="BorderBrush" Value="Transparent" /> <Setter Property="BorderBrush" Value="Transparent" />
</Style> </Style>
<Style Selector="^:pressed /template/ Border#Background"> <Style Selector="^:pressed /template/ Border#Background">
@@ -213,8 +213,8 @@
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsBorderBrush}" />
</Style> </Style>
<Style Selector="^:pointerover /template/ Border#Background"> <Style Selector="^:pointerover /template/ Border#Background">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointerOverBackground}" /> <Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsPointerOverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsPointeroverBorderBrush}" />
</Style> </Style>
<Style Selector="^:pressed /template/ Border#Background"> <Style Selector="^:pressed /template/ Border#Background">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPressedBackground}" /> <Setter Property="Background" Value="{DynamicResource DataValidationErrorsPressedBackground}" />

View File

@@ -62,13 +62,16 @@
ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplate="{TemplateBinding ContentTemplate}"
IsVisible="{TemplateBinding Content,Converter={x:Static ObjectConverters.IsNotNull}}" IsVisible="{TemplateBinding Content,Converter={x:Static ObjectConverters.IsNotNull}}"
FontSize="{TemplateBinding FontSize}" FontSize="{TemplateBinding FontSize}"
RecognizesAccessKey="True"
TextWrapping="Wrap" /> TextWrapping="Wrap" />
</Grid> </Grid>
</Border> </Border>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="RecognizesAccessKey" Value="True" />
</Style>
<Style Selector="^:unchecked"> <Style Selector="^:unchecked">
<Style Selector="^:pointerover /template/ Border#NormalRectangle"> <Style Selector="^:pointerover /template/ Border#NormalRectangle">
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxPointeroverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource CheckBoxPointeroverBorderBrush}" />
@@ -219,13 +222,16 @@
Foreground="{TemplateBinding Foreground}" Foreground="{TemplateBinding Foreground}"
IsVisible="{TemplateBinding Content,Converter={x:Static ObjectConverters.IsNotNull}}" IsVisible="{TemplateBinding Content,Converter={x:Static ObjectConverters.IsNotNull}}"
FontSize="{TemplateBinding FontSize}" FontSize="{TemplateBinding FontSize}"
RecognizesAccessKey="True"
TextWrapping="Wrap" /> TextWrapping="Wrap" />
</Grid> </Grid>
</Border> </Border>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="RecognizesAccessKey" Value="True" />
</Style>
<Style Selector="^:unchecked"> <Style Selector="^:unchecked">
<Style Selector="^:pointerover"> <Style Selector="^:pointerover">
<Style Selector="^ /template/ Border#NormalRectangle"> <Style Selector="^ /template/ Border#NormalRectangle">
@@ -337,12 +343,15 @@
Content="{TemplateBinding Content}" Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplate="{TemplateBinding ContentTemplate}"
CornerRadius="{TemplateBinding CornerRadius}" CornerRadius="{TemplateBinding CornerRadius}"
RecognizesAccessKey="True"
UseLayoutRounding="False" UseLayoutRounding="False"
TextWrapping="Wrap" /> TextWrapping="Wrap" />
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="RecognizesAccessKey" Value="True" />
</Style>
<Style Selector="^:unchecked"> <Style Selector="^:unchecked">
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource CheckBoxCardPointeroverBackground}" /> <Setter Property="Background" Value="{DynamicResource CheckBoxCardPointeroverBackground}" />

View File

@@ -66,8 +66,14 @@
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
TextTrimming="CharacterEllipsis" TextTrimming="CharacterEllipsis"
Foreground="{TemplateBinding PlaceholderForeground}" Foreground="{TemplateBinding PlaceholderForeground}"
IsVisible="{TemplateBinding SelectionBoxItem,Converter={x:Static ObjectConverters.IsNull}}" Text="{TemplateBinding PlaceholderText}">
Text="{TemplateBinding PlaceholderText}" /> <TextBlock.IsVisible>
<MultiBinding Converter="{x:Static BoolConverters.And}">
<TemplateBinding Property="SelectionBoxItem" Converter="{x:Static ObjectConverters.IsNull}" />
<TemplateBinding Property="IsEditable" Converter="{x:Static BoolConverters.Not}" />
</MultiBinding>
</TextBlock.IsVisible>
</TextBlock>
<ContentPresenter <ContentPresenter
Name="ContentPresenter" Name="ContentPresenter"
Grid.Column="0" Grid.Column="0"
@@ -75,7 +81,20 @@
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding SelectionBoxItem}" Content="{TemplateBinding SelectionBoxItem}"
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" /> ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
IsVisible="{TemplateBinding IsEditable, Converter={x:Static BoolConverters.Not}}" />
<TextBox
Name="PART_EditableTextBox"
Grid.Column="0"
Theme="{StaticResource LooklessTextBox}"
Padding="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Foreground="{TemplateBinding Foreground}"
Text="{TemplateBinding Text, Mode=TwoWay}"
Watermark="{TemplateBinding PlaceholderText}"
IsVisible="{TemplateBinding IsEditable}" />
<Button <Button
Name="ClearButton" Name="ClearButton"
Grid.Column="1" Grid.Column="1"
@@ -198,7 +217,7 @@
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsBackground}" /> <Setter Property="Background" Value="{DynamicResource DataValidationErrorsBackground}" />
</Style> </Style>
<Style Selector="^:pointerover /template/ Border#Background"> <Style Selector="^:pointerover /template/ Border#Background">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointerOverBackground}" /> <Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointeroverBackground}" />
<Setter Property="BorderBrush" Value="Transparent" /> <Setter Property="BorderBrush" Value="Transparent" />
</Style> </Style>
<Style Selector="^:pressed /template/ Border#Background"> <Style Selector="^:pressed /template/ Border#Background">
@@ -211,6 +230,11 @@
</Style> </Style>
</Style> </Style>
<Style Selector="^[IsEditable=true]">
<Setter Property="IsTabStop" Value="False" />
<Setter Property="KeyboardNavigation.TabNavigation" Value="Local" />
</Style>
<Style Selector="^.Bordered"> <Style Selector="^.Bordered">
<Style Selector="^ /template/ Border#Background"> <Style Selector="^ /template/ Border#Background">
<Setter Property="Background" Value="{DynamicResource ComboBoxSelectorBorderedBackground}" /> <Setter Property="Background" Value="{DynamicResource ComboBoxSelectorBorderedBackground}" />
@@ -249,8 +273,8 @@
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsBorderBrush}" />
</Style> </Style>
<Style Selector="^:pointerover /template/ Border#Background"> <Style Selector="^:pointerover /template/ Border#Background">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointerOverBackground}" /> <Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsPointerOverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsPointeroverBorderBrush}" />
</Style> </Style>
<Style Selector="^:pressed /template/ Border#Background"> <Style Selector="^:pressed /template/ Border#Background">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPressedBackground}" /> <Setter Property="Background" Value="{DynamicResource DataValidationErrorsPressedBackground}" />

View File

@@ -239,7 +239,8 @@
Margin="0,0,9,0" Margin="0,0,9,0"
Command="{Binding $parent[DatePicker].Clear}" Command="{Binding $parent[DatePicker].Clear}"
Content="{DynamicResource IconButtonClearData}" Content="{DynamicResource IconButtonClearData}"
IsVisible="False" /> IsVisible="False"
Focusable="False" />
</Grid> </Grid>
</DataValidationErrors> </DataValidationErrors>
</ControlTemplate> </ControlTemplate>

View File

@@ -37,7 +37,7 @@
<Setter Property="BorderBrush" Value="Transparent" /> <Setter Property="BorderBrush" Value="Transparent" />
</Style> </Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointerOverBackground}" /> <Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointeroverBackground}" />
<Setter Property="BorderBrush" Value="Transparent" /> <Setter Property="BorderBrush" Value="Transparent" />
</Style> </Style>
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">

View File

@@ -2,16 +2,90 @@
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Design.PreviewWith> <Design.PreviewWith>
<StackPanel Margin="20"> <StackPanel Margin="16" Spacing="16">
<DropDownButton Content="Button" /> <WrapPanel ItemSpacing="16">
<DropDownButton Classes="Primary" Content="Button" /> <DropDownButton Content="Default" />
<DropDownButton Classes="Secondary" Content="Button" /> <DropDownButton Content="Primary" Classes="Primary" />
<DropDownButton IsEnabled="False" Classes="Tertiary" Content="Button" /> <DropDownButton Content="Secondary" Classes="Secondary" />
<DropDownButton Theme="{DynamicResource SolidDropDownButton}" Classes="Success" Content="Button" /> <DropDownButton Content="Tertiary" Classes="Tertiary" />
<DropDownButton Theme="{DynamicResource OutlineDropDownButton}" Classes="Warning" Content="Button" /> <DropDownButton Content="Success" Classes="Success" />
<DropDownButton Theme="{DynamicResource BorderlessDropDownButton}" Classes="Danger" Content="Button" /> <DropDownButton Content="Warning" Classes="Warning" />
<DropDownButton Content="Danger" Classes="Danger" />
<DropDownButton Content="Disabled" Classes="Danger" IsEnabled="False" />
</WrapPanel>
<WrapPanel ItemSpacing="16">
<DropDownButton Content="Default" Theme="{DynamicResource SolidDropDownButton}" />
<DropDownButton Content="Primary" Classes="Primary" Theme="{DynamicResource SolidDropDownButton}" />
<DropDownButton Content="Secondary" Classes="Secondary" Theme="{DynamicResource SolidDropDownButton}" />
<DropDownButton Content="Tertiary" Classes="Tertiary" Theme="{DynamicResource SolidDropDownButton}" />
<DropDownButton Content="Success" Classes="Success" Theme="{DynamicResource SolidDropDownButton}" />
<DropDownButton Content="Warning" Classes="Warning" Theme="{DynamicResource SolidDropDownButton}" />
<DropDownButton Content="Danger" Classes="Danger" Theme="{DynamicResource SolidDropDownButton}" />
<DropDownButton Content="Disabled" Classes="Danger" Theme="{DynamicResource SolidDropDownButton}" IsEnabled="False" />
</WrapPanel>
<WrapPanel ItemSpacing="16">
<DropDownButton Content="Default" Theme="{DynamicResource OutlineDropDownButton}" />
<DropDownButton Content="Primary" Classes="Primary" Theme="{DynamicResource OutlineDropDownButton}" />
<DropDownButton Content="Secondary" Classes="Secondary" Theme="{DynamicResource OutlineDropDownButton}" />
<DropDownButton Content="Tertiary" Classes="Tertiary" Theme="{DynamicResource OutlineDropDownButton}" />
<DropDownButton Content="Success" Classes="Success" Theme="{DynamicResource OutlineDropDownButton}" />
<DropDownButton Content="Warning" Classes="Warning" Theme="{DynamicResource OutlineDropDownButton}" />
<DropDownButton Content="Danger" Classes="Danger" Theme="{DynamicResource OutlineDropDownButton}" />
<DropDownButton Content="Disabled" Classes="Danger" Theme="{DynamicResource OutlineDropDownButton}" IsEnabled="False" />
</WrapPanel>
<WrapPanel ItemSpacing="16">
<DropDownButton Content="Default" Theme="{DynamicResource BorderlessDropDownButton}" />
<DropDownButton Content="Primary" Classes="Primary" Theme="{DynamicResource BorderlessDropDownButton}" />
<DropDownButton Content="Secondary" Classes="Secondary" Theme="{DynamicResource BorderlessDropDownButton}" />
<DropDownButton Content="Tertiary" Classes="Tertiary" Theme="{DynamicResource BorderlessDropDownButton}" />
<DropDownButton Content="Success" Classes="Success" Theme="{DynamicResource BorderlessDropDownButton}" />
<DropDownButton Content="Warning" Classes="Warning" Theme="{DynamicResource BorderlessDropDownButton}" />
<DropDownButton Content="Danger" Classes="Danger" Theme="{DynamicResource BorderlessDropDownButton}" />
<DropDownButton Content="Disabled" Classes="Danger" Theme="{DynamicResource BorderlessDropDownButton}" IsEnabled="False" />
</WrapPanel>
<WrapPanel ItemSpacing="16">
<DropDownButton Content="Default" Classes="Colorful" />
<DropDownButton Content="Primary" Classes="Colorful Primary" />
<DropDownButton Content="Secondary" Classes="Colorful Secondary" />
<DropDownButton Content="Tertiary" Classes="Colorful Tertiary" />
<DropDownButton Content="Success" Classes="Colorful Success" />
<DropDownButton Content="Warning" Classes="Colorful Warning" />
<DropDownButton Content="Danger" Classes="Colorful Danger" />
<DropDownButton Content="Disabled" Classes="Colorful Primary" IsEnabled="False" />
</WrapPanel>
<WrapPanel ItemSpacing="16">
<DropDownButton Content="Default" Classes="Colorful" Theme="{DynamicResource SolidDropDownButton}" />
<DropDownButton Content="Primary" Classes="Colorful Primary" Theme="{DynamicResource SolidDropDownButton}" />
<DropDownButton Content="Secondary" Classes="Colorful Secondary" Theme="{DynamicResource SolidDropDownButton}" />
<DropDownButton Content="Tertiary" Classes="Colorful Tertiary" Theme="{DynamicResource SolidDropDownButton}" />
<DropDownButton Content="Success" Classes="Colorful Success" Theme="{DynamicResource SolidDropDownButton}" />
<DropDownButton Content="Warning" Classes="Colorful Warning" Theme="{DynamicResource SolidDropDownButton}" />
<DropDownButton Content="Danger" Classes="Colorful Danger" Theme="{DynamicResource SolidDropDownButton}" />
<DropDownButton Content="Disabled" Classes="Colorful Primary" Theme="{DynamicResource SolidDropDownButton}" IsEnabled="False" />
</WrapPanel>
<WrapPanel ItemSpacing="16">
<DropDownButton Content="Default" Classes="Colorful" Theme="{DynamicResource OutlineDropDownButton}" />
<DropDownButton Content="Primary" Classes="Colorful Primary" Theme="{DynamicResource OutlineDropDownButton}" />
<DropDownButton Content="Secondary" Classes="Colorful Secondary" Theme="{DynamicResource OutlineDropDownButton}" />
<DropDownButton Content="Tertiary" Classes="Colorful Tertiary" Theme="{DynamicResource OutlineDropDownButton}" />
<DropDownButton Content="Success" Classes="Colorful Success" Theme="{DynamicResource OutlineDropDownButton}" />
<DropDownButton Content="Warning" Classes="Colorful Warning" Theme="{DynamicResource OutlineDropDownButton}" />
<DropDownButton Content="Danger" Classes="Colorful Danger" Theme="{DynamicResource OutlineDropDownButton}" />
<DropDownButton Content="Disabled" Classes="Colorful Primary" Theme="{DynamicResource OutlineDropDownButton}" IsEnabled="False" />
</WrapPanel>
<WrapPanel ItemSpacing="16">
<DropDownButton Content="Default" Classes="Colorful" Theme="{DynamicResource BorderlessDropDownButton}" />
<DropDownButton Content="Primary" Classes="Colorful Primary" Theme="{DynamicResource BorderlessDropDownButton}" />
<DropDownButton Content="Secondary" Classes="Colorful Secondary" Theme="{DynamicResource BorderlessDropDownButton}" />
<DropDownButton Content="Tertiary" Classes="Colorful Tertiary" Theme="{DynamicResource BorderlessDropDownButton}" />
<DropDownButton Content="Success" Classes="Colorful Success" Theme="{DynamicResource BorderlessDropDownButton}" />
<DropDownButton Content="Warning" Classes="Colorful Warning" Theme="{DynamicResource BorderlessDropDownButton}" />
<DropDownButton Content="Danger" Classes="Colorful Danger" Theme="{DynamicResource BorderlessDropDownButton}" />
<DropDownButton Content="Disabled" Classes="Colorful Primary" Theme="{DynamicResource BorderlessDropDownButton}" IsEnabled="False" />
</WrapPanel>
</StackPanel> </StackPanel>
</Design.PreviewWith> </Design.PreviewWith>
<ControlTheme x:Key="{x:Type DropDownButton}" TargetType="DropDownButton"> <ControlTheme x:Key="{x:Type DropDownButton}" TargetType="DropDownButton">
<Setter Property="Padding" Value="{DynamicResource ButtonDefaultPadding}" /> <Setter Property="Padding" Value="{DynamicResource ButtonDefaultPadding}" />
<Setter Property="MinHeight" Value="{DynamicResource ButtonDefaultHeight}" /> <Setter Property="MinHeight" Value="{DynamicResource ButtonDefaultHeight}" />
@@ -36,13 +110,12 @@
Padding="{TemplateBinding Padding}" Padding="{TemplateBinding Padding}"
BorderThickness="{TemplateBinding BorderThickness}" BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"> CornerRadius="{TemplateBinding CornerRadius}">
<DockPanel> <DockPanel HorizontalSpacing="8">
<PathIcon <PathIcon
Name="DropDownGlyph" Name="DropDownGlyph"
DockPanel.Dock="Right" DockPanel.Dock="Right"
Theme="{DynamicResource InnerPathIcon}" Theme="{DynamicResource InnerPathIcon}"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Margin="8,0,0,0"
Data="{DynamicResource DropDownButtonIconGlyph}" Data="{DynamicResource DropDownButtonIconGlyph}"
Foreground="{Binding #PART_ContentPresenter.Foreground}" Foreground="{Binding #PART_ContentPresenter.Foreground}"
IsHitTestVisible="False" IsHitTestVisible="False"
@@ -53,8 +126,7 @@
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}" Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplate="{TemplateBinding ContentTemplate}"
Foreground="{TemplateBinding Foreground}" Foreground="{TemplateBinding Foreground}" />
RecognizesAccessKey="True" />
</DockPanel> </DockPanel>
</Border> </Border>
</ControlTemplate> </ControlTemplate>
@@ -65,6 +137,10 @@
<Setter Property="BorderBrush" Value="{TemplateBinding BorderBrush}" /> <Setter Property="BorderBrush" Value="{TemplateBinding BorderBrush}" />
</Style> </Style>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="RecognizesAccessKey" Value="True" />
</Style>
<Style Selector="^.Primary /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^.Primary /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
</Style> </Style>
@@ -84,6 +160,12 @@
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDangerForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDangerForeground}" />
</Style> </Style>
<Style Selector="^.Colorful">
<Style Selector="^.Primary /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultColorfulPrimaryForeground}" />
</Style>
</Style>
<Style Selector="^:pointerover /template/ Border#PART_Background"> <Style Selector="^:pointerover /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPointeroverBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonDefaultPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPointeroverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPointeroverBorderBrush}" />
@@ -243,6 +325,40 @@
</Style> </Style>
</Style> </Style>
<Style Selector="^.Colorful">
<Style Selector="^.Primary">
<Style Selector="^ /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidColorfulPrimaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidColorfulPrimaryBackground}" />
</Style>
<Style Selector="^:pointerover /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidColorfulPrimaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidColorfulPrimaryPointeroverBackground}" />
</Style>
<Style Selector="^:pressed /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidColorfulPrimaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidColorfulPrimaryPressedBackground}" />
</Style>
</Style>
<Style Selector="^.Tertiary">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidColorfulTertiaryForeground}" />
</Style>
<Style Selector="^ /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidColorfulTertiaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidColorfulTertiaryBackground}" />
</Style>
<Style Selector="^:pointerover /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidColorfulTertiaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidColorfulTertiaryPointeroverBackground}" />
</Style>
<Style Selector="^:pressed /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidColorfulTertiaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidColorfulTertiaryPressedBackground}" />
</Style>
</Style>
</Style>
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidDisabledForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonSolidDisabledForeground}" />
</Style> </Style>
@@ -277,6 +393,16 @@
<Style Selector="^.Danger /template/ Border#PART_Background"> <Style Selector="^.Danger /template/ Border#PART_Background">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineDangerBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineDangerBorderBrush}" />
</Style> </Style>
<Style Selector="^.Colorful">
<Style Selector="^.Primary">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonOutlineColorfulPrimaryForeground}" />
</Style>
<Style Selector="^ /template/ Border#PART_Background">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineColorfulPrimaryBorderBrush}" />
</Style>
</Style>
</Style>
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style> </Style>

View File

@@ -41,7 +41,6 @@
Grid.Row="0" Grid.Row="0"
Content="{TemplateBinding Header}" Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}" ContentTemplate="{TemplateBinding HeaderTemplate}"
RecognizesAccessKey="True"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
FontSize="{TemplateBinding FontSize}" FontSize="{TemplateBinding FontSize}"
@@ -53,7 +52,6 @@
Grid.Row="1" Grid.Row="1"
ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}" Content="{TemplateBinding Content}"
RecognizesAccessKey="True"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
FontSize="{TemplateBinding FontSize}" FontSize="{TemplateBinding FontSize}"
@@ -64,6 +62,14 @@
</Border> </Border>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^ /template/ ContentPresenter#PART_HeaderPresenter">
<Setter Property="RecognizesAccessKey" Value="True" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="RecognizesAccessKey" Value="True" />
</Style>
</ControlTheme> </ControlTheme>
<ControlTheme x:Key="GroupBox" TargetType="HeaderedContentControl"> <ControlTheme x:Key="GroupBox" TargetType="HeaderedContentControl">

View File

@@ -39,12 +39,15 @@
Name="PART_ContentPresenter" Name="PART_ContentPresenter"
Content="{TemplateBinding Content}" Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplate="{TemplateBinding ContentTemplate}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" />
RecognizesAccessKey="True" />
</DockPanel> </DockPanel>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="RecognizesAccessKey" Value="True" />
</Style>
<Style Selector="^:pointerover"> <Style Selector="^:pointerover">
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonPointeroverForeground}" /> <Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonPointeroverForeground}" />
</Style> </Style>

View File

@@ -75,7 +75,16 @@
<Label Classes="Solid Grey" Theme="{StaticResource TagLabel}">Grey</Label> <Label Classes="Solid Grey" Theme="{StaticResource TagLabel}">Grey</Label>
<Label Classes="Solid White" Theme="{StaticResource TagLabel}">White</Label> <Label Classes="Solid White" Theme="{StaticResource TagLabel}">White</Label>
</WrapPanel> </WrapPanel>
<WrapPanel>
<Label Classes="Colorful Gradient" Theme="{DynamicResource TagLabel}">AI</Label>
<Label Classes="Colorful Gradient Ghost" Theme="{DynamicResource TagLabel}">AI</Label>
<Label Classes="Colorful Gradient Solid" Theme="{DynamicResource TagLabel}">AI</Label>
</WrapPanel>
<WrapPanel>
<Label Classes="Colorful" Theme="{DynamicResource TagLabel}">AI</Label>
<Label Classes="Colorful Ghost" Theme="{DynamicResource TagLabel}">AI</Label>
<Label Classes="Colorful Solid" Theme="{DynamicResource TagLabel}">AI</Label>
</WrapPanel>
</StackPanel> </StackPanel>
</Design.PreviewWith> </Design.PreviewWith>
<ControlTheme x:Key="{x:Type Label}" TargetType="Label"> <ControlTheme x:Key="{x:Type Label}" TargetType="Label">
@@ -94,10 +103,12 @@
Content="{TemplateBinding Content}" Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplate="{TemplateBinding ContentTemplate}"
CornerRadius="{TemplateBinding CornerRadius}" CornerRadius="{TemplateBinding CornerRadius}"
FontSize="{TemplateBinding FontSize}" FontSize="{TemplateBinding FontSize}" />
RecognizesAccessKey="True" />
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="RecognizesAccessKey" Value="True" />
</Style>
<Style Selector="^.Secondary"> <Style Selector="^.Secondary">
<Setter Property="Foreground" Value="{DynamicResource TextBlockSecondaryForeground}" /> <Setter Property="Foreground" Value="{DynamicResource TextBlockSecondaryForeground}" />
</Style> </Style>
@@ -162,6 +173,7 @@
<!-- Shape: Square,Circle. Default is Square --> <!-- Shape: Square,Circle. Default is Square -->
<!-- Size: Small, Large. Default is Small --> <!-- Size: Small, Large. Default is Small -->
<!-- Color: Red, Pink, Purple, Violet, Indigo, Blue, LightBlue, Cyan, Teal, Green, LightGreen, Lime, Yellow, Amber, Orange, Grey, White. Default is Grey --> <!-- Color: Red, Pink, Purple, Violet, Indigo, Blue, LightBlue, Cyan, Teal, Green, LightGreen, Lime, Yellow, Amber, Orange, Grey, White. Default is Grey -->
<!-- AI style: Colorful, Gradient -->
<ControlTheme x:Key="TagLabel" TargetType="Label"> <ControlTheme x:Key="TagLabel" TargetType="Label">
<Setter Property="BorderThickness" Value="{DynamicResource LabelTagBorderThickness}" /> <Setter Property="BorderThickness" Value="{DynamicResource LabelTagBorderThickness}" />
<Setter Property="MinHeight" Value="{DynamicResource LabelTagSmallHeight}" /> <Setter Property="MinHeight" Value="{DynamicResource LabelTagSmallHeight}" />
@@ -187,10 +199,12 @@
ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplate="{TemplateBinding ContentTemplate}"
CornerRadius="{TemplateBinding CornerRadius}" CornerRadius="{TemplateBinding CornerRadius}"
FontSize="{TemplateBinding FontSize}" FontSize="{TemplateBinding FontSize}"
RecognizesAccessKey="True"
UseLayoutRounding="True" /> UseLayoutRounding="True" />
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="RecognizesAccessKey" Value="True" />
</Style>
<Style Selector="^.Large"> <Style Selector="^.Large">
<Setter Property="Padding" Value="{DynamicResource LabelTagLargePadding}" /> <Setter Property="Padding" Value="{DynamicResource LabelTagLargePadding}" />
<Setter Property="MinHeight" Value="{DynamicResource LabelTagLargeHeight}" /> <Setter Property="MinHeight" Value="{DynamicResource LabelTagLargeHeight}" />
@@ -395,5 +409,34 @@
<Setter Property="BorderBrush" Value="{DynamicResource LabelTagSolidWhiteBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource LabelTagSolidWhiteBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource LabelTagSolidWhiteBackground}" /> <Setter Property="Background" Value="{DynamicResource LabelTagSolidWhiteBackground}" />
</Style> </Style>
<Style Selector="^.Colorful">
<Setter Property="FontWeight" Value="{StaticResource LabelTagColorfulFontWeight}" />
<Setter Property="Foreground" Value="{DynamicResource LabelTagColorfulLightForeground}" />
<Setter Property="Background" Value="{DynamicResource LabelTagColorfulLightBackground}" />
<Style Selector="^.Ghost">
<Setter Property="Foreground" Value="{DynamicResource LabelTagColorfulGhostForeground}" />
<Setter Property="Background" Value="{DynamicResource LabelTagColorfulGhostBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource LabelTagColorfulGhostBorderBrush}" />
</Style>
<Style Selector="^.Solid">
<Setter Property="Foreground" Value="{DynamicResource LabelTagColorfulSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource LabelTagColorfulSolidBackground}" />
</Style>
<Style Selector="^.Gradient">
<Setter Property="Foreground" Value="{DynamicResource LabelTagColorfulGradientLightForeground}" />
<Setter Property="Background" Value="{DynamicResource LabelTagColorfulGradientLightBackground}" />
<Style Selector="^.Ghost">
<Setter Property="Foreground" Value="{DynamicResource LabelTagColorfulGradientGhostForeground}" />
<Setter Property="Background" Value="{DynamicResource LabelTagColorfulGradientGhostBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource LabelTagColorfulGradientGhostBorderBrush}" />
</Style>
<Style Selector="^.Solid">
<Setter Property="Foreground" Value="{DynamicResource LabelTagColorfulGradientSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource LabelTagColorfulGradientSolidBackground}" />
</Style>
</Style>
</Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -7,6 +7,7 @@
<ControlTheme x:Key="MenuScrollViewer" TargetType="ScrollViewer"> <ControlTheme x:Key="MenuScrollViewer" TargetType="ScrollViewer">
<Setter Property="Background" Value="Transparent" /> <Setter Property="Background" Value="Transparent" />
<Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="False" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="ScrollViewer"> <ControlTemplate TargetType="ScrollViewer">
<DockPanel> <DockPanel>
@@ -166,8 +167,7 @@
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Center" VerticalAlignment="Center"
Content="{TemplateBinding Header}" Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}" ContentTemplate="{TemplateBinding HeaderTemplate}" />
RecognizesAccessKey="True" />
<TextBlock <TextBlock
Name="PART_InputGestureText" Name="PART_InputGestureText"
Grid.Column="3" Grid.Column="3"
@@ -222,6 +222,10 @@
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^ /template/ ContentPresenter#PART_HeaderPresenter">
<Setter Property="RecognizesAccessKey" Value="True" />
</Style>
<Style Selector="^:icon /template/ Viewbox#PART_IconPresenter"> <Style Selector="^:icon /template/ Viewbox#PART_IconPresenter">
<Setter Property="IsVisible" Value="True" /> <Setter Property="IsVisible" Value="True" />
</Style> </Style>
@@ -346,7 +350,7 @@
BorderThickness="{DynamicResource MenuFlyoutBorderThickness}" BorderThickness="{DynamicResource MenuFlyoutBorderThickness}"
BoxShadow="{DynamicResource MenuFlyoutBorderBoxShadow}" BoxShadow="{DynamicResource MenuFlyoutBorderBoxShadow}"
CornerRadius="{DynamicResource MenuFlyoutCornerRadius}"> CornerRadius="{DynamicResource MenuFlyoutCornerRadius}">
<ScrollViewer Theme="{StaticResource MenuScrollViewer}" CornerRadius="{DynamicResource MenuFlyoutCornerRadius}"> <ScrollViewer Theme="{StaticResource MenuScrollViewer}" IsScrollChainingEnabled="False" CornerRadius="{DynamicResource MenuFlyoutCornerRadius}">
<ItemsPresenter <ItemsPresenter
Name="PART_ItemsPresenter" Name="PART_ItemsPresenter"
Grid.IsSharedSizeScope="True" Grid.IsSharedSizeScope="True"

View File

@@ -57,7 +57,7 @@
<Setter Property="BorderBrush" Value="Transparent" /> <Setter Property="BorderBrush" Value="Transparent" />
</Style> </Style>
<Style Selector="^:pointerover /template/ TextBox#PART_TextBox"> <Style Selector="^:pointerover /template/ TextBox#PART_TextBox">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointerOverBackground}" /> <Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointeroverBackground}" />
<Setter Property="BorderBrush" Value="Transparent" /> <Setter Property="BorderBrush" Value="Transparent" />
</Style> </Style>
<Style Selector="^:pressed /template/ TextBox#PART_TextBox"> <Style Selector="^:pressed /template/ TextBox#PART_TextBox">

View File

@@ -7,6 +7,7 @@
<Setter Property="FontSize" Value="{DynamicResource DefaultFontSize}" /> <Setter Property="FontSize" Value="{DynamicResource DefaultFontSize}" />
<Setter Property="FontWeight" Value="{DynamicResource DefaultFontWeight}" /> <Setter Property="FontWeight" Value="{DynamicResource DefaultFontWeight}" />
<Setter Property="FontFamily" Value="{DynamicResource DefaultFontFamily}" /> <Setter Property="FontFamily" Value="{DynamicResource DefaultFontFamily}" />
<Setter Property="Inline.TextDecorations" Value="" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="PopupRoot"> <ControlTemplate TargetType="PopupRoot">
<LayoutTransformControl LayoutTransform="{TemplateBinding Transform}"> <LayoutTransformControl LayoutTransform="{TemplateBinding Transform}">
@@ -29,6 +30,10 @@
</ControlTheme> </ControlTheme>
<ControlTheme x:Key="{x:Type OverlayPopupHost}" TargetType="OverlayPopupHost"> <ControlTheme x:Key="{x:Type OverlayPopupHost}" TargetType="OverlayPopupHost">
<Setter Property="FontSize" Value="{DynamicResource DefaultFontSize}" />
<Setter Property="FontWeight" Value="{DynamicResource DefaultFontWeight}" />
<Setter Property="FontFamily" Value="{DynamicResource DefaultFontFamily}" />
<Setter Property="Inline.TextDecorations" Value="" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate>
<LayoutTransformControl LayoutTransform="{TemplateBinding Transform}"> <LayoutTransformControl LayoutTransform="{TemplateBinding Transform}">

View File

@@ -64,13 +64,16 @@
Foreground="{TemplateBinding Foreground}" Foreground="{TemplateBinding Foreground}"
IsVisible="{TemplateBinding Content,Converter={x:Static ObjectConverters.IsNotNull}}" IsVisible="{TemplateBinding Content,Converter={x:Static ObjectConverters.IsNotNull}}"
FontSize="{TemplateBinding FontSize}" FontSize="{TemplateBinding FontSize}"
RecognizesAccessKey="True"
TextWrapping="Wrap" /> TextWrapping="Wrap" />
</Grid> </Grid>
</Border> </Border>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="RecognizesAccessKey" Value="True" />
</Style>
<Style Selector="^:unchecked"> <Style Selector="^:unchecked">
<Style Selector="^ /template/ Ellipse#CheckGlyph"> <Style Selector="^ /template/ Ellipse#CheckGlyph">
<Setter Property="IsVisible" Value="False" /> <Setter Property="IsVisible" Value="False" />
@@ -162,12 +165,14 @@
Content="{TemplateBinding Content}" Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplate="{TemplateBinding ContentTemplate}"
CornerRadius="{TemplateBinding CornerRadius}" CornerRadius="{TemplateBinding CornerRadius}"
RecognizesAccessKey="True"
TextElement.FontSize="{TemplateBinding FontSize}" TextElement.FontSize="{TemplateBinding FontSize}"
TextElement.FontWeight="{TemplateBinding FontWeight}" TextElement.FontWeight="{TemplateBinding FontWeight}"
UseLayoutRounding="False" /> UseLayoutRounding="False" />
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="RecognizesAccessKey" Value="True" />
</Style>
<Style Selector="^:unchecked"> <Style Selector="^:unchecked">
<Setter Property="Background" Value="Transparent" /> <Setter Property="Background" Value="Transparent" />
<Style Selector="^:pointerover"> <Style Selector="^:pointerover">
@@ -249,7 +254,6 @@
ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplate="{TemplateBinding ContentTemplate}"
Foreground="{TemplateBinding Foreground}" Foreground="{TemplateBinding Foreground}"
IsVisible="{TemplateBinding Content,Converter={x:Static ObjectConverters.IsNotNull}}" IsVisible="{TemplateBinding Content,Converter={x:Static ObjectConverters.IsNotNull}}"
RecognizesAccessKey="True"
FontSize="{TemplateBinding FontSize}" FontSize="{TemplateBinding FontSize}"
TextWrapping="Wrap" /> TextWrapping="Wrap" />
</Grid> </Grid>
@@ -257,6 +261,10 @@
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="RecognizesAccessKey" Value="True" />
</Style>
<Style Selector="^:unchecked"> <Style Selector="^:unchecked">
<Style Selector="^ /template/ Ellipse#CheckGlyph"> <Style Selector="^ /template/ Ellipse#CheckGlyph">
<Setter Property="IsVisible" Value="False" /> <Setter Property="IsVisible" Value="False" />
@@ -369,11 +377,13 @@
Content="{TemplateBinding Content}" Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplate="{TemplateBinding ContentTemplate}"
CornerRadius="{TemplateBinding CornerRadius}" CornerRadius="{TemplateBinding CornerRadius}"
RecognizesAccessKey="True"
UseLayoutRounding="False" UseLayoutRounding="False"
TextWrapping="Wrap" /> TextWrapping="Wrap" />
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="RecognizesAccessKey" Value="True" />
</Style>
<Style Selector="^:unchecked"> <Style Selector="^:unchecked">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCardDefaultBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCardDefaultBorderBrush}" />

View File

@@ -44,12 +44,14 @@
CornerRadius="{TemplateBinding CornerRadius}" CornerRadius="{TemplateBinding CornerRadius}"
Content="{TemplateBinding Content}" Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplate="{TemplateBinding ContentTemplate}"
RecognizesAccessKey="True"
TextElement.FontSize="{TemplateBinding FontSize}" TextElement.FontSize="{TemplateBinding FontSize}"
TextElement.FontWeight="{TemplateBinding FontWeight}" TextElement.FontWeight="{TemplateBinding FontWeight}"
UseLayoutRounding="False" /> UseLayoutRounding="False" />
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="RecognizesAccessKey" Value="True" />
</Style>
</ControlTheme> </ControlTheme>
<ControlTheme x:Key="{x:Type SplitButton}" TargetType="SplitButton"> <ControlTheme x:Key="{x:Type SplitButton}" TargetType="SplitButton">

View File

@@ -1,6 +1,4 @@
<ResourceDictionary <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ControlTheme x:Key="{x:Type SplitView}" TargetType="SplitView"> <ControlTheme x:Key="{x:Type SplitView}" TargetType="SplitView">
<Setter Property="OpenPaneLength" Value="{DynamicResource SplitViewOpenPaneThemeLength}" /> <Setter Property="OpenPaneLength" Value="{DynamicResource SplitViewOpenPaneThemeLength}" />
<Setter Property="CompactPaneLength" Value="{DynamicResource SplitViewCompactPaneThemeLength}" /> <Setter Property="CompactPaneLength" Value="{DynamicResource SplitViewCompactPaneThemeLength}" />
@@ -100,7 +98,7 @@
<Style Selector="^:right"> <Style Selector="^:right">
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate TargetType="SplitView">
<Grid Name="Container" Background="{TemplateBinding Background}"> <Grid Name="Container" Background="{TemplateBinding Background}">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
@@ -185,79 +183,13 @@
</Style> </Style>
</Style> </Style>
<Style Selector="^:open"> <Style Selector="^:top">
<Style Selector="^ /template/ Panel#PART_PaneRoot">
<Setter Property="Transitions">
<Transitions>
<DoubleTransition
Easing="{StaticResource SplitViewPaneAnimationEasing}"
Property="Width"
Duration="{StaticResource SplitViewPaneAnimationOpenDuration}" />
</Transitions>
</Setter>
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=OpenPaneLength}" />
</Style>
<Style Selector="^ /template/ Rectangle#LightDismissLayer">
<Setter Property="Transitions">
<Transitions>
<DoubleTransition
Easing="{StaticResource SplitViewPaneAnimationEasing}"
Property="Opacity"
Duration="{StaticResource SplitViewPaneAnimationOpenDuration}" />
</Transitions>
</Setter>
<Setter Property="Opacity" Value="1.0" />
</Style>
</Style>
<Style Selector="^:closed">
<Style Selector="^ /template/ Panel#PART_PaneRoot">
<Setter Property="Transitions">
<Transitions>
<DoubleTransition
Easing="{StaticResource SplitViewPaneAnimationEasing}"
Property="Width"
Duration="{StaticResource SplitViewPaneAnimationCloseDuration}" />
</Transitions>
</Setter>
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
</Style>
<Style Selector="^ /template/ Rectangle#LightDismissLayer">
<Setter Property="Transitions">
<Transitions>
<DoubleTransition
Easing="{StaticResource SplitViewPaneAnimationEasing}"
Property="Opacity"
Duration="{StaticResource SplitViewPaneAnimationCloseDuration}" />
</Transitions>
</Setter>
<Setter Property="Opacity" Value="0.0" />
</Style>
</Style>
<Style Selector="^:lightDismiss /template/ Rectangle#LightDismissLayer">
<Setter Property="Fill" Value="{DynamicResource SplitViewMaskBrush}" />
</Style>
<Style Selector="^:overlay:open /template/ Rectangle#LightDismissLayer">
<Setter Property="IsVisible" Value="True" />
</Style>
<Style Selector="^:compactoverlay:open /template/ Rectangle#LightDismissLayer">
<Setter Property="IsVisible" Value="True" />
</Style>
</ControlTheme>
<ControlTheme x:Key="VerticalSplitView" TargetType="SplitView">
<Setter Property="OpenPaneLength" Value="{DynamicResource SplitViewOpenPaneThemeLength}" />
<Setter Property="CompactPaneLength" Value="{DynamicResource SplitViewCompactPaneThemeLength}" />
<Setter Property="PaneBackground" Value="{DynamicResource SplitViewPaneBackground}" />
<Style Selector="^:left">
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="SplitView"> <ControlTemplate TargetType="SplitView">
<Grid Name="Container" Background="{TemplateBinding Background}"> <Grid Name="Container" Background="{TemplateBinding Background}">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<!-- why is this throwing a binding error? --> <!-- why is this throwing a binding error? -->
<RowDefinition <RowDefinition Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.PaneColumnGridLength}" />
Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.PaneColumnGridLength}" />
<RowDefinition Height="*" /> <RowDefinition Height="*" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
@@ -295,8 +227,7 @@
<Style Selector="^:overlay"> <Style Selector="^:overlay">
<Style Selector="^ /template/ Panel#PART_PaneRoot"> <Style Selector="^ /template/ Panel#PART_PaneRoot">
<Setter Property="Height" <Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
<Setter Property="Grid.RowSpan" Value="1" /> <Setter Property="Grid.RowSpan" Value="1" />
<Setter Property="Grid.Row" Value="0" /> <Setter Property="Grid.Row" Value="0" />
</Style> </Style>
@@ -310,8 +241,7 @@
<Style Selector="^ /template/ Panel#PART_PaneRoot"> <Style Selector="^ /template/ Panel#PART_PaneRoot">
<Setter Property="Grid.RowSpan" Value="1" /> <Setter Property="Grid.RowSpan" Value="1" />
<Setter Property="Grid.Row" Value="0" /> <Setter Property="Grid.Row" Value="0" />
<Setter Property="Height" <Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
</Style> </Style>
<Style Selector="^ /template/ Panel#ContentRoot"> <Style Selector="^ /template/ Panel#ContentRoot">
<Setter Property="Grid.Row" Value="1" /> <Setter Property="Grid.Row" Value="1" />
@@ -324,8 +254,7 @@
<!-- RowSpan should be 2 --> <!-- RowSpan should be 2 -->
<Setter Property="Grid.RowSpan" Value="1" /> <Setter Property="Grid.RowSpan" Value="1" />
<Setter Property="Grid.Row" Value="0" /> <Setter Property="Grid.Row" Value="0" />
<Setter Property="Height" <Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
</Style> </Style>
<Style Selector="^ /template/ Panel#ContentRoot"> <Style Selector="^ /template/ Panel#ContentRoot">
<Setter Property="Grid.Row" Value="1" /> <Setter Property="Grid.Row" Value="1" />
@@ -337,8 +266,322 @@
<Style Selector="^ /template/ Panel#PART_PaneRoot"> <Style Selector="^ /template/ Panel#PART_PaneRoot">
<Setter Property="Grid.RowSpan" Value="1" /> <Setter Property="Grid.RowSpan" Value="1" />
<Setter Property="Grid.Row" Value="0" /> <Setter Property="Grid.Row" Value="0" />
<Setter Property="Height" <Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" /> </Style>
<Style Selector="^ /template/ Panel#ContentRoot">
<Setter Property="Grid.Row" Value="1" />
<Setter Property="Grid.RowSpan" Value="1" />
</Style>
</Style>
</Style>
<Style Selector="^:bottom">
<Setter Property="Template">
<ControlTemplate TargetType="SplitView">
<Grid Name="Container" Background="{TemplateBinding Background}">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.PaneColumnGridLength}" />
</Grid.RowDefinitions>
<Panel
Name="PART_PaneRoot"
VerticalAlignment="Bottom"
Background="{TemplateBinding PaneBackground}"
ClipToBounds="True"
ZIndex="100">
<ContentPresenter
Name="PART_PanePresenter"
Content="{TemplateBinding Pane}"
ContentTemplate="{TemplateBinding PaneTemplate}" />
<Rectangle
Name="HCPaneBorder"
Height="1"
VerticalAlignment="Top"
Fill="{DynamicResource SplitViewSeparatorBackground}" />
</Panel>
<Panel Name="ContentRoot">
<ContentPresenter
Name="PART_ContentPresenter"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" />
<Rectangle
Name="LightDismissLayer"
Fill="Transparent"
IsVisible="False" />
</Panel>
</Grid>
</ControlTemplate>
</Setter>
<Style Selector="^:overlay">
<Style Selector="^ /template/ Panel#PART_PaneRoot">
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
<Setter Property="Grid.RowSpan" Value="2" />
<Setter Property="Grid.Row" Value="1" />
</Style>
<Style Selector="^ /template/ Panel#ContentRoot">
<Setter Property="Grid.Row" Value="0" />
<Setter Property="Grid.RowSpan" Value="2" />
</Style>
</Style>
<Style Selector="^:compactinline">
<Style Selector="^ /template/ Panel#PART_PaneRoot">
<Setter Property="Grid.RowSpan" Value="1" />
<Setter Property="Grid.Row" Value="1" />
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
</Style>
<Style Selector="^ /template/ Panel#ContentRoot">
<Setter Property="Grid.Row" Value="0" />
<Setter Property="Grid.RowSpan" Value="1" />
</Style>
</Style>
<Style Selector="^:compactoverlay">
<Style Selector="^ /template/ Panel#PART_PaneRoot">
<Setter Property="Grid.RowSpan" Value="2" />
<Setter Property="Grid.Row" Value="1" />
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
</Style>
<Style Selector="^ /template/ Panel#ContentRoot">
<Setter Property="Grid.Row" Value="0" />
<Setter Property="Grid.RowSpan" Value="1" />
</Style>
</Style>
<Style Selector="^:inline">
<Style Selector="^ /template/ Panel#PART_PaneRoot">
<Setter Property="Grid.RowSpan" Value="1" />
<Setter Property="Grid.Row" Value="1" />
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
</Style>
<Style Selector="^ /template/ Panel#ContentRoot">
<Setter Property="Grid.Row" Value="0" />
<Setter Property="Grid.RowSpan" Value="1" />
</Style>
</Style>
</Style>
<Style Selector="^:open">
<Style Selector="^:left /template/ Panel#PART_PaneRoot">
<Setter Property="Transitions">
<Transitions>
<DoubleTransition
Easing="{StaticResource SplitViewPaneAnimationEasing}"
Property="Width"
Duration="{StaticResource SplitViewPaneAnimationOpenDuration}" />
</Transitions>
</Setter>
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=OpenPaneLength}" />
</Style>
<Style Selector="^:right /template/ Panel#PART_PaneRoot">
<Setter Property="Transitions">
<Transitions>
<DoubleTransition
Easing="{StaticResource SplitViewPaneAnimationEasing}"
Property="Width"
Duration="{StaticResource SplitViewPaneAnimationOpenDuration}" />
</Transitions>
</Setter>
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=OpenPaneLength}" />
</Style>
<Style Selector="^:top /template/ Panel#PART_PaneRoot">
<Setter Property="Transitions">
<Transitions>
<DoubleTransition
Easing="{StaticResource SplitViewPaneAnimationEasing}"
Property="Height"
Duration="{StaticResource SplitViewPaneAnimationOpenDuration}" />
</Transitions>
</Setter>
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=OpenPaneLength}" />
</Style>
<Style Selector="^:bottom /template/ Panel#PART_PaneRoot">
<Setter Property="Transitions">
<Transitions>
<DoubleTransition
Easing="{StaticResource SplitViewPaneAnimationEasing}"
Property="Height"
Duration="{StaticResource SplitViewPaneAnimationOpenDuration}" />
</Transitions>
</Setter>
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=OpenPaneLength}" />
</Style>
<Style Selector="^ /template/ Rectangle#LightDismissLayer">
<Setter Property="Transitions">
<Transitions>
<DoubleTransition
Easing="{StaticResource SplitViewPaneAnimationEasing}"
Property="Opacity"
Duration="{StaticResource SplitViewPaneAnimationOpenDuration}" />
</Transitions>
</Setter>
<Setter Property="Opacity" Value="1.0" />
</Style>
</Style>
<Style Selector="^:closed">
<Style Selector="^:left /template/ Panel#PART_PaneRoot">
<Setter Property="Transitions">
<Transitions>
<DoubleTransition
Easing="{StaticResource SplitViewPaneAnimationEasing}"
Property="Width"
Duration="{StaticResource SplitViewPaneAnimationCloseDuration}" />
</Transitions>
</Setter>
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
</Style>
<Style Selector="^:right /template/ Panel#PART_PaneRoot">
<Setter Property="Transitions">
<Transitions>
<DoubleTransition
Easing="{StaticResource SplitViewPaneAnimationEasing}"
Property="Width"
Duration="{StaticResource SplitViewPaneAnimationCloseDuration}" />
</Transitions>
</Setter>
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
</Style>
<Style Selector="^:top /template/ Panel#PART_PaneRoot">
<Setter Property="Transitions">
<Transitions>
<DoubleTransition
Easing="{StaticResource SplitViewPaneAnimationEasing}"
Property="Height"
Duration="{StaticResource SplitViewPaneAnimationCloseDuration}" />
</Transitions>
</Setter>
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
</Style>
<Style Selector="^:bottom /template/ Panel#PART_PaneRoot">
<Setter Property="Transitions">
<Transitions>
<DoubleTransition
Easing="{StaticResource SplitViewPaneAnimationEasing}"
Property="Height"
Duration="{StaticResource SplitViewPaneAnimationCloseDuration}" />
</Transitions>
</Setter>
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
</Style>
<Style Selector="^ /template/ Rectangle#LightDismissLayer">
<Setter Property="Transitions">
<Transitions>
<DoubleTransition
Easing="{StaticResource SplitViewPaneAnimationEasing}"
Property="Opacity"
Duration="{StaticResource SplitViewPaneAnimationCloseDuration}" />
</Transitions>
</Setter>
<Setter Property="Opacity" Value="0.0" />
</Style>
</Style>
<Style Selector="^:lightDismiss /template/ Rectangle#LightDismissLayer">
<Setter Property="Fill" Value="{DynamicResource SplitViewMaskBrush}" />
</Style>
<Style Selector="^:overlay:open /template/ Rectangle#LightDismissLayer">
<Setter Property="IsVisible" Value="True" />
</Style>
<Style Selector="^:compactoverlay:open /template/ Rectangle#LightDismissLayer">
<Setter Property="IsVisible" Value="True" />
</Style>
</ControlTheme>
<!-- Obsolete after Avalonia 11.3.7 -->
<ControlTheme x:Key="VerticalSplitView" TargetType="SplitView">
<Setter Property="OpenPaneLength" Value="{DynamicResource SplitViewOpenPaneThemeLength}" />
<Setter Property="CompactPaneLength" Value="{DynamicResource SplitViewCompactPaneThemeLength}" />
<Setter Property="PaneBackground" Value="{DynamicResource SplitViewPaneBackground}" />
<Style Selector="^:left">
<Setter Property="Template">
<ControlTemplate TargetType="SplitView">
<Grid Name="Container" Background="{TemplateBinding Background}">
<Grid.RowDefinitions>
<!-- why is this throwing a binding error? -->
<RowDefinition Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.PaneColumnGridLength}" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Panel
Name="PART_PaneRoot"
VerticalAlignment="Top"
Background="{TemplateBinding PaneBackground}"
ClipToBounds="True"
ZIndex="100">
<ContentPresenter
Name="PART_PanePresenter"
Content="{TemplateBinding Pane}"
ContentTemplate="{TemplateBinding PaneTemplate}" />
<Rectangle
Name="HCPaneBorder"
Height="1"
VerticalAlignment="Bottom"
Fill="{DynamicResource SplitViewSeparatorBackground}" />
</Panel>
<Panel Name="ContentRoot">
<ContentPresenter
Name="PART_ContentPresenter"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" />
<Rectangle
Name="LightDismissLayer"
Fill="Transparent"
IsVisible="False" />
</Panel>
</Grid>
</ControlTemplate>
</Setter>
<Style Selector="^:overlay">
<Style Selector="^ /template/ Panel#PART_PaneRoot">
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
<Setter Property="Grid.RowSpan" Value="1" />
<Setter Property="Grid.Row" Value="0" />
</Style>
<Style Selector="^ /template/ Panel#ContentRoot">
<Setter Property="Grid.Row" Value="1" />
<Setter Property="Grid.RowSpan" Value="2" />
</Style>
</Style>
<Style Selector="^:compactinline">
<Style Selector="^ /template/ Panel#PART_PaneRoot">
<Setter Property="Grid.RowSpan" Value="1" />
<Setter Property="Grid.Row" Value="0" />
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
</Style>
<Style Selector="^ /template/ Panel#ContentRoot">
<Setter Property="Grid.Row" Value="1" />
<Setter Property="Grid.RowSpan" Value="1" />
</Style>
</Style>
<Style Selector="^:compactoverlay">
<Style Selector="^ /template/ Panel#PART_PaneRoot">
<!-- RowSpan should be 2 -->
<Setter Property="Grid.RowSpan" Value="1" />
<Setter Property="Grid.Row" Value="0" />
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
</Style>
<Style Selector="^ /template/ Panel#ContentRoot">
<Setter Property="Grid.Row" Value="1" />
<Setter Property="Grid.RowSpan" Value="1" />
</Style>
</Style>
<Style Selector="^:inline">
<Style Selector="^ /template/ Panel#PART_PaneRoot">
<Setter Property="Grid.RowSpan" Value="1" />
<Setter Property="Grid.Row" Value="0" />
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
</Style> </Style>
<Style Selector="^ /template/ Panel#ContentRoot"> <Style Selector="^ /template/ Panel#ContentRoot">
<Setter Property="Grid.Row" Value="1" /> <Setter Property="Grid.Row" Value="1" />
@@ -353,8 +596,7 @@
<Grid Name="Container" Background="{TemplateBinding Background}"> <Grid Name="Container" Background="{TemplateBinding Background}">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="*" /> <RowDefinition Height="*" />
<RowDefinition <RowDefinition Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.PaneColumnGridLength}" />
Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.PaneColumnGridLength}" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Panel <Panel
@@ -388,8 +630,7 @@
<Style Selector="^:overlay"> <Style Selector="^:overlay">
<Style Selector="^ /template/ Panel#PART_PaneRoot"> <Style Selector="^ /template/ Panel#PART_PaneRoot">
<Setter Property="Height" <Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
<Setter Property="Grid.RowSpan" Value="2" /> <Setter Property="Grid.RowSpan" Value="2" />
<Setter Property="Grid.Row" Value="1" /> <Setter Property="Grid.Row" Value="1" />
</Style> </Style>
@@ -403,8 +644,7 @@
<Style Selector="^ /template/ Panel#PART_PaneRoot"> <Style Selector="^ /template/ Panel#PART_PaneRoot">
<Setter Property="Grid.RowSpan" Value="1" /> <Setter Property="Grid.RowSpan" Value="1" />
<Setter Property="Grid.Row" Value="1" /> <Setter Property="Grid.Row" Value="1" />
<Setter Property="Height" <Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
</Style> </Style>
<Style Selector="^ /template/ Panel#ContentRoot"> <Style Selector="^ /template/ Panel#ContentRoot">
<Setter Property="Grid.Row" Value="0" /> <Setter Property="Grid.Row" Value="0" />
@@ -416,8 +656,7 @@
<Style Selector="^ /template/ Panel#PART_PaneRoot"> <Style Selector="^ /template/ Panel#PART_PaneRoot">
<Setter Property="Grid.RowSpan" Value="2" /> <Setter Property="Grid.RowSpan" Value="2" />
<Setter Property="Grid.Row" Value="1" /> <Setter Property="Grid.Row" Value="1" />
<Setter Property="Height" <Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
</Style> </Style>
<Style Selector="^ /template/ Panel#ContentRoot"> <Style Selector="^ /template/ Panel#ContentRoot">
<Setter Property="Grid.Row" Value="0" /> <Setter Property="Grid.Row" Value="0" />
@@ -429,8 +668,7 @@
<Style Selector="^ /template/ Panel#PART_PaneRoot"> <Style Selector="^ /template/ Panel#PART_PaneRoot">
<Setter Property="Grid.RowSpan" Value="1" /> <Setter Property="Grid.RowSpan" Value="1" />
<Setter Property="Grid.Row" Value="1" /> <Setter Property="Grid.Row" Value="1" />
<Setter Property="Height" <Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
</Style> </Style>
<Style Selector="^ /template/ Panel#ContentRoot"> <Style Selector="^ /template/ Panel#ContentRoot">
<Setter Property="Grid.Row" Value="0" /> <Setter Property="Grid.Row" Value="0" />
@@ -449,8 +687,7 @@
Duration="{StaticResource SplitViewPaneAnimationOpenDuration}" /> Duration="{StaticResource SplitViewPaneAnimationOpenDuration}" />
</Transitions> </Transitions>
</Setter> </Setter>
<Setter Property="Height" <Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=OpenPaneLength}" />
Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=OpenPaneLength}" />
</Style> </Style>
<Style Selector="^ /template/ Rectangle#LightDismissLayer"> <Style Selector="^ /template/ Rectangle#LightDismissLayer">
<Setter Property="Transitions"> <Setter Property="Transitions">
@@ -475,8 +712,7 @@
Duration="{StaticResource SplitViewPaneAnimationCloseDuration}" /> Duration="{StaticResource SplitViewPaneAnimationCloseDuration}" />
</Transitions> </Transitions>
</Setter> </Setter>
<Setter Property="Height" <Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
</Style> </Style>
<Style Selector="^ /template/ Rectangle#LightDismissLayer"> <Style Selector="^ /template/ Rectangle#LightDismissLayer">
<Setter Property="Transitions"> <Setter Property="Transitions">

View File

@@ -42,6 +42,10 @@
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^ /template/ ContentPresenter#PART_HeaderPresenter">
<Setter Property="RecognizesAccessKey" Value="True" />
</Style>
<Style Selector="^:selected /template/ ContentPresenter#PART_HeaderPresenter"> <Style Selector="^:selected /template/ ContentPresenter#PART_HeaderPresenter">
<Setter Property="FontWeight" Value="{DynamicResource TabItemSelectedFontWeight}" /> <Setter Property="FontWeight" Value="{DynamicResource TabItemSelectedFontWeight}" />
<Setter Property="Foreground" Value="{DynamicResource TabItemLineHeaderSelectedForeground}" /> <Setter Property="Foreground" Value="{DynamicResource TabItemLineHeaderSelectedForeground}" />

View File

@@ -107,6 +107,7 @@
Command="{Binding $parent[TextBox].Clear}" Command="{Binding $parent[TextBox].Clear}"
Content="{DynamicResource IconButtonClearData}" Content="{DynamicResource IconButtonClearData}"
IsVisible="False" IsVisible="False"
Focusable="False"
Theme="{StaticResource InnerIconButton}" /> Theme="{StaticResource InnerIconButton}" />
<ToggleButton <ToggleButton
Name="PART_RevealButton" Name="PART_RevealButton"
@@ -152,7 +153,7 @@
<Setter Property="BorderBrush" Value="Transparent" /> <Setter Property="BorderBrush" Value="Transparent" />
</Style> </Style>
<Style Selector="^:pointerover /template/ Border#PART_ContentPresenterBorder"> <Style Selector="^:pointerover /template/ Border#PART_ContentPresenterBorder">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointerOverBackground}" /> <Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointeroverBackground}" />
<Setter Property="BorderBrush" Value="Transparent" /> <Setter Property="BorderBrush" Value="Transparent" />
</Style> </Style>
<Style Selector="^:pressed /template/ Border#PART_ContentPresenterBorder"> <Style Selector="^:pressed /template/ Border#PART_ContentPresenterBorder">
@@ -210,8 +211,8 @@
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsBorderBrush}" />
</Style> </Style>
<Style Selector="^:pointerover /template/ Border#PART_ContentPresenterBorder"> <Style Selector="^:pointerover /template/ Border#PART_ContentPresenterBorder">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointerOverBackground}" /> <Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsPointerOverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsPointeroverBorderBrush}" />
</Style> </Style>
<Style Selector="^:pressed /template/ Border#PART_ContentPresenterBorder"> <Style Selector="^:pressed /template/ Border#PART_ContentPresenterBorder">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPressedBackground}" /> <Setter Property="Background" Value="{DynamicResource DataValidationErrorsPressedBackground}" />
@@ -260,7 +261,6 @@
<Setter Property="BorderThickness" Value="{DynamicResource TextBoxBorderThickness}" /> <Setter Property="BorderThickness" Value="{DynamicResource TextBoxBorderThickness}" />
<Setter Property="BackgroundSizing" Value="OuterBorderEdge" /> <Setter Property="BackgroundSizing" Value="OuterBorderEdge" />
<Setter Property="CornerRadius" Value="{DynamicResource TextBoxDefaultCornerRadius}" /> <Setter Property="CornerRadius" Value="{DynamicResource TextBoxDefaultCornerRadius}" />
<Setter Property="Cursor" Value="Ibeam" />
<Setter Property="CaretBrush" Value="{DynamicResource TextBoxTextCaretBrush}" /> <Setter Property="CaretBrush" Value="{DynamicResource TextBoxTextCaretBrush}" />
<Setter Property="Padding" Value="{DynamicResource TextBoxContentPadding}" /> <Setter Property="Padding" Value="{DynamicResource TextBoxContentPadding}" />
<Setter Property="MinHeight" Value="{DynamicResource TextBoxDefaultHeight}" /> <Setter Property="MinHeight" Value="{DynamicResource TextBoxDefaultHeight}" />
@@ -328,6 +328,11 @@
TextAlignment="{TemplateBinding TextAlignment}" TextAlignment="{TemplateBinding TextAlignment}"
TextWrapping="{TemplateBinding TextWrapping}" /> TextWrapping="{TemplateBinding TextWrapping}" />
</Panel> </Panel>
<ScrollViewer.Styles>
<Style Selector="ScrollContentPresenter#PART_ContentPresenter">
<Setter Property="Cursor" Value="Ibeam" />
</Style>
</ScrollViewer.Styles>
</ScrollViewer> </ScrollViewer>
<Button <Button
Name="PART_ClearButton" Name="PART_ClearButton"
@@ -335,6 +340,7 @@
Command="{Binding $parent[TextBox].Clear}" Command="{Binding $parent[TextBox].Clear}"
Content="{DynamicResource IconButtonClearData}" Content="{DynamicResource IconButtonClearData}"
IsVisible="False" IsVisible="False"
Focusable="False"
Theme="{StaticResource InnerIconButton}" /> Theme="{StaticResource InnerIconButton}" />
<ToggleButton <ToggleButton
Name="PART_RevealButton" Name="PART_RevealButton"
@@ -380,7 +386,7 @@
<Setter Property="BorderBrush" Value="Transparent" /> <Setter Property="BorderBrush" Value="Transparent" />
</Style> </Style>
<Style Selector="^:pointerover /template/ Border#PART_ContentPresenterBorder"> <Style Selector="^:pointerover /template/ Border#PART_ContentPresenterBorder">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointerOverBackground}" /> <Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointeroverBackground}" />
<Setter Property="BorderBrush" Value="Transparent" /> <Setter Property="BorderBrush" Value="Transparent" />
</Style> </Style>
<Style Selector="^:pressed /template/ Border#PART_ContentPresenterBorder"> <Style Selector="^:pressed /template/ Border#PART_ContentPresenterBorder">
@@ -438,8 +444,8 @@
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsBorderBrush}" />
</Style> </Style>
<Style Selector="^:pointerover /template/ Border#PART_ContentPresenterBorder"> <Style Selector="^:pointerover /template/ Border#PART_ContentPresenterBorder">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointerOverBackground}" /> <Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsPointerOverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsPointeroverBorderBrush}" />
</Style> </Style>
<Style Selector="^:pressed /template/ Border#PART_ContentPresenterBorder"> <Style Selector="^:pressed /template/ Border#PART_ContentPresenterBorder">
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPressedBackground}" /> <Setter Property="Background" Value="{DynamicResource DataValidationErrorsPressedBackground}" />
@@ -483,7 +489,6 @@
<Setter Property="Foreground" Value="{DynamicResource TextBoxForeground}" /> <Setter Property="Foreground" Value="{DynamicResource TextBoxForeground}" />
<Setter Property="SelectionBrush" Value="{DynamicResource TextBoxSelectionBackground}" /> <Setter Property="SelectionBrush" Value="{DynamicResource TextBoxSelectionBackground}" />
<Setter Property="SelectionForegroundBrush" Value="{DynamicResource TextBoxSelectionForeground}" /> <Setter Property="SelectionForegroundBrush" Value="{DynamicResource TextBoxSelectionForeground}" />
<Setter Property="Cursor" Value="Ibeam" />
<Setter Property="CaretBrush" Value="{DynamicResource TextBoxTextCaretBrush}" /> <Setter Property="CaretBrush" Value="{DynamicResource TextBoxTextCaretBrush}" />
<Setter Property="Padding" Value="{DynamicResource TextBoxContentPadding}" /> <Setter Property="Padding" Value="{DynamicResource TextBoxContentPadding}" />
<Setter Property="MinHeight" Value="{DynamicResource TextBoxDefaultHeight}" /> <Setter Property="MinHeight" Value="{DynamicResource TextBoxDefaultHeight}" />
@@ -491,6 +496,7 @@
<Setter Property="VerticalContentAlignment" Value="Center" /> <Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="FocusAdorner" Value="{x:Null}" /> <Setter Property="FocusAdorner" Value="{x:Null}" />
<Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="True" /> <Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="True" />
<Setter Property="ContextFlyout" Value="{StaticResource DefaultTextBoxContextFlyout}" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="TextBox"> <ControlTemplate TargetType="TextBox">
<Border Name="PART_ContentPresenterBorder" MinHeight="{TemplateBinding MinHeight}"> <Border Name="PART_ContentPresenterBorder" MinHeight="{TemplateBinding MinHeight}">
@@ -541,6 +547,11 @@
TextAlignment="{TemplateBinding TextAlignment}" TextAlignment="{TemplateBinding TextAlignment}"
TextWrapping="{TemplateBinding TextWrapping}" /> TextWrapping="{TemplateBinding TextWrapping}" />
</Panel> </Panel>
<ScrollViewer.Styles>
<Style Selector="ScrollContentPresenter#PART_ContentPresenter">
<Setter Property="Cursor" Value="Ibeam" />
</Style>
</ScrollViewer.Styles>
</ScrollViewer> </ScrollViewer>
<ContentPresenter <ContentPresenter
Grid.Column="2" Grid.Column="2"

View File

@@ -305,7 +305,8 @@
Margin="0,0,9,0" Margin="0,0,9,0"
Command="{Binding $parent[TimePicker].Clear}" Command="{Binding $parent[TimePicker].Clear}"
Content="{DynamicResource IconButtonClearData}" Content="{DynamicResource IconButtonClearData}"
IsVisible="False" /> IsVisible="False"
Focusable="False" />
</Grid> </Grid>
</DataValidationErrors> </DataValidationErrors>
</ControlTemplate> </ControlTemplate>

View File

@@ -2,20 +2,67 @@
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Design.PreviewWith> <Design.PreviewWith>
<StackPanel Margin="20"> <StackPanel HorizontalAlignment="Left" Spacing="16">
<ToggleButton Classes="Primary">Toggle</ToggleButton> <WrapPanel ItemSpacing="16" LineSpacing="16">
<ToggleButton Classes="Secondary">Toggle</ToggleButton> <ToggleButton Content="Default" />
<ToggleButton Classes="Tertiary">Toggle</ToggleButton> <ToggleButton Content="Primary" Classes="Primary" />
<ToggleButton Classes="Success">Toggle</ToggleButton> <ToggleButton Content="Secondary" Classes="Secondary" />
<ToggleButton Classes="Warning">Toggle</ToggleButton> <ToggleButton Content="Tertiary" Classes="Tertiary" />
<ToggleButton Classes="Danger">Toggle</ToggleButton> <ToggleButton Content="Success" Classes="Success" />
<ToggleButton Content="Warning" Classes="Warning" />
<ToggleButton Classes="Primary" IsThreeState="True">Toggle 3</ToggleButton> <ToggleButton Content="Danger" Classes="Danger" />
<ToggleButton Classes="Secondary" IsThreeState="True">Toggle 3</ToggleButton> <ToggleButton Content="Disabled" Classes="Danger" IsEnabled="False" />
<ToggleButton Classes="Tertiary" IsThreeState="True">Toggle 3</ToggleButton> </WrapPanel>
<ToggleButton Classes="Success" IsThreeState="True">Toggle 3</ToggleButton> <WrapPanel ItemSpacing="16" LineSpacing="16">
<ToggleButton Classes="Warning" IsThreeState="True">Toggle 3</ToggleButton> <ToggleButton Content="Default" IsChecked="True" />
<ToggleButton Classes="Danger" IsThreeState="True">Toggle 3</ToggleButton> <ToggleButton Content="Primary" Classes="Primary" IsChecked="True" />
<ToggleButton Content="Secondary" Classes="Secondary" IsChecked="True" />
<ToggleButton Content="Tertiary" Classes="Tertiary" IsChecked="True" />
<ToggleButton Content="Success" Classes="Success" IsChecked="True" />
<ToggleButton Content="Warning" Classes="Warning" IsChecked="True" />
<ToggleButton Content="Danger" Classes="Danger" IsChecked="True" />
<ToggleButton Content="Disabled" Classes="Danger" IsChecked="True" IsEnabled="False" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<ToggleButton Content="Default" IsChecked="{x:Null}" IsThreeState="True" />
<ToggleButton Content="Primary" Classes="Primary" IsChecked="{x:Null}" IsThreeState="True" />
<ToggleButton Content="Secondary" Classes="Secondary" IsChecked="{x:Null}" IsThreeState="True" />
<ToggleButton Content="Tertiary" Classes="Tertiary" IsChecked="{x:Null}" IsThreeState="True" />
<ToggleButton Content="Success" Classes="Success" IsChecked="{x:Null}" IsThreeState="True" />
<ToggleButton Content="Warning" Classes="Warning" IsChecked="{x:Null}" IsThreeState="True" />
<ToggleButton Content="Danger" Classes="Danger" IsChecked="{x:Null}" IsThreeState="True" />
<ToggleButton Content="Disabled" Classes="Danger" IsChecked="{x:Null}" IsThreeState="True" IsEnabled="False" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<ToggleButton Content="Default" Classes="Colorful" />
<ToggleButton Content="Primary" Classes="Colorful Primary" />
<ToggleButton Content="Secondary" Classes="Colorful Secondary" />
<ToggleButton Content="Tertiary" Classes="Colorful Tertiary" />
<ToggleButton Content="Success" Classes="Colorful Success" />
<ToggleButton Content="Warning" Classes="Colorful Warning" />
<ToggleButton Content="Danger" Classes="Colorful Danger" />
<ToggleButton Content="Disabled" Classes="Colorful Primary" IsEnabled="False" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<ToggleButton Content="Default" Classes="Colorful" IsChecked="True" />
<ToggleButton Content="Primary" Classes="Colorful Primary" IsChecked="True" />
<ToggleButton Content="Secondary" Classes="Colorful Secondary" IsChecked="True" />
<ToggleButton Content="Tertiary" Classes="Colorful Tertiary" IsChecked="True" />
<ToggleButton Content="Success" Classes="Colorful Success" IsChecked="True" />
<ToggleButton Content="Warning" Classes="Colorful Warning" IsChecked="True" />
<ToggleButton Content="Danger" Classes="Colorful Danger" IsChecked="True" />
<ToggleButton Content="Disabled" Classes="Colorful Primary" IsChecked="True" IsEnabled="False" />
</WrapPanel>
<WrapPanel ItemSpacing="16" LineSpacing="16">
<ToggleButton Content="Default" Classes="Colorful" IsChecked="{x:Null}" IsThreeState="True" />
<ToggleButton Content="Primary" Classes="Colorful Primary" IsChecked="{x:Null}" IsThreeState="True" />
<ToggleButton Content="Secondary" Classes="Colorful Secondary" IsChecked="{x:Null}" IsThreeState="True" />
<ToggleButton Content="Tertiary" Classes="Colorful Tertiary" IsChecked="{x:Null}" IsThreeState="True" />
<ToggleButton Content="Success" Classes="Colorful Success" IsChecked="{x:Null}" IsThreeState="True" />
<ToggleButton Content="Warning" Classes="Colorful Warning" IsChecked="{x:Null}" IsThreeState="True" />
<ToggleButton Content="Danger" Classes="Colorful Danger" IsChecked="{x:Null}" IsThreeState="True" />
<ToggleButton Content="Disabled" Classes="Colorful Primary" IsChecked="{x:Null}" IsThreeState="True" IsEnabled="False" />
</WrapPanel>
</StackPanel> </StackPanel>
</Design.PreviewWith> </Design.PreviewWith>
<ControlTheme <ControlTheme
@@ -136,6 +183,39 @@
</Style> </Style>
</Style> </Style>
<Style Selector="^.Colorful">
<Style Selector="^.Primary">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidColorfulPrimaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidColorfulPrimaryBackground}" />
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidColorfulPrimaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidColorfulPrimaryPointeroverBackground}" />
</Style>
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidColorfulPrimaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidColorfulPrimaryPressedBackground}" />
</Style>
</Style>
<Style Selector="^.Tertiary">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidColorfulTertiaryForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidColorfulTertiaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidColorfulTertiaryBackground}" />
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidColorfulTertiaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidColorfulTertiaryPointeroverBackground}" />
</Style>
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidColorfulTertiaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidColorfulTertiaryPressedBackground}" />
</Style>
</Style>
</Style>
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidDisabledForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonSolidDisabledForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidDisabledBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidDisabledBackground}" />
@@ -174,6 +254,14 @@
<Style Selector="^.Danger /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^.Danger /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineDangerBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineDangerBorderBrush}" />
</Style> </Style>
<Style Selector="^.Colorful">
<Style Selector="^.Primary /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonOutlineColorfulPrimaryForeground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineColorfulPrimaryBorderBrush}" />
</Style>
</Style>
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" />

View File

@@ -64,8 +64,7 @@
VerticalAlignment="Top" VerticalAlignment="Top"
Content="{TemplateBinding Content}" Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplate="{TemplateBinding ContentTemplate}"
IsVisible="{TemplateBinding Content, Converter={x:Static ObjectConverters.IsNotNull}}" IsVisible="{TemplateBinding Content, Converter={x:Static ObjectConverters.IsNotNull}}" />
RecognizesAccessKey="True" />
<Border <Border
Name="SwitchBackgroundBorder" Name="SwitchBackgroundBorder"
@@ -140,6 +139,10 @@
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="RecognizesAccessKey" Value="True" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter:empty"> <Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter:empty">
<Setter Property="Margin" Value="0" /> <Setter Property="Margin" Value="0" />
</Style> </Style>

View File

@@ -0,0 +1,30 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StreamGeometry x:Key="SemiIconAIBell">
M20 20a1 1 0 0 1 0 2H4a1 1 0 0 1 0-2h16ZM12 3.5a1 1 0 0 1 0 2 5 5 0 0 0-5 5v6h10V14a1 1 0 0 1 2 0v3.5a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-7a7 7 0 0 1 7-7ZM1.05 6.18a1 1 0 0 1 1.17-.66l.1.03 1.5.5.1.04a1 1 0 0 1-.64 1.89l-.1-.03-1.5-.5-.1-.04a1 1 0 0 1-.53-1.23ZM2.8 2.8a1 1 0 0 1 1.34-.07l.08.07 1.5 1.5.07.08a1 1 0 0 1-1.41 1.4l-.08-.06-1.5-1.5-.07-.08A1 1 0 0 1 2.8 2.8Zm3.4-1.74a1 1 0 0 1 1.22.54l.04.1.5 1.5.03.1a1 1 0 0 1-1.9.62l-.03-.1-.5-1.5-.03-.1a1 1 0 0 1 .66-1.16Z
M17.11 4.05a4.56 4.56 0 0 1-2.06 2.06 4.28 4.28 0 0 1-.58.24.68.68 0 0 0 0 1.3 4.56 4.56 0 0 1 .58.24c.9.44 1.62 1.17 2.06 2.06a4.4 4.4 0 0 1 .24.58.68.68 0 0 0 1.3 0 4.57 4.57 0 0 1 .24-.58 4.56 4.56 0 0 1 2.06-2.06 4.28 4.28 0 0 1 .58-.24.68.68 0 0 0 0-1.3 4.56 4.56 0 0 1-.58-.24 4.56 4.56 0 0 1-2.3-2.64.68.68 0 0 0-1.3 0 4.58 4.58 0 0 1-.24.58ZM18 5.73c-.36.48-.79.91-1.27 1.27.48.36.91.79 1.27 1.27.36-.48.79-.91 1.27-1.27A6.2 6.2 0 0 1 18 5.73Z
</StreamGeometry>
<StreamGeometry x:Key="SemiIconAIEdit">
M16.28 5.04a2 2 0 0 1 2.83 0l2.15 2.14a2 2 0 0 1 0 2.84L11.24 20.04c-.7.7-1.6 1.18-2.56 1.37l-2.97.6a1.2 1.2 0 0 1-1.42-1.42l.6-2.97c.19-.97.67-1.86 1.37-2.56L16.28 5.04Zm-8.6 11.43c-.43.42-.71.96-.83 1.54l-.36 1.8 1.8-.37c.58-.11 1.11-.4 1.53-.82l7.29-7.29-2.15-2.15-7.29 7.3ZM5.56 2.5a.69.69 0 0 1 1.3 0c.06.17.12.34.2.5l.04.08c.44.9 1.17 1.62 2.07 2.07l.08.04.5.2c.62.2.62 1.09 0 1.3-.17.06-.34.12-.5.2l-.08.04A4.57 4.57 0 0 0 7.1 9l-.04.08c-.08.16-.14.33-.2.5a.69.69 0 0 1-1.3 0 4.57 4.57 0 0 0-.2-.5L5.33 9a4.57 4.57 0 0 0-2.07-2.07l-.08-.04a4.58 4.58 0 0 0-.5-.2.69.69 0 0 1 0-1.3l.5-.2.08-.04a4.57 4.57 0 0 0 2.07-2.07L5.37 3l.2-.5Zm10.81 5.27 2.15 2.14 1.31-1.3-2.15-2.15-1.3 1.3Zm-10.16-3c-.36.48-.8.9-1.27 1.27.48.36.9.79 1.27 1.27.36-.48.79-.91 1.27-1.27a6.22 6.22 0 0 1-1.27-1.27Z
</StreamGeometry>
<StreamGeometry x:Key="SemiIconAIFile">
M19 1a2 2 0 0 1 2 2v10a1 1 0 1 1-2 0V3H5v18h7a1 1 0 1 1 0 2H5a2 2 0 0 1-2-2V3c0-1.1.9-2 2-2h14Zm-1.07 15.4a.6.6 0 0 1 1.14 0c.05.16.1.3.17.45l.04.07a3.99 3.99 0 0 0 1.8 1.8l.07.04a4 4 0 0 0 .44.17.6.6 0 0 1 0 1.14 4 4 0 0 0-.44.17l-.07.04a3.99 3.99 0 0 0-1.8 1.8l-.04.07a4 4 0 0 0-.17.44.6.6 0 0 1-1.14 0 4 4 0 0 0-.17-.44l-.04-.07a3.99 3.99 0 0 0-1.8-1.8l-.07-.04a4 4 0 0 0-.44-.17.6.6 0 0 1 0-1.14 4 4 0 0 0 .44-.17l.07-.04a3.99 3.99 0 0 0 1.8-1.8l.04-.07a4 4 0 0 0 .17-.44Zm.57 2c-.31.41-.69.79-1.1 1.1.41.31.79.69 1.1 1.1.31-.41.69-.79 1.1-1.1-.41-.31-.79-.69-1.1-1.1Zm-4.4-8.1a.43.43 0 0 1 .8 0 2.85 2.85 0 0 0 .57.98l.05.05.15.15.05.05a2.85 2.85 0 0 0 .99.56c.39.13.39.69 0 .82a2.85 2.85 0 0 0-.99.56l-.05.05-.15.15-.05.05a2.85 2.85 0 0 0-.56.99.43.43 0 0 1-.82 0 2.85 2.85 0 0 0-.56-.99l-.05-.05-.15-.15-.05-.05a2.85 2.85 0 0 0-.99-.56.43.43 0 0 1 0-.82 2.85 2.85 0 0 0 .99-.56l.05-.05.15-.15.05-.05a2.85 2.85 0 0 0 .56-.99Zm-4.6 1.2a1 1 0 1 1 0 2H8a1 1 0 1 1 0-2h1.5ZM16 6a1 1 0 1 1 0 2H8a1 1 0 0 1 0-2h8Z
</StreamGeometry>
<StreamGeometry x:Key="SemiIconAIFilled">
M9.68 5.45c.22-1.1 1.8-1.1 2.02 0a8.79 8.79 0 0 0 6.85 6.85c1.1.22 1.1 1.8 0 2.02a8.79 8.79 0 0 0-6.85 6.85c-.22 1.1-1.8 1.1-2.02 0a8.79 8.79 0 0 0-6.85-6.85c-1.1-.22-1.1-1.8 0-2.02a8.79 8.79 0 0 0 6.85-6.85Zm8.48-3.85c.16-.8 1.31-.8 1.48 0a3.54 3.54 0 0 0 2.76 2.76c.8.17.8 1.32 0 1.48a3.54 3.54 0 0 0-2.76 2.76c-.17.8-1.32.8-1.48 0a3.54 3.54 0 0 0-2.76-2.76c-.8-.16-.8-1.31 0-1.48a3.54 3.54 0 0 0 2.76-2.76Z
</StreamGeometry>
<StreamGeometry x:Key="SemiIconAIImage">
M12 2a1 1 0 1 1 0 2H4v11.23l3.67-3.37.15-.12a2 2 0 0 1 2.5.08l3.2 2.74 2.16-2.15a2 2 0 0 1 2.61-.19L20 13.5V12a1 1 0 1 1 2 0v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4c0-1.1.9-2 2-2h8ZM4 17.94V20h16v-4l-2.9-2.18-2.05 2.05 1.6 1.37a1 1 0 0 1-1.3 1.52l-6.33-5.42L4 17.94Z
M17.72 2.92a3.99 3.99 0 0 1-1.8 1.8 4.28 4.28 0 0 1-.51.21.6.6 0 0 0 0 1.14 3.99 3.99 0 0 1 .5.2 3.99 3.99 0 0 1 1.81 1.81 4.4 4.4 0 0 1 .21.51.6.6 0 0 0 1.14 0 3.98 3.98 0 0 1 .2-.5 3.99 3.99 0 0 1 1.81-1.81 4.2 4.2 0 0 1 .51-.21.6.6 0 0 0 0-1.14 3.99 3.99 0 0 1-.5-.2 3.99 3.99 0 0 1-1.81-1.81 4.4 4.4 0 0 1-.21-.51.6.6 0 0 0-1.14 0 3.98 3.98 0 0 1-.2.5Zm.78 1.47c-.31.42-.69.8-1.11 1.11.42.31.8.69 1.11 1.11.31-.42.69-.8 1.11-1.11-.42-.31-.8-.69-1.11-1.11Z
</StreamGeometry>
<StreamGeometry x:Key="SemiIconAISearch">
M10 2a1 1 0 1 1 0 2 6 6 0 1 0 6 6 1 1 0 0 1 2 0 8 8 0 0 1-1.68 4.9l5.39 5.4a1 1 0 1 1-1.42 1.4l-5.39-5.38A8 8 0 1 1 10 2Zm4.93-.6a.6.6 0 0 1 1.14 0c.05.16.1.3.17.45l.04.07a3.99 3.99 0 0 0 1.8 1.8l.07.04a4 4 0 0 0 .44.17.6.6 0 0 1 0 1.14 4 4 0 0 0-.44.17l-.07.04a4 4 0 0 0-1.8 1.8 4.5 4.5 0 0 0-.21.51.6.6 0 0 1-1.14 0 4 4 0 0 0-.2-.5 4 4 0 0 0-1.81-1.81l-.07-.04a4 4 0 0 0-.44-.17.6.6 0 0 1 0-1.14 4 4 0 0 0 .44-.17l.07-.04a4 4 0 0 0 1.8-1.8l.04-.07.17-.44Zm.57 2c-.31.41-.69.79-1.1 1.1.41.31.79.69 1.1 1.1.31-.41.69-.79 1.1-1.1-.41-.31-.79-.69-1.1-1.1Z
</StreamGeometry>
<StreamGeometry x:Key="SemiIconAIStroked">
M9.68 5.45c.22-1.1 1.8-1.1 2.02 0a8.79 8.79 0 0 0 6.85 6.85c1.1.22 1.1 1.8 0 2.02a8.79 8.79 0 0 0-6.85 6.85c-.22 1.1-1.8 1.1-2.02 0a8.79 8.79 0 0 0-6.85-6.85c-1.1-.22-1.1-1.8 0-2.02a8.79 8.79 0 0 0 6.85-6.85Zm1.01 2.96a10.73 10.73 0 0 1-4.9 4.9 10.73 10.73 0 0 1 4.9 4.9 10.73 10.73 0 0 1 4.9-4.9 10.73 10.73 0 0 1-4.9-4.9Zm7.47-6.8c.16-.81 1.31-.81 1.48 0a3.54 3.54 0 0 0 2.76 2.75c.8.17.8 1.32 0 1.48a3.54 3.54 0 0 0-2.76 2.76c-.17.8-1.32.8-1.48 0a3.54 3.54 0 0 0-2.76-2.76c-.8-.16-.8-1.31 0-1.48a3.54 3.54 0 0 0 2.76-2.76Z
</StreamGeometry>
<StreamGeometry x:Key="SemiIconAIWand">
M17.11 15.05a4.56 4.56 0 0 1-2.64 2.3.68.68 0 0 0 0 1.3 4.57 4.57 0 0 1 2.64 2.3 4.4 4.4 0 0 1 .24.58.68.68 0 0 0 1.3 0 4.57 4.57 0 0 1 .24-.58 4.56 4.56 0 0 1 2.06-2.06 4.4 4.4 0 0 1 .58-.24.68.68 0 0 0 0-1.3 4.57 4.57 0 0 1-.58-.24 4.56 4.56 0 0 1-2.3-2.64.68.68 0 0 0-1.3 0 4.57 4.57 0 0 1-.24.58Zm.89 1.68c-.36.48-.79.91-1.27 1.27.48.36.91.79 1.27 1.27.36-.48.79-.91 1.27-1.27A6.2 6.2 0 0 1 18 16.73Z
M4.83 3.53a3.42 3.42 0 0 0 .68-1.18.51.51 0 0 1 .98 0 3.42 3.42 0 0 0 2.16 2.16c.47.16.47.82 0 .98a3.42 3.42 0 0 0-2.16 2.16.51.51 0 0 1-.98 0 3.42 3.42 0 0 0-2.16-2.16.51.51 0 0 1 0-.98 3.42 3.42 0 0 0 1.48-.98Z
M16.57 2.93a3.18 3.18 0 1 1 4.5 4.5L7.43 21.07a3.18 3.18 0 1 1-4.5-4.5L16.57 2.93ZM4.34 17.97a1.2 1.2 0 0 0 1.7 1.7L16.6 9.08l-1.7-1.7L4.34 17.97ZM19.67 4.33a1.2 1.2 0 0 0-1.7 0L16.3 6l1.7 1.7 1.66-1.66a1.2 1.2 0 0 0 0-1.7Z
</StreamGeometry>
</ResourceDictionary>

View File

@@ -1,69 +0,0 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StreamGeometry x:Key="SemiIconCaretDown">
m17.55 15.66-4.8 5.48a1 1 0 0 1-1.5 0l-4.8-5.48A1 1 0 0 1 7.2 14h9.6a1 1 0 0 1 .75 1.66Z
</StreamGeometry>
<StreamGeometry x:Key="SemiIconCaretUp">
m6.45 8.34 4.8-5.48a1 1 0 0 1 1.5 0l4.8 5.48A1 1 0 0 1 16.8 10H7.2a1 1 0 0 1-.75-1.66Z
</StreamGeometry>
<StreamGeometry x:Key="SemiIconCheckBoxIndeterminate">
M5 12.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 5 12.5Z
</StreamGeometry>
<StreamGeometry x:Key="SemiIconCheckBoxTick">
M17.41 7.3c.66.51.78 1.45.28 2.11l-6.5 8.5a1.5 1.5 0 0 1-2.37.01l-3.5-4.5a1.5 1.5 0 1 1 2.36-1.84L10 14.54l5.32-6.95a1.5 1.5 0 0 1 2.1-.28Z
</StreamGeometry>
<StreamGeometry x:Key="SemiIconConfigStroked">
M16.95 4.24c0-.63.5-1.13 1.13-1.13h3.31a1.13 1.13 0 0 1 0 2.25h-3.31c-.62 0-1.13-.5-1.13-1.12Z,
M13.66.9c.62 0 1.12.5 1.12 1.13v4.42a1.13 1.13 0 0 1-2.25 0V2.03c0-.63.5-1.13 1.13-1.13Z,
M.38 4.24c0-.63.5-1.13 1.12-1.13h11.03v2.25H1.5c-.62 0-1.13-.5-1.13-1.12Z,
M.38 11.97c0-.62.5-1.12 1.12-1.12h4.42a1.13 1.13 0 0 1 0 2.25H1.5c-.62 0-1.13-.5-1.13-1.13Z,
M10.34 8.64c.62 0 1.13.5 1.13 1.12v4.42a1.13 1.13 0 0 1-2.25 0V9.76c0-.62.5-1.12 1.12-1.12Z,
M11.47 10.85H22.5a1.13 1.13 0 010 2.25H11.47Z,
M16.95 19.71c0-.62.5-1.13 1.13-1.13h3.31a1.13 1.13 0 0 1 0 2.25h-3.31c-.62 0-1.13-.5-1.13-1.12Z,
M13.66 16.37c.62 0 1.12.5 1.12 1.13v4.42a1.13 1.13 0 0 1-2.25 0V17.5c0-.62.5-1.13 1.13-1.13Z,
M.38 19.71c0-.62.5-1.13 1.12-1.13h11.03v2.25H1.5c-.62 0-1.13-.5-1.13-1.12Z
</StreamGeometry>
<StreamGeometry x:Key="SemiIconDesktop">
M2.5 14.5v-9c0-1.1.9-2 2-2h15a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-15a2 2 0 0 1-2-2Z,
M5.5 13.5v-7h13v7h-13Z,
M7 21.5h10a1 1 0 001-1v-1a1 1 0 00-1-1h-10a1 1 0 00-1 1v1a1 1 0 001 1Z,
M10 16.5v2h4v-2h-4Z
</StreamGeometry>
<StreamGeometry x:Key="SemiIconGallery">
M15.66.75 2.4 4.22A3 3 0 0 0 .34 7.95l2.35 8.23a3 3 0 0 0 .31.7V11a4 4 0 0 1 4-4h13.5l-1.2-4.18A3 3 0 0 0 15.67.75Z,
M8 9h13a3 3 0 013 3v9a3 3 0 01-3 3H8a3 3 0 01-3-3V12a3 3 0 013-3Z
</StreamGeometry>
<StreamGeometry x:Key="SemiIconIssueStroked">
M4.13 4.13a11.1 11.1 0 0 1 15.74 0 11.1 11.1 0 0 1 0 15.74 11.1 11.1 0 0 1-15.74 0 11.1 11.1 0 0 1 0-15.74Zm1.6 1.6a8.84 8.84 0 0 1 12.55 0 8.84 8.84 0 0 1 0 12.55 8.84 8.84 0 0 1-12.56 0 8.84 8.84 0 0 1 0-12.56Z,
M12 18.5a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z,
M12 4.88c.62 0 1.13.5 1.13 1.12v8a1.13 1.13 0 0 1-2.26 0V6c0-.62.5-1.13 1.13-1.13Z
</StreamGeometry>
<StreamGeometry x:Key="SemiIconLoading">
M12 0c.66 0 1.2.54 1.2 1.2v5.2a1.2 1.2 0 0 1-2.4 0V1.2c0-.66.54-1.2 1.2-1.2Zm7.05 2.3c.54.38.66 1.13.27 1.67l-3.06 4.2a1.2 1.2 0 0 1-1.94-1.4l3.06-4.21a1.2 1.2 0 0 1 1.67-.27Zm-14.1 0a1.2 1.2 0 0 1 1.67.26l3.06 4.2a1.2 1.2 0 1 1-1.94 1.41l-3.06-4.2a1.2 1.2 0 0 1 .27-1.68Zm-4.36 6c.2-.64.88-.98 1.5-.78l4.95 1.6a1.2 1.2 0 0 1-.74 2.3L1.36 9.8a1.2 1.2 0 0 1-.77-1.5Zm22.82 0c.2.62-.14 1.3-.77 1.5l-4.94 1.61a1.2 1.2 0 0 1-.74-2.28l4.94-1.6c.63-.21 1.3.13 1.51.76Zm-15.6 5.06c.21.63-.13 1.3-.77 1.51l-4.94 1.6a1.2 1.2 0 0 1-.74-2.27l4.94-1.61c.63-.2 1.31.14 1.52.77Zm8.37 0c.21-.63.89-.98 1.52-.77l4.94 1.6a1.2 1.2 0 0 1-.74 2.29l-4.94-1.6a1.2 1.2 0 0 1-.78-1.52Zm-6.77 2.2c.54.39.66 1.14.27 1.68l-3.06 4.2a1.2 1.2 0 1 1-1.94-1.4l3.06-4.21a1.2 1.2 0 0 1 1.67-.27Zm5.18 0a1.2 1.2 0 0 1 1.67.27l3.06 4.2a1.2 1.2 0 0 1-1.94 1.41l-3.06-4.2a1.2 1.2 0 0 1 .27-1.68ZM12 16.4c.66 0 1.2.54 1.2 1.2v5.2a1.2 1.2 0 0 1-2.4 0v-5.2c0-.66.54-1.2 1.2-1.2Z
</StreamGeometry>
<StreamGeometry x:Key="SemiIconRegExp">
M16.75 1c.83 0 1.5.67 1.5 1.5v2.7l2.17-1.45a1.5 1.5 0 1 1 1.66 2.5L19.46 8l2.62 1.75a1.5 1.5 0 1 1-1.66 2.5l-2.17-1.45v2.7a1.5 1.5 0 0 1-3 0v-2.7l-2.17 1.45a1.5 1.5 0 0 1-1.66-2.5L14.05 8l-2.63-1.75a1.5 1.5 0 0 1 1.66-2.5l2.17 1.45V2.5c0-.83.67-1.5 1.5-1.5Z,
M2 17.5a4.5 4.5 0 109 0 4.5 4.5 0 10-9 0Z
</StreamGeometry>
<StreamGeometry x:Key="SemiIconShieldStroked">
m3 4.13 9-1.63 9 1.63v5.39c0 5.66-3.62 10.69-9 12.48-5.37-1.8-9-6.82-9-12.49V4.13Z,
M5 6.13 12 4.5l7 1.63v3.39c0 3.66-3 8.69-7 10.48-4-1.8-7-5.82-7-10.49V6.13Z,
M13 10.5h2a1 1 0 010 2h-2v2a1 1 0 01-2 0v-2H9a1 1 0 010-2h2v-2a1 1 0 012 0v2Z
</StreamGeometry>
<StreamGeometry x:Key="SemiIconSpin">
M14.2 3.79A8.5 8.5 0 0 0 5 16.81a1.5 1.5 0 1 1-2.48 1.7 11.5 11.5 0 1 1 20.6-3.53 1.5 1.5 0 0 1-2.91-.78A8.5 8.5 0 0 0 14.2 3.79Z
</StreamGeometry>
<StreamGeometry x:Key="SemiIconTriangleArrow">
M24 9v1c-4 0-5.5 1-7.5 3S14 16 12 16s-2.5-1-4.5-3S4 10 0 10V9h24Z
</StreamGeometry>
<StreamGeometry x:Key="SemiIconUnlink">
M12.94 2.94a5.74 5.74 0 1 1 8.12 8.12l-3.55 3.55-2.12-2.12 3.55-3.55a2.74 2.74 0 1 0-3.88-3.88l-3.55 3.55L9.39 6.5l3.55-3.55Zm-10 10 3.05-3.05L8.11 12l-3.05 3.05a2.74 2.74 0 0 0 3.88 3.88l3.05-3.05L14.11 18l-3.05 3.05a5.74 5.74 0 1 1-8.12-8.12Z,
M5.4 7.5l2.7 2.7 1.4-1.4-2.7-2.7L5.4 7.5Z,
M15.3 14.4l-1.4 1.4 2.7 2.7 1.4-1.4-2.7-2.7Z
</StreamGeometry>
<StreamGeometry x:Key="SemiIconUserAdd">
M19.08 19.84c-1.38-2.24-4.32-4.34-8.62-4.34-4.3 0-7.24 2.1-8.62 4.34C1.2 20.88 2.1 22 3.34 22h14.24c1.23 0 2.14-1.12 1.5-2.16Z,
M14.05 10.42c.52-.21 1.02-.86 1.25-1.7.3-1.11.23-2.1-.57-2.4C14.65 2.48 13.13 1 9.96 1 6.78 1 5.27 2.48 5.19 6.32c-.8.3-.86 1.29-.57 2.4.23.84.73 1.49 1.25 1.7.84 2.15 2.37 3.6 4.09 3.6 1.72 0 3.25-1.45 4.09-3.6Z,
M20 1a1 1 0 0 0-1 1v2h-2a1 1 0 0 0 0 2h2v2a1 1 0 0 0 2 0V6h2a1 1 0 1 0 0-2h-2V2a1 1 0 0 0-1-1Z
</StreamGeometry>
</ResourceDictionary>

Some files were not shown because too many files have changed in this diff Show More