mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-08 02:06:37 +08:00
Compare commits
313 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4447475f18 | ||
|
|
e53e744d1f | ||
|
|
6eaa47e7ce | ||
|
|
1edc65c091 | ||
|
|
1348149957 | ||
|
|
3b4443cd54 | ||
|
|
35bea6ff1f | ||
|
|
c393d41112 | ||
|
|
d4c4ef1dba | ||
|
|
35b62fe3af | ||
|
|
c48d96e40f | ||
|
|
c128feb4ff | ||
|
|
48c3837d81 | ||
|
|
f22709fcb1 | ||
|
|
0fbcf43309 | ||
|
|
a1bda0d2d9 | ||
|
|
52cc3887b1 | ||
|
|
9cf27b3906 | ||
|
|
bfb3dd671b | ||
|
|
665dca3bd3 | ||
|
|
f5e56511ac | ||
|
|
b3b7459088 | ||
|
|
96f7f3d1e1 | ||
|
|
64e2b50a1d | ||
|
|
fbfe5b0b6a | ||
|
|
bd4d4e2096 | ||
|
|
01e213d741 | ||
|
|
87fed4febd | ||
|
|
646272dc21 | ||
|
|
672560643b | ||
|
|
d6d03133b4 | ||
|
|
1d59cff87d | ||
|
|
141eeefd2e | ||
|
|
c84c8a3c90 | ||
|
|
dd5f5182fa | ||
|
|
d865f2aeb4 | ||
|
|
44152ef731 | ||
|
|
25f75d605c | ||
|
|
77dffc55b1 | ||
|
|
c144056ab0 | ||
|
|
65e4d0d4a4 | ||
|
|
3ba357b691 | ||
|
|
de3ffc97b6 | ||
|
|
7da8a03f84 | ||
|
|
ab03be1aea | ||
|
|
4ec2d0cf86 | ||
|
|
757f91a140 | ||
|
|
f6d068b722 | ||
|
|
3a6452cccd | ||
|
|
5ea834d57e | ||
|
|
1d9fe693a3 | ||
|
|
2b867f9c6f | ||
|
|
5ea42844ea | ||
|
|
f819531465 | ||
|
|
8f24b2f332 | ||
|
|
a309729c11 | ||
|
|
d57c843032 | ||
|
|
a56b1e374a | ||
|
|
664d05db45 | ||
|
|
fdbfd91b8f | ||
|
|
3b0b007a40 | ||
|
|
c1eff9ddf8 | ||
|
|
4285e6e227 | ||
|
|
edacd88fa7 | ||
|
|
136d577667 | ||
|
|
4ef1520e64 | ||
|
|
5e751ccdbb | ||
|
|
13dcdbdd07 | ||
|
|
185fe8c984 | ||
|
|
622c8c23b7 | ||
|
|
104ba2f1f4 | ||
|
|
4895d2f51b | ||
|
|
414736443d | ||
|
|
65d2f88cab | ||
|
|
0a622772f4 | ||
|
|
5ef8f7ddaf | ||
|
|
ba9dd0a574 | ||
|
|
f784a2c927 | ||
|
|
69cc9b9ca3 | ||
|
|
9226858cda | ||
|
|
7f81aa3bde | ||
|
|
bc37be16ac | ||
|
|
7a831d35f7 | ||
|
|
5f8357ecbc | ||
|
|
4c7caa6dbf | ||
|
|
445b31893e | ||
|
|
301a4e954c | ||
|
|
dc80578c53 | ||
|
|
6c8825b3df | ||
|
|
aa105337fa | ||
|
|
f92b5f4373 | ||
|
|
bbff875d9c | ||
|
|
df75863ac5 | ||
|
|
c04e5e8579 | ||
|
|
9fca51b30d | ||
|
|
0ea632437d | ||
|
|
c0277a7004 | ||
|
|
2c527dc598 | ||
|
|
ab2cef9dc4 | ||
|
|
86daf6b428 | ||
|
|
8f7cdf52b4 | ||
|
|
176430f95f | ||
|
|
1062175204 | ||
|
|
0dda40d322 | ||
|
|
37feb8a9a7 | ||
|
|
c632c6c1f5 | ||
|
|
be2b25a94b | ||
|
|
47c6899b94 | ||
|
|
975d14a36f | ||
|
|
7a13de00a6 | ||
|
|
f7ce4aef30 | ||
|
|
f9a85734d1 | ||
|
|
9dd846f6be | ||
|
|
5384de7b23 | ||
|
|
7ccb6fd41a | ||
|
|
521ed1bd0f | ||
|
|
55d472300e | ||
|
|
a45f50005c | ||
|
|
cd9daf11da | ||
|
|
1c69f53c3c | ||
|
|
8da2e44d4c | ||
|
|
6f2129639a | ||
|
|
865b453b65 | ||
|
|
5622069446 | ||
|
|
76a3d4207f | ||
|
|
513bbba154 | ||
|
|
727fedaedf | ||
|
|
3082ef9ad0 | ||
|
|
985ad0c637 | ||
|
|
59576d4cfd | ||
|
|
c2a072041d | ||
|
|
a62655d25a | ||
|
|
2d2f2afec1 | ||
|
|
1f02f28f8b | ||
|
|
ec2202e2ef | ||
|
|
68dfaa8a57 | ||
|
|
16a8d6b37d | ||
|
|
6d0f3526a9 | ||
|
|
e5822ff6d1 | ||
|
|
08d55c2b7a | ||
|
|
297d4ab825 | ||
|
|
469e2080d4 | ||
|
|
4d93b387a7 | ||
|
|
69821dc15e | ||
|
|
a9463b8fad | ||
|
|
37598f94e6 | ||
|
|
1cb3fe956d | ||
|
|
7b41fd3f33 | ||
|
|
8e675538ba | ||
|
|
b61d939fce | ||
|
|
d206876c03 | ||
|
|
4522b48f22 | ||
|
|
ffa2f04842 | ||
|
|
d400a53784 | ||
|
|
a31b52cc29 | ||
|
|
5ffcb32b18 | ||
|
|
d9be5bef21 | ||
|
|
39e12eb6f8 | ||
|
|
7bc96775f7 | ||
|
|
f3a19f7383 | ||
|
|
57235c447d | ||
|
|
d03fe72fc2 | ||
|
|
9b70613b6a | ||
|
|
4e897596ac | ||
|
|
a2a36dbfcf | ||
|
|
d5e0675808 | ||
|
|
14a3384cd2 | ||
|
|
a9440fd656 | ||
|
|
e119edf8bb | ||
|
|
648bcc99f3 | ||
|
|
24a0d9aace | ||
|
|
d50af16ee5 | ||
|
|
42ceff91bb | ||
|
|
71984d3e10 | ||
|
|
1a30867902 | ||
|
|
55654c16ae | ||
|
|
2e157b39bb | ||
|
|
37004426fd | ||
|
|
5148c62d24 | ||
|
|
926ebc39da | ||
|
|
efdc6953e5 | ||
|
|
d3b9d4225e | ||
|
|
ac03334b19 | ||
|
|
4af5fb654f | ||
|
|
08ee7e4dc0 | ||
|
|
d67c573535 | ||
|
|
7056894c03 | ||
|
|
62030c581c | ||
|
|
bc6daf75a0 | ||
|
|
213f9ee0d7 | ||
|
|
cf79993d4a | ||
|
|
0ffc5e697a | ||
|
|
96cff5df74 | ||
|
|
04c810275a | ||
|
|
77ee768962 | ||
|
|
567027e089 | ||
|
|
0110a53e55 | ||
|
|
b3842a7866 | ||
|
|
d085c83d27 | ||
|
|
d2af636a1a | ||
|
|
7641a94a5a | ||
|
|
391e558721 | ||
|
|
b20edc3b01 | ||
|
|
82699e7317 | ||
|
|
1ae0585325 | ||
|
|
f50795cd25 | ||
|
|
31a219f36f | ||
|
|
6f98fbb21c | ||
|
|
cae26f2134 | ||
|
|
5bd08daaac | ||
|
|
efd94d1d97 | ||
|
|
49a3eada34 | ||
|
|
db24d4393b | ||
|
|
90ef903c22 | ||
|
|
cffcaee392 | ||
|
|
3c4da0f82c | ||
|
|
4120f59c90 | ||
|
|
471764f355 | ||
|
|
47d7e1d7a8 | ||
|
|
5843cbf430 | ||
|
|
c9e549c3e8 | ||
|
|
804f95e0e5 | ||
|
|
2569170ce1 | ||
|
|
b1e63a857d | ||
|
|
c898e9eb52 | ||
|
|
c062297031 | ||
|
|
2a70cd7ced | ||
|
|
8c0160c310 | ||
|
|
28a1336413 | ||
|
|
f008333683 | ||
|
|
4adfe739e0 | ||
|
|
4222e62b76 | ||
|
|
b61c9b081f | ||
|
|
c75d413699 | ||
|
|
39550a6010 | ||
|
|
610d7f4058 | ||
|
|
4a985f42bc | ||
|
|
74071f48fe | ||
|
|
eefc7dc3f2 | ||
|
|
b90b606b97 | ||
|
|
09a070e3a9 | ||
|
|
8e7581fbe7 | ||
|
|
051b137121 | ||
|
|
3f67c32f03 | ||
|
|
7302c59994 | ||
|
|
c1d663cefe | ||
|
|
45b1c9ab73 | ||
|
|
b780b793c8 | ||
|
|
3d83cd02e2 | ||
|
|
34d36b19c8 | ||
|
|
7751f417f0 | ||
|
|
c5e8bd6662 | ||
|
|
c447fd8d5d | ||
|
|
a7debb7886 | ||
|
|
de6dc99efb | ||
|
|
71b1c38ec4 | ||
|
|
992017951b | ||
|
|
a796cb828b | ||
|
|
3b41331c67 | ||
|
|
a6711ab453 | ||
|
|
9eab777faa | ||
|
|
ccdbf25004 | ||
|
|
626dff4e69 | ||
|
|
054b6f59d5 | ||
|
|
32687b1820 | ||
|
|
d0b9f2d7c9 | ||
|
|
a671ee3fcb | ||
|
|
67c0db10ac | ||
|
|
6cda56a830 | ||
|
|
d7690e464b | ||
|
|
41811a84a9 | ||
|
|
51abb760c9 | ||
|
|
f4c0e0d79a | ||
|
|
c3c6ef629f | ||
|
|
de08d4a20f | ||
|
|
9f432ddee6 | ||
|
|
21635cfb56 | ||
|
|
1d54b8ca4b | ||
|
|
cf90be7cea | ||
|
|
9aa24c066b | ||
|
|
d03e80d0ef | ||
|
|
5a1d87e163 | ||
|
|
86b2ad53fa | ||
|
|
7e33078f00 | ||
|
|
8022a80f0e | ||
|
|
08552cf57e | ||
|
|
ffbd8efef7 | ||
|
|
ea182c07f0 | ||
|
|
776ac47a98 | ||
|
|
af013bf938 | ||
|
|
2192aabf14 | ||
|
|
589221bf88 | ||
|
|
27b08caae7 | ||
|
|
a6855ab7db | ||
|
|
7a11884d97 | ||
|
|
6488c42ea9 | ||
|
|
645876fe32 | ||
|
|
74bd41a5c4 | ||
|
|
4e48cde1e7 | ||
|
|
90023554e8 | ||
|
|
f30b2dc263 | ||
|
|
8094582911 | ||
|
|
6dcc27acbc | ||
|
|
30f39d1383 | ||
|
|
42233d272c | ||
|
|
38e4866531 | ||
|
|
623ce798df | ||
|
|
19dcb020f1 | ||
|
|
9081855ab1 | ||
|
|
3210269589 | ||
|
|
857e14368b | ||
|
|
9ba6a22b6d | ||
|
|
251f884248 |
15
.github/FUNDING.yml
vendored
Normal file
15
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||||
|
patreon: # Replace with a single Patreon username
|
||||||
|
open_collective: semiavalonia
|
||||||
|
ko_fi: # Replace with a single Ko-fi username
|
||||||
|
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||||
|
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||||
|
liberapay: # Replace with a single Liberapay username
|
||||||
|
issuehunt: # Replace with a single IssueHunt username
|
||||||
|
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
||||||
|
polar: # Replace with a single Polar username
|
||||||
|
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
|
||||||
|
thanks_dev: # Replace with a single thanks.dev username
|
||||||
|
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||||
16
.github/workflows/deploy.yml
vendored
16
.github/workflows/deploy.yml
vendored
@@ -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@v6
|
||||||
|
|
||||||
- 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
|
||||||
@@ -24,9 +25,6 @@ jobs:
|
|||||||
- name: Publish .NET Project
|
- name: Publish .NET Project
|
||||||
run: dotnet publish $PROJECT_PATH -c Release --nologo
|
run: dotnet publish $PROJECT_PATH -c Release --nologo
|
||||||
|
|
||||||
- name: Change base-tag in index.html
|
|
||||||
run: sed -i 's#<base href="/" />#<base href="/Semi.Avalonia/" />#g' $OUTPUT_PATH/index.html
|
|
||||||
|
|
||||||
- name: copy index.html to 404.html
|
- name: copy index.html to 404.html
|
||||||
run: cp $OUTPUT_PATH/index.html $OUTPUT_PATH/404.html
|
run: cp $OUTPUT_PATH/index.html $OUTPUT_PATH/404.html
|
||||||
|
|
||||||
@@ -34,7 +32,7 @@ jobs:
|
|||||||
run: touch $OUTPUT_PATH/.nojekyll
|
run: touch $OUTPUT_PATH/.nojekyll
|
||||||
|
|
||||||
- name: Commit wwwroot to GitHub Pages
|
- name: Commit wwwroot to GitHub Pages
|
||||||
uses: JamesIves/github-pages-deploy-action@v4.5.0
|
uses: JamesIves/github-pages-deploy-action@v4
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
branch: gh-pages
|
branch: gh-pages
|
||||||
|
|||||||
38
.github/workflows/pack-nightly.yml
vendored
38
.github/workflows/pack-nightly.yml
vendored
@@ -10,23 +10,19 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
Semi_Avalonia:
|
Semi_Avalonia:
|
||||||
description: 'Pack Semi.Avalonia'
|
description: 'Pack Semi.Avalonia'
|
||||||
required: true
|
default: true
|
||||||
default: 'true'
|
|
||||||
type: boolean
|
type: boolean
|
||||||
Semi_Avalonia_ColorPicker:
|
Semi_Avalonia_ColorPicker:
|
||||||
description: 'Pack Semi.Avalonia.ColorPicker'
|
description: 'Pack Semi.Avalonia.ColorPicker'
|
||||||
required: true
|
default: true
|
||||||
default: 'true'
|
|
||||||
type: boolean
|
type: boolean
|
||||||
Semi_Avalonia_DataGrid:
|
Semi_Avalonia_DataGrid:
|
||||||
description: 'Pack Semi.Avalonia.DataGrid'
|
description: 'Pack Semi.Avalonia.DataGrid'
|
||||||
required: true
|
default: false
|
||||||
default: 'true'
|
|
||||||
type: boolean
|
type: boolean
|
||||||
Semi_Avalonia_TreeDataGrid:
|
Semi_Avalonia_TreeDataGrid:
|
||||||
description: 'Pack Semi.Avalonia.TreeDataGrid'
|
description: 'Pack Semi.Avalonia.TreeDataGrid'
|
||||||
required: true
|
default: false
|
||||||
default: 'false'
|
|
||||||
type: boolean
|
type: boolean
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -35,39 +31,39 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4.1.1
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Get Version
|
- name: Get Version
|
||||||
run: |
|
run: |
|
||||||
VERSION_TIMESTAMP=$(date +'%Y%m%d%H%M%S')
|
VERSION_TIMESTAMP=$(date +'%Y%m%d%H%M%S')
|
||||||
VERSION="${{ github.event.inputs.Version_Prefix }}-nightly-${VERSION_TIMESTAMP}"
|
VERSION="${{ inputs.Version_Prefix }}-nightly-${VERSION_TIMESTAMP}"
|
||||||
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Pack Semi.Avalonia
|
- name: Pack Semi.Avalonia
|
||||||
if: ${{ github.event.inputs.Semi_Avalonia == 'true' }}
|
if: ${{ inputs.Semi_Avalonia }}
|
||||||
run: dotnet pack ./src/Semi.Avalonia -o ./nugets /p:Version=${{ env.VERSION }}
|
run: dotnet pack src/Semi.Avalonia -o nugets /p:Version=${{ env.VERSION }}
|
||||||
|
|
||||||
- name: Pack Semi.Avalonia.ColorPicker
|
- name: Pack Semi.Avalonia.ColorPicker
|
||||||
if: ${{ github.event.inputs.Semi_Avalonia_ColorPicker == 'true' }}
|
if: ${{ inputs.Semi_Avalonia_ColorPicker }}
|
||||||
run: dotnet pack ./src/Semi.Avalonia.ColorPicker -o ./nugets /p:Version=${{ env.VERSION }}
|
run: dotnet pack src/Semi.Avalonia.ColorPicker -o nugets /p:Version=${{ env.VERSION }}
|
||||||
|
|
||||||
- name: Pack Semi.Avalonia.DataGrid
|
- name: Pack Semi.Avalonia.DataGrid
|
||||||
if: ${{ github.event.inputs.Semi_Avalonia_DataGrid == 'true' }}
|
if: ${{ inputs.Semi_Avalonia_DataGrid }}
|
||||||
run: dotnet pack ./src/Semi.Avalonia.DataGrid -o ./nugets /p:Version=${{ env.VERSION }}
|
run: dotnet pack src/Semi.Avalonia.DataGrid -o nugets /p:Version=${{ env.VERSION }}
|
||||||
|
|
||||||
- name: Pack Semi.Avalonia.TreeDataGrid
|
- name: Pack Semi.Avalonia.TreeDataGrid
|
||||||
if: ${{ github.event.inputs.Semi_Avalonia_TreeDataGrid == 'true' }}
|
if: ${{ inputs.Semi_Avalonia_TreeDataGrid }}
|
||||||
run: dotnet pack ./src/Semi.Avalonia.TreeDataGrid -o ./nugets /p:Version=${{ env.VERSION }}
|
run: dotnet pack src/Semi.Avalonia.TreeDataGrid -o nugets /p:Version=${{ env.VERSION }}
|
||||||
|
|
||||||
- name: Add NuGet Source
|
- name: Add NuGet Source
|
||||||
run: dotnet nuget add source ${{ secrets.IRIHI_NUGET_NIGHTLY_FEED }} -n irihi.tech -u ${{ secrets.IRIHI_NUGET_USERNAME }} -p ${{ secrets.IRIHI_NUGET_PASSWORD }} --store-password-in-clear-text
|
run: dotnet nuget add source ${{ secrets.IRIHI_NUGET_NIGHTLY_FEED }} -n irihi.tech -u ${{ secrets.IRIHI_NUGET_USERNAME }} -p ${{ secrets.IRIHI_NUGET_PASSWORD }} --store-password-in-clear-text
|
||||||
|
|
||||||
- name: Publish Nightly Package
|
- name: Publish Nightly Package
|
||||||
run: dotnet nuget push "./nugets/*.nupkg" --api-key ${{ secrets.IRIHI_NUGET_API_KEY }} --source irihi.tech --skip-duplicate
|
run: dotnet nuget push "nugets/*.nupkg" --api-key ${{ secrets.IRIHI_NUGET_API_KEY }} --source irihi.tech --skip-duplicate
|
||||||
|
|
||||||
- name: Upload a Build Artifact
|
- name: Upload a Build Artifact
|
||||||
uses: actions/upload-artifact@v4.3.1
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: nugets
|
name: nugets
|
||||||
path: ./nugets
|
path: nugets
|
||||||
if: always()
|
if: always()
|
||||||
60
.github/workflows/pack.yml
vendored
60
.github/workflows/pack.yml
vendored
@@ -3,26 +3,43 @@ name: Pack to NuGet
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
|
Upload_to_NuGet:
|
||||||
|
description: 'Upload to NuGet'
|
||||||
|
default: true
|
||||||
|
type: boolean
|
||||||
Semi_Avalonia:
|
Semi_Avalonia:
|
||||||
description: 'Pack Semi.Avalonia'
|
description: 'Pack Semi.Avalonia'
|
||||||
required: true
|
default: true
|
||||||
default: 'true'
|
|
||||||
type: boolean
|
type: boolean
|
||||||
Semi_Avalonia_ColorPicker:
|
Semi_Avalonia_ColorPicker:
|
||||||
description: 'Pack Semi.Avalonia.ColorPicker'
|
description: 'Pack Semi.Avalonia.ColorPicker'
|
||||||
required: true
|
default: true
|
||||||
default: 'true'
|
|
||||||
type: boolean
|
type: boolean
|
||||||
Semi_Avalonia_DataGrid:
|
Semi_Avalonia_DataGrid:
|
||||||
description: 'Pack Semi.Avalonia.DataGrid'
|
description: 'Pack Semi.Avalonia.DataGrid'
|
||||||
required: true
|
default: false
|
||||||
default: 'true'
|
|
||||||
type: boolean
|
type: boolean
|
||||||
Semi_Avalonia_TreeDataGrid:
|
Semi_Avalonia_TreeDataGrid:
|
||||||
description: 'Pack Semi.Avalonia.TreeDataGrid'
|
description: 'Pack Semi.Avalonia.TreeDataGrid'
|
||||||
required: true
|
default: false
|
||||||
default: 'false'
|
|
||||||
type: boolean
|
type: boolean
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
Upload_to_NuGet:
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
Semi_Avalonia:
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
Semi_Avalonia_ColorPicker:
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
Semi_Avalonia_DataGrid:
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
Semi_Avalonia_TreeDataGrid:
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Pack_to_NuGet:
|
Pack_to_NuGet:
|
||||||
@@ -30,30 +47,31 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4.1.1
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Pack Semi.Avalonia
|
- name: Pack Semi.Avalonia
|
||||||
if: ${{ github.event.inputs.Semi_Avalonia == 'true' }}
|
if: ${{ inputs.Semi_Avalonia }}
|
||||||
run: dotnet pack ./src/Semi.Avalonia -o ./nugets
|
run: dotnet pack src/Semi.Avalonia -o nugets
|
||||||
|
|
||||||
- name: Pack Semi.Avalonia.ColorPicker
|
- name: Pack Semi.Avalonia.ColorPicker
|
||||||
if: ${{ github.event.inputs.Semi_Avalonia_ColorPicker == 'true' }}
|
if: ${{ inputs.Semi_Avalonia_ColorPicker }}
|
||||||
run: dotnet pack ./src/Semi.Avalonia.ColorPicker -o ./nugets
|
run: dotnet pack src/Semi.Avalonia.ColorPicker -o nugets
|
||||||
|
|
||||||
- name: Pack Semi.Avalonia.DataGrid
|
- name: Pack Semi.Avalonia.DataGrid
|
||||||
if: ${{ github.event.inputs.Semi_Avalonia_DataGrid == 'true' }}
|
if: ${{ inputs.Semi_Avalonia_DataGrid }}
|
||||||
run: dotnet pack ./src/Semi.Avalonia.DataGrid -o ./nugets
|
run: dotnet pack src/Semi.Avalonia.DataGrid -o nugets
|
||||||
|
|
||||||
- name: Pack Semi.Avalonia.TreeDataGrid
|
- name: Pack Semi.Avalonia.TreeDataGrid
|
||||||
if: ${{ github.event.inputs.Semi_Avalonia_TreeDataGrid == 'true' }}
|
if: ${{ inputs.Semi_Avalonia_TreeDataGrid }}
|
||||||
run: dotnet pack ./src/Semi.Avalonia.TreeDataGrid -o ./nugets
|
run: dotnet pack src/Semi.Avalonia.TreeDataGrid -o nugets
|
||||||
|
|
||||||
- name: Publish NuGet package
|
- name: Upload to NuGet
|
||||||
run: dotnet nuget push "./nugets/*.nupkg" --api-key ${{ secrets.NUGET_ORG_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
|
if: ${{ inputs.Upload_to_NuGet }}
|
||||||
|
run: dotnet nuget push "nugets/*.nupkg" --api-key ${{ secrets.NUGET_ORG_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
|
||||||
|
|
||||||
- name: Upload a Build Artifact
|
- name: Upload a Build Artifact
|
||||||
uses: actions/upload-artifact@v4.3.1
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: nugets
|
name: nugets
|
||||||
path: ./nugets
|
path: nugets
|
||||||
if: always()
|
if: always()
|
||||||
283
.github/workflows/publish.yml
vendored
283
.github/workflows/publish.yml
vendored
@@ -3,116 +3,223 @@ name: Publish Demo
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
platform:
|
win-x64:
|
||||||
description: 'Platform to publish'
|
description: 'Windows x64'
|
||||||
required: true
|
default: false
|
||||||
default: 'all'
|
|
||||||
type: choice
|
|
||||||
options:
|
|
||||||
- 'windows'
|
|
||||||
- 'linux'
|
|
||||||
- 'android'
|
|
||||||
- 'all'
|
|
||||||
include_aot:
|
|
||||||
description: 'Include Windows AOT packaging'
|
|
||||||
required: true
|
|
||||||
default: true
|
|
||||||
type: boolean
|
type: boolean
|
||||||
include_drm:
|
win-x64-aot:
|
||||||
description: 'Include Linux DRM packaging'
|
description: 'Windows x64 AOT'
|
||||||
required: true
|
default: false
|
||||||
default: true
|
|
||||||
type: boolean
|
type: boolean
|
||||||
|
linux-x64:
|
||||||
|
description: 'Linux x64'
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
linux-x64-aot:
|
||||||
|
description: 'Linux x64 AOT'
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
drm-linux-x64:
|
||||||
|
description: 'DRM Linux x64'
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
drm-linux-x64-aot:
|
||||||
|
description: 'DRM Linux x64 AOT'
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
osx-arm64:
|
||||||
|
description: 'macOS arm64'
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
osx-arm64-aot:
|
||||||
|
description: 'macOS arm64 AOT'
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
android-arm64:
|
||||||
|
description: 'Android arm64'
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
win-x64:
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
win-x64-aot:
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
linux-x64:
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
linux-x64-aot:
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
drm-linux-x64:
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
drm-linux-x64-aot:
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
osx-arm64:
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
osx-arm64-aot:
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
android-arm64:
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
windows:
|
win-x64:
|
||||||
if: ${{ github.event.inputs.platform == 'windows' || github.event.inputs.platform == 'all' }}
|
if: ${{inputs.win-x64}}
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4.1.1
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Make upload directory
|
|
||||||
run: mkdir upload
|
|
||||||
|
|
||||||
- name: Publish win-x64
|
- name: Publish win-x64
|
||||||
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/win64
|
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o publish --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
|
||||||
|
|
||||||
- name: Zip win-x64
|
|
||||||
run: |
|
|
||||||
$files = Get-ChildItem -Path ./publish/win64/* -Recurse -Exclude *.pdb
|
|
||||||
Compress-Archive -Path $files.FullName -DestinationPath ./upload/Semi.Avalonia.Demo.Desktop.win-x64.zip
|
|
||||||
|
|
||||||
- name: Enable Native AOT in .csproj
|
|
||||||
if: ${{ github.event.inputs.include_aot == 'true' }}
|
|
||||||
run: |
|
|
||||||
sed -i 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
|
|
||||||
sed -i 's#<!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>-->#<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
|
|
||||||
|
|
||||||
- name: Publish win-x64 AOT
|
|
||||||
if: ${{ github.event.inputs.include_aot == 'true' }}
|
|
||||||
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o ./publish/win64-aot
|
|
||||||
|
|
||||||
- name: Zip win-x64 AOT
|
|
||||||
if: ${{ github.event.inputs.include_aot == 'true' }}
|
|
||||||
run: |
|
|
||||||
$files = Get-ChildItem -Path ./publish/win64-aot/* -Recurse -Exclude *.pdb
|
|
||||||
Compress-Archive -Path $files.FullName -DestinationPath ./upload/Semi.Avalonia.Demo.Desktop.win-x64.NativeAOT.zip
|
|
||||||
|
|
||||||
- name: Upload a Build Artifact
|
- name: Upload a Build Artifact
|
||||||
uses: actions/upload-artifact@v4.3.1
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: windows
|
name: Semi.Avalonia.Demo.Desktop.win-x64
|
||||||
path: ./upload
|
path: |
|
||||||
|
publish
|
||||||
|
!publish/*.pdb
|
||||||
|
|
||||||
linux:
|
win-x64-aot:
|
||||||
if: ${{ github.event.inputs.platform == 'linux' || github.event.inputs.platform == 'all' }}
|
if: ${{inputs.win-x64-aot}}
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
- 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
|
||||||
|
- name: Publish win-x64 AOT
|
||||||
|
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o publish
|
||||||
|
- name: Upload a Build Artifact
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: Semi.Avalonia.Demo.Desktop.win-x64.NativeAOT
|
||||||
|
path: |
|
||||||
|
publish
|
||||||
|
!publish/*.pdb
|
||||||
|
|
||||||
|
linux-x64:
|
||||||
|
if: ${{inputs.linux-x64}}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4.1.1
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Make upload directory
|
|
||||||
run: mkdir upload
|
|
||||||
|
|
||||||
- name: Publish linux-x64
|
- name: Publish linux-x64
|
||||||
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r linux-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/linux64
|
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r linux-x64 -c Release -o publish --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
|
||||||
|
|
||||||
- name: Zip linux-x64
|
|
||||||
run: zip -j -r ./upload/Semi.Avalonia.Demo.Desktop.linux-x64.zip ./publish/linux64 -x "*.pdb"
|
|
||||||
|
|
||||||
- name: Publish linux-x64 DRM
|
|
||||||
if: ${{ github.event.inputs.include_drm == 'true' }}
|
|
||||||
run: dotnet publish demo/Semi.Avalonia.Demo.Drm -r linux-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/drm
|
|
||||||
|
|
||||||
- name: Zip linux-x64 DRM
|
|
||||||
if: ${{ github.event.inputs.include_drm == 'true' }}
|
|
||||||
run: zip -j -r ./upload/Semi.Avalonia.Demo.Drm.linux-x64.zip ./publish/drm -x "*.pdb"
|
|
||||||
|
|
||||||
- name: Upload a Build Artifact
|
- name: Upload a Build Artifact
|
||||||
uses: actions/upload-artifact@v4.3.1
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: linux
|
name: Semi.Avalonia.Demo.Desktop.linux-x64
|
||||||
path: ./upload
|
path: |
|
||||||
|
publish
|
||||||
|
!publish/*.pdb
|
||||||
|
|
||||||
android:
|
linux-x64-aot:
|
||||||
if: ${{ github.event.inputs.platform == 'android' || github.event.inputs.platform == 'all' }}
|
if: ${{inputs.linux-x64-aot}}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
- 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
|
||||||
|
- name: Publish linux-x64 AOT
|
||||||
|
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r linux-x64 -c Release -o publish
|
||||||
|
- name: Upload a Build Artifact
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: Semi.Avalonia.Demo.Desktop.linux-x64.NativeAOT
|
||||||
|
path: |
|
||||||
|
publish
|
||||||
|
!publish/*.pdb
|
||||||
|
|
||||||
|
drm-linux-x64:
|
||||||
|
if: ${{inputs.drm-linux-x64}}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
- 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
|
||||||
|
- name: Upload a Build Artifact
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: Semi.Avalonia.Demo.Drm.linux-x64
|
||||||
|
path: |
|
||||||
|
publish
|
||||||
|
!publish/*.pdb
|
||||||
|
|
||||||
|
drm-linux-x64-aot:
|
||||||
|
if: ${{inputs.drm-linux-x64-aot}}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
- 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
|
||||||
|
- name: Publish linux-x64 AOT
|
||||||
|
run: dotnet publish demo/Semi.Avalonia.Demo.Drm -r linux-x64 -c Release -o publish
|
||||||
|
- name: Upload a Build Artifact
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: Semi.Avalonia.Demo.Drm.linux-x64.NativeAOT
|
||||||
|
path: |
|
||||||
|
publish
|
||||||
|
!publish/*.pdb
|
||||||
|
|
||||||
|
osx-arm64:
|
||||||
|
if: ${{inputs.osx-arm64}}
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
- 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
|
||||||
|
- name: Upload a Build Artifact
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: Semi.Avalonia.Demo.Desktop.osx-arm64
|
||||||
|
path: |
|
||||||
|
publish
|
||||||
|
!publish/*.pdb
|
||||||
|
|
||||||
|
osx-arm64-aot:
|
||||||
|
if: ${{inputs.osx-arm64-aot}}
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
- 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
|
||||||
|
- name: Publish osx-arm64 AOT
|
||||||
|
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r osx-arm64 -c Release -o publish
|
||||||
|
- name: Upload a Build Artifact
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: Semi.Avalonia.Demo.Desktop.osx-arm64.NativeAOT
|
||||||
|
path: |
|
||||||
|
publish
|
||||||
|
!publish/*.pdb
|
||||||
|
|
||||||
|
android-arm64:
|
||||||
|
if: ${{inputs.android-arm64 }}
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4.1.1
|
uses: actions/checkout@v6
|
||||||
|
- name: Install Android workload
|
||||||
- name: CD Android
|
run: dotnet workload install android
|
||||||
run: cd ./demo/Semi.Avalonia.Demo.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.3.1
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: android
|
name: android-arm64
|
||||||
path: ./publish/*Signed.apk
|
path: publish/*Signed.apk
|
||||||
|
|||||||
174
.github/workflows/release-tag.yml
vendored
174
.github/workflows/release-tag.yml
vendored
@@ -1,141 +1,65 @@
|
|||||||
name: Release Tag
|
name: Release Tag
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- "v[0-9]+.[0-9]+.[0-9]+.[0-9]+"
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
Upload_to_NuGet:
|
||||||
|
description: 'Upload to NuGet'
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
Semi_Avalonia:
|
||||||
|
description: 'Pack Semi.Avalonia'
|
||||||
|
default: true
|
||||||
|
type: boolean
|
||||||
|
Semi_Avalonia_ColorPicker:
|
||||||
|
description: 'Pack Semi.Avalonia.ColorPicker'
|
||||||
|
default: true
|
||||||
|
type: boolean
|
||||||
|
Semi_Avalonia_DataGrid:
|
||||||
|
description: 'Pack Semi.Avalonia.DataGrid'
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
Semi_Avalonia_TreeDataGrid:
|
||||||
|
description: 'Pack Semi.Avalonia.TreeDataGrid'
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
pack:
|
nuget:
|
||||||
runs-on: ubuntu-latest
|
uses: ./.github/workflows/pack.yml
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Pack Semi.Avalonia
|
|
||||||
run: dotnet pack ./src/Semi.Avalonia -o ./nugets
|
|
||||||
|
|
||||||
- name: Pack Semi.Avalonia.ColorPicker
|
|
||||||
run: dotnet pack ./src/Semi.Avalonia.ColorPicker -o ./nugets
|
|
||||||
|
|
||||||
- name: Pack Semi.Avalonia.DataGrid
|
|
||||||
run: dotnet pack ./src/Semi.Avalonia.DataGrid -o ./nugets
|
|
||||||
|
|
||||||
- name: Upload a Build Artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: nugets
|
Upload_to_NuGet: ${{ inputs.Upload_to_NuGet }}
|
||||||
path: ./nugets
|
Semi_Avalonia: ${{ inputs.Semi_Avalonia }}
|
||||||
|
Semi_Avalonia_ColorPicker: ${{ inputs.Semi_Avalonia_ColorPicker }}
|
||||||
|
Semi_Avalonia_DataGrid: ${{ inputs.Semi_Avalonia_DataGrid }}
|
||||||
|
Semi_Avalonia_TreeDataGrid: ${{ inputs.Semi_Avalonia_TreeDataGrid }}
|
||||||
|
|
||||||
publish-windows:
|
publish:
|
||||||
runs-on: windows-latest
|
uses: ./.github/workflows/publish.yml
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Make upload directory
|
|
||||||
run: mkdir upload
|
|
||||||
|
|
||||||
- name: Publish win-x64
|
|
||||||
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/win64
|
|
||||||
|
|
||||||
- name: Zip win-x64
|
|
||||||
run: |
|
|
||||||
$files = Get-ChildItem -Path ./publish/win64/* -Recurse -Exclude *.pdb
|
|
||||||
Compress-Archive -Path $files.FullName -DestinationPath ./upload/Semi.Avalonia.Demo.Desktop.win-x64.zip
|
|
||||||
|
|
||||||
- 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
|
|
||||||
sed -i 's#<!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>-->#<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
|
|
||||||
|
|
||||||
- name: Publish win-x64 AOT
|
|
||||||
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o ./publish/win64-aot
|
|
||||||
|
|
||||||
- name: Zip win-x64 AOT
|
|
||||||
run: |
|
|
||||||
$files = Get-ChildItem -Path ./publish/win64-aot/* -Recurse -Exclude *.pdb
|
|
||||||
Compress-Archive -Path $files.FullName -DestinationPath ./upload/Semi.Avalonia.Demo.Desktop.win-x64.NativeAOT.zip
|
|
||||||
|
|
||||||
- name: Upload a Build Artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: windows
|
|
||||||
path: ./upload
|
|
||||||
|
|
||||||
publish-linux:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Make upload directory
|
|
||||||
run: mkdir upload
|
|
||||||
|
|
||||||
- name: Publish linux-x64
|
|
||||||
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r linux-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/linux64
|
|
||||||
|
|
||||||
- name: Zip linux-x64
|
|
||||||
run: zip -j -r ./upload/Semi.Avalonia.Demo.Desktop.linux-x64.zip ./publish/linux64 -x "*.pdb"
|
|
||||||
|
|
||||||
- name: Publish linux-x64 DRM
|
|
||||||
run: dotnet publish demo/Semi.Avalonia.Demo.Drm -r linux-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/drm
|
|
||||||
|
|
||||||
- name: Zip linux-x64 DRM
|
|
||||||
run: zip -j -r ./upload/Semi.Avalonia.Demo.Drm.linux-x64.zip ./publish/drm -x "*.pdb"
|
|
||||||
|
|
||||||
- name: Upload a Build Artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: linux
|
|
||||||
path: ./upload
|
|
||||||
|
|
||||||
publish-android:
|
|
||||||
runs-on: windows-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: CD Android
|
|
||||||
run: cd ./demo/Semi.Avalonia.Demo.Android
|
|
||||||
|
|
||||||
- name: Restore Dependencies
|
|
||||||
run: dotnet restore
|
|
||||||
|
|
||||||
- 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
|
|
||||||
|
|
||||||
- name: Upload a Build Artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: android
|
|
||||||
path: ./publish/*Signed.apk
|
|
||||||
|
|
||||||
draft-release:
|
draft-release:
|
||||||
needs: [ pack, publish-windows, publish-linux, publish-android ]
|
needs: [ nuget,publish ]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Download nugets Artifacts
|
- uses: actions/download-artifact@v8
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: nugets
|
|
||||||
|
|
||||||
- name: Download windows Artifacts
|
- name: Display structure of downloaded files
|
||||||
uses: actions/download-artifact@v4
|
run: ls -R
|
||||||
with:
|
|
||||||
name: windows
|
|
||||||
|
|
||||||
- name: Download linux Artifacts
|
- name: Zip artifacts
|
||||||
uses: actions/download-artifact@v4
|
run: |
|
||||||
with:
|
zip -rj Semi.Avalonia.Demo.Desktop.win-x64.zip Semi.Avalonia.Demo.Desktop.win-x64
|
||||||
name: linux
|
zip -rj Semi.Avalonia.Demo.Desktop.win-x64.NativeAOT.zip Semi.Avalonia.Demo.Desktop.win-x64.NativeAOT
|
||||||
|
zip -rj Semi.Avalonia.Demo.Desktop.linux-x64.zip Semi.Avalonia.Demo.Desktop.linux-x64
|
||||||
|
zip -rj Semi.Avalonia.Demo.Desktop.linux-x64.NativeAOT.zip Semi.Avalonia.Demo.Desktop.linux-x64.NativeAOT
|
||||||
|
zip -rj Semi.Avalonia.Demo.Drm.linux-x64.zip Semi.Avalonia.Demo.Drm.linux-x64
|
||||||
|
zip -rj Semi.Avalonia.Demo.Drm.linux-x64.NativeAOT.zip Semi.Avalonia.Demo.Drm.linux-x64.NativeAOT
|
||||||
|
zip -rj Semi.Avalonia.Demo.Desktop.osx-arm64.zip Semi.Avalonia.Demo.Desktop.osx-arm64
|
||||||
|
cd Semi.Avalonia.Demo.Desktop.osx-arm64.NativeAOT
|
||||||
|
zip -r ../Semi.Avalonia.Demo.Desktop.osx-arm64.NativeAOT.zip .
|
||||||
|
|
||||||
- name: Download android Artifacts
|
- name: Display structure of zipped files
|
||||||
uses: actions/download-artifact@v4
|
run: ls -R
|
||||||
with:
|
|
||||||
name: android
|
|
||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
@@ -144,6 +68,6 @@ jobs:
|
|||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
draft: true
|
draft: true
|
||||||
files: |
|
files: |
|
||||||
*.nupkg
|
nugets/*.nupkg
|
||||||
|
android-arm64/*.apk
|
||||||
*.zip
|
*.zip
|
||||||
*.apk
|
|
||||||
|
|||||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2022 iriHi Technology
|
Copyright (c) 2022 IRIHI Technology
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
6
Nuget.Config
Normal file
6
Nuget.Config
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<packageSources>
|
||||||
|
<add key="avalonia-nightly" value="https://nuget-feed-nightly.avaloniaui.net/v3/index.json" />
|
||||||
|
</packageSources>
|
||||||
|
</configuration>
|
||||||
27
README.md
27
README.md
@@ -38,22 +38,30 @@ Include Semi Design Styles in application:
|
|||||||
|
|
||||||
That's all.
|
That's all.
|
||||||
|
|
||||||
ColorPicker, DataGrid and TreeDataGrid are distributed in separated packages. Please install if you need.
|
ColorPicker, DataGrid, TreeDataGrid, Dock, Tabalonia and AvaloniaEdit are distributed in separated packages. Please install if you need.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
dotnet add package Semi.Avalonia.ColorPicker
|
dotnet add package Semi.Avalonia.ColorPicker
|
||||||
dotnet add package Semi.Avalonia.DataGrid
|
dotnet add package Semi.Avalonia.DataGrid
|
||||||
dotnet add package Semi.Avalonia.TreeDataGrid
|
dotnet add package Semi.Avalonia.TreeDataGrid
|
||||||
|
dotnet add package Semi.Avalonia.Dock
|
||||||
|
dotnet add package Semi.Avalonia.Tabalonia
|
||||||
|
dotnet add package Semi.Avalonia.AvaloniaEdit
|
||||||
```
|
```
|
||||||
|
|
||||||
```xaml
|
```xaml
|
||||||
<Application.Styles>
|
<Application.Styles>
|
||||||
<StyleInclude Source="avares://Semi.Avalonia.ColorPicker/Index.axaml" />
|
<semi:ColorPickerSemiTheme />
|
||||||
<StyleInclude Source="avares://Semi.Avalonia.DataGrid/Index.axaml" />
|
<semi:DataGridSemiTheme />
|
||||||
<StyleInclude Source="avares://Semi.Avalonia.TreeDataGrid/Index.axaml" />
|
<semi:TreeDataGridSemiTheme />
|
||||||
|
<semi:DockSemiTheme />
|
||||||
|
<semi:TabaloniaSemiTheme />
|
||||||
|
<semi:AvaloniaEditSemiTheme />
|
||||||
</Application.Styles>
|
</Application.Styles>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Notice: Dock, Tabalonia and AvaloniaEdit are delivered via nuget for free, but not open source. Please read the license and agree to continue use these packages. If you need source code, please contact us via email: [contact@irihi.tech](contact@irihi.tech)
|
||||||
|
|
||||||
## Demo
|
## Demo
|
||||||
|
|
||||||
You can always download demo executable to play around with Semi Avalonia Themes.
|
You can always download demo executable to play around with Semi Avalonia Themes.
|
||||||
@@ -67,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.3.7 | >=11.3.7 |
|
||||||
| 11.2.1 | >=11.2.1 |
|
| 11.2.1 | >=11.2.1 |
|
||||||
| 11.2.0 | 11.2.0 |
|
| 11.2.0 | End of Life |
|
||||||
| 11.1.0 | >=11.1.0 |
|
| 11.1.x | End of Life |
|
||||||
| 11.0.7 | >=11.0.7 |
|
|
||||||
| 11.0.1 | <=11.0.6 |
|
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
|
|||||||
27
README_CN.md
27
README_CN.md
@@ -38,22 +38,30 @@ dotnet add package Semi.Avalonia
|
|||||||
|
|
||||||
这样就可以了。
|
这样就可以了。
|
||||||
|
|
||||||
ColorPicker、DataGrid 和 TreeDataGrid 的样式单独分发,如果需要请安装并引用。
|
ColorPicker、DataGrid、TreeDataGrid、Dock、Tabalonia 和 AvaloniaEdit 的样式单独分发,如果需要请安装并引用。
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
dotnet add package Semi.Avalonia.ColorPicker
|
dotnet add package Semi.Avalonia.ColorPicker
|
||||||
dotnet add package Semi.Avalonia.DataGrid
|
dotnet add package Semi.Avalonia.DataGrid
|
||||||
dotnet add package Semi.Avalonia.TreeDataGrid
|
dotnet add package Semi.Avalonia.TreeDataGrid
|
||||||
|
dotnet add package Semi.Avalonia.Dock
|
||||||
|
dotnet add package Semi.Avalonia.Tabalonia
|
||||||
|
dotnet add package Semi.Avalonia.AvaloniaEdit
|
||||||
```
|
```
|
||||||
|
|
||||||
```xaml
|
```xaml
|
||||||
<Application.Styles>
|
<Application.Styles>
|
||||||
<StyleInclude Source="avares://Semi.Avalonia.ColorPicker/Index.axaml" />
|
<semi:ColorPickerSemiTheme />
|
||||||
<StyleInclude Source="avares://Semi.Avalonia.DataGrid/Index.axaml" />
|
<semi:DataGridSemiTheme />
|
||||||
<StyleInclude Source="avares://Semi.Avalonia.TreeDataGrid/Index.axaml" />
|
<semi:TreeDataGridSemiTheme />
|
||||||
|
<semi:DockSemiTheme />
|
||||||
|
<semi:TabaloniaSemiTheme />
|
||||||
|
<semi:AvaloniaEditSemiTheme />
|
||||||
</Application.Styles>
|
</Application.Styles>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
注意:Dock、Tabalonia 和 AvaloniaEdit 是通过 NuGet 免费分发的,但不是开源的。请阅读许可协议并同意后继续使用这些包。如果您需要源代码,请通过电子邮件联系我们:[contact@irihi.tech](contact@irihi.tech)
|
||||||
|
|
||||||
## 示例
|
## 示例
|
||||||
|
|
||||||
您可以从 Semi Avalonia 的 release 页下载并试用 Semi Avalonia 的展示应用。
|
您可以从 Semi Avalonia 的 release 页下载并试用 Semi Avalonia 的展示应用。
|
||||||
@@ -67,13 +75,12 @@ dotnet add package Semi.Avalonia.TreeDataGrid
|
|||||||
|
|
||||||
## 版本兼容性
|
## 版本兼容性
|
||||||
|
|
||||||
| Semi Design Version | Avalonia Version |
|
| Semi Avalonia Version | Avalonia Version |
|
||||||
|:--------------------|:-----------------|
|
|:----------------------|:-----------------|
|
||||||
|
| 11.3.7 | >=11.3.7 |
|
||||||
| 11.2.1 | >=11.2.1 |
|
| 11.2.1 | >=11.2.1 |
|
||||||
| 11.2.0 | 11.2.0 |
|
| 11.2.0 | End of Life |
|
||||||
| 11.1.0 | >=11.1.0 |
|
| 11.1.x | End of Life |
|
||||||
| 11.0.7 | >=11.0.7 |
|
|
||||||
| 11.0.1 | <=11.0.6 |
|
|
||||||
|
|
||||||
## 致谢
|
## 致谢
|
||||||
|
|
||||||
|
|||||||
@@ -1,106 +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
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Semi.Avalonia.TreeDataGrid.Demo", "demo\Semi.Avalonia.TreeDataGrid.Demo\Semi.Avalonia.TreeDataGrid.Demo.csproj", "{6178B545-4BB6-458C-A27C-EE11F3885D38}"
|
|
||||||
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
|
|
||||||
{6178B545-4BB6-458C-A27C-EE11F3885D38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{6178B545-4BB6-458C-A27C-EE11F3885D38}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{6178B545-4BB6-458C-A27C-EE11F3885D38}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{6178B545-4BB6-458C-A27C-EE11F3885D38}.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}
|
|
||||||
{6178B545-4BB6-458C-A27C-EE11F3885D38} = {43091528-9509-43CB-A003-9C5C11E96DD6}
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
|
||||||
SolutionGuid = {7CA41ED3-2CED-40CC-AA21-28C3B42B1E86}
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
||||||
28
Semi.Avalonia.slnx
Normal file
28
Semi.Avalonia.slnx
Normal 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>
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<Project>
|
|
||||||
<PropertyGroup>
|
|
||||||
<AvaloniaVersion>11.2.3</AvaloniaVersion>
|
|
||||||
<CommunityToolkitVersion>8.4.0</CommunityToolkitVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
</Project>
|
|
||||||
26
demo/Directory.Packages.props
Normal file
26
demo/Directory.Packages.props
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||||
|
<AvaloniaVersion>12.0.0</AvaloniaVersion>
|
||||||
|
<DataGridVersion>12.0.0</DataGridVersion>
|
||||||
|
<SkiaSharpVersion>3.119.3-preview.1.1</SkiaSharpVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageVersion Include="Avalonia" 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="AvaloniaUI.DiagnosticsSupport" Version="2.2.0-beta3"/>
|
||||||
|
|
||||||
|
<PackageVersion Include="SkiaSharp" Version="$(SkiaSharpVersion)"/>
|
||||||
|
<PackageVersion Include="SkiaSharp.NativeAssets.WebAssembly" Version="$(SkiaSharpVersion)"/>
|
||||||
|
|
||||||
|
<PackageVersion Include="Xamarin.AndroidX.Core.SplashScreen" Version="1.2.0.2"/>
|
||||||
|
|
||||||
|
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.2"/>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
20
demo/Semi.Avalonia.Demo.Android/Application.cs
Normal file
20
demo/Semi.Avalonia.Demo.Android/Application.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
using Android.App;
|
||||||
|
using Android.Runtime;
|
||||||
|
using Avalonia;
|
||||||
|
using Avalonia.Android;
|
||||||
|
|
||||||
|
namespace Semi.Avalonia.Demo.Android;
|
||||||
|
|
||||||
|
[Application]
|
||||||
|
public class Application : AvaloniaAndroidApplication<App>
|
||||||
|
{
|
||||||
|
protected Application(nint javaReference, JniHandleOwnership transfer) : base(javaReference, transfer)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
|
||||||
|
{
|
||||||
|
return base.CustomizeAppBuilder(builder)
|
||||||
|
.WithSourceHanSansCNFont();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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 |
@@ -11,6 +11,4 @@ namespace Semi.Avalonia.Demo.Android;
|
|||||||
MainLauncher = true,
|
MainLauncher = true,
|
||||||
LaunchMode = LaunchMode.SingleTop,
|
LaunchMode = LaunchMode.SingleTop,
|
||||||
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)]
|
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)]
|
||||||
public class MainActivity : AvaloniaMainActivity<App>
|
public class MainActivity : AvaloniaMainActivity;
|
||||||
{
|
|
||||||
}
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<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>23</SupportedOSPlatformVersion>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ApplicationId>com.irihitech.Semi.Avalonia</ApplicationId>
|
<ApplicationId>com.irihitech.Semi.Avalonia</ApplicationId>
|
||||||
<ApplicationVersion>1</ApplicationVersion>
|
<ApplicationVersion>1</ApplicationVersion>
|
||||||
@@ -13,15 +13,20 @@
|
|||||||
<RootNamespace>Semi.Avalonia.Demo.Android</RootNamespace>
|
<RootNamespace>Semi.Avalonia.Demo.Android</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<!-- Use CoreCLR on Android -->
|
||||||
|
<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
|
||||||
|
<UseMonoRuntime>false</UseMonoRuntime>
|
||||||
|
<PublishReadyToRun>true</PublishReadyToRun>
|
||||||
|
</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>
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
<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>-->
|
||||||
<!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>-->
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
|
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)"/>
|
<PackageReference Include="Avalonia.Desktop"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ private static void SilenceConsole()
|
|||||||
6. Publish the app to Linux
|
6. Publish the app to Linux
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
dotnet publish demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj -c Release -r linux-x64 --sc -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
|
dotnet publish demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj -c Release -r linux-x64 --sc /p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
|
||||||
```
|
```
|
||||||
|
|
||||||
Add the following code to the csproj file for AOT publishing
|
Add the following code to the csproj file for AOT publishing
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ private static void SilenceConsole()
|
|||||||
6. 发布程序到Linux
|
6. 发布程序到Linux
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
dotnet publish demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj -c Release -r linux-x64 --sc -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
|
dotnet publish demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj -c Release -r linux-x64 --sc /p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
|
||||||
```
|
```
|
||||||
|
|
||||||
AOT发布需要在csproj文件中添加以下代码
|
AOT发布需要在csproj文件中添加以下代码
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
<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>-->
|
||||||
<!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>-->
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
|
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
|
||||||
@@ -23,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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -1,33 +1,49 @@
|
|||||||
<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>
|
||||||
<!-- You can still reference in old way. -->
|
|
||||||
<!-- <StyleInclude Source="avares://Semi.Avalonia/Index.axaml" /> -->
|
|
||||||
<semi:SemiTheme Locale="zh-CN" />
|
<semi:SemiTheme Locale="zh-CN" />
|
||||||
<semi:SemiPopupAnimations />
|
<semi:SemiPopupAnimations />
|
||||||
<StyleInclude Source="avares://Semi.Avalonia.DataGrid/Index.axaml" />
|
<semi:ColorPickerSemiTheme />
|
||||||
<StyleInclude Source="avares://Semi.Avalonia.ColorPicker/Index.axaml" />
|
<semi:DataGridSemiTheme />
|
||||||
|
<!-- <semi:TreeDataGridSemiTheme /> -->
|
||||||
</Application.Styles>
|
</Application.Styles>
|
||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<ResourceInclude
|
<ResourceInclude Source="Themes/_index.axaml" />
|
||||||
Source="Themes/_index.axaml" />
|
|
||||||
</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>
|
||||||
|
|||||||
@@ -12,6 +12,9 @@ public partial class App : Application
|
|||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
AvaloniaXamlLoader.Load(this);
|
AvaloniaXamlLoader.Load(this);
|
||||||
|
#if DEBUG
|
||||||
|
this.AttachDeveloperTools();
|
||||||
|
#endif
|
||||||
this.DataContext = new ApplicationViewModel();
|
this.DataContext = new ApplicationViewModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -22,7 +25,7 @@ public partial class App : Application
|
|||||||
case IClassicDesktopStyleApplicationLifetime desktop:
|
case IClassicDesktopStyleApplicationLifetime desktop:
|
||||||
// Line below is needed to remove Avalonia data validation.
|
// Line below is needed to remove Avalonia data validation.
|
||||||
// Without this line you will get duplicate validations from both Avalonia and CT
|
// Without this line you will get duplicate validations from both Avalonia and CT
|
||||||
BindingPlugins.DataValidators.RemoveAt(0);
|
// BindingPlugins.DataValidators.RemoveAt(0);
|
||||||
desktop.MainWindow = new MainWindow();
|
desktop.MainWindow = new MainWindow();
|
||||||
break;
|
break;
|
||||||
case ISingleViewApplicationLifetime singleView:
|
case ISingleViewApplicationLifetime singleView:
|
||||||
|
|||||||
BIN
demo/Semi.Avalonia.Demo/Assets/irihi2.ico
Normal file
BIN
demo/Semi.Avalonia.Demo/Assets/irihi2.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 948 B |
@@ -5,8 +5,8 @@ namespace Semi.Avalonia.Demo.Constant;
|
|||||||
|
|
||||||
public static class ColorTokens
|
public static class ColorTokens
|
||||||
{
|
{
|
||||||
public static IReadOnlyList<Tuple<string, string>> PrimaryTokens { get; } = new List<Tuple<string, string>>
|
public static IReadOnlyList<Tuple<string, string>> PrimaryTokens { get; } =
|
||||||
{
|
[
|
||||||
new("SemiColorPrimary", "Primary"),
|
new("SemiColorPrimary", "Primary"),
|
||||||
new("SemiColorPrimaryPointerover", "Primary Pointerover"),
|
new("SemiColorPrimaryPointerover", "Primary Pointerover"),
|
||||||
new("SemiColorPrimaryActive", "Primary Active"),
|
new("SemiColorPrimaryActive", "Primary Active"),
|
||||||
@@ -14,130 +14,156 @@ public static class ColorTokens
|
|||||||
new("SemiColorPrimaryLight", "Primary Light"),
|
new("SemiColorPrimaryLight", "Primary Light"),
|
||||||
new("SemiColorPrimaryLightPointerover", "Primary Light Pointerover"),
|
new("SemiColorPrimaryLightPointerover", "Primary Light Pointerover"),
|
||||||
new("SemiColorPrimaryLightActive", "Primary Light Active"),
|
new("SemiColorPrimaryLightActive", "Primary Light Active"),
|
||||||
};
|
];
|
||||||
|
|
||||||
public static IReadOnlyList<Tuple<string, string>> SecondaryTokens { get; } = new List<Tuple<string, string>>
|
public static IReadOnlyList<Tuple<string, string>> SecondaryTokens { get; } =
|
||||||
{
|
[
|
||||||
new("SemiColorSecondary", "Secondary"),
|
new("SemiColorSecondary", "Secondary"),
|
||||||
new("SemiColorSecondaryPointerover", "Secondary Pointerover"),
|
new("SemiColorSecondaryPointerover", "Secondary Pointerover"),
|
||||||
new("SemiColorSecondaryActive", "Secondary Active"),
|
new("SemiColorSecondaryActive", "Secondary Active"),
|
||||||
new("SemiColorSecondaryDisabled", "Secondary Disabled"),
|
new("SemiColorSecondaryDisabled", "Secondary Disabled"),
|
||||||
new("SemiColorSecondaryLight", "Secondary Light"),
|
new("SemiColorSecondaryLight", "Secondary Light"),
|
||||||
new("SemiColorSecondaryLightPointerover", "Secondary Light Pointerover"),
|
new("SemiColorSecondaryLightPointerover", "Secondary Light Pointerover"),
|
||||||
new("SemiColorSecondaryLightActive", "Secondary Light Active"),
|
new("SemiColorSecondaryLightActive", "Secondary Light Active")
|
||||||
};
|
];
|
||||||
|
|
||||||
public static IReadOnlyList<Tuple<string, string>> TertiaryTokens { get; } = new List<Tuple<string, string>>
|
public static IReadOnlyList<Tuple<string, string>> TertiaryTokens { get; } =
|
||||||
{
|
[
|
||||||
new("SemiColorTertiary", "Tertiary"),
|
new("SemiColorTertiary", "Tertiary"),
|
||||||
new("SemiColorTertiaryPointerover", "Tertiary Pointerover"),
|
new("SemiColorTertiaryPointerover", "Tertiary Pointerover"),
|
||||||
new("SemiColorTertiaryActive", "Tertiary Active"),
|
new("SemiColorTertiaryActive", "Tertiary Active"),
|
||||||
new("SemiColorTertiaryLight", "Tertiary Light"),
|
new("SemiColorTertiaryLight", "Tertiary Light"),
|
||||||
new("SemiColorTertiaryLightPointerover", "Tertiary Light Pointerover"),
|
new("SemiColorTertiaryLightPointerover", "Tertiary Light Pointerover"),
|
||||||
new("SemiColorTertiaryLightActive", "Tertiary Light Active"),
|
new("SemiColorTertiaryLightActive", "Tertiary Light Active")
|
||||||
};
|
];
|
||||||
|
|
||||||
public static IReadOnlyList<Tuple<string, string>> InformationTokens { get; } = new List<Tuple<string, string>>
|
public static IReadOnlyList<Tuple<string, string>> InformationTokens { get; } =
|
||||||
{
|
[
|
||||||
new("SemiColorInformation", "Information"),
|
new("SemiColorInformation", "Information"),
|
||||||
new("SemiColorInformationPointerover", "Information Pointerover"),
|
new("SemiColorInformationPointerover", "Information Pointerover"),
|
||||||
new("SemiColorInformationActive", "Information Active"),
|
new("SemiColorInformationActive", "Information Active"),
|
||||||
new("SemiColorInformationDisabled", "Information Disabled"),
|
new("SemiColorInformationDisabled", "Information Disabled"),
|
||||||
new("SemiColorInformationLight", "Information Light"),
|
new("SemiColorInformationLight", "Information Light"),
|
||||||
new("SemiColorInformationLightPointerover", "Information Light Pointerover"),
|
new("SemiColorInformationLightPointerover", "Information Light Pointerover"),
|
||||||
new("SemiColorInformationLightActive", "Information Light Active"),
|
new("SemiColorInformationLightActive", "Information Light Active")
|
||||||
};
|
];
|
||||||
|
|
||||||
public static IReadOnlyList<Tuple<string, string>> SuccessTokens { get; } = new List<Tuple<string, string>>
|
public static IReadOnlyList<Tuple<string, string>> SuccessTokens { get; } =
|
||||||
{
|
[
|
||||||
new("SemiColorSuccess", "Success"),
|
new("SemiColorSuccess", "Success"),
|
||||||
new("SemiColorSuccessPointerover", "Success Pointerover"),
|
new("SemiColorSuccessPointerover", "Success Pointerover"),
|
||||||
new("SemiColorSuccessActive", "Success Active"),
|
new("SemiColorSuccessActive", "Success Active"),
|
||||||
new("SemiColorSuccessDisabled", "Success Disabled"),
|
new("SemiColorSuccessDisabled", "Success Disabled"),
|
||||||
new("SemiColorSuccessLight", "Success Light"),
|
new("SemiColorSuccessLight", "Success Light"),
|
||||||
new("SemiColorSuccessLightPointerover", "Success Light Pointerover"),
|
new("SemiColorSuccessLightPointerover", "Success Light Pointerover"),
|
||||||
new("SemiColorSuccessLightActive", "Success Light Active"),
|
new("SemiColorSuccessLightActive", "Success Light Active")
|
||||||
};
|
];
|
||||||
|
|
||||||
public static IReadOnlyList<Tuple<string, string>> WarningTokens { get; } = new List<Tuple<string, string>>
|
public static IReadOnlyList<Tuple<string, string>> WarningTokens { get; } =
|
||||||
{
|
[
|
||||||
new("SemiColorWarning", "Warning"),
|
new("SemiColorWarning", "Warning"),
|
||||||
new("SemiColorWarningPointerover", "Warning Pointerover"),
|
new("SemiColorWarningPointerover", "Warning Pointerover"),
|
||||||
new("SemiColorWarningActive", "Warning Active"),
|
new("SemiColorWarningActive", "Warning Active"),
|
||||||
new("SemiColorWarningLight", "Warning Light"),
|
new("SemiColorWarningLight", "Warning Light"),
|
||||||
new("SemiColorWarningLightPointerover", "Warning Light Pointerover"),
|
new("SemiColorWarningLightPointerover", "Warning Light Pointerover"),
|
||||||
new("SemiColorWarningLightActive", "Warning Light Active"),
|
new("SemiColorWarningLightActive", "Warning Light Active")
|
||||||
};
|
];
|
||||||
|
|
||||||
public static IReadOnlyList<Tuple<string, string>> DangerTokens { get; } = new List<Tuple<string, string>>
|
public static IReadOnlyList<Tuple<string, string>> DangerTokens { get; } =
|
||||||
{
|
[
|
||||||
new("SemiColorDanger", "Danger"),
|
new("SemiColorDanger", "Danger"),
|
||||||
new("SemiColorDangerPointerover", "Danger Pointerover"),
|
new("SemiColorDangerPointerover", "Danger Pointerover"),
|
||||||
new("SemiColorDangerActive", "Danger Active"),
|
new("SemiColorDangerActive", "Danger Active"),
|
||||||
new("SemiColorDangerLight", "Danger Light"),
|
new("SemiColorDangerLight", "Danger Light"),
|
||||||
new("SemiColorDangerLightPointerover", "Danger Light Pointerover"),
|
new("SemiColorDangerLightPointerover", "Danger Light Pointerover"),
|
||||||
new("SemiColorDangerLightActive", "Danger Light Active"),
|
new("SemiColorDangerLightActive", "Danger Light Active")
|
||||||
};
|
];
|
||||||
|
|
||||||
public static IReadOnlyList<Tuple<string, string>> TextTokens { get; } = new List<Tuple<string, string>>
|
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; } =
|
||||||
|
[
|
||||||
new("SemiColorText0", "Text 0"),
|
new("SemiColorText0", "Text 0"),
|
||||||
new("SemiColorText1", "Text 1"),
|
new("SemiColorText1", "Text 1"),
|
||||||
new("SemiColorText2", "Text 2"),
|
new("SemiColorText2", "Text 2"),
|
||||||
new("SemiColorText3", "Text 3"),
|
new("SemiColorText3", "Text 3")
|
||||||
};
|
];
|
||||||
|
|
||||||
public static IReadOnlyList<Tuple<string, string>> LinkTokens { get; } = new List<Tuple<string, string>>
|
public static IReadOnlyList<Tuple<string, string>> LinkTokens { get; } =
|
||||||
{
|
[
|
||||||
new("SemiColorLink", "Link"),
|
new("SemiColorLink", "Link"),
|
||||||
new("SemiColorLinkPointerover", "Link Pointerover"),
|
new("SemiColorLinkPointerover", "Link Pointerover"),
|
||||||
new("SemiColorLinkActive", "Link Active"),
|
new("SemiColorLinkActive", "Link Active"),
|
||||||
new("SemiColorLinkVisited", "Link Visited"),
|
new("SemiColorLinkVisited", "Link Visited")
|
||||||
};
|
];
|
||||||
|
|
||||||
public static IReadOnlyList<Tuple<string, string>> BackgroundTokens { get; } = new List<Tuple<string, string>>
|
public static IReadOnlyList<Tuple<string, string>> BackgroundTokens { get; } =
|
||||||
{
|
[
|
||||||
new("SemiColorBackground0", "Background 0"),
|
new("SemiColorBackground0", "Background 0"),
|
||||||
new("SemiColorBackground1", "Background 1"),
|
new("SemiColorBackground1", "Background 1"),
|
||||||
new("SemiColorBackground2", "Background 2"),
|
new("SemiColorBackground2", "Background 2"),
|
||||||
new("SemiColorBackground3", "Background 3"),
|
new("SemiColorBackground3", "Background 3"),
|
||||||
new("SemiColorBackground4", "Background 4"),
|
new("SemiColorBackground4", "Background 4")
|
||||||
};
|
];
|
||||||
|
|
||||||
public static IReadOnlyList<Tuple<string, string>> FillTokens { get; } = new List<Tuple<string, string>>
|
public static IReadOnlyList<Tuple<string, string>> FillTokens { get; } =
|
||||||
{
|
[
|
||||||
new("SemiColorFill0", "Fill 0"),
|
new("SemiColorFill0", "Fill 0"),
|
||||||
new("SemiColorFill1", "Fill 1"),
|
new("SemiColorFill1", "Fill 1"),
|
||||||
new("SemiColorFill2", "Fill 2"),
|
new("SemiColorFill2", "Fill 2")
|
||||||
};
|
];
|
||||||
|
|
||||||
public static IReadOnlyList<Tuple<string, string>> BorderTokens { get; } = new List<Tuple<string, string>>
|
public static IReadOnlyList<Tuple<string, string>> BorderTokens { get; } =
|
||||||
{
|
[
|
||||||
new("SemiColorBorder", "Border"),
|
new("SemiColorBorder", "Border"),
|
||||||
new("SemiColorFocusBorder", "Focus Border"),
|
new("SemiColorFocusBorder", "Focus Border")
|
||||||
};
|
];
|
||||||
|
|
||||||
public static IReadOnlyList<Tuple<string, string>> DisabledTokens { get; } = new List<Tuple<string, string>>
|
public static IReadOnlyList<Tuple<string, string>> DisabledTokens { get; } =
|
||||||
{
|
[
|
||||||
new("SemiColorDisabledText", "Disabled Text"),
|
new("SemiColorDisabledText", "Disabled Text"),
|
||||||
new("SemiColorDisabledBorder", "Disabled Border"),
|
new("SemiColorDisabledBorder", "Disabled Border"),
|
||||||
new("SemiColorDisabledBackground", "Disabled Background"),
|
new("SemiColorDisabledBackground", "Disabled Background"),
|
||||||
new("SemiColorDisabledFill", "Disabled Fill"),
|
new("SemiColorDisabledFill", "Disabled Fill")
|
||||||
};
|
];
|
||||||
|
|
||||||
public static IReadOnlyList<Tuple<string, string>> OtherTokens { get; } = new List<Tuple<string, string>>
|
public static IReadOnlyList<Tuple<string, string>> OtherTokens { get; } =
|
||||||
{
|
[
|
||||||
new("SemiColorWhite", "White"),
|
new("SemiColorWhite", "White"),
|
||||||
new("SemiColorBlack", "Black"),
|
new("SemiColorBlack", "Black"),
|
||||||
new("SemiColorNavBackground", "Navigation Background"),
|
new("SemiColorNavBackground", "Navigation Background"),
|
||||||
new("SemiColorOverlayBackground", "Overlay Background"),
|
new("SemiColorOverlayBackground", "Overlay Background"),
|
||||||
new("SemiColorHighlightBackground", "Highlight Background"),
|
new("SemiColorHighlightBackground", "Highlight Background"),
|
||||||
new("SemiColorHighlight", "Highlight Text"),
|
new("SemiColorHighlight", "Highlight Text")
|
||||||
};
|
];
|
||||||
|
|
||||||
public static IReadOnlyList<Tuple<string, string>> ShadowTokens { get; } = new List<Tuple<string, string>>
|
public static IReadOnlyList<Tuple<string, string>> ShadowTokens { get; } =
|
||||||
{
|
[
|
||||||
new("SemiColorShadow", "Shadow"),
|
new("SemiColorShadow", "Shadow"),
|
||||||
new("SemiShadowElevated", "Shadow Elevated"),
|
new("SemiShadowElevated", "Shadow Elevated")
|
||||||
};
|
];
|
||||||
}
|
}
|
||||||
@@ -3,6 +3,7 @@ using System.Threading.Tasks;
|
|||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Controls.Primitives;
|
using Avalonia.Controls.Primitives;
|
||||||
|
using Avalonia.Input.Platform;
|
||||||
using Avalonia.Media;
|
using Avalonia.Media;
|
||||||
using Semi.Avalonia.Demo.Converters;
|
using Semi.Avalonia.Demo.Converters;
|
||||||
|
|
||||||
@@ -92,6 +93,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)
|
||||||
|
|||||||
@@ -3,15 +3,13 @@ using System.Collections.Generic;
|
|||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Data.Converters;
|
using Avalonia.Data.Converters;
|
||||||
using Avalonia.Media;
|
|
||||||
using Avalonia.Metadata;
|
using Avalonia.Metadata;
|
||||||
|
|
||||||
namespace Semi.Avalonia.TreeDataGrid.Demo.Converters;
|
namespace Semi.Avalonia.Demo.Converters;
|
||||||
|
|
||||||
public class FileIconConverter : IMultiValueConverter
|
public class FileIconConverter : IMultiValueConverter
|
||||||
{
|
{
|
||||||
[Content]
|
[Content] public IDictionary<string, object?> Items { get; } = new Dictionary<string, object?>();
|
||||||
public Dictionary<string, PathGeometry> Items { get; set; } = new Dictionary<string, PathGeometry>();
|
|
||||||
|
|
||||||
public object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture)
|
public object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
@@ -21,8 +19,10 @@ public class FileIconConverter: IMultiValueConverter
|
|||||||
{
|
{
|
||||||
return Items["file"];
|
return Items["file"];
|
||||||
}
|
}
|
||||||
|
|
||||||
return isOpen ? Items["folderOpen"] : Items["folderClosed"];
|
return isOpen ? Items["folderOpen"] : Items["folderClosed"];
|
||||||
}
|
}
|
||||||
|
|
||||||
return AvaloniaProperty.UnsetValue;
|
return AvaloniaProperty.UnsetValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
236
demo/Semi.Avalonia.Demo/Pages/AboutUs.axaml
Normal file
236
demo/Semi.Avalonia.Demo/Pages/AboutUs.axaml
Normal file
@@ -0,0 +1,236 @@
|
|||||||
|
<UserControl
|
||||||
|
x:Class="Semi.Avalonia.Demo.Pages.AboutUs"
|
||||||
|
xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:collections="clr-namespace:Avalonia.Collections;assembly=Avalonia.Base"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:iri="https://irihi.tech/shared"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
|
||||||
|
x:DataType="vm:AboutUsViewModel"
|
||||||
|
d:DesignHeight="450"
|
||||||
|
d:DesignWidth="800"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
<UserControl.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<ResourceDictionary.ThemeDictionaries>
|
||||||
|
<ResourceDictionary x:Key="Light">
|
||||||
|
<collections:AvaloniaList x:Key="CanvasPalette" x:TypeArguments="Color">
|
||||||
|
<Color>#FFFDB7A5</Color>
|
||||||
|
<Color>#FFF6A0B5</Color>
|
||||||
|
<Color>#FFDD9BE0</Color>
|
||||||
|
<Color>#FFC4A7E9</Color>
|
||||||
|
<Color>#FFA7B3E1</Color>
|
||||||
|
<Color>#FF98CDFD</Color>
|
||||||
|
<Color>#FF95D8F8</Color>
|
||||||
|
</collections:AvaloniaList>
|
||||||
|
<LinearGradientBrush x:Key="TileTitleForeground" StartPoint="">
|
||||||
|
<GradientStop Offset="0.0" Color="#FFA20B48" />
|
||||||
|
<GradientStop Offset="0.3" Color="#FF71168A" />
|
||||||
|
<GradientStop Offset="0.6" Color="#FF46259E" />
|
||||||
|
<GradientStop Offset="1.0" Color="#FF28348C" />
|
||||||
|
</LinearGradientBrush>
|
||||||
|
</ResourceDictionary>
|
||||||
|
<ResourceDictionary x:Key="Dark">
|
||||||
|
<collections:AvaloniaList x:Key="CanvasPalette" x:TypeArguments="Color">
|
||||||
|
<Color>#FFB42019</Color>
|
||||||
|
<Color>#FFA41751</Color>
|
||||||
|
<Color>#FF731F8A</Color>
|
||||||
|
<Color>#FF582EA0</Color>
|
||||||
|
<Color>#FF29368E</Color>
|
||||||
|
<Color>#FF135CB8</Color>
|
||||||
|
<Color>#FF0366A9</Color>
|
||||||
|
</collections:AvaloniaList>
|
||||||
|
<LinearGradientBrush x:Key="TileTitleForeground">
|
||||||
|
<GradientStop Offset="0.0" Color="#FFF7A8BC" />
|
||||||
|
<GradientStop Offset="0.3" Color="#FFDDA0E1" />
|
||||||
|
<GradientStop Offset="0.6" Color="#FFBEADE9" />
|
||||||
|
<GradientStop Offset="1.0" Color="#FFA7B4E2" />
|
||||||
|
</LinearGradientBrush>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</ResourceDictionary.ThemeDictionaries>
|
||||||
|
<ControlTheme x:Key="TileButton" TargetType="Button">
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||||
|
<Setter Property="Padding" Value="24" />
|
||||||
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||||
|
<Setter Property="Template">
|
||||||
|
<ControlTemplate>
|
||||||
|
<Border
|
||||||
|
Padding="0"
|
||||||
|
Classes="Hover"
|
||||||
|
Cursor="Hand"
|
||||||
|
Theme="{DynamicResource CardBorder}">
|
||||||
|
<Border.Transitions>
|
||||||
|
<Transitions>
|
||||||
|
<BrushTransition Property="BorderBrush" Duration="0.5" />
|
||||||
|
</Transitions>
|
||||||
|
</Border.Transitions>
|
||||||
|
<ContentPresenter
|
||||||
|
Padding="{TemplateBinding Padding}"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
VerticalAlignment="Stretch"
|
||||||
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
|
Content="{TemplateBinding Content}"
|
||||||
|
ContentTemplate="{TemplateBinding ContentTemplate}" />
|
||||||
|
</Border>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter>
|
||||||
|
<Style Selector="^:pointerover /template/ Border">
|
||||||
|
<Setter Property="BorderBrush" Value="{DynamicResource TileTitleForeground}" />
|
||||||
|
</Style>
|
||||||
|
</ControlTheme>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</UserControl.Resources>
|
||||||
|
<UserControl.Styles>
|
||||||
|
<Style Selector="TextBlock.TileTitle">
|
||||||
|
<Setter Property="FontWeight" Value="700" />
|
||||||
|
<Setter Property="FontSize" Value="24" />
|
||||||
|
<Setter Property="Margin" Value="0 0 0 8" />
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource TileTitleForeground}" />
|
||||||
|
</Style>
|
||||||
|
</UserControl.Styles>
|
||||||
|
<Grid RowDefinitions="*, Auto">
|
||||||
|
<ScrollViewer>
|
||||||
|
<StackPanel>
|
||||||
|
<Grid
|
||||||
|
Margin="0,96,0,48"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
ColumnDefinitions="*, *"
|
||||||
|
RowDefinitions="*, *">
|
||||||
|
<iri:IrihiLogo
|
||||||
|
Grid.Row="0"
|
||||||
|
Grid.RowSpan="2"
|
||||||
|
Grid.Column="0"
|
||||||
|
Fill="{DynamicResource TextBlockSecondaryForeground}"
|
||||||
|
Width="96"
|
||||||
|
Margin="0,0,24,0"
|
||||||
|
VerticalAlignment="Center" />
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="0"
|
||||||
|
Grid.Column="1"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
VerticalAlignment="Bottom"
|
||||||
|
Classes="Secondary"
|
||||||
|
FontSize="48"
|
||||||
|
FontWeight="700"
|
||||||
|
Text="铱泓科技" />
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.Column="1"
|
||||||
|
Margin="12,0,0,0"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
Classes="Secondary"
|
||||||
|
FontSize="16"
|
||||||
|
Text="IRIHI Technology" />
|
||||||
|
</Grid>
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
Classes="Tertiary"
|
||||||
|
FontSize="20"
|
||||||
|
FontWeight="700"
|
||||||
|
Text="聚焦生产力的美学进化" />
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
Classes="Tertiary"
|
||||||
|
FontSize="20"
|
||||||
|
Text="Aesthetic Evolution of Productivity" />
|
||||||
|
<UniformGrid
|
||||||
|
MaxWidth="810"
|
||||||
|
Margin="24"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
Columns="2">
|
||||||
|
<Button
|
||||||
|
Margin="8"
|
||||||
|
Command="{Binding NavigateCommand}"
|
||||||
|
CommandParameter="semi"
|
||||||
|
Theme="{DynamicResource TileButton}">
|
||||||
|
<StackPanel HorizontalAlignment="Left">
|
||||||
|
<TextBlock Classes="TileTitle" Text="Semi" />
|
||||||
|
<StackPanel Orientation="Horizontal" Margin="0 0 0 8">
|
||||||
|
<Label Theme="{DynamicResource TagLabel}" Classes="Blue Ghost">Open Source</Label>
|
||||||
|
</StackPanel>
|
||||||
|
<TextBlock Text="开箱即用的独立主题库" />
|
||||||
|
<TextBlock Text="A ready-to-use standalone theme library" />
|
||||||
|
</StackPanel>
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
Margin="8"
|
||||||
|
Command="{Binding NavigateCommand}"
|
||||||
|
CommandParameter="ursa"
|
||||||
|
Theme="{DynamicResource TileButton}">
|
||||||
|
<StackPanel HorizontalAlignment="Left">
|
||||||
|
<TextBlock Classes="TileTitle" Text="Ursa" />
|
||||||
|
<StackPanel Orientation="Horizontal" Margin="0 0 0 8">
|
||||||
|
<Label Theme="{DynamicResource TagLabel}" Classes="Blue Ghost">Open Source</Label>
|
||||||
|
</StackPanel>
|
||||||
|
<TextBlock Text="高性能企业级桌面客户端控件库" />
|
||||||
|
<TextBlock Text="High-performance enterprise level control library for desktop apps" />
|
||||||
|
</StackPanel>
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
Margin="8"
|
||||||
|
Command="{Binding NavigateCommand}"
|
||||||
|
CommandParameter="mantra"
|
||||||
|
Theme="{DynamicResource TileButton}">
|
||||||
|
<StackPanel HorizontalAlignment="Left">
|
||||||
|
<TextBlock Classes="TileTitle" Text="Mantra" />
|
||||||
|
<StackPanel Orientation="Horizontal" Margin="0 0 0 8">
|
||||||
|
<Label Theme="{DynamicResource TagLabel}" Classes="Purple Ghost">Commercial</Label>
|
||||||
|
</StackPanel>
|
||||||
|
<TextBlock Text="高性能文字排版渲染控件库" />
|
||||||
|
<TextBlock Text="High-performance typography control library" />
|
||||||
|
</StackPanel>
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
Margin="8"
|
||||||
|
Command="{Binding NavigateCommand}"
|
||||||
|
CommandParameter="huska"
|
||||||
|
Theme="{DynamicResource TileButton}">
|
||||||
|
<StackPanel HorizontalAlignment="Left">
|
||||||
|
<TextBlock Classes="TileTitle" Text="Huska" />
|
||||||
|
<StackPanel Orientation="Horizontal" Margin="0 0 0 8">
|
||||||
|
<Label Theme="{DynamicResource TagLabel}" Classes="Purple Ghost">Commercial</Label>
|
||||||
|
</StackPanel>
|
||||||
|
<TextBlock Text="手绘风格主题库" />
|
||||||
|
<TextBlock Text="Hand-drawing theme library" />
|
||||||
|
</StackPanel>
|
||||||
|
</Button>
|
||||||
|
</UniformGrid>
|
||||||
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
|
<StackPanel
|
||||||
|
Grid.Row="1"
|
||||||
|
Margin="0,16"
|
||||||
|
Spacing="32"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
Orientation="Horizontal">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<HyperlinkButton
|
||||||
|
Classes="WithIcon"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Content="Homepage"
|
||||||
|
NavigateUri="https://irihi.tech">
|
||||||
|
<HyperlinkButton.Styles>
|
||||||
|
<Style Selector=".WithIcon /template/ PathIcon">
|
||||||
|
<Setter Property="Data" Value="{StaticResource SemiIconHome}" />
|
||||||
|
</Style>
|
||||||
|
</HyperlinkButton.Styles>
|
||||||
|
</HyperlinkButton>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<HyperlinkButton
|
||||||
|
Classes="WithIcon"
|
||||||
|
Content="GitHub"
|
||||||
|
NavigateUri="https://github.com/irihitech">
|
||||||
|
<HyperlinkButton.Styles>
|
||||||
|
<Style Selector=".WithIcon /template/ PathIcon">
|
||||||
|
<Setter Property="Data" Value="{StaticResource SemiIconGithubLogo}" />
|
||||||
|
</Style>
|
||||||
|
</HyperlinkButton.Styles>
|
||||||
|
</HyperlinkButton>
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
24
demo/Semi.Avalonia.Demo/Pages/AboutUs.axaml.cs
Normal file
24
demo/Semi.Avalonia.Demo/Pages/AboutUs.axaml.cs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Interactivity;
|
||||||
|
using Semi.Avalonia.Demo.ViewModels;
|
||||||
|
|
||||||
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
public partial class AboutUs : UserControl
|
||||||
|
{
|
||||||
|
public AboutUs()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
this.DataContext = new AboutUsViewModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnLoaded(RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
base.OnLoaded(e);
|
||||||
|
if (this.DataContext is AboutUsViewModel vm)
|
||||||
|
{
|
||||||
|
var launcher = TopLevel.GetTopLevel(this)?.Launcher;
|
||||||
|
vm.Launcher = launcher;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,15 +3,14 @@
|
|||||||
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:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="clr-namespace:Semi.Avalonia.Demo.Pages"
|
|
||||||
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"
|
||||||
d:DesignHeight="450"
|
d:DesignHeight="450"
|
||||||
d:DesignWidth="800"
|
d:DesignWidth="800"
|
||||||
x:CompileBindings="False"
|
x:DataType="vm:AutoCompleteBoxDemoViewModel"
|
||||||
x:DataType="local:AutoCompleteBoxDemoViewModel"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<Design.DataContext>
|
<Design.DataContext>
|
||||||
<local:AutoCompleteBoxDemoViewModel />
|
<vm:AutoCompleteBoxDemoViewModel />
|
||||||
</Design.DataContext>
|
</Design.DataContext>
|
||||||
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
||||||
<StackPanel.Styles>
|
<StackPanel.Styles>
|
||||||
@@ -21,7 +20,7 @@
|
|||||||
<Binding Path="States" />
|
<Binding Path="States" />
|
||||||
</Setter>
|
</Setter>
|
||||||
<Setter Property="ItemTemplate">
|
<Setter Property="ItemTemplate">
|
||||||
<DataTemplate DataType="local:StateData">
|
<DataTemplate DataType="vm:StateData">
|
||||||
<TextBlock Text="{Binding Name}" />
|
<TextBlock Text="{Binding Name}" />
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
@@ -29,59 +28,59 @@
|
|||||||
</StackPanel.Styles>
|
</StackPanel.Styles>
|
||||||
|
|
||||||
<AutoCompleteBox
|
<AutoCompleteBox
|
||||||
Watermark="Please select a State"
|
PlaceholderText="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"
|
PlaceholderText="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"
|
PlaceholderText="Large"
|
||||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||||
<AutoCompleteBox
|
<AutoCompleteBox
|
||||||
Width="100"
|
Width="100"
|
||||||
Watermark="Default"
|
PlaceholderText="Default"
|
||||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||||
<AutoCompleteBox
|
<AutoCompleteBox
|
||||||
Width="100"
|
Width="100"
|
||||||
Classes="Small"
|
Classes="Small"
|
||||||
Watermark="Small"
|
PlaceholderText="Small"
|
||||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<AutoCompleteBox
|
<AutoCompleteBox
|
||||||
Width="100"
|
Width="100"
|
||||||
IsEnabled="False"
|
IsEnabled="False"
|
||||||
Watermark="Disabled"
|
PlaceholderText="Disabled"
|
||||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||||
<AutoCompleteBox
|
<AutoCompleteBox
|
||||||
Width="100"
|
Width="100"
|
||||||
Classes="Bordered"
|
Classes="Bordered"
|
||||||
Watermark="Bordered"
|
PlaceholderText="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>
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
using System.Collections.ObjectModel;
|
|
||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
using Semi.Avalonia.Demo.ViewModels;
|
||||||
using System.Collections.Generic;
|
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -15,85 +11,3 @@ public partial class AutoCompleteBoxDemo : UserControl
|
|||||||
this.DataContext = new AutoCompleteBoxDemoViewModel();
|
this.DataContext = new AutoCompleteBoxDemoViewModel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class AutoCompleteBoxDemoViewModel: ObservableObject
|
|
||||||
{
|
|
||||||
public ObservableCollection<StateData> States { get; set; }
|
|
||||||
|
|
||||||
public AutoCompleteBoxDemoViewModel()
|
|
||||||
{
|
|
||||||
States = new ObservableCollection<StateData>(GetStates());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private static List<StateData> GetStates()
|
|
||||||
{
|
|
||||||
return new List<StateData>
|
|
||||||
{
|
|
||||||
new StateData("Alabama", "AL", "Montgomery"),
|
|
||||||
new StateData("Alaska", "AK", "Juneau"),
|
|
||||||
new StateData("Arizona", "AZ", "Phoenix"),
|
|
||||||
new StateData("Arkansas", "AR", "Little Rock"),
|
|
||||||
new StateData("California", "CA", "Sacramento"),
|
|
||||||
new StateData("Colorado", "CO", "Denver"),
|
|
||||||
new StateData("Connecticut", "CT", "Hartford"),
|
|
||||||
new StateData("Delaware", "DE", "Dover"),
|
|
||||||
new StateData("Florida", "FL", "Tallahassee"),
|
|
||||||
new StateData("Georgia", "GA", "Atlanta"),
|
|
||||||
new StateData("Hawaii", "HI", "Honolulu"),
|
|
||||||
new StateData("Idaho", "ID", "Boise"),
|
|
||||||
new StateData("Illinois", "IL", "Springfield"),
|
|
||||||
new StateData("Indiana", "IN", "Indianapolis"),
|
|
||||||
new StateData("Iowa", "IA", "Des Moines"),
|
|
||||||
new StateData("Kansas", "KS", "Topeka"),
|
|
||||||
new StateData("Kentucky", "KY", "Frankfort"),
|
|
||||||
new StateData("Louisiana", "LA", "Baton Rouge"),
|
|
||||||
new StateData("Maine", "ME", "Augusta"),
|
|
||||||
new StateData("Maryland", "MD", "Annapolis"),
|
|
||||||
new StateData("Massachusetts", "MA", "Boston"),
|
|
||||||
new StateData("Michigan", "MI", "Lansing"),
|
|
||||||
new StateData("Minnesota", "MN", "St. Paul"),
|
|
||||||
new StateData("Mississippi", "MS", "Jackson"),
|
|
||||||
new StateData("Missouri", "MO", "Jefferson City"),
|
|
||||||
new StateData("Montana", "MT", "Helena"),
|
|
||||||
new StateData("Nebraska", "NE", "Lincoln"),
|
|
||||||
new StateData("Nevada", "NV", "Carson City"),
|
|
||||||
new StateData("New Hampshire", "NH", "Concord"),
|
|
||||||
new StateData("New Jersey", "NJ", "Trenton"),
|
|
||||||
new StateData("New Mexico", "NM", "Santa Fe"),
|
|
||||||
new StateData("New York", "NY", "Albany"),
|
|
||||||
new StateData("North Carolina", "NC", "Raleigh"),
|
|
||||||
new StateData("North Dakota", "ND", "Bismarck"),
|
|
||||||
new StateData("Ohio", "OH", "Columbus"),
|
|
||||||
new StateData("Oklahoma", "OK", "Oklahoma City"),
|
|
||||||
new StateData("Oregon", "OR", "Salem"),
|
|
||||||
new StateData("Pennsylvania", "PA", "Harrisburg"),
|
|
||||||
new StateData("Rhode Island", "RI", "Providence"),
|
|
||||||
new StateData("South Carolina", "SC", "Columbia"),
|
|
||||||
new StateData("South Dakota", "SD", "Pierre"),
|
|
||||||
new StateData("Tennessee", "TN", "Nashville"),
|
|
||||||
new StateData("Texas", "TX", "Austin"),
|
|
||||||
new StateData("Utah", "UT", "Salt Lake City"),
|
|
||||||
new StateData("Vermont", "VT", "Montpelier"),
|
|
||||||
new StateData("Virginia", "VA", "Richmond"),
|
|
||||||
new StateData("Washington", "WA", "Olympia"),
|
|
||||||
new StateData("West Virginia", "WV", "Charleston"),
|
|
||||||
new StateData("Wisconsin", "WI", "Madison"),
|
|
||||||
new StateData("Wyoming", "WY", "Cheyenne"),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class StateData
|
|
||||||
{
|
|
||||||
public string Name { get; private set; }
|
|
||||||
public string Abbreviation { get; private set; }
|
|
||||||
public string Capital { get; private set; }
|
|
||||||
|
|
||||||
public StateData(string name, string abbreviation, string capital)
|
|
||||||
{
|
|
||||||
Name = name;
|
|
||||||
Abbreviation = abbreviation;
|
|
||||||
Capital = capital;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
|||||||
@@ -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"
|
|
||||||
Content="Disabled"
|
|
||||||
IsEnabled="False" />
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
</HeaderedContentControl.Header>
|
||||||
<DropDownButton Content="Default" Classes="Success"/>
|
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||||
<DropDownButton Content="Solid" Theme="{DynamicResource SolidDropDownButton}" Classes="Success"/>
|
<Button Content="Large" Classes="Large" />
|
||||||
<DropDownButton Content="Outline" Theme="{DynamicResource OutlineDropDownButton}" Classes="Success"/>
|
<Button Content="Default" />
|
||||||
<DropDownButton Content="Borderless" Theme="{DynamicResource BorderlessDropDownButton}" Classes="Success"/>
|
<Button Content="Small" Classes="Small" />
|
||||||
<DropDownButton Content="Default" Classes="Success" IsEnabled="False"/>
|
</WrapPanel>
|
||||||
<DropDownButton Content="Solid" Theme="{DynamicResource SolidDropDownButton}" Classes="Success" IsEnabled="False"/>
|
</HeaderedContentControl>
|
||||||
<DropDownButton Content="Outline" Theme="{DynamicResource OutlineDropDownButton}" Classes="Success" IsEnabled="False"/>
|
|
||||||
<DropDownButton Content="Borderless" Theme="{DynamicResource BorderlessDropDownButton}" Classes="Success" IsEnabled="False"/>
|
<HeaderedContentControl
|
||||||
|
Theme="{StaticResource GroupBox}">
|
||||||
|
<HeaderedContentControl.Header>
|
||||||
|
<StackPanel Spacing="8">
|
||||||
|
<TextBlock Text="AI style - Colorful Button" />
|
||||||
|
<WrapPanel ItemSpacing="4">
|
||||||
|
<TextBlock Text="Theme:" />
|
||||||
|
<Label Theme="{StaticResource TagLabel}" Classes="Colorful Gradient Solid" Content="Light" />
|
||||||
|
<Label Theme="{StaticResource TagLabel}" Classes="Colorful Gradient Solid" Content="Solid" />
|
||||||
|
<Label Theme="{StaticResource TagLabel}" Classes="Colorful Gradient Solid" Content="Outline" />
|
||||||
|
<Label Theme="{StaticResource TagLabel}" Classes="Colorful Gradient Solid" Content="Borderless" />
|
||||||
|
</WrapPanel>
|
||||||
|
<WrapPanel ItemSpacing="4">
|
||||||
|
<TextBlock Text="Classes:" />
|
||||||
|
<Label Theme="{StaticResource TagLabel}" Classes="Colorful Gradient" Content="Colorful Primary" />
|
||||||
|
<Label Theme="{StaticResource TagLabel}" Classes="Colorful Gradient" Content="Colorful Tertiary" />
|
||||||
|
</WrapPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
</HeaderedContentControl.Header>
|
||||||
<DropDownButton Classes="Small" Content="Small" />
|
<StackPanel HorizontalAlignment="Left" Spacing="16">
|
||||||
|
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||||
|
<Button Content="Primary" Classes="Colorful Primary" />
|
||||||
|
<Button Content="Tertiary" Classes="Colorful Tertiary" />
|
||||||
|
<Button Content="Disabled" Classes="Colorful Primary" IsEnabled="False" />
|
||||||
|
</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>
|
||||||
|
|
||||||
|
<HeaderedContentControl
|
||||||
|
Theme="{StaticResource GroupBox}" Header="DropDownButton">
|
||||||
|
<StackPanel HorizontalAlignment="Left" Spacing="16">
|
||||||
|
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||||
<DropDownButton Content="Default" />
|
<DropDownButton Content="Default" />
|
||||||
<DropDownButton Classes="Large" Content="Large" />
|
<DropDownButton Content="Primary" Classes="Primary" />
|
||||||
|
<DropDownButton Content="Secondary" Classes="Secondary" />
|
||||||
|
<DropDownButton Content="Tertiary" Classes="Tertiary" />
|
||||||
|
<DropDownButton Content="Success" Classes="Success" />
|
||||||
|
<DropDownButton Content="Warning" Classes="Warning" />
|
||||||
|
<DropDownButton Content="Danger" Classes="Danger" />
|
||||||
|
</WrapPanel>
|
||||||
|
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||||
|
<DropDownButton Content="Default" Theme="{StaticResource SolidDropDownButton}" />
|
||||||
|
<DropDownButton Content="Primary" Classes="Primary" Theme="{StaticResource SolidDropDownButton}" />
|
||||||
|
<DropDownButton Content="Secondary" Classes="Secondary" Theme="{StaticResource SolidDropDownButton}" />
|
||||||
|
<DropDownButton Content="Tertiary" Classes="Tertiary" Theme="{StaticResource SolidDropDownButton}" />
|
||||||
|
<DropDownButton Content="Success" Classes="Success" Theme="{StaticResource SolidDropDownButton}" />
|
||||||
|
<DropDownButton Content="Warning" Classes="Warning" Theme="{StaticResource SolidDropDownButton}" />
|
||||||
|
<DropDownButton Content="Danger" Classes="Danger" Theme="{StaticResource SolidDropDownButton}" />
|
||||||
|
</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>
|
</StackPanel>
|
||||||
|
</HeaderedContentControl>
|
||||||
|
|
||||||
<TextBlock>SplitButton</TextBlock>
|
<HeaderedContentControl
|
||||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
Theme="{StaticResource GroupBox}" Header="SplitButton">
|
||||||
<SplitButton Content="Primary" />
|
<StackPanel HorizontalAlignment="Left" Spacing="16">
|
||||||
<SplitButton Classes="Secondary" Content="Secondary" />
|
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||||
<SplitButton Classes="Tertiary" Content="Tertiary" />
|
|
||||||
<SplitButton Classes="Success" Content="Success" />
|
|
||||||
<SplitButton Classes="Warning" Content="Warning" />
|
|
||||||
<SplitButton Classes="Danger" Content="Danger" />
|
|
||||||
<SplitButton Classes="Danger" Content="Disabled" IsEnabled="False" />
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
|
||||||
<SplitButton Content="Default" Classes="Success" />
|
|
||||||
<SplitButton Content="Solid" Theme="{DynamicResource SolidSplitButton}" Classes="Success" />
|
|
||||||
<SplitButton Content="Outline" Theme="{DynamicResource OutlineSplitButton}" Classes="Success" />
|
|
||||||
<SplitButton Content="Borderless" Theme="{DynamicResource BorderlessSplitButton}" Classes="Success" />
|
|
||||||
<SplitButton Content="Default" Classes="Success" IsEnabled="False" />
|
|
||||||
<SplitButton Content="Solid" Theme="{DynamicResource SolidSplitButton}" Classes="Success" IsEnabled="False" />
|
|
||||||
<SplitButton Content="Outline" Theme="{DynamicResource OutlineSplitButton}" Classes="Success" IsEnabled="False" />
|
|
||||||
<SplitButton Content="Borderless" Theme="{DynamicResource BorderlessSplitButton}" Classes="Success" IsEnabled="False" />
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
|
||||||
<SplitButton Classes="Small" Content="Small" />
|
|
||||||
<SplitButton Content="Default" />
|
<SplitButton Content="Default" />
|
||||||
<SplitButton Classes="Large" Content="Large" />
|
<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>
|
</StackPanel>
|
||||||
|
</HeaderedContentControl>
|
||||||
|
|
||||||
<TextBlock>ToggleSplitButton</TextBlock>
|
<HeaderedContentControl
|
||||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
Theme="{StaticResource GroupBox}"
|
||||||
<ToggleSplitButton Content="Primary" />
|
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="Secondary" Content="Secondary" />
|
||||||
<ToggleSplitButton Classes="Tertiary" Content="Tertiary" />
|
<ToggleSplitButton Classes="Tertiary" Content="Tertiary" />
|
||||||
<ToggleSplitButton Classes="Success" Content="Success" />
|
<ToggleSplitButton Classes="Success" Content="Success" />
|
||||||
<ToggleSplitButton Classes="Warning" Content="Warning" />
|
<ToggleSplitButton Classes="Warning" Content="Warning" />
|
||||||
<ToggleSplitButton Classes="Danger" Content="Danger" />
|
<ToggleSplitButton Classes="Danger" Content="Danger" />
|
||||||
<ToggleSplitButton Classes="Danger" Content="Disabled" IsEnabled="False" />
|
</WrapPanel>
|
||||||
</StackPanel>
|
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
<ToggleSplitButton Content="Default" IsChecked="True" />
|
||||||
<ToggleSplitButton Content="Default" Classes="Success" />
|
<ToggleSplitButton Classes="Primary" Content="Primary" IsChecked="True" />
|
||||||
<ToggleSplitButton Content="Checked" Classes="Success" IsChecked="True" />
|
<ToggleSplitButton Classes="Secondary" Content="Secondary" IsChecked="True" />
|
||||||
<ToggleSplitButton Content="Default" Classes="Success" IsEnabled="False" />
|
<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" />
|
<ToggleSplitButton Content="Checked" Classes="Success" IsChecked="True" IsEnabled="False" />
|
||||||
</StackPanel>
|
</WrapPanel>
|
||||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||||
<ToggleSplitButton Classes="Small" Content="Small" />
|
<ToggleSplitButton Content="Large" Classes="Large" />
|
||||||
<ToggleSplitButton Content="Default" />
|
<ToggleSplitButton Content="Default" />
|
||||||
<ToggleSplitButton Classes="Large" Content="Large" />
|
<ToggleSplitButton Content="Small" Classes="Small" />
|
||||||
|
</WrapPanel>
|
||||||
</StackPanel>
|
</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>
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
|||||||
@@ -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}"
|
||||||
@@ -31,5 +35,30 @@
|
|||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Text="A.S.I.A" />
|
Text="A.S.I.A" />
|
||||||
</ButtonSpinner>
|
</ButtonSpinner>
|
||||||
|
<ButtonSpinner
|
||||||
|
Height="30"
|
||||||
|
AllowSpin="{Binding #allowSpinCheck.IsChecked}"
|
||||||
|
BorderThickness="1"
|
||||||
|
ShowButtonSpinner="{Binding #showSpinCheck.IsChecked}"
|
||||||
|
Spin="OnSpin"
|
||||||
|
Theme="{StaticResource SplitButtonSpinner}">
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="A.S.I.A" />
|
||||||
|
</ButtonSpinner>
|
||||||
|
<ButtonSpinner
|
||||||
|
Height="30"
|
||||||
|
AllowSpin="{Binding #allowSpinCheck.IsChecked}"
|
||||||
|
ButtonSpinnerLocation="Left"
|
||||||
|
BorderThickness="1"
|
||||||
|
ShowButtonSpinner="{Binding #showSpinCheck.IsChecked}"
|
||||||
|
Spin="OnSpin"
|
||||||
|
Theme="{StaticResource SplitButtonSpinner}">
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="A.S.I.A" />
|
||||||
|
</ButtonSpinner>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -31,7 +29,6 @@ public partial class ButtonSpinnerDemo : UserControl
|
|||||||
|
|
||||||
txtBox.Text = _mountains[value];
|
txtBox.Text = _mountains[value];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly string[] _mountains = new[]
|
private readonly string[] _mountains = new[]
|
||||||
|
|||||||
@@ -33,6 +33,6 @@
|
|||||||
Margin="0,0,0,8"
|
Margin="0,0,0,8"
|
||||||
CustomDateFormatString="ddd, MMM d"
|
CustomDateFormatString="ddd, MMM d"
|
||||||
SelectedDateFormat="Custom" />
|
SelectedDateFormat="Custom" />
|
||||||
<CalendarDatePicker Margin="0,0,0,8" Watermark="Watermark" />
|
<CalendarDatePicker Margin="0,0,0,8" PlaceholderText="Placeholder" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -10,9 +8,4 @@ public partial class CalendarDemo : UserControl
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Interactivity;
|
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
|||||||
69
demo/Semi.Avalonia.Demo/Pages/CarouselPageDemo.axaml
Normal file
69
demo/Semi.Avalonia.Demo/Pages/CarouselPageDemo.axaml
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
<UserControl xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
x:Class="Semi.Avalonia.Demo.Pages.CarouselPageDemo">
|
||||||
|
<DockPanel>
|
||||||
|
<ScrollViewer DockPanel.Dock="Right" Width="220">
|
||||||
|
<StackPanel Margin="12" Spacing="8">
|
||||||
|
<TextBlock Text="Configuration" FontWeight="SemiBold" FontSize="16"
|
||||||
|
Foreground="{DynamicResource SystemControlHighlightAccentBrush}" />
|
||||||
|
|
||||||
|
<TextBlock Text="Navigation" FontWeight="SemiBold" FontSize="13" />
|
||||||
|
<StackPanel Spacing="6">
|
||||||
|
<Button Content="Previous" Click="OnPrevious" HorizontalAlignment="Stretch" />
|
||||||
|
<Button Content="Next" Click="OnNext" HorizontalAlignment="Stretch" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<Separator />
|
||||||
|
|
||||||
|
<TextBlock Text="Status" FontWeight="SemiBold" FontSize="13" />
|
||||||
|
<TextBlock Name="StatusText" Text="Page 1 of 3" Opacity="0.7" TextWrapping="Wrap" />
|
||||||
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
|
|
||||||
|
<Border DockPanel.Dock="Right" Width="1"
|
||||||
|
Background="{DynamicResource SystemControlForegroundBaseMediumLowBrush}" />
|
||||||
|
|
||||||
|
<Border Margin="12"
|
||||||
|
BorderBrush="{DynamicResource SystemControlForegroundBaseMediumLowBrush}"
|
||||||
|
BorderThickness="1" CornerRadius="6" ClipToBounds="True">
|
||||||
|
<Panel>
|
||||||
|
<CarouselPage Name="DemoCarousel"
|
||||||
|
SelectionChanged="OnSelectionChanged">
|
||||||
|
<ContentPage Header="Welcome">
|
||||||
|
<StackPanel Margin="24" Spacing="12"
|
||||||
|
HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||||
|
<TextBlock Text="Welcome" FontSize="28" FontWeight="Bold"
|
||||||
|
HorizontalAlignment="Center" />
|
||||||
|
<TextBlock Text="Swipe left or use the buttons to navigate."
|
||||||
|
TextWrapping="Wrap" Opacity="0.7" TextAlignment="Center" MaxWidth="280" />
|
||||||
|
</StackPanel>
|
||||||
|
</ContentPage>
|
||||||
|
<ContentPage Header="Explore">
|
||||||
|
<StackPanel Margin="24" Spacing="12"
|
||||||
|
HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||||
|
<TextBlock Text="Explore" FontSize="28" FontWeight="Bold"
|
||||||
|
HorizontalAlignment="Center" />
|
||||||
|
<TextBlock Text="CarouselPage supports scroll-based and transition-based navigation modes."
|
||||||
|
TextWrapping="Wrap" Opacity="0.7" TextAlignment="Center" MaxWidth="280" />
|
||||||
|
</StackPanel>
|
||||||
|
</ContentPage>
|
||||||
|
<ContentPage Header="Get Started">
|
||||||
|
<StackPanel Margin="24" Spacing="12"
|
||||||
|
HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||||
|
<TextBlock Text="Get Started" FontSize="28" FontWeight="Bold"
|
||||||
|
HorizontalAlignment="Center" />
|
||||||
|
<TextBlock Text="Use SelectedIndex to jump to any page, or assign a PageTransition for animated switching."
|
||||||
|
TextWrapping="Wrap" Opacity="0.7" TextAlignment="Center" MaxWidth="280" />
|
||||||
|
</StackPanel>
|
||||||
|
</ContentPage>
|
||||||
|
</CarouselPage>
|
||||||
|
<PipsPager HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Bottom" Margin="0,0,0,20"
|
||||||
|
NumberOfPages="3"
|
||||||
|
SelectedPageIndex="{Binding #DemoCarousel.SelectedIndex}" />
|
||||||
|
</Panel>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
|
||||||
|
</DockPanel>
|
||||||
|
</UserControl>
|
||||||
34
demo/Semi.Avalonia.Demo/Pages/CarouselPageDemo.axaml.cs
Normal file
34
demo/Semi.Avalonia.Demo/Pages/CarouselPageDemo.axaml.cs
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Interactivity;
|
||||||
|
|
||||||
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
public partial class CarouselPageDemo : UserControl
|
||||||
|
{
|
||||||
|
public CarouselPageDemo()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnPrevious(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (DemoCarousel.SelectedIndex > 0)
|
||||||
|
DemoCarousel.SelectedIndex--;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnNext(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
var pageCount = (DemoCarousel.Pages as IList)?.Count ?? 0;
|
||||||
|
if (DemoCarousel.SelectedIndex < pageCount - 1)
|
||||||
|
DemoCarousel.SelectedIndex++;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnSelectionChanged(object? sender, PageSelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (StatusText == null)
|
||||||
|
return;
|
||||||
|
var pageCount = (DemoCarousel.Pages as IList)?.Count ?? 0;
|
||||||
|
StatusText.Text = $"Page {DemoCarousel.SelectedIndex + 1} of {pageCount}";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
|||||||
@@ -2,92 +2,90 @@
|
|||||||
x:Class="Semi.Avalonia.Demo.Pages.ColorPickerDemo"
|
x:Class="Semi.Avalonia.Demo.Pages.ColorPickerDemo"
|
||||||
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:colorPicker="clr-namespace:Semi.Avalonia.ColorPicker;assembly=Semi.Avalonia.ColorPicker"
|
|
||||||
xmlns:controls="using:Avalonia.Controls"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
d:DesignHeight="1450"
|
d:DesignHeight="1450"
|
||||||
d:DesignWidth="800"
|
d:DesignWidth="800"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<ScrollViewer>
|
<DockPanel>
|
||||||
<StackPanel Spacing="20">
|
<ScrollViewer DockPanel.Dock="Right" Width="260">
|
||||||
<StackPanel
|
<StackPanel Margin="12" Spacing="8">
|
||||||
VerticalAlignment="Top"
|
<StackPanel.Styles>
|
||||||
Orientation="Horizontal"
|
<Style Selector="ToggleSwitch">
|
||||||
Spacing="20">
|
<Setter Property="OffContent" Value="{Binding $self.OnContent}" />
|
||||||
<ColorView Name="Test" ColorSpectrumShape="Ring" />
|
|
||||||
<ColorView ColorSpectrumShape="Box" />
|
|
||||||
<ColorView Palette="{DynamicResource SemiColorPalette}" />
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel VerticalAlignment="Top" Orientation="Horizontal">
|
|
||||||
<ColorView
|
|
||||||
Name="SimpleColorViewTest"
|
|
||||||
HsvColor="hsv(120,11%,10%)"
|
|
||||||
IsAlphaVisible="True"
|
|
||||||
Theme="{StaticResource SimpleColorView}" />
|
|
||||||
<StackPanel>
|
|
||||||
<TextBlock Text="{Binding #SimpleColorViewTest.HsvColor}" />
|
|
||||||
<TextBlock Text="{Binding #SimpleColorViewTest.Color}" />
|
|
||||||
</StackPanel>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
|
||||||
<ColorPicker Margin="8" ColorSpectrumShape="Ring">
|
|
||||||
<ColorPicker.Palette>
|
|
||||||
<controls:FlatHalfColorPalette />
|
|
||||||
</ColorPicker.Palette>
|
|
||||||
</ColorPicker>
|
|
||||||
<ColorPicker Margin="8" ColorSpectrumShape="Box">
|
|
||||||
<ColorPicker.Palette>
|
|
||||||
<colorPicker:SemiColorLightPalette />
|
|
||||||
</ColorPicker.Palette>
|
|
||||||
</ColorPicker>
|
|
||||||
|
|
||||||
<ColorPicker
|
|
||||||
Margin="8"
|
|
||||||
ColorSpectrumShape="Box"
|
|
||||||
Theme="{DynamicResource HexColorPicker}">
|
|
||||||
<ColorPicker.Palette>
|
|
||||||
<colorPicker:SemiColorLightPalette />
|
|
||||||
</ColorPicker.Palette>
|
|
||||||
</ColorPicker>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel HorizontalAlignment="Left" >
|
|
||||||
<TextBlock Text="Use Style to customize button"></TextBlock>
|
|
||||||
<ColorPicker
|
|
||||||
Margin="8"
|
|
||||||
Width="32"
|
|
||||||
HsvColor="hsv(120,11%,10%)"
|
|
||||||
>
|
|
||||||
<ColorPicker.Content>
|
|
||||||
<Border
|
|
||||||
Margin="1"
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
VerticalAlignment="Stretch"
|
|
||||||
Background="{Binding $parent[ColorPicker].HsvColor,
|
|
||||||
Converter={StaticResource ToBrushConverter}}"
|
|
||||||
CornerRadius="1" />
|
|
||||||
</ColorPicker.Content>
|
|
||||||
<ColorPicker.Styles>
|
|
||||||
<Style Selector="DropDownButton">
|
|
||||||
<Setter Property="Padding" Value="0"/>
|
|
||||||
<Style Selector="^ /template/ PathIcon">
|
|
||||||
<Setter Property="IsVisible" Value="False"/>
|
|
||||||
</Style>
|
</Style>
|
||||||
</Style>
|
</StackPanel.Styles>
|
||||||
</ColorPicker.Styles>
|
<StackPanel Spacing="8">
|
||||||
</ColorPicker>
|
<ToggleSwitch Name="AccentColors" OnContent="IsAccentColorsVisible" IsChecked="True" />
|
||||||
|
<ToggleSwitch Name="AlphaEnabled" OnContent="IsAlphaEnabled" IsChecked="True" />
|
||||||
|
<ToggleSwitch Name="Alpha" OnContent="IsAlphaVisible" IsChecked="True" />
|
||||||
|
<ToggleSwitch Name="ColorComponents" OnContent="IsColorComponentsVisible" IsChecked="True" />
|
||||||
|
<ToggleSwitch Name="ColorModel" OnContent="IsColorModelVisible" IsChecked="True" />
|
||||||
|
<ToggleSwitch Name="ColorPalette" OnContent="IsColorPaletteVisible" IsChecked="True" />
|
||||||
|
<ToggleSwitch Name="ColorPreview" OnContent="IsColorPreviewVisible" IsChecked="True" />
|
||||||
|
<ToggleSwitch Name="ColorSpectrum" OnContent="IsColorSpectrumVisible" IsChecked="True" />
|
||||||
|
<ToggleSwitch Name="ColorSpectrumSlider" OnContent="IsColorSpectrumSliderVisible" IsChecked="True" />
|
||||||
|
<ToggleSwitch Name="ComponentSlider" OnContent="IsComponentSliderVisible" IsChecked="True" />
|
||||||
|
<ToggleSwitch Name="ComponentTextInput" OnContent="IsComponentTextInputVisible" IsChecked="True" />
|
||||||
|
<ToggleSwitch Name="HexInput" OnContent="IsHexInputVisible" IsChecked="True" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
|
||||||
<ColorPicker
|
<Separator />
|
||||||
Margin="8"
|
|
||||||
HsvColor="hsv(120,11%,10%)"
|
<StackPanel Spacing="8">
|
||||||
Theme="{StaticResource SimpleColorPicker}" />
|
<TextBlock>
|
||||||
<ColorPicker
|
<Run Text="Color: " />
|
||||||
Margin="8"
|
<Run Text="{Binding #cv.Color,Mode=OneWay}" />
|
||||||
HsvColor="hsv(120,11%,10%)"
|
</TextBlock>
|
||||||
Theme="{StaticResource HexSimpleColorPicker}" />
|
<TextBlock>
|
||||||
|
<Run Text="HsvColor:" />
|
||||||
|
<Run Text="{Binding #cv.HsvColor,Mode=OneWay}" />
|
||||||
|
</TextBlock>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
|
||||||
|
<Border Margin="12"
|
||||||
|
BorderBrush="{DynamicResource SemiColorBorder}"
|
||||||
|
BorderThickness="1"
|
||||||
|
CornerRadius="6"
|
||||||
|
ClipToBounds="True">
|
||||||
|
<Border.Styles>
|
||||||
|
<Style Selector=":is(ColorView)">
|
||||||
|
<Setter Property="IsAccentColorsVisible" Value="{Binding #AccentColors.IsChecked}" />
|
||||||
|
<Setter Property="IsAlphaEnabled" Value="{Binding #AlphaEnabled.IsChecked}" />
|
||||||
|
<Setter Property="IsAlphaVisible" Value="{Binding #Alpha.IsChecked}" />
|
||||||
|
<Setter Property="IsColorComponentsVisible" Value="{Binding #ColorComponents.IsChecked}" />
|
||||||
|
<Setter Property="IsColorModelVisible" Value="{Binding #ColorModel.IsChecked}" />
|
||||||
|
<Setter Property="IsColorPaletteVisible" Value="{Binding #ColorPalette.IsChecked}" />
|
||||||
|
<Setter Property="IsColorPreviewVisible" Value="{Binding #ColorPreview.IsChecked}" />
|
||||||
|
<Setter Property="IsColorSpectrumVisible" Value="{Binding #ColorSpectrum.IsChecked}" />
|
||||||
|
<Setter Property="IsColorSpectrumSliderVisible" Value="{Binding #ColorSpectrumSlider.IsChecked}" />
|
||||||
|
<Setter Property="IsComponentSliderVisible" Value="{Binding #ComponentSlider.IsChecked}" />
|
||||||
|
<Setter Property="IsComponentTextInputVisible" Value="{Binding #ComponentTextInput.IsChecked}" />
|
||||||
|
<Setter Property="IsHexInputVisible" Value="{Binding #HexInput.IsChecked}" />
|
||||||
|
|
||||||
|
<Setter Property="Color" Value="#39C5BB" />
|
||||||
|
</Style>
|
||||||
|
</Border.Styles>
|
||||||
|
<StackPanel Margin="12" Spacing="12" Orientation="Horizontal">
|
||||||
|
<StackPanel Spacing="12">
|
||||||
|
<TextBlock Text="Default Theme" FontWeight="Bold" FontSize="16" />
|
||||||
|
<ColorView Name="cv" />
|
||||||
|
<StackPanel Spacing="12" Orientation="Horizontal">
|
||||||
|
<ColorPicker />
|
||||||
|
<ColorPicker Theme="{DynamicResource HexColorPicker}" />
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Spacing="12">
|
||||||
|
<TextBlock Text="SimpleColorPicker" FontWeight="Bold" FontSize="16" />
|
||||||
|
<ColorView Theme="{DynamicResource SimpleColorView}" />
|
||||||
|
<StackPanel Spacing="12" Orientation="Horizontal">
|
||||||
|
<ColorPicker Theme="{DynamicResource SimpleColorPicker}" />
|
||||||
|
<ColorPicker Theme="{DynamicResource HexSimpleColorPicker}" />
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
</DockPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
|||||||
@@ -4,13 +4,15 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
|
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>
|
||||||
<pages:ComboBoxDemoViewModel />
|
<vm:ComboBoxDemoViewModel />
|
||||||
</Design.DataContext>
|
</Design.DataContext>
|
||||||
|
<ScrollViewer>
|
||||||
<StackPanel Spacing="20">
|
<StackPanel Spacing="20">
|
||||||
<StackPanel.Styles>
|
<StackPanel.Styles>
|
||||||
<Style Selector="ComboBox">
|
<Style Selector="ComboBox">
|
||||||
@@ -48,5 +50,8 @@
|
|||||||
<ComboBox Width="100" Classes="Bordered" PlaceholderText="Bordered" />
|
<ComboBox Width="100" Classes="Bordered" PlaceholderText="Bordered" />
|
||||||
<ComboBox Width="100" Classes="Bordered" IsEnabled="False" />
|
<ComboBox Width="100" Classes="Bordered" IsEnabled="False" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
<ToggleSwitch Name="toggle" IsChecked="True" Content="IsEditable" />
|
||||||
|
<ComboBox IsEditable="{Binding #toggle.IsChecked}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
using System.Collections.ObjectModel;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
using Semi.Avalonia.Demo.ViewModels;
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -12,8 +11,3 @@ public partial class ComboBoxDemo : UserControl
|
|||||||
this.DataContext = new ComboBoxDemoViewModel();
|
this.DataContext = new ComboBoxDemoViewModel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ComboBoxDemoViewModel : ObservableObject
|
|
||||||
{
|
|
||||||
public ObservableCollection<string> Items { get; set; } = ["Ding", "Otter", "Husky", "Mr.17", "Cass"];
|
|
||||||
}
|
|
||||||
94
demo/Semi.Avalonia.Demo/Pages/CommandBarDemo.axaml
Normal file
94
demo/Semi.Avalonia.Demo/Pages/CommandBarDemo.axaml
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
<UserControl
|
||||||
|
x:Class="Semi.Avalonia.Demo.Pages.CommandBarDemo"
|
||||||
|
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"
|
||||||
|
xmlns:collections="clr-namespace:Avalonia.Collections;assembly=Avalonia.Base"
|
||||||
|
d:DesignHeight="600"
|
||||||
|
d:DesignWidth="800"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
<UserControl.Resources>
|
||||||
|
<collections:AvaloniaList x:TypeArguments="CommandBarDefaultLabelPosition" x:Key="LabelPositionList">
|
||||||
|
<CommandBarDefaultLabelPosition>Bottom</CommandBarDefaultLabelPosition>
|
||||||
|
<CommandBarDefaultLabelPosition>Collapsed</CommandBarDefaultLabelPosition>
|
||||||
|
<CommandBarDefaultLabelPosition>Right</CommandBarDefaultLabelPosition>
|
||||||
|
</collections:AvaloniaList>
|
||||||
|
<collections:AvaloniaList x:TypeArguments="CommandBarOverflowButtonVisibility" x:Key="VisibilityList">
|
||||||
|
<CommandBarOverflowButtonVisibility>Auto</CommandBarOverflowButtonVisibility>
|
||||||
|
<CommandBarOverflowButtonVisibility>Collapsed</CommandBarOverflowButtonVisibility>
|
||||||
|
<CommandBarOverflowButtonVisibility>Visible</CommandBarOverflowButtonVisibility>
|
||||||
|
</collections:AvaloniaList>
|
||||||
|
</UserControl.Resources>
|
||||||
|
<ScrollViewer>
|
||||||
|
<StackPanel Spacing="16">
|
||||||
|
<GroupBox>
|
||||||
|
<GroupBox.Header>
|
||||||
|
<Grid ColumnDefinitions="Auto,*" RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto">
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="0" Grid.Column="0" Text="DefaultLabelPosition" VerticalAlignment="Center" />
|
||||||
|
<ComboBox Grid.Row="0" Grid.Column="1"
|
||||||
|
Name="lc"
|
||||||
|
ItemsSource="{DynamicResource LabelPositionList}"
|
||||||
|
SelectedValue="{x:Static CommandBarDefaultLabelPosition.Bottom}" />
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="1" Grid.Column="0" Text="OverflowButtonVisibility" VerticalAlignment="Center" />
|
||||||
|
<ComboBox Grid.Row="1" Grid.Column="1"
|
||||||
|
Name="btvb"
|
||||||
|
ItemsSource="{DynamicResource VisibilityList}"
|
||||||
|
SelectedValue="{x:Static CommandBarOverflowButtonVisibility.Auto}" />
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="2" Grid.Column="0" Text="IsDynamicOverflowEnabled" VerticalAlignment="Center" />
|
||||||
|
<ToggleSwitch Grid.Row="2" Grid.Column="1" Name="idfe" IsChecked="True" />
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="3" Grid.Column="0" Text="IsOpen" VerticalAlignment="Center" />
|
||||||
|
<ToggleSwitch Grid.Row="3" Grid.Column="1" Name="isop" />
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="4" Grid.Column="0" Text="IsSticky" VerticalAlignment="Center" />
|
||||||
|
<ToggleSwitch Grid.Row="4" Grid.Column="1" Name="isst" />
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="5" Grid.Column="0" Text="Width" VerticalAlignment="Center" />
|
||||||
|
<Slider Grid.Row="5" Grid.Column="1" Name="ws" HorizontalAlignment="Left" Width="500" Minimum="0" Maximum="1000" Value="200" />
|
||||||
|
</Grid>
|
||||||
|
</GroupBox.Header>
|
||||||
|
<CommandBar
|
||||||
|
DefaultLabelPosition="{Binding #lc.SelectedValue}"
|
||||||
|
OverflowButtonVisibility="{Binding #btvb.SelectedValue}"
|
||||||
|
IsDynamicOverflowEnabled="{Binding #idfe.IsChecked}"
|
||||||
|
IsOpen="{Binding #isop.IsChecked}"
|
||||||
|
IsSticky="{Binding #isst.IsChecked}"
|
||||||
|
Width="{Binding #ws.Value}">
|
||||||
|
<CommandBarButton Label="New" Icon="{DynamicResource SemiIconPlus}" />
|
||||||
|
<CommandBarButton Label="Save" Icon="{DynamicResource SemiIconSave}" />
|
||||||
|
<CommandBarSeparator />
|
||||||
|
<CommandBarToggleButton Label="Bold" Icon="{DynamicResource SemiIconBold}" />
|
||||||
|
<CommandBarToggleButton Label="Italic" Icon="{DynamicResource SemiIconItalic}" />
|
||||||
|
<CommandBarToggleButton IsChecked="True" IsEnabled="False" Label="Underline" Icon="{DynamicResource SemiIconUnderline}" />
|
||||||
|
<CommandBarSeparator />
|
||||||
|
<CommandBarButton Label="Share" Icon="{DynamicResource SemiIconShare}" />
|
||||||
|
<CommandBarButton Label="Export" Icon="{DynamicResource SemiIconExport}" />
|
||||||
|
<CommandBarButton Label="Print" Icon="{DynamicResource SemiIconPrint}" />
|
||||||
|
<CommandBarSeparator />
|
||||||
|
<CommandBarButton Label="Delete" Icon="{DynamicResource SemiIconDelete}" />
|
||||||
|
</CommandBar>
|
||||||
|
</GroupBox>
|
||||||
|
|
||||||
|
<!-- With secondary commands (overflow) -->
|
||||||
|
<GroupBox>
|
||||||
|
<GroupBox.Header>
|
||||||
|
<TextBlock Text="CommandBar — With Secondary Commands (overflow)" />
|
||||||
|
</GroupBox.Header>
|
||||||
|
<CommandBar>
|
||||||
|
<CommandBarButton Label="New" Icon="{DynamicResource SemiIconPlus}" />
|
||||||
|
<CommandBarButton Label="Save" Icon="{DynamicResource SemiIconSave}" />
|
||||||
|
<CommandBarButton Label="Share" Icon="{DynamicResource SemiIconShare}" />
|
||||||
|
<CommandBar.SecondaryCommands>
|
||||||
|
<CommandBarButton Label="Export" Icon="{DynamicResource SemiIconExport}" />
|
||||||
|
<CommandBarButton Label="Delete" Icon="{DynamicResource SemiIconDelete}" />
|
||||||
|
</CommandBar.SecondaryCommands>
|
||||||
|
</CommandBar>
|
||||||
|
</GroupBox>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
|
</UserControl>
|
||||||
11
demo/Semi.Avalonia.Demo/Pages/CommandBarDemo.axaml.cs
Normal file
11
demo/Semi.Avalonia.Demo/Pages/CommandBarDemo.axaml.cs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
using Avalonia.Controls;
|
||||||
|
|
||||||
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
public partial class CommandBarDemo : UserControl
|
||||||
|
{
|
||||||
|
public CommandBarDemo()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
54
demo/Semi.Avalonia.Demo/Pages/ContentPageDemo.axaml
Normal file
54
demo/Semi.Avalonia.Demo/Pages/ContentPageDemo.axaml
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
<UserControl
|
||||||
|
x:Class="Semi.Avalonia.Demo.Pages.ContentPageDemo"
|
||||||
|
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="600"
|
||||||
|
d:DesignWidth="800"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
<DockPanel>
|
||||||
|
<ScrollViewer DockPanel.Dock="Right" Width="260">
|
||||||
|
<StackPanel Margin="12" Spacing="8">
|
||||||
|
<TextBlock Text="Configuration" FontWeight="SemiBold" FontSize="16"
|
||||||
|
Foreground="{DynamicResource SemiColorText0}" />
|
||||||
|
<TextBlock Text="ContentPage is the fundamental page type. It hosts a single piece of content and integrates with NavigationPage, TabbedPage, and CarouselPage. The Header property sets the navigation bar title."
|
||||||
|
FontSize="12" Opacity="0.7" TextWrapping="Wrap" />
|
||||||
|
|
||||||
|
<Separator />
|
||||||
|
|
||||||
|
<TextBlock Text="Navigation" FontWeight="SemiBold" />
|
||||||
|
<Button Content="Push Page" HorizontalAlignment="Stretch" Click="OnPush" />
|
||||||
|
<Button Content="Pop Page" HorizontalAlignment="Stretch" Click="OnPop" />
|
||||||
|
<Button Content="Pop to Root" HorizontalAlignment="Stretch" Click="OnPopToRoot" />
|
||||||
|
|
||||||
|
<Separator />
|
||||||
|
|
||||||
|
<TextBlock Text="Key Properties" FontWeight="SemiBold" />
|
||||||
|
<TextBlock Text="• Header: nav bar title (string or Control)" FontSize="12" Opacity="0.8" TextWrapping="Wrap" />
|
||||||
|
<TextBlock Text="• Content: any Avalonia control" FontSize="12" Opacity="0.8" TextWrapping="Wrap" />
|
||||||
|
<TextBlock Text="• Background: page background brush" FontSize="12" Opacity="0.8" TextWrapping="Wrap" />
|
||||||
|
<TextBlock Text="• HorizontalContentAlignment" FontSize="12" Opacity="0.8" />
|
||||||
|
<TextBlock Text="• VerticalContentAlignment" FontSize="12" Opacity="0.8" />
|
||||||
|
<TextBlock Text="• AutomaticallyApplySafeAreaPadding" FontSize="12" Opacity="0.8" />
|
||||||
|
|
||||||
|
<Separator />
|
||||||
|
|
||||||
|
<TextBlock Name="StatusText"
|
||||||
|
Text="Depth: 1 | Current: Root Page"
|
||||||
|
FontSize="11"
|
||||||
|
Opacity="0.7" />
|
||||||
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
|
|
||||||
|
<Border DockPanel.Dock="Right" Width="1" Background="{DynamicResource SemiColorBackground0}" />
|
||||||
|
|
||||||
|
<Border Margin="12"
|
||||||
|
BorderBrush="{DynamicResource SemiColorBorder}"
|
||||||
|
BorderThickness="1"
|
||||||
|
CornerRadius="6"
|
||||||
|
ClipToBounds="True">
|
||||||
|
<NavigationPage Name="DemoNav" />
|
||||||
|
</Border>
|
||||||
|
</DockPanel>
|
||||||
|
</UserControl>
|
||||||
93
demo/Semi.Avalonia.Demo/Pages/ContentPageDemo.axaml.cs
Normal file
93
demo/Semi.Avalonia.Demo/Pages/ContentPageDemo.axaml.cs
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Interactivity;
|
||||||
|
using Avalonia.Media;
|
||||||
|
using Avalonia.Layout;
|
||||||
|
|
||||||
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
public partial class ContentPageDemo : UserControl
|
||||||
|
{
|
||||||
|
private static readonly Color[] PageColors =
|
||||||
|
[
|
||||||
|
Color.FromRgb(0xE3, 0xF2, 0xFD), // blue
|
||||||
|
Color.FromRgb(0xF3, 0xE5, 0xF5), // purple
|
||||||
|
Color.FromRgb(0xE8, 0xF5, 0xE9), // green
|
||||||
|
Color.FromRgb(0xFF, 0xF8, 0xE1), // amber
|
||||||
|
Color.FromRgb(0xFB, 0xE9, 0xE7), // deep orange
|
||||||
|
];
|
||||||
|
|
||||||
|
private int _pageCount;
|
||||||
|
|
||||||
|
public ContentPageDemo()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
Loaded += OnLoaded;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void OnLoaded(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
await DemoNav.PushAsync(MakePage("Root Page", "ContentPage inside a NavigationPage.\nUse the options to navigate."));
|
||||||
|
UpdateStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void OnPush(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
_pageCount++;
|
||||||
|
await DemoNav.PushAsync(MakePage($"Page {_pageCount}", $"ContentPage #{_pageCount}.\nNavigate back using the back button."));
|
||||||
|
UpdateStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void OnPop(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
await DemoNav.PopAsync();
|
||||||
|
UpdateStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void OnPopToRoot(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
await DemoNav.PopToRootAsync();
|
||||||
|
_pageCount = 0;
|
||||||
|
UpdateStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateStatus()
|
||||||
|
{
|
||||||
|
StatusText.Text = $"Depth: {DemoNav.StackDepth} | Current: {DemoNav.CurrentPage?.Header}";
|
||||||
|
}
|
||||||
|
|
||||||
|
private ContentPage MakePage(string header, string body) =>
|
||||||
|
new ContentPage
|
||||||
|
{
|
||||||
|
Header = header,
|
||||||
|
Background = new SolidColorBrush(PageColors[_pageCount % PageColors.Length]),
|
||||||
|
Content = new StackPanel
|
||||||
|
{
|
||||||
|
HorizontalAlignment = HorizontalAlignment.Center,
|
||||||
|
VerticalAlignment = VerticalAlignment.Center,
|
||||||
|
Spacing = 10,
|
||||||
|
Children =
|
||||||
|
{
|
||||||
|
new TextBlock
|
||||||
|
{
|
||||||
|
Text = header,
|
||||||
|
FontSize = 20,
|
||||||
|
FontWeight = FontWeight.SemiBold,
|
||||||
|
HorizontalAlignment = HorizontalAlignment.Center,
|
||||||
|
Foreground = Brushes.Black,
|
||||||
|
},
|
||||||
|
new TextBlock
|
||||||
|
{
|
||||||
|
Text = body,
|
||||||
|
FontSize = 13,
|
||||||
|
Opacity = 0.7,
|
||||||
|
TextWrapping = TextWrapping.Wrap,
|
||||||
|
TextAlignment = TextAlignment.Center,
|
||||||
|
MaxWidth = 260,
|
||||||
|
Foreground = Brushes.Black,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
HorizontalContentAlignment = HorizontalAlignment.Stretch,
|
||||||
|
VerticalContentAlignment = VerticalAlignment.Stretch
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -3,20 +3,19 @@
|
|||||||
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:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Semi.Avalonia.Demo.Pages"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
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>
|
||||||
<TabItem Header="DataGrid">
|
<TabItem Header="DataGrid">
|
||||||
<Grid RowDefinitions="Auto, *">
|
<Grid RowDefinitions="Auto, *">
|
||||||
<StackPanel Grid.Row="0" Orientation="Horizontal">
|
<StackPanel Grid.Row="0" Orientation="Horizontal">
|
||||||
<ToggleSwitch Content="Disable" Name="DisableToggle" />
|
<ToggleSwitch Content="Enable" Name="enable" IsChecked="True" />
|
||||||
<ToggleSwitch Content="ScrollViewerHide" Name="ScrollViewerHide" />
|
<ToggleSwitch Content="Inset Content" Name="inset" />
|
||||||
|
<ToggleSwitch Content="ScrollBar Auto Hide" Name="autohide" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<DataGrid Grid.Row="1"
|
<DataGrid Grid.Row="1"
|
||||||
Margin="8"
|
Margin="8"
|
||||||
@@ -25,8 +24,9 @@
|
|||||||
CanUserSortColumns="True"
|
CanUserSortColumns="True"
|
||||||
HeadersVisibility="All"
|
HeadersVisibility="All"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
ScrollViewer.AllowAutoHide="{Binding #ScrollViewerHide.IsChecked}"
|
Classes.InsetContent="{Binding #inset.IsChecked}"
|
||||||
IsEnabled="{Binding #DisableToggle.IsChecked}"
|
ScrollViewer.AllowAutoHide="{Binding #autohide.IsChecked}"
|
||||||
|
IsEnabled="{Binding #enable.IsChecked}"
|
||||||
ItemsSource="{Binding GridData1}">
|
ItemsSource="{Binding GridData1}">
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
<DataGridTextColumn
|
<DataGridTextColumn
|
||||||
|
|||||||
@@ -1,18 +1,6 @@
|
|||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Linq;
|
|
||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Collections;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Controls.Primitives;
|
|
||||||
using Avalonia.Data;
|
|
||||||
using Avalonia.Input;
|
|
||||||
using Avalonia.Input.Raw;
|
|
||||||
using Avalonia.Markup.Xaml;
|
using Avalonia.Markup.Xaml;
|
||||||
using Avalonia.Threading;
|
|
||||||
using Semi.Avalonia.Demo.ViewModels;
|
using Semi.Avalonia.Demo.ViewModels;
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -10,9 +8,4 @@ public partial class DataValidationErrorsDemo : UserControl
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
using Avalonia.Media;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -11,14 +8,4 @@ public partial class DatePickerDemo : UserControl
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Render(DrawingContext context)
|
|
||||||
{
|
|
||||||
base.Render(context);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
77
demo/Semi.Avalonia.Demo/Pages/DrawerPageDemo.axaml
Normal file
77
demo/Semi.Avalonia.Demo/Pages/DrawerPageDemo.axaml
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
<UserControl
|
||||||
|
x:Class="Semi.Avalonia.Demo.Pages.DrawerPageDemo"
|
||||||
|
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="700"
|
||||||
|
d:DesignWidth="800"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
<DockPanel>
|
||||||
|
<ScrollViewer DockPanel.Dock="Right" Width="260">
|
||||||
|
<StackPanel Margin="12" Spacing="8">
|
||||||
|
<TextBlock Text="Configuration" FontWeight="SemiBold" FontSize="16"
|
||||||
|
Foreground="{DynamicResource SemiColorText0}" />
|
||||||
|
|
||||||
|
<Button Content="Toggle Drawer"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
Click="OnToggleDrawer" />
|
||||||
|
|
||||||
|
<Separator />
|
||||||
|
|
||||||
|
<CheckBox Name="GestureCheck"
|
||||||
|
Content="Gesture Enabled"
|
||||||
|
IsChecked="True"
|
||||||
|
IsCheckedChanged="OnGestureChanged" />
|
||||||
|
|
||||||
|
<ComboBox SelectionChanged="OnLayoutChanged" >
|
||||||
|
<ComboBoxItem Content="CompactOverlay" />
|
||||||
|
<ComboBoxItem Content="CompactInline" />
|
||||||
|
<ComboBoxItem Content="Split" />
|
||||||
|
<ComboBoxItem Content="Overlay" />
|
||||||
|
</ComboBox>
|
||||||
|
|
||||||
|
<Separator />
|
||||||
|
|
||||||
|
<TextBlock Text="Status" FontWeight="SemiBold" FontSize="14" />
|
||||||
|
<TextBlock Name="StatusText"
|
||||||
|
Text="Drawer: Closed"
|
||||||
|
Opacity="0.7"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
|
|
||||||
|
<Border DockPanel.Dock="Right" Width="1" Background="{DynamicResource SemiColorBackground0}" />
|
||||||
|
|
||||||
|
<DrawerPage Name="DemoDrawer"
|
||||||
|
Margin="12"
|
||||||
|
Header="First Look"
|
||||||
|
DrawerLayoutBehavior="Overlay"
|
||||||
|
CompactDrawerLength="80"
|
||||||
|
DrawerLength="250">
|
||||||
|
<DrawerPage.DrawerHeader>
|
||||||
|
<TextBlock Text="Menu" Margin="16" FontSize="18" FontWeight="SemiBold" Foreground="{DynamicResource SemiColorPrimary}" />
|
||||||
|
</DrawerPage.DrawerHeader>
|
||||||
|
<DrawerPage.DrawerFooter>
|
||||||
|
<TextBlock HorizontalAlignment="Center" Text="Powered by IRIHI" Margin="8" />
|
||||||
|
</DrawerPage.DrawerFooter>
|
||||||
|
<DrawerPage.Drawer>
|
||||||
|
<ListBox Name="DrawerMenu" SelectionChanged="OnMenuSelectionChanged">
|
||||||
|
<ListBoxItem Content="Home" />
|
||||||
|
<ListBoxItem Content="Settings" />
|
||||||
|
<ListBoxItem Content="Profile" />
|
||||||
|
<ListBoxItem Content="About" />
|
||||||
|
</ListBox>
|
||||||
|
</DrawerPage.Drawer>
|
||||||
|
<DrawerPage.Content>
|
||||||
|
<ContentPage Header="Home">
|
||||||
|
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Spacing="8">
|
||||||
|
<TextBlock Text="Home Page" FontSize="20" FontWeight="SemiBold" HorizontalAlignment="Center" />
|
||||||
|
<TextBlock Text="Swipe from the left edge or use the hamburger button to open the drawer."
|
||||||
|
FontSize="13" Opacity="0.7" TextWrapping="Wrap" TextAlignment="Center" MaxWidth="300" />
|
||||||
|
</StackPanel>
|
||||||
|
</ContentPage>
|
||||||
|
</DrawerPage.Content>
|
||||||
|
</DrawerPage>
|
||||||
|
</DockPanel>
|
||||||
|
</UserControl>
|
||||||
90
demo/Semi.Avalonia.Demo/Pages/DrawerPageDemo.axaml.cs
Normal file
90
demo/Semi.Avalonia.Demo/Pages/DrawerPageDemo.axaml.cs
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Input.GestureRecognizers;
|
||||||
|
using Avalonia.Interactivity;
|
||||||
|
using Avalonia.Layout;
|
||||||
|
|
||||||
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
public partial class DrawerPageDemo : UserControl
|
||||||
|
{
|
||||||
|
public DrawerPageDemo()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
EnableMouseSwipeGesture(DemoDrawer);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnLoaded(RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
base.OnLoaded(e);
|
||||||
|
DemoDrawer.Opened += OnDrawerStatusChanged;
|
||||||
|
DemoDrawer.Closed += OnDrawerStatusChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnUnloaded(RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
base.OnUnloaded(e);
|
||||||
|
DemoDrawer.Opened -= OnDrawerStatusChanged;
|
||||||
|
DemoDrawer.Closed -= OnDrawerStatusChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDrawerStatusChanged(object? sender, EventArgs e) => UpdateStatus();
|
||||||
|
|
||||||
|
private void OnToggleDrawer(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
DemoDrawer.IsOpen = !DemoDrawer.IsOpen;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnGestureChanged(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
DemoDrawer.IsGestureEnabled = GestureCheck.IsChecked == true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnMenuSelectionChanged(object? sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (DrawerMenu.SelectedItem is ListBoxItem item)
|
||||||
|
{
|
||||||
|
DemoDrawer.Content = new ContentPage
|
||||||
|
{
|
||||||
|
Header = item.Content?.ToString(),
|
||||||
|
Content = new TextBlock
|
||||||
|
{
|
||||||
|
Text = $"{item.Content} page content",
|
||||||
|
FontSize = 16,
|
||||||
|
HorizontalAlignment = HorizontalAlignment.Center,
|
||||||
|
VerticalAlignment = VerticalAlignment.Center,
|
||||||
|
},
|
||||||
|
HorizontalContentAlignment = HorizontalAlignment.Stretch,
|
||||||
|
VerticalContentAlignment = VerticalAlignment.Stretch
|
||||||
|
};
|
||||||
|
DemoDrawer.IsOpen = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateStatus()
|
||||||
|
{
|
||||||
|
StatusText.Text = $"Drawer: {(DemoDrawer.IsOpen ? "Open" : "Closed")}";
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void EnableMouseSwipeGesture(Control control)
|
||||||
|
{
|
||||||
|
var recognizer = control.GestureRecognizers
|
||||||
|
.OfType<SwipeGestureRecognizer>()
|
||||||
|
.FirstOrDefault();
|
||||||
|
|
||||||
|
recognizer?.IsMouseEnabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnLayoutChanged(object? sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
DemoDrawer.DrawerLayoutBehavior = (sender as ComboBox)?.SelectedIndex switch
|
||||||
|
{
|
||||||
|
0 => DrawerLayoutBehavior.CompactOverlay,
|
||||||
|
1 => DrawerLayoutBehavior.CompactInline,
|
||||||
|
2 => DrawerLayoutBehavior.Split,
|
||||||
|
3 => DrawerLayoutBehavior.Overlay,
|
||||||
|
_ => DrawerLayoutBehavior.CompactOverlay
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.LogicalTree;
|
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -9,9 +8,4 @@ public partial class GridSplitterDemo : UserControl
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -36,10 +36,20 @@
|
|||||||
<HyperlinkButton HorizontalAlignment="Right" Content="更多" />
|
<HyperlinkButton HorizontalAlignment="Right" Content="更多" />
|
||||||
</Panel>
|
</Panel>
|
||||||
</HeaderedContentControl.Header>
|
</HeaderedContentControl.Header>
|
||||||
<HeaderedContentControl.Content>
|
|
||||||
<SelectableTextBlock Text="Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统。设计系统包含设计语言以及一整套可复用的前端组件,帮助设计师与开发者更容易地打造高质量的、用户体验一致的、符合设计规范的 Web 应用。" />
|
<SelectableTextBlock Text="Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统。设计系统包含设计语言以及一整套可复用的前端组件,帮助设计师与开发者更容易地打造高质量的、用户体验一致的、符合设计规范的 Web 应用。" />
|
||||||
</HeaderedContentControl.Content>
|
|
||||||
</HeaderedContentControl>
|
</HeaderedContentControl>
|
||||||
|
<TextBlock>Real GroupBox</TextBlock>
|
||||||
|
<GroupBox
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
MaxWidth="360">
|
||||||
|
<HeaderedContentControl.Header>
|
||||||
|
<Panel>
|
||||||
|
<SelectableTextBlock Text="Semi Design" />
|
||||||
|
<HyperlinkButton HorizontalAlignment="Right" Content="更多" />
|
||||||
|
</Panel>
|
||||||
|
</HeaderedContentControl.Header>
|
||||||
|
<SelectableTextBlock Text="Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统。设计系统包含设计语言以及一整套可复用的前端组件,帮助设计师与开发者更容易地打造高质量的、用户体验一致的、符合设计规范的 Web 应用。" />
|
||||||
|
</GroupBox>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<UserControl xmlns="https://github.com/avaloniaui"
|
<UserControl xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
@@ -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 />
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Input.Platform;
|
||||||
using Semi.Avalonia.Demo.ViewModels;
|
using Semi.Avalonia.Demo.ViewModels;
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
using System;
|
|
||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
|||||||
@@ -16,15 +16,40 @@
|
|||||||
Margin="8"
|
Margin="8"
|
||||||
Classes="ClearButton"
|
Classes="ClearButton"
|
||||||
Text="{Binding SearchText}"
|
Text="{Binding SearchText}"
|
||||||
Watermark="Input Icon Name" />
|
PlaceholderText="Input Icon Name" />
|
||||||
|
|
||||||
<TabControl Grid.Row="1">
|
<TabControl
|
||||||
<TabItem Header="Filled Icons">
|
Grid.Row="1"
|
||||||
|
Theme="{StaticResource LineTabControl}"
|
||||||
|
ItemsSource="{Binding IconTabs}">
|
||||||
|
<TabControl.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<WrapPanel ItemSpacing="5">
|
||||||
|
<TextBlock Text="{Binding Header}" />
|
||||||
|
<Label
|
||||||
|
Theme="{StaticResource TagLabel}"
|
||||||
|
Classes="Purple"
|
||||||
|
IsVisible="{Binding Header,
|
||||||
|
Converter={x:Static ObjectConverters.Equal},
|
||||||
|
ConverterParameter='AI Icons'}"
|
||||||
|
Content="New" />
|
||||||
|
</WrapPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
</TabControl.ItemTemplate>
|
||||||
|
|
||||||
|
<TabControl.ContentTemplate>
|
||||||
|
<DataTemplate DataType="vm:IconTab">
|
||||||
<ScrollViewer>
|
<ScrollViewer>
|
||||||
<ItemsControl ItemsSource="{Binding FilteredFilledIcons}">
|
<ItemsControl
|
||||||
|
Margin="0 10"
|
||||||
|
ItemsSource="{Binding IconItems}">
|
||||||
<ItemsControl.ItemsPanel>
|
<ItemsControl.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
<WrapPanel />
|
<WrapPanel
|
||||||
|
ItemWidth="200"
|
||||||
|
ItemHeight="120"
|
||||||
|
ItemSpacing="10"
|
||||||
|
LineSpacing="10" />
|
||||||
</ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
</ItemsControl.ItemsPanel>
|
</ItemsControl.ItemsPanel>
|
||||||
<ItemsControl.ItemTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
@@ -32,9 +57,8 @@
|
|||||||
<Button Theme="{DynamicResource OutlineButton}"
|
<Button Theme="{DynamicResource OutlineButton}"
|
||||||
Classes="Tertiary"
|
Classes="Tertiary"
|
||||||
Padding="0"
|
Padding="0"
|
||||||
Margin="10"
|
HorizontalAlignment="Stretch"
|
||||||
Width="200"
|
VerticalAlignment="Stretch"
|
||||||
Height="120"
|
|
||||||
Click="Button_Clicked">
|
Click="Button_Clicked">
|
||||||
<StackPanel Spacing="8">
|
<StackPanel Spacing="8">
|
||||||
<PathIcon
|
<PathIcon
|
||||||
@@ -53,43 +77,8 @@
|
|||||||
</ItemsControl.ItemTemplate>
|
</ItemsControl.ItemTemplate>
|
||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</TabItem>
|
|
||||||
|
|
||||||
<TabItem Header="Stroked Icons">
|
|
||||||
<ScrollViewer>
|
|
||||||
<ItemsControl ItemsSource="{Binding FilteredStrokedIcons}">
|
|
||||||
<ItemsControl.ItemsPanel>
|
|
||||||
<ItemsPanelTemplate>
|
|
||||||
<WrapPanel />
|
|
||||||
</ItemsPanelTemplate>
|
|
||||||
</ItemsControl.ItemsPanel>
|
|
||||||
<ItemsControl.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<Button Theme="{DynamicResource OutlineButton}"
|
|
||||||
Classes="Tertiary"
|
|
||||||
Padding="0"
|
|
||||||
Margin="10"
|
|
||||||
Width="200"
|
|
||||||
Height="120"
|
|
||||||
Click="Button_Clicked">
|
|
||||||
<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>
|
</DataTemplate>
|
||||||
</ItemsControl.ItemTemplate>
|
</TabControl.ContentTemplate>
|
||||||
</ItemsControl>
|
|
||||||
</ScrollViewer>
|
|
||||||
</TabItem>
|
|
||||||
</TabControl>
|
</TabControl>
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -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,13 +153,14 @@
|
|||||||
</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">
|
||||||
|
<StackPanel Spacing="4">
|
||||||
<Label Classes="Red" Theme="{StaticResource TagLabel}">Red</Label>
|
<Label Classes="Red" Theme="{StaticResource TagLabel}">Red</Label>
|
||||||
<Label Classes="Pink" Theme="{StaticResource TagLabel}">Pink</Label>
|
<Label Classes="Pink" Theme="{StaticResource TagLabel}">Pink</Label>
|
||||||
<Label Classes="Purple" Theme="{StaticResource TagLabel}">Purple</Label>
|
<Label Classes="Purple" Theme="{StaticResource TagLabel}">Purple</Label>
|
||||||
@@ -180,8 +178,8 @@
|
|||||||
<Label Classes="Orange" Theme="{StaticResource TagLabel}">Orange</Label>
|
<Label Classes="Orange" Theme="{StaticResource TagLabel}">Orange</Label>
|
||||||
<Label Classes="Grey" Theme="{StaticResource TagLabel}">Grey</Label>
|
<Label Classes="Grey" Theme="{StaticResource TagLabel}">Grey</Label>
|
||||||
<Label Classes="White" Theme="{StaticResource TagLabel}">White</Label>
|
<Label Classes="White" Theme="{StaticResource TagLabel}">White</Label>
|
||||||
</WrapPanel>
|
</StackPanel>
|
||||||
<WrapPanel>
|
<StackPanel Spacing="4">
|
||||||
<Label Classes="Ghost Red" Theme="{StaticResource TagLabel}">Red</Label>
|
<Label Classes="Ghost Red" Theme="{StaticResource TagLabel}">Red</Label>
|
||||||
<Label Classes="Ghost Pink" Theme="{StaticResource TagLabel}">Pink</Label>
|
<Label Classes="Ghost Pink" Theme="{StaticResource TagLabel}">Pink</Label>
|
||||||
<Label Classes="Ghost Purple" Theme="{StaticResource TagLabel}">Purple</Label>
|
<Label Classes="Ghost Purple" Theme="{StaticResource TagLabel}">Purple</Label>
|
||||||
@@ -199,8 +197,8 @@
|
|||||||
<Label Classes="Ghost Orange" Theme="{StaticResource TagLabel}">Orange</Label>
|
<Label Classes="Ghost Orange" Theme="{StaticResource TagLabel}">Orange</Label>
|
||||||
<Label Classes="Ghost Grey" Theme="{StaticResource TagLabel}">Grey</Label>
|
<Label Classes="Ghost Grey" Theme="{StaticResource TagLabel}">Grey</Label>
|
||||||
<Label Classes="Ghost White" Theme="{StaticResource TagLabel}">White</Label>
|
<Label Classes="Ghost White" Theme="{StaticResource TagLabel}">White</Label>
|
||||||
</WrapPanel>
|
</StackPanel>
|
||||||
<WrapPanel>
|
<StackPanel Spacing="4">
|
||||||
<Label Classes="Solid Red" Theme="{StaticResource TagLabel}">Red</Label>
|
<Label Classes="Solid Red" Theme="{StaticResource TagLabel}">Red</Label>
|
||||||
<Label Classes="Solid Pink" Theme="{StaticResource TagLabel}">Pink</Label>
|
<Label Classes="Solid Pink" Theme="{StaticResource TagLabel}">Pink</Label>
|
||||||
<Label Classes="Solid Purple" Theme="{StaticResource TagLabel}">Purple</Label>
|
<Label Classes="Solid Purple" Theme="{StaticResource TagLabel}">Purple</Label>
|
||||||
@@ -218,7 +216,26 @@
|
|||||||
<Label Classes="Solid Orange" Theme="{StaticResource TagLabel}">Orange</Label>
|
<Label Classes="Solid Orange" Theme="{StaticResource TagLabel}">Orange</Label>
|
||||||
<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>
|
</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>
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -11,8 +9,4 @@ public partial class MenuDemo : UserControl
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
66
demo/Semi.Avalonia.Demo/Pages/NavigationDemoHelper.cs
Normal file
66
demo/Semi.Avalonia.Demo/Pages/NavigationDemoHelper.cs
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Layout;
|
||||||
|
using Avalonia.Media;
|
||||||
|
|
||||||
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Shared helpers for ControlCatalog demo pages.
|
||||||
|
/// </summary>
|
||||||
|
internal static class NavigationDemoHelper
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Pastel background brushes cycled by page index.
|
||||||
|
/// </summary>
|
||||||
|
internal static readonly IBrush[] PageBrushes =
|
||||||
|
[
|
||||||
|
new SolidColorBrush(Color.Parse("#BBDEFB")),
|
||||||
|
new SolidColorBrush(Color.Parse("#C8E6C9")),
|
||||||
|
new SolidColorBrush(Color.Parse("#FFE0B2")),
|
||||||
|
new SolidColorBrush(Color.Parse("#E1BEE7")),
|
||||||
|
new SolidColorBrush(Color.Parse("#FFCDD2")),
|
||||||
|
new SolidColorBrush(Color.Parse("#B2EBF2"))
|
||||||
|
];
|
||||||
|
|
||||||
|
internal static IBrush GetPageBrush(int index) =>
|
||||||
|
PageBrushes[(index % PageBrushes.Length + PageBrushes.Length) % PageBrushes.Length];
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a simple demo ContentPage with a centered title and subtitle.
|
||||||
|
/// </summary>
|
||||||
|
internal static ContentPage MakePage(string header, string body, int colorIndex) =>
|
||||||
|
new()
|
||||||
|
{
|
||||||
|
Header = header,
|
||||||
|
Background = GetPageBrush(colorIndex),
|
||||||
|
Content = new StackPanel
|
||||||
|
{
|
||||||
|
HorizontalAlignment = HorizontalAlignment.Center,
|
||||||
|
VerticalAlignment = VerticalAlignment.Center,
|
||||||
|
Spacing = 8,
|
||||||
|
Children =
|
||||||
|
{
|
||||||
|
new TextBlock
|
||||||
|
{
|
||||||
|
Text = header,
|
||||||
|
FontSize = 20,
|
||||||
|
FontWeight = FontWeight.SemiBold,
|
||||||
|
HorizontalAlignment = HorizontalAlignment.Center,
|
||||||
|
Foreground = Brushes.Black,
|
||||||
|
},
|
||||||
|
new TextBlock
|
||||||
|
{
|
||||||
|
Text = body,
|
||||||
|
FontSize = 13,
|
||||||
|
Opacity = 0.7,
|
||||||
|
TextWrapping = TextWrapping.Wrap,
|
||||||
|
TextAlignment = TextAlignment.Center,
|
||||||
|
MaxWidth = 260,
|
||||||
|
Foreground = Brushes.Black,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
HorizontalContentAlignment = HorizontalAlignment.Stretch,
|
||||||
|
VerticalContentAlignment = VerticalAlignment.Stretch
|
||||||
|
};
|
||||||
|
}
|
||||||
68
demo/Semi.Avalonia.Demo/Pages/NavigationPageDemo.axaml
Normal file
68
demo/Semi.Avalonia.Demo/Pages/NavigationPageDemo.axaml
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
<UserControl
|
||||||
|
x:Class="Semi.Avalonia.Demo.Pages.NavigationPageDemo"
|
||||||
|
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="700"
|
||||||
|
d:DesignWidth="800"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
<ScrollViewer>
|
||||||
|
<DockPanel>
|
||||||
|
<ScrollViewer DockPanel.Dock="Right" Width="260">
|
||||||
|
<StackPanel Margin="12" Spacing="8">
|
||||||
|
<TextBlock Text="Configuration" FontWeight="SemiBold" FontSize="16" />
|
||||||
|
<TextBlock Text="Navigation" FontWeight="SemiBold" FontSize="13" />
|
||||||
|
|
||||||
|
<Button Content="Push Page"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
Click="OnPush" />
|
||||||
|
<Button Content="Pop"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
Click="OnPop" />
|
||||||
|
<Button Content="Pop to Root"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
Click="OnPopToRoot" />
|
||||||
|
|
||||||
|
<Separator />
|
||||||
|
|
||||||
|
<TextBlock Text="Options" FontWeight="SemiBold" FontSize="14" />
|
||||||
|
|
||||||
|
<CheckBox Name="HasNavBarCheck"
|
||||||
|
Content="Has Navigation Bar"
|
||||||
|
IsChecked="True"
|
||||||
|
IsCheckedChanged="OnHasNavBarChanged" />
|
||||||
|
<CheckBox Name="HasBackButtonCheck"
|
||||||
|
Content="Has Back Button"
|
||||||
|
IsChecked="True"
|
||||||
|
IsCheckedChanged="OnHasBackButonChanged" />
|
||||||
|
|
||||||
|
<Separator />
|
||||||
|
|
||||||
|
<TextBlock Text="Status" FontWeight="SemiBold" FontSize="14" />
|
||||||
|
<TextBlock Name="StatusText"
|
||||||
|
Text="Depth: 1"
|
||||||
|
Opacity="0.7"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
<TextBlock Name="HeaderText"
|
||||||
|
Text="Current: Home"
|
||||||
|
Opacity="0.7"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
<ToggleSwitch Content="Large" Name="large" />
|
||||||
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
|
|
||||||
|
<Border DockPanel.Dock="Right" Width="1" Background="{DynamicResource SemiColorBackground0}" />
|
||||||
|
|
||||||
|
<Border Margin="12"
|
||||||
|
BorderBrush="{DynamicResource SemiColorBorder}"
|
||||||
|
BorderThickness="1"
|
||||||
|
CornerRadius="6"
|
||||||
|
ClipToBounds="True">
|
||||||
|
<NavigationPage
|
||||||
|
Name="DemoNav"
|
||||||
|
Classes.Large="{Binding #large.IsChecked}" />
|
||||||
|
</Border>
|
||||||
|
</DockPanel>
|
||||||
|
</ScrollViewer>
|
||||||
|
</UserControl>
|
||||||
66
demo/Semi.Avalonia.Demo/Pages/NavigationPageDemo.axaml.cs
Normal file
66
demo/Semi.Avalonia.Demo/Pages/NavigationPageDemo.axaml.cs
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Interactivity;
|
||||||
|
|
||||||
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
public partial class NavigationPageDemo : UserControl
|
||||||
|
{
|
||||||
|
private int _pageCount;
|
||||||
|
|
||||||
|
public NavigationPageDemo()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
Loaded += OnLoaded;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void OnLoaded(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
await DemoNav.PushAsync(NavigationDemoHelper.MakePage("Home", "Welcome!\nUse the buttons to push and pop pages.", 0), null);
|
||||||
|
UpdateStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void OnPush(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
_pageCount++;
|
||||||
|
var page = NavigationDemoHelper.MakePage($"Page {_pageCount}", $"This is page {_pageCount}.", _pageCount);
|
||||||
|
NavigationPage.SetHasNavigationBar(page, HasNavBarCheck.IsChecked == true);
|
||||||
|
NavigationPage.SetHasBackButton(page, HasBackButtonCheck.IsChecked == true);
|
||||||
|
await DemoNav.PushAsync(page);
|
||||||
|
UpdateStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void OnPop(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
await DemoNav.PopAsync();
|
||||||
|
UpdateStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void OnPopToRoot(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
await DemoNav.PopToRootAsync();
|
||||||
|
_pageCount = 0;
|
||||||
|
UpdateStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnHasNavBarChanged(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (DemoNav == null)
|
||||||
|
return;
|
||||||
|
if (DemoNav.CurrentPage != null)
|
||||||
|
NavigationPage.SetHasNavigationBar(DemoNav.CurrentPage, HasNavBarCheck.IsChecked == true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnHasBackButonChanged(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (DemoNav == null)
|
||||||
|
return;
|
||||||
|
if (DemoNav.CurrentPage != null)
|
||||||
|
NavigationPage.SetHasBackButton(DemoNav.CurrentPage, HasBackButtonCheck.IsChecked == true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateStatus()
|
||||||
|
{
|
||||||
|
StatusText.Text = $"Depth: {DemoNav.StackDepth}";
|
||||||
|
HeaderText.Text = $"Current: {DemoNav.CurrentPage?.Header ?? "(none)"}";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -27,6 +27,7 @@ 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);
|
||||||
|
if (_manager is not null)
|
||||||
_manager.Position = t;
|
_manager.Position = t;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,15 +28,15 @@
|
|||||||
<NumericUpDown
|
<NumericUpDown
|
||||||
Width="100"
|
Width="100"
|
||||||
Classes="Large"
|
Classes="Large"
|
||||||
Watermark="Large"
|
PlaceholderText="Large"
|
||||||
ButtonSpinnerLocation="Left" />
|
ButtonSpinnerLocation="Left" />
|
||||||
<NumericUpDown
|
<NumericUpDown
|
||||||
Width="100"
|
Width="100"
|
||||||
Watermark="Default"
|
PlaceholderText="Default"
|
||||||
ShowButtonSpinner="False" />
|
ShowButtonSpinner="False" />
|
||||||
<NumericUpDown
|
<NumericUpDown
|
||||||
Width="100"
|
Width="100"
|
||||||
Watermark="Small"
|
PlaceholderText="Small"
|
||||||
Classes="Small" />
|
Classes="Small" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
@@ -52,5 +52,10 @@
|
|||||||
<NumericUpDown Width="100" ButtonSpinnerLocation="Left" />
|
<NumericUpDown Width="100" ButtonSpinnerLocation="Left" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="Split" />
|
||||||
|
<NumericUpDown Classes="Split" Width="300" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -11,8 +9,4 @@ public partial class NumericUpDownDemo : UserControl
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -41,9 +41,9 @@
|
|||||||
<Image.Source>
|
<Image.Source>
|
||||||
<DrawingImage>
|
<DrawingImage>
|
||||||
<DrawingGroup>
|
<DrawingGroup>
|
||||||
<GeometryDrawing Brush="#8B44AC" Geometry="M74.8535 85.8231C75.0263 85.8231 75.1954 85.8231 75.3679 85.8231C80.7347 85.8231 85.1439 81.8027 85.7614 76.6019L85.8357 41.7604C85.2255 18.5931 66.2537 0 42.9393 0C19.2399 0 0.02771 19.2122 0.02771 42.9116C0.02771 66.3573 18.8309 85.418 42.18 85.8231H74.8535Z" />
|
<GeometryDrawing Brush="#0D6EFD" Geometry="M74.8535 85.8231C75.0263 85.8231 75.1954 85.8231 75.3679 85.8231C80.7347 85.8231 85.1439 81.8027 85.7614 76.6019L85.8357 41.7604C85.2255 18.5931 66.2537 0 42.9393 0C19.2399 0 0.02771 19.2122 0.02771 42.9116C0.02771 66.3573 18.8309 85.418 42.18 85.8231H74.8535Z" />
|
||||||
<GeometryDrawing Brush="#F9F9FB" Geometry="M43.0585 14.6143C29.5513 14.6143 18.2555 24.082 15.4454 36.7432C18.1357 37.4975 20.1087 39.9679 20.1087 42.8992C20.1087 45.8305 18.1357 48.301 15.4454 49.0552C18.2555 61.7164 29.5513 71.1842 43.0585 71.1842C47.9754 71.1842 52.5993 69.9296 56.6276 67.723V70.9926H71.3435V44.0716C71.3569 43.7138 71.3435 43.2603 71.3435 42.8992C71.3435 27.2779 58.6799 14.6143 43.0585 14.6143ZM29.5096 42.8992C29.5096 35.4164 35.5757 29.3503 43.0585 29.3503C50.5414 29.3503 56.6074 35.4164 56.6074 42.8992C56.6074 50.3821 50.5414 56.4481 43.0585 56.4481C35.5757 56.4481 29.5096 50.3821 29.5096 42.8992Z" />
|
<GeometryDrawing Brush="White" Geometry="M43.0585 14.6143C29.5513 14.6143 18.2555 24.082 15.4454 36.7432C18.1357 37.4975 20.1087 39.9679 20.1087 42.8992C20.1087 45.8305 18.1357 48.301 15.4454 49.0552C18.2555 61.7164 29.5513 71.1842 43.0585 71.1842C47.9754 71.1842 52.5993 69.9296 56.6276 67.723V70.9926H71.3435V44.0716C71.3569 43.7138 71.3435 43.2603 71.3435 42.8992C71.3435 27.2779 58.6799 14.6143 43.0585 14.6143ZM29.5096 42.8992C29.5096 35.4164 35.5757 29.3503 43.0585 29.3503C50.5414 29.3503 56.6074 35.4164 56.6074 42.8992C56.6074 50.3821 50.5414 56.4481 43.0585 56.4481C35.5757 56.4481 29.5096 50.3821 29.5096 42.8992Z" />
|
||||||
<GeometryDrawing Brush="#F9F9FB" Geometry="M18.105 42.8805C18.105 45.3803 16.0785 47.4068 13.5787 47.4068C11.0789 47.4068 9.05237 45.3803 9.05237 42.8805C9.05237 40.3807 11.0789 38.3542 13.5787 38.3542C16.0785 38.3542 18.105 40.3807 18.105 42.8805Z" />
|
<GeometryDrawing Brush="White" Geometry="M18.105 42.8805C18.105 45.3803 16.0785 47.4068 13.5787 47.4068C11.0789 47.4068 9.05237 45.3803 9.05237 42.8805C9.05237 40.3807 11.0789 38.3542 13.5787 38.3542C16.0785 38.3542 18.105 40.3807 18.105 42.8805Z" />
|
||||||
</DrawingGroup>
|
</DrawingGroup>
|
||||||
</DrawingImage>
|
</DrawingImage>
|
||||||
</Image.Source>
|
</Image.Source>
|
||||||
@@ -234,7 +234,7 @@
|
|||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Palette="{DynamicResource SemiColorPalette}"
|
Palette="{DynamicResource SemiColorPalette}"
|
||||||
SelectedIndex="2"
|
SelectedIndex="2"
|
||||||
Color="#8B44AC" />
|
Color="#0D6EFD" />
|
||||||
<StackPanel Width="300" Margin="8">
|
<StackPanel Width="300" Margin="8">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<Slider
|
<Slider
|
||||||
@@ -348,17 +348,17 @@
|
|||||||
Classes="H5"
|
Classes="H5"
|
||||||
Text="Start to install"
|
Text="Start to install"
|
||||||
Theme="{DynamicResource TitleTextBlock}" />
|
Theme="{DynamicResource TitleTextBlock}" />
|
||||||
<TabControl Padding="8">
|
<TabControl Theme="{StaticResource LineTabControl}">
|
||||||
<TabItem Header="Main">
|
<TabItem Header="Main">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock Text="Install via nuget: " />
|
<TextBlock Text="Install via nuget: " />
|
||||||
<Border Margin="0,16" Classes="CodeBlock">
|
<Border Margin="0,16" Classes="CodeBlock">
|
||||||
<SelectableTextBlock FontFamily="Consolas" Text="{Binding $parent[local:Overview].MainInstall}" />
|
<SelectableTextBlock Text="{Binding $parent[local:Overview].MainInstall}" />
|
||||||
</Border>
|
</Border>
|
||||||
<TextBlock Text="Reference styles: " />
|
<TextBlock Text="Reference styles: " />
|
||||||
<Border Margin="0,16" Classes="CodeBlock">
|
<Border Margin="0,16" Classes="CodeBlock">
|
||||||
<SelectableTextBlock
|
<SelectableTextBlock
|
||||||
FontFamily="Consolas"
|
|
||||||
Text="{Binding $parent[local:Overview].MainStyle}"
|
Text="{Binding $parent[local:Overview].MainStyle}"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
</Border>
|
</Border>
|
||||||
@@ -368,12 +368,12 @@
|
|||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock Text="Install via nuget: " />
|
<TextBlock Text="Install via nuget: " />
|
||||||
<Border Margin="0,16" Classes="CodeBlock">
|
<Border Margin="0,16" Classes="CodeBlock">
|
||||||
<SelectableTextBlock FontFamily="Consolas" Text="{Binding $parent[local:Overview].ColorPickerInstall}" />
|
<SelectableTextBlock Text="{Binding $parent[local:Overview].ColorPickerInstall}" />
|
||||||
</Border>
|
</Border>
|
||||||
<TextBlock Text="Reference styles: " />
|
<TextBlock Text="Reference styles: " />
|
||||||
<Border Margin="0,16" Classes="CodeBlock">
|
<Border Margin="0,16" Classes="CodeBlock">
|
||||||
<SelectableTextBlock
|
<SelectableTextBlock
|
||||||
FontFamily="Consolas"
|
|
||||||
Text="{Binding $parent[local:Overview].ColorPickerStyle}"
|
Text="{Binding $parent[local:Overview].ColorPickerStyle}"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
</Border>
|
</Border>
|
||||||
@@ -383,12 +383,12 @@
|
|||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock Text="Install via nuget: " />
|
<TextBlock Text="Install via nuget: " />
|
||||||
<Border Margin="0,16" Classes="CodeBlock">
|
<Border Margin="0,16" Classes="CodeBlock">
|
||||||
<SelectableTextBlock FontFamily="Consolas" Text="{Binding $parent[local:Overview].DataGridInstall}" />
|
<SelectableTextBlock Text="{Binding $parent[local:Overview].DataGridInstall}" />
|
||||||
</Border>
|
</Border>
|
||||||
<TextBlock Text="Reference styles: " />
|
<TextBlock Text="Reference styles: " />
|
||||||
<Border Margin="0,16" Classes="CodeBlock">
|
<Border Margin="0,16" Classes="CodeBlock">
|
||||||
<SelectableTextBlock
|
<SelectableTextBlock
|
||||||
FontFamily="Consolas"
|
|
||||||
Text="{Binding $parent[local:Overview].DataGridStyle}"
|
Text="{Binding $parent[local:Overview].DataGridStyle}"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
</Border>
|
</Border>
|
||||||
@@ -398,17 +398,62 @@
|
|||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock Text="Install via nuget: " />
|
<TextBlock Text="Install via nuget: " />
|
||||||
<Border Margin="0,16" Classes="CodeBlock">
|
<Border Margin="0,16" Classes="CodeBlock">
|
||||||
<SelectableTextBlock FontFamily="Consolas" Text="{Binding $parent[local:Overview].TreeDataGridInstall}" />
|
<SelectableTextBlock Text="{Binding $parent[local:Overview].TreeDataGridInstall}" />
|
||||||
</Border>
|
</Border>
|
||||||
<TextBlock Text="Reference styles: " />
|
<TextBlock Text="Reference styles: " />
|
||||||
<Border Margin="0,16" Classes="CodeBlock">
|
<Border Margin="0,16" Classes="CodeBlock">
|
||||||
<SelectableTextBlock
|
<SelectableTextBlock
|
||||||
FontFamily="Consolas"
|
|
||||||
Text="{Binding $parent[local:Overview].TreeDataGridStyle}"
|
Text="{Binding $parent[local:Overview].TreeDataGridStyle}"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
</Border>
|
</Border>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
<TabItem Header="Dock">
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="Install via nuget: " />
|
||||||
|
<Border Margin="0,16" Classes="CodeBlock">
|
||||||
|
<SelectableTextBlock Text="{Binding $parent[local:Overview].DockInstall}" />
|
||||||
|
</Border>
|
||||||
|
<TextBlock Text="Reference styles: " />
|
||||||
|
<Border Margin="0,16" Classes="CodeBlock">
|
||||||
|
<SelectableTextBlock
|
||||||
|
|
||||||
|
Text="{Binding $parent[local:Overview].DockStyle}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
</Border>
|
||||||
|
</StackPanel>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="Tabalonia">
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="Install via nuget: " />
|
||||||
|
<Border Margin="0,16" Classes="CodeBlock">
|
||||||
|
<SelectableTextBlock Text="{Binding $parent[local:Overview].TabaloniaInstall}" />
|
||||||
|
</Border>
|
||||||
|
<TextBlock Text="Reference styles: " />
|
||||||
|
<Border Margin="0,16" Classes="CodeBlock">
|
||||||
|
<SelectableTextBlock
|
||||||
|
|
||||||
|
Text="{Binding $parent[local:Overview].TabaloniaStyle}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
</Border>
|
||||||
|
</StackPanel>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="AvaloniaEdit">
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="Install via nuget: " />
|
||||||
|
<Border Margin="0,16" Classes="CodeBlock">
|
||||||
|
<SelectableTextBlock Text="{Binding $parent[local:Overview].AvaloniaEditInstall}" />
|
||||||
|
</Border>
|
||||||
|
<TextBlock Text="Reference styles: " />
|
||||||
|
<Border Margin="0,16" Classes="CodeBlock">
|
||||||
|
<SelectableTextBlock
|
||||||
|
|
||||||
|
Text="{Binding $parent[local:Overview].AvaloniaEditStyle}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
</Border>
|
||||||
|
</StackPanel>
|
||||||
|
</TabItem>
|
||||||
</TabControl>
|
</TabControl>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|||||||
@@ -9,41 +9,66 @@ public partial class Overview : UserControl
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string MainInstall { get; set; } = "dotnet add package Semi.Avalonia --version 11.2.1.5";
|
public string MainInstall { get; set; } = "dotnet add package Semi.Avalonia";
|
||||||
|
|
||||||
public string MainStyle { get; set; } =
|
public string MainStyle { get; set; } =
|
||||||
"""
|
"""
|
||||||
<Application.Styles>
|
<Application.Styles>
|
||||||
<!-- You can still reference in old way. -->
|
|
||||||
<!-- <StyleInclude Source="avares://Semi.Avalonia/Index.axaml" /> -->
|
|
||||||
<semi:SemiTheme Locale="zh-CN" />
|
<semi:SemiTheme Locale="zh-CN" />
|
||||||
</Application.Styles>
|
</Application.Styles>
|
||||||
""";
|
""";
|
||||||
|
|
||||||
public string ColorPickerInstall { get; set; } = "dotnet add package Semi.Avalonia.ColorPicker --version 11.2.1.5";
|
public string ColorPickerInstall { get; set; } = "dotnet add package Semi.Avalonia.ColorPicker";
|
||||||
|
|
||||||
public string ColorPickerStyle { get; set; } =
|
public string ColorPickerStyle { get; set; } =
|
||||||
"""
|
"""
|
||||||
<Application.Styles>
|
<Application.Styles>
|
||||||
<StyleInclude Source="avares://Semi.Avalonia.ColorPicker/Index.axaml" />
|
<semi:ColorPickerSemiTheme />
|
||||||
</Application.Styles>
|
</Application.Styles>
|
||||||
""";
|
""";
|
||||||
|
|
||||||
public string DataGridInstall { get; set; } = "dotnet add package Semi.Avalonia.DataGrid --version 11.2.1.5";
|
public string DataGridInstall { get; set; } = "dotnet add package Semi.Avalonia.DataGrid";
|
||||||
|
|
||||||
public string DataGridStyle { get; set; } =
|
public string DataGridStyle { get; set; } =
|
||||||
"""
|
"""
|
||||||
<Application.Styles>
|
<Application.Styles>
|
||||||
<StyleInclude Source="avares://Semi.Avalonia.DataGrid/Index.axaml" />
|
<semi:DataGridSemiTheme />
|
||||||
</Application.Styles>
|
</Application.Styles>
|
||||||
""";
|
""";
|
||||||
|
|
||||||
public string TreeDataGridInstall { get; set; } = "dotnet add package Semi.Avalonia.TreeDataGrid --version 11.0.10.1";
|
public string TreeDataGridInstall { get; set; } = "dotnet add package Semi.Avalonia.TreeDataGrid";
|
||||||
|
|
||||||
public string TreeDataGridStyle { get; set; } =
|
public string TreeDataGridStyle { get; set; } =
|
||||||
"""
|
"""
|
||||||
<Application.Styles>
|
<Application.Styles>
|
||||||
<StyleInclude Source="avares://Semi.Avalonia.TreeDataGrid/Index.axaml" />
|
<semi:TreeDataGridSemiTheme />
|
||||||
|
</Application.Styles>
|
||||||
|
""";
|
||||||
|
|
||||||
|
public string DockInstall { get; set; } = "dotnet add package Semi.Avalonia.Dock";
|
||||||
|
|
||||||
|
public string DockStyle { get; set; } =
|
||||||
|
"""
|
||||||
|
<Application.Styles>
|
||||||
|
<semi:DockSemiTheme />
|
||||||
|
</Application.Styles>
|
||||||
|
""";
|
||||||
|
|
||||||
|
public string TabaloniaInstall { get; set; } = "dotnet add package Semi.Avalonia.Tabalonia";
|
||||||
|
|
||||||
|
public string TabaloniaStyle { get; set; } =
|
||||||
|
"""
|
||||||
|
<Application.Styles>
|
||||||
|
<semi:TabaloniaSemiTheme />
|
||||||
|
</Application.Styles>
|
||||||
|
""";
|
||||||
|
|
||||||
|
public string AvaloniaEditInstall { get; set; } = "dotnet add package Semi.Avalonia.AvaloniaEdit";
|
||||||
|
|
||||||
|
public string AvaloniaEditStyle { get; set; } =
|
||||||
|
"""
|
||||||
|
<Application.Styles>
|
||||||
|
<semi:AvaloniaEditSemiTheme />
|
||||||
</Application.Styles>
|
</Application.Styles>
|
||||||
""";
|
""";
|
||||||
}
|
}
|
||||||
@@ -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>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Controls.Primitives;
|
using Avalonia.Controls.Primitives;
|
||||||
|
using Avalonia.Input.Platform;
|
||||||
using Avalonia.Threading;
|
using Avalonia.Threading;
|
||||||
using Semi.Avalonia.Demo.ViewModels;
|
using Semi.Avalonia.Demo.ViewModels;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Controls;
|
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
|||||||
99
demo/Semi.Avalonia.Demo/Pages/PipsPagerDemo.axaml
Normal file
99
demo/Semi.Avalonia.Demo/Pages/PipsPagerDemo.axaml
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
<UserControl
|
||||||
|
x:Class="Semi.Avalonia.Demo.Pages.PipsPagerDemo"
|
||||||
|
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="600"
|
||||||
|
d:DesignWidth="800"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
<ScrollViewer>
|
||||||
|
<StackPanel HorizontalAlignment="Left" Spacing="16" Margin="0,0,0,20">
|
||||||
|
|
||||||
|
<!-- Horizontal PipsPager -->
|
||||||
|
<TextBlock Classes="H6" Text="Horizontal" />
|
||||||
|
<PipsPager
|
||||||
|
NumberOfPages="8"
|
||||||
|
Orientation="Horizontal" />
|
||||||
|
|
||||||
|
<!-- Vertical PipsPager -->
|
||||||
|
<TextBlock Classes="H6" Text="Vertical" />
|
||||||
|
<PipsPager
|
||||||
|
NumberOfPages="8"
|
||||||
|
Orientation="Vertical" />
|
||||||
|
|
||||||
|
<!-- Linked with Carousel -->
|
||||||
|
<TextBlock Classes="H6" Text="Linked with Carousel" />
|
||||||
|
<Panel>
|
||||||
|
<Carousel
|
||||||
|
Name="DemoCarousel"
|
||||||
|
Height="160">
|
||||||
|
<Border Background="#EAF5FF">
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Foreground="#1C1F23"
|
||||||
|
Text="Page 1" />
|
||||||
|
</Border>
|
||||||
|
<Border Background="#F9F9F9">
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Foreground="#1C1F23"
|
||||||
|
Text="Page 2" />
|
||||||
|
</Border>
|
||||||
|
<Border Background="#FFF8EA">
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Foreground="#1C1F23"
|
||||||
|
Text="Page 3" />
|
||||||
|
</Border>
|
||||||
|
<Border Background="#FEF2ED">
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Foreground="#1C1F23"
|
||||||
|
Text="Page 4" />
|
||||||
|
</Border>
|
||||||
|
<Border Background="#F0F5FF">
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Foreground="#1C1F23"
|
||||||
|
Text="Page 5" />
|
||||||
|
</Border>
|
||||||
|
</Carousel>
|
||||||
|
<ThemeVariantScope RequestedThemeVariant="Light">
|
||||||
|
<PipsPager
|
||||||
|
Name="LinkedPager"
|
||||||
|
NumberOfPages="5"
|
||||||
|
Orientation="Horizontal"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Bottom"
|
||||||
|
Margin="0,0,0,8"
|
||||||
|
SelectedPageIndex="{Binding #DemoCarousel.SelectedIndex}" />
|
||||||
|
</ThemeVariantScope>
|
||||||
|
</Panel>
|
||||||
|
|
||||||
|
<!-- Various page counts -->
|
||||||
|
<TextBlock Classes="H6" Text="Various Page Counts" />
|
||||||
|
<StackPanel Spacing="12">
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||||
|
<TextBlock VerticalAlignment="Center" Width="80" Text="3 pages" />
|
||||||
|
<PipsPager NumberOfPages="3" Orientation="Horizontal" />
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||||
|
<TextBlock VerticalAlignment="Center" Width="80" Text="5 pages" />
|
||||||
|
<PipsPager NumberOfPages="5" Orientation="Horizontal" />
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||||
|
<TextBlock VerticalAlignment="Center" Width="80" Text="10 pages" />
|
||||||
|
<PipsPager NumberOfPages="10" Orientation="Horizontal" />
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
|
</UserControl>
|
||||||
|
|
||||||
12
demo/Semi.Avalonia.Demo/Pages/PipsPagerDemo.axaml.cs
Normal file
12
demo/Semi.Avalonia.Demo/Pages/PipsPagerDemo.axaml.cs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
using Avalonia.Controls;
|
||||||
|
|
||||||
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
public partial class PipsPagerDemo : UserControl
|
||||||
|
{
|
||||||
|
public PipsPagerDemo()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -25,6 +25,7 @@
|
|||||||
Width="100"
|
Width="100"
|
||||||
Height="100"
|
Height="100"
|
||||||
IsIndeterminate="True"
|
IsIndeterminate="True"
|
||||||
|
BorderThickness="16"
|
||||||
Maximum="{Binding #slider.Maximum}"
|
Maximum="{Binding #slider.Maximum}"
|
||||||
Minimum="{Binding #slider.Minimum}"
|
Minimum="{Binding #slider.Minimum}"
|
||||||
Theme="{DynamicResource ProgressRing}"
|
Theme="{DynamicResource ProgressRing}"
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -10,9 +8,4 @@ public partial class ProgressBarDemo : UserControl
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,10 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
|
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
|
||||||
d:DesignHeight="450"
|
d:DesignHeight="450"
|
||||||
d:DesignWidth="800"
|
d:DesignWidth="800"
|
||||||
x:DataType="pages: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>
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
using System.Collections.ObjectModel;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
using Semi.Avalonia.Demo.ViewModels;
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -13,34 +10,14 @@ public partial class RefreshContainerDemo : UserControl
|
|||||||
public RefreshContainerDemo()
|
public RefreshContainerDemo()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
_viewModel = new RefreshContainerDemoViewModel();
|
_viewModel = new RefreshContainerDemoViewModel();
|
||||||
|
|
||||||
DataContext = _viewModel;
|
DataContext = _viewModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void RefreshContainerPage_RefreshRequested(object? sender, RefreshRequestedEventArgs e)
|
private async void RefreshContainerPage_RefreshRequested(object? sender, RefreshRequestedEventArgs e)
|
||||||
{
|
{
|
||||||
var deferral = e.GetDeferral();
|
var deferral = e.GetDeferral();
|
||||||
|
|
||||||
await _viewModel.AddToTop();
|
await _viewModel.AddToTop();
|
||||||
|
|
||||||
deferral.Complete();
|
deferral.Complete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class RefreshContainerDemoViewModel : ObservableObject
|
|
||||||
{
|
|
||||||
public ObservableCollection<string> Items { get; }
|
|
||||||
|
|
||||||
public RefreshContainerDemoViewModel()
|
|
||||||
{
|
|
||||||
Items = new ObservableCollection<string>(Enumerable.Range(1, 200).Select(i => $"Item {i}"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task AddToTop()
|
|
||||||
{
|
|
||||||
await Task.Delay(1000);
|
|
||||||
Items.Insert(0, $"Item {200 - Items.Count}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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>
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
|
||||||
|
|
||||||
public partial class RepeatButtonDemo : UserControl
|
|
||||||
{
|
|
||||||
public RepeatButtonDemo()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -9,66 +9,22 @@
|
|||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<ScrollViewer>
|
<ScrollViewer>
|
||||||
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
||||||
|
<ToggleSwitch Name="inset" Content="Inset Content" />
|
||||||
|
<ToggleSwitch Name="autohide" Content="Allow AutoHide" />
|
||||||
<ScrollViewer
|
<ScrollViewer
|
||||||
Width="200"
|
|
||||||
Height="200"
|
|
||||||
Margin="10"
|
Margin="10"
|
||||||
|
Width="200" Height="200"
|
||||||
|
AllowAutoHide="{Binding #autohide.IsChecked}"
|
||||||
|
Classes.InsetContent="{Binding #inset.IsChecked}"
|
||||||
HorizontalScrollBarVisibility="Auto">
|
HorizontalScrollBarVisibility="Auto">
|
||||||
<Grid RowDefinitions="Auto,Auto"
|
<UniformGrid
|
||||||
ColumnDefinitions="Auto,Auto"
|
Rows="2" Columns="2"
|
||||||
Width="300" Height="300">
|
Width="300" Height="300">
|
||||||
<Rectangle
|
<Rectangle Fill="{DynamicResource SemiYellow2}" />
|
||||||
Grid.Row="0" Grid.Column="0"
|
<Rectangle Fill="{DynamicResource SemiBlue2}" />
|
||||||
Width="150"
|
<Rectangle Fill="{DynamicResource SemiPink2}" />
|
||||||
Height="150"
|
<Rectangle Fill="{DynamicResource SemiGreen2}" />
|
||||||
Fill="{DynamicResource SemiYellow2}" />
|
</UniformGrid>
|
||||||
<Rectangle
|
|
||||||
Grid.Row="0" Grid.Column="1"
|
|
||||||
Width="150"
|
|
||||||
Height="150"
|
|
||||||
Fill="{DynamicResource SemiBlue2}" />
|
|
||||||
<Rectangle
|
|
||||||
Grid.Row="1" Grid.Column="0"
|
|
||||||
Width="150"
|
|
||||||
Height="150"
|
|
||||||
Fill="{DynamicResource SemiPink2}" />
|
|
||||||
<Rectangle
|
|
||||||
Grid.Row="1" Grid.Column="1"
|
|
||||||
Width="150"
|
|
||||||
Height="150"
|
|
||||||
Fill="{DynamicResource SemiGreen2}" />
|
|
||||||
</Grid>
|
|
||||||
</ScrollViewer>
|
|
||||||
<ScrollViewer
|
|
||||||
Width="200"
|
|
||||||
Height="200"
|
|
||||||
Margin="10"
|
|
||||||
HorizontalScrollBarVisibility="Auto"
|
|
||||||
Theme="{DynamicResource StaticScrollViewer}">
|
|
||||||
<Grid RowDefinitions="Auto,Auto"
|
|
||||||
ColumnDefinitions="Auto,Auto"
|
|
||||||
Width="300" Height="300">
|
|
||||||
<Rectangle
|
|
||||||
Grid.Row="0" Grid.Column="0"
|
|
||||||
Width="150"
|
|
||||||
Height="150"
|
|
||||||
Fill="{DynamicResource SemiYellow2}" />
|
|
||||||
<Rectangle
|
|
||||||
Grid.Row="0" Grid.Column="1"
|
|
||||||
Width="150"
|
|
||||||
Height="150"
|
|
||||||
Fill="{DynamicResource SemiBlue2}" />
|
|
||||||
<Rectangle
|
|
||||||
Grid.Row="1" Grid.Column="0"
|
|
||||||
Width="150"
|
|
||||||
Height="150"
|
|
||||||
Fill="{DynamicResource SemiPink2}" />
|
|
||||||
<Rectangle
|
|
||||||
Grid.Row="1" Grid.Column="1"
|
|
||||||
Width="150"
|
|
||||||
Height="150"
|
|
||||||
Fill="{DynamicResource SemiGreen2}" />
|
|
||||||
</Grid>
|
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -10,9 +8,4 @@ public partial class ScrollViewerDemo : UserControl
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -11,8 +9,4 @@ public partial class SelectableTextBlockDemo : UserControl
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -22,6 +22,15 @@
|
|||||||
TickFrequency="10"
|
TickFrequency="10"
|
||||||
TickPlacement="Outside"
|
TickPlacement="Outside"
|
||||||
Value="0" />
|
Value="0" />
|
||||||
|
<Slider
|
||||||
|
Value="0"
|
||||||
|
Minimum="0"
|
||||||
|
Maximum="100"
|
||||||
|
TickPlacement="BottomRight"
|
||||||
|
IsSnapToTickEnabled="True"
|
||||||
|
IsDirectionReversed="True"
|
||||||
|
Ticks="0,20,25,40,75,100"
|
||||||
|
Width="300" />
|
||||||
<Slider
|
<Slider
|
||||||
Width="300"
|
Width="300"
|
||||||
Classes="ToolTip"
|
Classes="ToolTip"
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -11,8 +9,4 @@ public partial class SliderDemo : UserControl
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -4,116 +4,130 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
|
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>
|
||||||
<pages: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"
|
||||||
IsChecked="{Binding #SplitView.IsPaneOpen}" />
|
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"
|
||||||
IsChecked="{Binding #SplitView.UseLightDismissOverlayMode}" />
|
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"
|
||||||
OffContent="Left"
|
Grid.Column="1"
|
||||||
OnContent="Right"
|
Name="PanelPlacementSelector"
|
||||||
IsChecked="{Binding #SplitView.PanePlacement}" />
|
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="{Binding DisplayModes}"
|
ItemsSource="{x:Static vm:SplitViewDemoViewModel.DisplayModes}"
|
||||||
SelectedIndex="{Binding #SplitView.DisplayMode}" />
|
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="{Binding #SplitView.CompactPaneLength}" />
|
|
||||||
|
|
||||||
<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="{Binding #SplitView.OpenPaneLength}" />
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
<Border
|
|
||||||
Grid.Column="0"
|
|
||||||
BorderBrush="{DynamicResource SemiGrey1}"
|
|
||||||
BorderThickness="1">
|
|
||||||
<SplitView
|
<SplitView
|
||||||
|
Grid.Column="0"
|
||||||
Name="SplitView"
|
Name="SplitView"
|
||||||
DisplayMode="CompactOverlay"
|
CompactPaneLength="{Binding #CompactPaneLengthSlider.Value}"
|
||||||
CompactPaneLength="48"
|
DisplayMode="{Binding #DisplayModeSelector.SelectedItem}"
|
||||||
OpenPaneLength="256">
|
IsPaneOpen="{Binding #PaneOpenButton.IsChecked, Mode=TwoWay}"
|
||||||
|
OpenPaneLength="{Binding #OpenPaneLengthSlider.Value}"
|
||||||
|
PanePlacement="{Binding #PanelPlacementSelector.SelectedItem}"
|
||||||
|
UseLightDismissOverlayMode="{Binding #UseLightDismissOverlayModeButton.IsChecked}">
|
||||||
<SplitView.Background>
|
<SplitView.Background>
|
||||||
<LinearGradientBrush StartPoint="0%,0%" EndPoint="0%,100%">
|
<LinearGradientBrush StartPoint="0%,0%" EndPoint="0%,100%">
|
||||||
<GradientStop Color="#6b4c1b" Offset="0" />
|
<GradientStop Offset="0" Color="#6b4c1b" />
|
||||||
<GradientStop Color="#291e10" Offset="1" />
|
<GradientStop Offset="1" Color="#291e10" />
|
||||||
</LinearGradientBrush>
|
</LinearGradientBrush>
|
||||||
</SplitView.Background>
|
</SplitView.Background>
|
||||||
<SplitView.Pane>
|
<SplitView.Pane>
|
||||||
<Grid RowDefinitions="Auto,*,Auto">
|
<Grid RowDefinitions="Auto,*,Auto">
|
||||||
|
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="8 12">
|
||||||
|
<ToggleSwitch
|
||||||
|
Content="{StaticResource SemiIconSidebar}"
|
||||||
|
IsChecked="{Binding #SplitView.IsPaneOpen}"
|
||||||
|
Theme="{DynamicResource IconBorderlessToggleSwitch}" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="0"
|
|
||||||
Name="PaneHeader"
|
Name="PaneHeader"
|
||||||
Margin="8,12"
|
VerticalAlignment="Center"
|
||||||
|
Margin="8 0"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
Text="Playlist" />
|
Text="Playlist" />
|
||||||
<ListBox
|
</StackPanel>
|
||||||
Grid.Row="1"
|
|
||||||
ItemsSource="{Binding Songs}" />
|
<ListBox Grid.Row="1" ItemsSource="{Binding Songs}" />
|
||||||
<ToggleSwitch
|
|
||||||
Grid.Row="2"
|
|
||||||
Theme="{DynamicResource IconBorderlessToggleSwitch}"
|
|
||||||
Content="{StaticResource SemiIconSidebar}"
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
IsChecked="{Binding #SplitView.IsPaneOpen}">
|
|
||||||
</ToggleSwitch>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</SplitView.Pane>
|
</SplitView.Pane>
|
||||||
|
|
||||||
@@ -133,23 +147,23 @@
|
|||||||
</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>
|
||||||
@@ -157,26 +171,23 @@
|
|||||||
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"
|
||||||
|
Opacity="0.1"
|
||||||
StartAngle="0"
|
StartAngle="0"
|
||||||
SweepAngle="360"
|
Stroke="#C6CACD"
|
||||||
StrokeJoin="Round"
|
StrokeJoin="Round"
|
||||||
StrokeLineCap="Round"
|
StrokeLineCap="Round"
|
||||||
StrokeThickness="10"
|
StrokeThickness="10"
|
||||||
Stroke="#C6CACD"
|
SweepAngle="360" />
|
||||||
Opacity="0.1" />
|
|
||||||
</Panel>
|
</Panel>
|
||||||
|
|
||||||
</SplitView>
|
</SplitView>
|
||||||
</Border>
|
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
using System.Collections.ObjectModel;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
using Semi.Avalonia.Demo.ViewModels;
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -12,33 +10,4 @@ public partial class SplitViewDemo : UserControl
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.DataContext = new SplitViewDemoViewModel();
|
this.DataContext = new SplitViewDemoViewModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class SplitViewDemoViewModel : ObservableObject
|
|
||||||
{
|
|
||||||
public ObservableCollection<string> Songs { get; set; } =
|
|
||||||
[
|
|
||||||
"320万年前",
|
|
||||||
"隐德来希",
|
|
||||||
"孔明",
|
|
||||||
"锦鲤卟噜噜",
|
|
||||||
"指鹿为马",
|
|
||||||
"热带季风Remix",
|
|
||||||
"加州梦境",
|
|
||||||
"渐近自由",
|
|
||||||
"世界所有的烂漫",
|
|
||||||
];
|
|
||||||
|
|
||||||
public ObservableCollection<SplitViewDisplayMode> DisplayModes { get; set; } =
|
|
||||||
[
|
|
||||||
SplitViewDisplayMode.Inline,
|
|
||||||
SplitViewDisplayMode.CompactInline,
|
|
||||||
SplitViewDisplayMode.Overlay,
|
|
||||||
SplitViewDisplayMode.CompactOverlay,
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user