Compare commits
413 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
37211a07e7 | ||
|
|
3761a0a3fb | ||
|
|
d906a7754c | ||
|
|
d712f16642 | ||
|
|
947081302a | ||
|
|
28ce72dda9 | ||
|
|
78bc6c370b | ||
|
|
2999beefac | ||
|
|
77a05fb801 | ||
|
|
98dd72e9e3 | ||
|
|
5a954fbca8 | ||
|
|
2da0733bdf | ||
|
|
a5255bd032 | ||
|
|
7530061ca4 | ||
|
|
58c1c365a9 | ||
|
|
b5fe4d92a6 | ||
|
|
5d0116ca8e | ||
|
|
e981fe1c82 | ||
|
|
232ce71677 | ||
|
|
3fceec143d | ||
|
|
a99db733ed | ||
|
|
bb928fb239 | ||
|
|
371eb1b0d3 | ||
|
|
e56ef9d6ca | ||
|
|
0eeba47e88 | ||
|
|
96078a4115 | ||
|
|
26ef3ebf36 | ||
|
|
8615783b61 | ||
|
|
a0ca9fa4d0 | ||
|
|
e6ff4103ef | ||
|
|
2514d919f1 | ||
|
|
7a4b18e14a | ||
|
|
32e5e6b5f2 | ||
|
|
c253154e8f | ||
|
|
8955c83fd9 | ||
|
|
ea51867f0f | ||
|
|
8bb314984e | ||
|
|
af6c52660d | ||
|
|
f6962657fa | ||
|
|
8df91270b1 | ||
|
|
22f61cd836 | ||
|
|
86848b548f | ||
|
|
67fd0c4ca3 | ||
|
|
263c65dd18 | ||
|
|
26bb251d1e | ||
|
|
609dfbb5f0 | ||
|
|
ad4bead1bd | ||
|
|
02444f7f16 | ||
|
|
06d9e35add | ||
|
|
1200c9a1c9 | ||
|
|
7600b187f4 | ||
|
|
c55efe8835 | ||
|
|
1fe4df3716 | ||
|
|
c22211df24 | ||
|
|
6459863395 | ||
|
|
ab824fbcd2 | ||
|
|
e4adde26d2 | ||
|
|
057c31a311 | ||
|
|
ef8531d25d | ||
|
|
c44b9a0173 | ||
|
|
5715bba345 | ||
|
|
96b0999db1 | ||
|
|
ffd9b08acc | ||
|
|
64fd8a787a | ||
|
|
4087b685e8 | ||
|
|
70669406b2 | ||
|
|
9925f363f2 | ||
|
|
d328c66be0 | ||
|
|
049552f254 | ||
|
|
ec9233c51b | ||
|
|
6434c400d4 | ||
|
|
00b0e01198 | ||
|
|
19285645ee | ||
|
|
154a005b84 | ||
|
|
3c8ca20337 | ||
|
|
9947bffa07 | ||
|
|
0f872689a2 | ||
|
|
81f36f6559 | ||
|
|
2424c48070 | ||
|
|
40bf46dec5 | ||
|
|
5770065960 | ||
|
|
ecb15c978e | ||
|
|
5f5f9d2d60 | ||
|
|
382617f269 | ||
|
|
b13e719201 | ||
|
|
013eb39bac | ||
|
|
b25181c5bc | ||
|
|
0eb138d73c | ||
|
|
67cbcfe313 | ||
|
|
a6a4837151 | ||
|
|
9ac71cf726 | ||
|
|
d60b32adc6 | ||
|
|
04a113c546 | ||
|
|
9b4d6967a5 | ||
|
|
c302da6e4b | ||
|
|
dbae6edf40 | ||
|
|
8aa58355af | ||
|
|
1d18dd743a | ||
|
|
4ee9251b5a | ||
|
|
42285130d0 | ||
|
|
b03dfdf494 | ||
|
|
7ba3fbcb7a | ||
|
|
c437e6c79c | ||
|
|
f71e2630bb | ||
|
|
f891e05e4c | ||
|
|
77cd48ecfe | ||
|
|
329e041ced | ||
|
|
5222e64197 | ||
|
|
4c0f6dbf25 | ||
|
|
24f46bd12f | ||
|
|
afb5b65a51 | ||
|
|
25aa8fa3f2 | ||
|
|
50c3b7cf0b | ||
|
|
691e9987bc | ||
|
|
67f33125f6 | ||
|
|
729b92e35f | ||
|
|
e61c07f352 | ||
|
|
9ef0e418b8 | ||
|
|
de58cf9f3d | ||
|
|
d0f5b5ef7b | ||
|
|
5d51b158fa | ||
|
|
a02b017be7 | ||
|
|
d9b5eefd10 | ||
|
|
fb3f4fee16 | ||
|
|
3e295097df | ||
|
|
2aaec47fa6 | ||
|
|
9c96d6e476 | ||
|
|
ae9421f666 | ||
|
|
8e55ff1a6f | ||
|
|
8b3dbfc225 | ||
|
|
db28c82476 | ||
|
|
002619a8b5 | ||
|
|
f3c4714372 | ||
|
|
9cabf55ebd | ||
|
|
f318d33764 | ||
|
|
e4445da37b | ||
|
|
42aa2c7f17 | ||
|
|
a909b6da6e | ||
|
|
a8cdf5688b | ||
|
|
2ce8bcdc1b | ||
|
|
50b5159d17 | ||
|
|
fe380f9b0b | ||
|
|
2bded9434b | ||
|
|
3c8854f9de | ||
|
|
147d4fd968 | ||
|
|
142abbf3da | ||
|
|
b4d5a3f932 | ||
|
|
266fdade35 | ||
|
|
f138ae457e | ||
|
|
cc001e951e | ||
|
|
faee95f12f | ||
|
|
ed6b8c7469 | ||
|
|
7ac603b18e | ||
|
|
4803f0e65a | ||
|
|
ed84181b1c | ||
|
|
7207e595f6 | ||
|
|
f83dbafe7a | ||
|
|
53540e679b | ||
|
|
869fd70aef | ||
|
|
36d096d813 | ||
|
|
31e082f46e | ||
|
|
fa8b2d1f21 | ||
|
|
e4ecbfd1e8 | ||
|
|
bc050308fc | ||
|
|
904b7caa75 | ||
|
|
5af0fde583 | ||
|
|
5742412cb9 | ||
|
|
7cf453343a | ||
|
|
99d928ea15 | ||
|
|
b31b622a2e | ||
|
|
5f199d728e | ||
|
|
b6e458b81c | ||
|
|
8cdac330a4 | ||
|
|
8484d6ad86 | ||
|
|
d1d235a120 | ||
|
|
3a31924c6b | ||
|
|
252da729bb | ||
|
|
7f6a5615e6 | ||
|
|
1ee19246a1 | ||
|
|
46b1c5d1cc | ||
|
|
2437df392b | ||
|
|
580e780e58 | ||
|
|
3ce4067c3f | ||
|
|
d3f297730b | ||
|
|
dfcb3579b4 | ||
|
|
90ba261638 | ||
|
|
793d63a454 | ||
|
|
a4ee27778e | ||
|
|
021ca97865 | ||
|
|
d271b7e26c | ||
|
|
a38d4bdf55 | ||
|
|
30ac27d34a | ||
|
|
5451495c5c | ||
|
|
450fd5edbb | ||
|
|
1250d45ad8 | ||
|
|
f277c7c574 | ||
|
|
90dfa3ba8a | ||
|
|
8ba8ec69ca | ||
|
|
4b53300909 | ||
|
|
0858f01fec | ||
|
|
c5623faab1 | ||
|
|
fd68cad375 |
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']
|
||||
15
.github/workflows/deploy.yml
vendored
@@ -4,10 +4,7 @@ env:
|
||||
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
|
||||
on:
|
||||
push:
|
||||
branches: [ "action/deploy" ]
|
||||
pull_request:
|
||||
branches: [ "action/deploy" ]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy-to-github-pages:
|
||||
@@ -27,9 +24,6 @@ jobs:
|
||||
- name: Publish .NET Project
|
||||
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
|
||||
run: cp $OUTPUT_PATH/index.html $OUTPUT_PATH/404.html
|
||||
|
||||
@@ -39,6 +33,7 @@ jobs:
|
||||
- name: Commit wwwroot to GitHub Pages
|
||||
uses: JamesIves/github-pages-deploy-action@v4.5.0
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
BRANCH: gh-pages
|
||||
FOLDER: ${{ env.OUTPUT_PATH }}
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: gh-pages
|
||||
folder: ${{ env.OUTPUT_PATH }}
|
||||
single-commit: true
|
||||
69
.github/workflows/pack-nightly.yml
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
name: Pack Nightly
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
Version_Prefix:
|
||||
description: 'Version Prefix'
|
||||
required: true
|
||||
default: '11.2.999'
|
||||
type: string
|
||||
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:
|
||||
Pack_Nightly:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Get Version
|
||||
run: |
|
||||
VERSION_TIMESTAMP=$(date +'%Y%m%d%H%M%S')
|
||||
VERSION="${{ inputs.Version_Prefix }}-nightly-${VERSION_TIMESTAMP}"
|
||||
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||
|
||||
- name: Pack Semi.Avalonia
|
||||
if: ${{ inputs.Semi_Avalonia }}
|
||||
run: dotnet pack src/Semi.Avalonia -o nugets /p:Version=${{ env.VERSION }}
|
||||
|
||||
- name: Pack Semi.Avalonia.ColorPicker
|
||||
if: ${{ inputs.Semi_Avalonia_ColorPicker }}
|
||||
run: dotnet pack src/Semi.Avalonia.ColorPicker -o nugets /p:Version=${{ env.VERSION }}
|
||||
|
||||
- name: Pack Semi.Avalonia.DataGrid
|
||||
if: ${{ inputs.Semi_Avalonia_DataGrid }}
|
||||
run: dotnet pack src/Semi.Avalonia.DataGrid -o nugets /p:Version=${{ env.VERSION }}
|
||||
|
||||
- name: Pack Semi.Avalonia.TreeDataGrid
|
||||
if: ${{ inputs.Semi_Avalonia_TreeDataGrid }}
|
||||
run: dotnet pack src/Semi.Avalonia.TreeDataGrid -o nugets /p:Version=${{ env.VERSION }}
|
||||
|
||||
- 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
|
||||
|
||||
- name: Publish Nightly Package
|
||||
run: dotnet nuget push "nugets/*.nupkg" --api-key ${{ secrets.IRIHI_NUGET_API_KEY }} --source irihi.tech --skip-duplicate
|
||||
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: nugets
|
||||
path: nugets
|
||||
if: always()
|
||||
79
.github/workflows/pack.yml
vendored
@@ -1,32 +1,77 @@
|
||||
name: Pack Nuget
|
||||
name: Pack to NuGet
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "action/pack" ]
|
||||
pull_request:
|
||||
branches: [ "action/pack" ]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
Upload_to_NuGet:
|
||||
description: 'Upload to NuGet'
|
||||
default: true
|
||||
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
|
||||
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:
|
||||
nuget:
|
||||
Pack_to_NuGet:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Nuget Semi.Avalonia
|
||||
run: dotnet pack ./src/Semi.Avalonia -o ./nugets
|
||||
- name: Pack Semi.Avalonia
|
||||
if: ${{ inputs.Semi_Avalonia }}
|
||||
run: dotnet pack src/Semi.Avalonia -o nugets
|
||||
|
||||
- name: Nuget Semi.Avalonia.ColorPicker
|
||||
run: dotnet pack ./src/Semi.Avalonia.ColorPicker -o ./nugets
|
||||
- name: Pack Semi.Avalonia.ColorPicker
|
||||
if: ${{ inputs.Semi_Avalonia_ColorPicker }}
|
||||
run: dotnet pack src/Semi.Avalonia.ColorPicker -o nugets
|
||||
|
||||
- name: Nuget Semi.Avalonia.DataGrid
|
||||
run: dotnet pack ./src/Semi.Avalonia.DataGrid -o ./nugets
|
||||
- name: Pack Semi.Avalonia.DataGrid
|
||||
if: ${{ inputs.Semi_Avalonia_DataGrid }}
|
||||
run: dotnet pack src/Semi.Avalonia.DataGrid -o nugets
|
||||
|
||||
- name: Nuget Semi.Avalonia.TreeDataGrid
|
||||
run: dotnet pack ./src/Semi.Avalonia.TreeDataGrid -o ./nugets
|
||||
- name: Pack Semi.Avalonia.TreeDataGrid
|
||||
if: ${{ inputs.Semi_Avalonia_TreeDataGrid }}
|
||||
run: dotnet pack src/Semi.Avalonia.TreeDataGrid -o nugets
|
||||
|
||||
- name: Upload to NuGet
|
||||
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
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: nugets
|
||||
path: ./nugets
|
||||
path: nugets
|
||||
if: always()
|
||||
261
.github/workflows/publish.yml
vendored
@@ -1,92 +1,225 @@
|
||||
name: Publish Demo
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "action/publish" ]
|
||||
pull_request:
|
||||
branches: [ "action/publish" ]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
win-x64:
|
||||
description: 'Windows x64'
|
||||
default: false
|
||||
type: boolean
|
||||
win-x64-aot:
|
||||
description: 'Windows x64 AOT'
|
||||
default: false
|
||||
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:
|
||||
windows:
|
||||
win-x64:
|
||||
if: ${{inputs.win-x64}}
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
|
||||
- name: Make upload directory
|
||||
run: mkdir upload
|
||||
|
||||
uses: actions/checkout@v4.2.2
|
||||
- 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
|
||||
|
||||
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o publish --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: windows
|
||||
path: ./upload
|
||||
name: Semi.Avalonia.Demo.Desktop.win-x64
|
||||
path: |
|
||||
publish
|
||||
!publish/*.pdb
|
||||
|
||||
linux:
|
||||
win-x64-aot:
|
||||
if: ${{inputs.win-x64-aot}}
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.2.2
|
||||
- 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@v4.6.2
|
||||
with:
|
||||
name: Semi.Avalonia.Demo.Desktop.win-x64.NativeAOT
|
||||
path: |
|
||||
publish
|
||||
!publish/*.pdb
|
||||
|
||||
linux-x64:
|
||||
if: ${{inputs.linux-x64}}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
|
||||
- name: Make upload directory
|
||||
run: mkdir upload
|
||||
|
||||
uses: actions/checkout@v4.2.2
|
||||
- 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"
|
||||
|
||||
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r linux-x64 -c Release -o publish --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: linux
|
||||
path: ./upload
|
||||
name: Semi.Avalonia.Demo.Desktop.linux-x64
|
||||
path: |
|
||||
publish
|
||||
!publish/*.pdb
|
||||
|
||||
android:
|
||||
linux-x64-aot:
|
||||
if: ${{inputs.linux-x64-aot}}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.2.2
|
||||
- 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@v4.6.2
|
||||
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@v4.2.2
|
||||
- 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@v4.6.2
|
||||
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@v4.2.2
|
||||
- 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@v4.6.2
|
||||
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@v4.2.2
|
||||
- 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@v4.6.2
|
||||
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@v4.2.2
|
||||
- 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@v4.6.2
|
||||
with:
|
||||
name: Semi.Avalonia.Demo.Desktop.osx-arm64.NativeAOT
|
||||
path: |
|
||||
publish
|
||||
!publish/*.pdb
|
||||
|
||||
android-arm64:
|
||||
if: ${{inputs.android-arm64 }}
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
|
||||
uses: actions/checkout@v4.2.2
|
||||
- name: CD Android
|
||||
run: cd ./demo/Semi.Avalonia.Demo.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
|
||||
|
||||
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.3.1
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: android
|
||||
path: ./publish/*Signed.apk
|
||||
name: android-arm64
|
||||
path: publish/*Signed.apk
|
||||
|
||||
73
.github/workflows/release-tag.yml
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
name: Release Tag
|
||||
|
||||
on:
|
||||
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:
|
||||
nuget:
|
||||
uses: ./.github/workflows/pack.yml
|
||||
with:
|
||||
Upload_to_NuGet: ${{ inputs.Upload_to_NuGet }}
|
||||
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:
|
||||
uses: ./.github/workflows/publish.yml
|
||||
|
||||
draft-release:
|
||||
needs: [ nuget,publish ]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4.3.0
|
||||
|
||||
- name: Display structure of downloaded files
|
||||
run: ls -R
|
||||
|
||||
- name: Zip artifacts
|
||||
run: |
|
||||
zip -rj Semi.Avalonia.Demo.Desktop.win-x64.zip Semi.Avalonia.Demo.Desktop.win-x64
|
||||
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: Display structure of zipped files
|
||||
run: ls -R
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2.3.2
|
||||
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
|
||||
with:
|
||||
generate_release_notes: true
|
||||
draft: true
|
||||
files: |
|
||||
nugets/*.nupkg
|
||||
android-arm64/*.apk
|
||||
*.zip
|
||||
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
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
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
21
README.md
@@ -2,6 +2,7 @@
|
||||
|
||||
[](https://www.nuget.org/packages/Semi.Avalonia/)
|
||||
[](https://www.nuget.org/packages/Semi.Avalonia/)
|
||||
[](https://gitcode.com/IRIHI_Technology/Semi.Avalonia)
|
||||
|
||||
[中文](./README_CN.md)
|
||||
|
||||
@@ -37,22 +38,30 @@ Include Semi Design Styles in application:
|
||||
|
||||
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
|
||||
dotnet add package Semi.Avalonia.ColorPicker
|
||||
dotnet add package Semi.Avalonia.DataGrid
|
||||
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
|
||||
<Application.Styles>
|
||||
<StyleInclude Source="avares://Semi.Avalonia.ColorPicker/Index.axaml" />
|
||||
<StyleInclude Source="avares://Semi.Avalonia.DataGrid/Index.axaml" />
|
||||
<StyleInclude Source="avares://Semi.Avalonia.TreeDataGrid/Index.axaml" />
|
||||
<semi:ColorPickerSemiTheme />
|
||||
<semi:DataGridSemiTheme />
|
||||
<semi:TreeDataGridSemiTheme />
|
||||
<semi:DockSemiTheme />
|
||||
<semi:TabaloniaSemiTheme />
|
||||
<semi:AvaloniaEditSemiTheme />
|
||||
</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
|
||||
|
||||
You can always download demo executable to play around with Semi Avalonia Themes.
|
||||
@@ -62,12 +71,14 @@ You can always download demo executable to play around with Semi Avalonia Themes
|
||||
|
||||
We offer limited free community support for Semi Avalonia and Ursa. If you have any question or suggestion, feel free to raise issues and discussions via GitHub, and you are welcomed to join our group via FeiShu(Lark)
|
||||
|
||||

|
||||

|
||||
|
||||
## Version compatibility
|
||||
|
||||
| Semi Design Version | Avalonia Version |
|
||||
|:--------------------|:-----------------|
|
||||
| 11.2.1 | >=11.2.1 |
|
||||
| 11.2.0 | 11.2.0 |
|
||||
| 11.1.0 | >=11.1.0 |
|
||||
| 11.0.7 | >=11.0.7 |
|
||||
| 11.0.1 | <=11.0.6 |
|
||||
|
||||
21
README_CN.md
@@ -2,6 +2,7 @@
|
||||
|
||||
[](https://www.nuget.org/packages/Semi.Avalonia/)
|
||||
[](https://www.nuget.org/packages/Semi.Avalonia/)
|
||||
[](https://gitcode.com/IRIHI_Technology/Semi.Avalonia)
|
||||
|
||||
[English](./README.md)
|
||||
|
||||
@@ -37,26 +38,33 @@ dotnet add package Semi.Avalonia
|
||||
|
||||
这样就可以了。
|
||||
|
||||
ColorPicker、DataGrid 和 TreeDataGrid 的样式单独分发,如果需要请安装并引用。
|
||||
ColorPicker、DataGrid、TreeDataGrid、Dock、Tabalonia 和 AvaloniaEdit 的样式单独分发,如果需要请安装并引用。
|
||||
|
||||
```bash
|
||||
dotnet add package Semi.Avalonia.ColorPicker
|
||||
dotnet add package Semi.Avalonia.DataGrid
|
||||
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
|
||||
<Application.Styles>
|
||||
<StyleInclude Source="avares://Semi.Avalonia.ColorPicker/Index.axaml" />
|
||||
<StyleInclude Source="avares://Semi.Avalonia.DataGrid/Index.axaml" />
|
||||
<StyleInclude Source="avares://Semi.Avalonia.TreeDataGrid/Index.axaml" />
|
||||
<semi:ColorPickerSemiTheme />
|
||||
<semi:DataGridSemiTheme />
|
||||
<semi:TreeDataGridSemiTheme />
|
||||
<semi:DockSemiTheme />
|
||||
<semi:TabaloniaSemiTheme />
|
||||
<semi:AvaloniaEditSemiTheme />
|
||||
</Application.Styles>
|
||||
```
|
||||
|
||||
注意:Dock、Tabalonia 和 AvaloniaEdit 是通过 NuGet 免费分发的,但不是开源的。请阅读许可协议并同意后继续使用这些包。如果您需要源代码,请通过电子邮件联系我们:[contact@irihi.tech](contact@irihi.tech)
|
||||
|
||||
## 示例
|
||||
|
||||
您可以从 Semi Avalonia 的 release 页下载并试用 Semi Avalonia 的展示应用。
|
||||
|
||||
<https://github.com/irihitech/Semi.Avalonia/releases>
|
||||
|
||||
## 社区支持
|
||||
@@ -65,11 +73,12 @@ dotnet add package Semi.Avalonia.TreeDataGrid
|
||||
|
||||

|
||||
|
||||
|
||||
## 版本兼容性
|
||||
|
||||
| Semi Design Version | Avalonia Version |
|
||||
|:--------------------|:-----------------|
|
||||
| 11.2.1 | >=11.2.1 |
|
||||
| 11.2.0 | 11.2.0 |
|
||||
| 11.1.0 | >=11.1.0 |
|
||||
| 11.0.7 | >=11.0.7 |
|
||||
| 11.0.1 | <=11.0.6 |
|
||||
|
||||
@@ -12,6 +12,15 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution
|
||||
src\Package.props = src\Package.props
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHub Action", "GitHub Action", "{318534A1-1CC3-40FB-B4AE-736F94465232}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.github\workflows\deploy.yml = .github\workflows\deploy.yml
|
||||
.github\workflows\pack.yml = .github\workflows\pack.yml
|
||||
.github\workflows\pack-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}"
|
||||
@@ -30,8 +39,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Semi.Avalonia.Demo.Drm", "d
|
||||
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
|
||||
@@ -75,10 +82,6 @@ Global
|
||||
{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
|
||||
@@ -89,7 +92,6 @@ Global
|
||||
{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}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<Nullable>enable</Nullable>
|
||||
<AvaloniaVersion>11.2.0</AvaloniaVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AvaloniaVersion>11.3.7</AvaloniaVersion>
|
||||
<DataGridVersion>11.3.7</DataGridVersion>
|
||||
<CommunityToolkitVersion>8.4.0</CommunityToolkitVersion>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 717 B |
@@ -14,9 +14,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Icon.png">
|
||||
<Link>Resources\drawable\Icon.png</Link>
|
||||
</AndroidResource>
|
||||
<AndroidResource Include="Icon.png" Link="Resources\drawable\Icon.png"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
using Avalonia;
|
||||
using System;
|
||||
using Avalonia;
|
||||
using Avalonia.Dialogs;
|
||||
using Avalonia.Media;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Desktop;
|
||||
|
||||
class Program
|
||||
sealed class Program
|
||||
{
|
||||
// Initialization code. Don't use any Avalonia, third-party APIs or any
|
||||
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
|
||||
@@ -16,13 +14,13 @@ class Program
|
||||
public static void Main(string[] args) => BuildAvaloniaApp()
|
||||
.With(new FontManagerOptions
|
||||
{
|
||||
FontFallbacks = new[]
|
||||
{
|
||||
FontFallbacks =
|
||||
[
|
||||
new FontFallback
|
||||
{
|
||||
FontFamily = new FontFamily("Microsoft YaHei")
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
.StartWithClassicDesktopLifetime(args);
|
||||
|
||||
@@ -33,4 +31,4 @@ class Program
|
||||
.UsePlatformDetect()
|
||||
.With(new Win32PlatformOptions())
|
||||
.LogToTrace();
|
||||
}
|
||||
}
|
||||
@@ -4,9 +4,9 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
||||
<ApplicationIcon>..\Semi.Avalonia.Demo\Assets\irihi.ico</ApplicationIcon>
|
||||
<!-- Uncomment below to enable Native AOT compilation-->
|
||||
<!--<PublishAot>true</PublishAot>-->
|
||||
<!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>-->
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
|
||||
@@ -19,16 +19,14 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<TrimmerRootDescriptor Include="Roots.xml" />
|
||||
<TrimmerRootDescriptor Include="Roots.xml"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
|
||||
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
|
||||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
|
||||
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj" />
|
||||
<ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj"/>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -7,7 +7,7 @@ using Avalonia.Dialogs;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Drm;
|
||||
|
||||
class Program
|
||||
sealed class Program
|
||||
{
|
||||
// Initialization code. Don't use any Avalonia, third-party APIs or any
|
||||
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
|
||||
|
||||
@@ -63,7 +63,7 @@ private static void SilenceConsole()
|
||||
6. Publish the app to Linux
|
||||
|
||||
```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
|
||||
|
||||
@@ -63,7 +63,7 @@ private static void SilenceConsole()
|
||||
6. 发布程序到Linux
|
||||
|
||||
```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文件中添加以下代码
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
||||
<ApplicationIcon>..\Semi.Avalonia.Demo\Assets\irihi.ico</ApplicationIcon>
|
||||
<!-- Uncomment below to enable Native AOT compilation-->
|
||||
<!--<PublishAot>true</PublishAot>-->
|
||||
<!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>-->
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
|
||||
@@ -19,17 +19,15 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<TrimmerRootDescriptor Include="Roots.xml" />
|
||||
<TrimmerRootDescriptor Include="Roots.xml"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
|
||||
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
|
||||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
|
||||
<PackageReference Include="Avalonia.LinuxFramebuffer" Version="$(AvaloniaVersion)" />
|
||||
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)"/>
|
||||
<PackageReference Include="Avalonia.LinuxFramebuffer" Version="$(AvaloniaVersion)"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj" />
|
||||
<ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj"/>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -11,6 +11,6 @@ public static class AvaloniaAppBuilderExtensions
|
||||
builder.With(new FontManagerOptions
|
||||
{
|
||||
DefaultFamilyName = DefaultFontFamily,
|
||||
FontFallbacks = new[] { new FontFallback { FontFamily = new FontFamily(DefaultFontFamily) } }
|
||||
FontFallbacks = [new FontFallback { FontFamily = new FontFamily(DefaultFontFamily) }]
|
||||
});
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
<TargetFramework>net8.0-browser</TargetFramework>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
|
Before Width: | Height: | Size: 172 KiB After Width: | Height: | Size: 162 KiB |
@@ -6,6 +6,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="./app.css" />
|
||||
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
||||
</head>
|
||||
|
||||
<body style="margin: 0; overflow: hidden">
|
||||
|
||||
@@ -1,13 +1,52 @@
|
||||
<Application
|
||||
Name="Semi Avalonia Demo"
|
||||
x:Class="Semi.Avalonia.Demo.App"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:semi="https://irihi.tech/semi">
|
||||
xmlns:semi="https://irihi.tech/semi"
|
||||
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
|
||||
x:DataType="vm:ApplicationViewModel">
|
||||
<Application.Styles>
|
||||
<!-- You can still reference in old way. -->
|
||||
<!-- <StyleInclude Source="avares://Semi.Avalonia/Themes/Index.axaml" /> -->
|
||||
<semi:SemiTheme Locale="zh-cn" />
|
||||
<StyleInclude Source="avares://Semi.Avalonia.DataGrid/Index.axaml" />
|
||||
<StyleInclude Source="avares://Semi.Avalonia.ColorPicker/Index.axaml" />
|
||||
<semi:SemiTheme Locale="zh-CN" />
|
||||
<semi:SemiPopupAnimations />
|
||||
<semi:ColorPickerSemiTheme />
|
||||
<semi:DataGridSemiTheme />
|
||||
<semi:TreeDataGridSemiTheme />
|
||||
</Application.Styles>
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceInclude Source="Themes/_index.axaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
<NativeMenu.Menu>
|
||||
<NativeMenu>
|
||||
<NativeMenuItem
|
||||
Header="About Us"
|
||||
Command="{Binding JumpToCommand}"
|
||||
CommandParameter="{Binding $self.Header}" />
|
||||
</NativeMenu>
|
||||
</NativeMenu.Menu>
|
||||
<TrayIcon.Icons>
|
||||
<TrayIcons>
|
||||
<TrayIcon
|
||||
Icon="{OnPlatform Default=/Assets/irihi.ico, macOS=/Assets/irihi2.ico}"
|
||||
MacOSProperties.IsTemplateIcon="true"
|
||||
Command="{Binding ActivateCommand}"
|
||||
ToolTipText="Semi Avalonia Demo">
|
||||
<TrayIcon.Menu>
|
||||
<NativeMenu>
|
||||
<NativeMenuItem
|
||||
Header="About Us"
|
||||
Command="{Binding JumpToCommand}"
|
||||
CommandParameter="{Binding $self.Header}" />
|
||||
<NativeMenuItem
|
||||
Header="Exit"
|
||||
Command="{Binding ExitCommand}" />
|
||||
</NativeMenu>
|
||||
</TrayIcon.Menu>
|
||||
</TrayIcon>
|
||||
</TrayIcons>
|
||||
</TrayIcon.Icons>
|
||||
</Application>
|
||||
@@ -2,6 +2,7 @@ using Avalonia;
|
||||
using Avalonia.Controls.ApplicationLifetimes;
|
||||
using Avalonia.Data.Core.Plugins;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Semi.Avalonia.Demo.ViewModels;
|
||||
using Semi.Avalonia.Demo.Views;
|
||||
|
||||
namespace Semi.Avalonia.Demo;
|
||||
@@ -11,6 +12,7 @@ public partial class App : Application
|
||||
public override void Initialize()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
this.DataContext = new ApplicationViewModel();
|
||||
}
|
||||
|
||||
public override void OnFrameworkInitializationCompleted()
|
||||
@@ -28,6 +30,7 @@ public partial class App : Application
|
||||
break;
|
||||
}
|
||||
|
||||
this.RegisterFollowSystemTheme();
|
||||
base.OnFrameworkInitializationCompleted();
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 172 KiB |
BIN
demo/Semi.Avalonia.Demo/Assets/irihi.ico
Normal file
|
After Width: | Height: | Size: 162 KiB |
BIN
demo/Semi.Avalonia.Demo/Assets/irihi2.ico
Normal file
|
After Width: | Height: | Size: 948 B |
143
demo/Semi.Avalonia.Demo/Constant/ColorTokens.cs
Normal file
@@ -0,0 +1,143 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Constant;
|
||||
|
||||
public static class ColorTokens
|
||||
{
|
||||
public static IReadOnlyList<Tuple<string, string>> PrimaryTokens { get; } =
|
||||
[
|
||||
new("SemiColorPrimary", "Primary"),
|
||||
new("SemiColorPrimaryPointerover", "Primary Pointerover"),
|
||||
new("SemiColorPrimaryActive", "Primary Active"),
|
||||
new("SemiColorPrimaryDisabled", "Primary Disabled"),
|
||||
new("SemiColorPrimaryLight", "Primary Light"),
|
||||
new("SemiColorPrimaryLightPointerover", "Primary Light Pointerover"),
|
||||
new("SemiColorPrimaryLightActive", "Primary Light Active"),
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> SecondaryTokens { get; } =
|
||||
[
|
||||
new("SemiColorSecondary", "Secondary"),
|
||||
new("SemiColorSecondaryPointerover", "Secondary Pointerover"),
|
||||
new("SemiColorSecondaryActive", "Secondary Active"),
|
||||
new("SemiColorSecondaryDisabled", "Secondary Disabled"),
|
||||
new("SemiColorSecondaryLight", "Secondary Light"),
|
||||
new("SemiColorSecondaryLightPointerover", "Secondary Light Pointerover"),
|
||||
new("SemiColorSecondaryLightActive", "Secondary Light Active")
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> TertiaryTokens { get; } =
|
||||
[
|
||||
new("SemiColorTertiary", "Tertiary"),
|
||||
new("SemiColorTertiaryPointerover", "Tertiary Pointerover"),
|
||||
new("SemiColorTertiaryActive", "Tertiary Active"),
|
||||
new("SemiColorTertiaryLight", "Tertiary Light"),
|
||||
new("SemiColorTertiaryLightPointerover", "Tertiary Light Pointerover"),
|
||||
new("SemiColorTertiaryLightActive", "Tertiary Light Active")
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> InformationTokens { get; } =
|
||||
[
|
||||
new("SemiColorInformation", "Information"),
|
||||
new("SemiColorInformationPointerover", "Information Pointerover"),
|
||||
new("SemiColorInformationActive", "Information Active"),
|
||||
new("SemiColorInformationDisabled", "Information Disabled"),
|
||||
new("SemiColorInformationLight", "Information Light"),
|
||||
new("SemiColorInformationLightPointerover", "Information Light Pointerover"),
|
||||
new("SemiColorInformationLightActive", "Information Light Active")
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> SuccessTokens { get; } =
|
||||
[
|
||||
new("SemiColorSuccess", "Success"),
|
||||
new("SemiColorSuccessPointerover", "Success Pointerover"),
|
||||
new("SemiColorSuccessActive", "Success Active"),
|
||||
new("SemiColorSuccessDisabled", "Success Disabled"),
|
||||
new("SemiColorSuccessLight", "Success Light"),
|
||||
new("SemiColorSuccessLightPointerover", "Success Light Pointerover"),
|
||||
new("SemiColorSuccessLightActive", "Success Light Active")
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> WarningTokens { get; } =
|
||||
[
|
||||
new("SemiColorWarning", "Warning"),
|
||||
new("SemiColorWarningPointerover", "Warning Pointerover"),
|
||||
new("SemiColorWarningActive", "Warning Active"),
|
||||
new("SemiColorWarningLight", "Warning Light"),
|
||||
new("SemiColorWarningLightPointerover", "Warning Light Pointerover"),
|
||||
new("SemiColorWarningLightActive", "Warning Light Active")
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> DangerTokens { get; } =
|
||||
[
|
||||
new("SemiColorDanger", "Danger"),
|
||||
new("SemiColorDangerPointerover", "Danger Pointerover"),
|
||||
new("SemiColorDangerActive", "Danger Active"),
|
||||
new("SemiColorDangerLight", "Danger Light"),
|
||||
new("SemiColorDangerLightPointerover", "Danger Light Pointerover"),
|
||||
new("SemiColorDangerLightActive", "Danger Light Active")
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> TextTokens { get; } =
|
||||
[
|
||||
new("SemiColorText0", "Text 0"),
|
||||
new("SemiColorText1", "Text 1"),
|
||||
new("SemiColorText2", "Text 2"),
|
||||
new("SemiColorText3", "Text 3")
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> LinkTokens { get; } =
|
||||
[
|
||||
new("SemiColorLink", "Link"),
|
||||
new("SemiColorLinkPointerover", "Link Pointerover"),
|
||||
new("SemiColorLinkActive", "Link Active"),
|
||||
new("SemiColorLinkVisited", "Link Visited")
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> BackgroundTokens { get; } =
|
||||
[
|
||||
new("SemiColorBackground0", "Background 0"),
|
||||
new("SemiColorBackground1", "Background 1"),
|
||||
new("SemiColorBackground2", "Background 2"),
|
||||
new("SemiColorBackground3", "Background 3"),
|
||||
new("SemiColorBackground4", "Background 4")
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> FillTokens { get; } =
|
||||
[
|
||||
new("SemiColorFill0", "Fill 0"),
|
||||
new("SemiColorFill1", "Fill 1"),
|
||||
new("SemiColorFill2", "Fill 2")
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> BorderTokens { get; } =
|
||||
[
|
||||
new("SemiColorBorder", "Border"),
|
||||
new("SemiColorFocusBorder", "Focus Border")
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> DisabledTokens { get; } =
|
||||
[
|
||||
new("SemiColorDisabledText", "Disabled Text"),
|
||||
new("SemiColorDisabledBorder", "Disabled Border"),
|
||||
new("SemiColorDisabledBackground", "Disabled Background"),
|
||||
new("SemiColorDisabledFill", "Disabled Fill")
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> OtherTokens { get; } =
|
||||
[
|
||||
new("SemiColorWhite", "White"),
|
||||
new("SemiColorBlack", "Black"),
|
||||
new("SemiColorNavBackground", "Navigation Background"),
|
||||
new("SemiColorOverlayBackground", "Overlay Background"),
|
||||
new("SemiColorHighlightBackground", "Highlight Background"),
|
||||
new("SemiColorHighlight", "Highlight Text")
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> ShadowTokens { get; } =
|
||||
[
|
||||
new("SemiColorShadow", "Shadow"),
|
||||
new("SemiShadowElevated", "Shadow Elevated")
|
||||
];
|
||||
}
|
||||
@@ -1,30 +1,32 @@
|
||||
using System.Globalization;
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Input.Platform;
|
||||
using Avalonia.Media;
|
||||
using Avalonia.Media.Immutable;
|
||||
using Semi.Avalonia.Demo.Converters;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Controls;
|
||||
|
||||
public class ColorDetailControl: TemplatedControl
|
||||
public class ColorDetailControl : TemplatedControl
|
||||
{
|
||||
public const string KEY_ResourceKey = "ResourceKey";
|
||||
public const string KEY_Hex = "Hex";
|
||||
public const string KEY_Hex2 = "Hex2";
|
||||
public const string KEY_Opacity = "Opacity";
|
||||
public const string KEY_ColorResourceKey = "ColorResourceKey";
|
||||
|
||||
public static readonly StyledProperty<string?> ResourceKeyProperty = AvaloniaProperty.Register<ColorDetailControl, string?>(
|
||||
nameof(ResourceKey));
|
||||
|
||||
public static readonly StyledProperty<string?> ResourceKeyProperty =
|
||||
AvaloniaProperty.Register<ColorDetailControl, string?>(nameof(ResourceKey));
|
||||
|
||||
public string? ResourceKey
|
||||
{
|
||||
get => GetValue(ResourceKeyProperty);
|
||||
set => SetValue(ResourceKeyProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<string?> ResourceNameProperty = AvaloniaProperty.Register<ColorDetailControl, string?>(
|
||||
nameof(ResourceName));
|
||||
public static readonly StyledProperty<string?> ResourceNameProperty =
|
||||
AvaloniaProperty.Register<ColorDetailControl, string?>(nameof(ResourceName));
|
||||
|
||||
public string? ResourceName
|
||||
{
|
||||
@@ -32,8 +34,8 @@ public class ColorDetailControl: TemplatedControl
|
||||
set => SetValue(ResourceNameProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<string?> ColorResourceKeyProperty = AvaloniaProperty.Register<ColorDetailControl, string?>(
|
||||
nameof(ColorResourceKey));
|
||||
public static readonly StyledProperty<string?> ColorResourceKeyProperty =
|
||||
AvaloniaProperty.Register<ColorDetailControl, string?>(nameof(ColorResourceKey));
|
||||
|
||||
public string? ColorResourceKey
|
||||
{
|
||||
@@ -41,27 +43,39 @@ public class ColorDetailControl: TemplatedControl
|
||||
set => SetValue(ColorResourceKeyProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DirectProperty<ColorDetailControl, string?> HexProperty = AvaloniaProperty.RegisterDirect<ColorDetailControl, string?>(
|
||||
nameof(Hex), o => o.Hex);
|
||||
public static readonly DirectProperty<ColorDetailControl, string?> HexProperty =
|
||||
AvaloniaProperty.RegisterDirect<ColorDetailControl, string?>(nameof(Hex), o => o.Hex);
|
||||
|
||||
private string? _hex;
|
||||
|
||||
public string? Hex
|
||||
{
|
||||
get => _hex;
|
||||
private set => SetAndRaise(HexProperty, ref _hex, value);
|
||||
}
|
||||
|
||||
public static readonly DirectProperty<ColorDetailControl, string?> OpacityNumberProperty = AvaloniaProperty.RegisterDirect<ColorDetailControl, string?>(
|
||||
nameof(OpacityNumber), o => o.OpacityNumber);
|
||||
|
||||
private string? _hex2;
|
||||
|
||||
public static readonly DirectProperty<ColorDetailControl, string?> Hex2Property =
|
||||
AvaloniaProperty.RegisterDirect<ColorDetailControl, string?>(nameof(Hex2), o => o.Hex2);
|
||||
|
||||
public string? Hex2
|
||||
{
|
||||
get => _hex2;
|
||||
set => SetAndRaise(Hex2Property, ref _hex2, value);
|
||||
}
|
||||
|
||||
public static readonly DirectProperty<ColorDetailControl, string?> OpacityNumberProperty =
|
||||
AvaloniaProperty.RegisterDirect<ColorDetailControl, string?>(nameof(OpacityNumber), o => o.OpacityNumber);
|
||||
|
||||
private string? _opacityNumber;
|
||||
|
||||
public string? OpacityNumber
|
||||
{
|
||||
get => _opacityNumber;
|
||||
private set => SetAndRaise(OpacityNumberProperty, ref _opacityNumber, value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static ColorDetailControl()
|
||||
{
|
||||
BackgroundProperty.Changed.AddClassHandler<ColorDetailControl>((o, e) => o.OnBackgroundChanged(e));
|
||||
@@ -70,38 +84,36 @@ public class ColorDetailControl: TemplatedControl
|
||||
private void OnBackgroundChanged(AvaloniaPropertyChangedEventArgs args)
|
||||
{
|
||||
var color = args.GetNewValue<IBrush>();
|
||||
if (color is ISolidColorBrush b)
|
||||
if (color is ISolidColorBrush brush)
|
||||
{
|
||||
Hex = b.Color.ToString().ToUpperInvariant();
|
||||
OpacityNumber = b.Opacity.ToString(CultureInfo.InvariantCulture);
|
||||
var hex1 = ColorConverter.ToHex.Convert(brush.Color, typeof(string), false, CultureInfo.InvariantCulture);
|
||||
var hex2 = ColorConverter.ToHex.Convert(brush.Color, typeof(string), true, CultureInfo.InvariantCulture);
|
||||
Hex = hex1 as string;
|
||||
Hex2 = hex2 as string;
|
||||
OpacityNumber = brush.Opacity.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
}
|
||||
|
||||
public async void Copy(object o)
|
||||
public async Task Copy(object o)
|
||||
{
|
||||
string? text = null;
|
||||
if (o is string s)
|
||||
{
|
||||
switch (s)
|
||||
text = s switch
|
||||
{
|
||||
case KEY_ResourceKey: text = ResourceKey;
|
||||
break;
|
||||
case KEY_Hex: text = Hex;
|
||||
break;
|
||||
case KEY_Opacity: text = OpacityNumber;
|
||||
break;
|
||||
case KEY_ColorResourceKey: text = ColorResourceKey;
|
||||
break;
|
||||
default: text = string.Empty; break;
|
||||
}
|
||||
KEY_ResourceKey => ResourceKey,
|
||||
KEY_Hex => Hex,
|
||||
KEY_Hex2 => Hex2,
|
||||
KEY_Opacity => OpacityNumber,
|
||||
KEY_ColorResourceKey => ColorResourceKey,
|
||||
_ => string.Empty
|
||||
};
|
||||
}
|
||||
|
||||
var toplevel = TopLevel.GetTopLevel(this);
|
||||
if (toplevel?.Clipboard is { } c)
|
||||
{
|
||||
await c.SetTextAsync(text??string.Empty);
|
||||
await c.SetTextAsync(text ?? string.Empty);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Input;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
@@ -9,8 +8,8 @@ namespace Semi.Avalonia.Demo.Controls;
|
||||
|
||||
public class ColorItemControl : TemplatedControl
|
||||
{
|
||||
public static readonly StyledProperty<string?> ColorNameProperty = AvaloniaProperty.Register<ColorItemControl, string?>(
|
||||
nameof(ColorName));
|
||||
public static readonly StyledProperty<string?> ColorNameProperty =
|
||||
AvaloniaProperty.Register<ColorItemControl, string?>(nameof(ColorName));
|
||||
|
||||
public string? ColorName
|
||||
{
|
||||
@@ -26,14 +25,18 @@ public class ColorItemControl : TemplatedControl
|
||||
get => GetValue(HexProperty);
|
||||
set => SetValue(HexProperty, value);
|
||||
}
|
||||
|
||||
|
||||
protected override void OnPointerPressed(PointerPressedEventArgs e)
|
||||
{
|
||||
base.OnPointerPressed(e);
|
||||
if (this.DataContext is ColorItemViewModel v)
|
||||
switch (this.DataContext)
|
||||
{
|
||||
WeakReferenceMessenger.Default.Send(v);
|
||||
case ColorItemViewModel colorItemViewModel:
|
||||
WeakReferenceMessenger.Default.Send(colorItemViewModel);
|
||||
break;
|
||||
case ColorResource colorResource:
|
||||
WeakReferenceMessenger.Default.Send(colorResource);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -4,33 +4,38 @@ using Avalonia.Controls.Primitives;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Controls;
|
||||
|
||||
public class FunctionalColorGroupControl: TemplatedControl
|
||||
public class FunctionalColorGroupControl : TemplatedControl
|
||||
{
|
||||
public static readonly StyledProperty<string?> TitleProperty = AvaloniaProperty.Register<FunctionalColorGroupControl, string?>(
|
||||
nameof(Title));
|
||||
public static readonly StyledProperty<string?> TitleProperty =
|
||||
AvaloniaProperty.Register<FunctionalColorGroupControl, string?>(nameof(Title));
|
||||
|
||||
public string? Title
|
||||
{
|
||||
get => GetValue(TitleProperty);
|
||||
set => SetValue(TitleProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DirectProperty<FunctionalColorGroupControl, IEnumerable?> LightColorsProperty = AvaloniaProperty.RegisterDirect<FunctionalColorGroupControl, IEnumerable?>(
|
||||
nameof(LightColors), o => o.LightColors, (o, v) => o.LightColors = v);
|
||||
|
||||
public static readonly DirectProperty<FunctionalColorGroupControl, IEnumerable?> LightColorsProperty =
|
||||
AvaloniaProperty.RegisterDirect<FunctionalColorGroupControl, IEnumerable?>(nameof(LightColors),
|
||||
o => o.LightColors, (o, v) => o.LightColors = v);
|
||||
|
||||
private IEnumerable? _lightColors;
|
||||
|
||||
public IEnumerable? LightColors
|
||||
{
|
||||
get => _lightColors;
|
||||
set => SetAndRaise(LightColorsProperty, ref _lightColors, value);
|
||||
}
|
||||
|
||||
public static readonly DirectProperty<FunctionalColorGroupControl, IEnumerable?> DarkColorsProperty = AvaloniaProperty.RegisterDirect<FunctionalColorGroupControl, IEnumerable?>(
|
||||
nameof(DarkColors), o => o.DarkColors, (o, v) => o.DarkColors = v);
|
||||
|
||||
public static readonly DirectProperty<FunctionalColorGroupControl, IEnumerable?> DarkColorsProperty =
|
||||
AvaloniaProperty.RegisterDirect<FunctionalColorGroupControl, IEnumerable?>(nameof(DarkColors),
|
||||
o => o.DarkColors, (o, v) => o.DarkColors = v);
|
||||
|
||||
private IEnumerable? _darkColors;
|
||||
|
||||
public IEnumerable? DarkColors
|
||||
{
|
||||
get => _darkColors;
|
||||
set => SetAndRaise(DarkColorsProperty, ref _darkColors, value);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
41
demo/Semi.Avalonia.Demo/Controls/ShadowGroupControl.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System.Collections;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls.Primitives;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Controls;
|
||||
|
||||
public class ShadowGroupControl : TemplatedControl
|
||||
{
|
||||
public static readonly StyledProperty<string?> TitleProperty =
|
||||
AvaloniaProperty.Register<ShadowGroupControl, string?>(nameof(Title));
|
||||
|
||||
public string? Title
|
||||
{
|
||||
get => GetValue(TitleProperty);
|
||||
set => SetValue(TitleProperty, value);
|
||||
}
|
||||
|
||||
private IEnumerable? _lightShadows;
|
||||
|
||||
public static readonly DirectProperty<ShadowGroupControl, IEnumerable?> LightShadowsProperty =
|
||||
AvaloniaProperty.RegisterDirect<ShadowGroupControl, IEnumerable?>(nameof(LightShadows),
|
||||
o => o.LightShadows, (o, v) => o.LightShadows = v);
|
||||
|
||||
public IEnumerable? LightShadows
|
||||
{
|
||||
get => _lightShadows;
|
||||
set => SetAndRaise(LightShadowsProperty, ref _lightShadows, value);
|
||||
}
|
||||
|
||||
private IEnumerable? _darkShadows;
|
||||
|
||||
public static readonly DirectProperty<ShadowGroupControl, IEnumerable?> DarkShadowsProperty =
|
||||
AvaloniaProperty.RegisterDirect<ShadowGroupControl, IEnumerable?>(nameof(DarkShadows),
|
||||
o => o.DarkShadows, (o, v) => o.DarkShadows = v);
|
||||
|
||||
public IEnumerable? DarkShadows
|
||||
{
|
||||
get => _darkShadows;
|
||||
set => SetAndRaise(DarkShadowsProperty, ref _darkShadows, value);
|
||||
}
|
||||
}
|
||||
22
demo/Semi.Avalonia.Demo/Converters/ColorConverter.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Avalonia.Data.Converters;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Converters;
|
||||
|
||||
public static class ColorConverter
|
||||
{
|
||||
public static readonly IValueConverter ToHex =
|
||||
new FuncValueConverter<object, bool, string>(
|
||||
(obj, withAlpha) =>
|
||||
obj switch
|
||||
{
|
||||
Color color => withAlpha
|
||||
? $"#{color.A:X2}{color.R:X2}{color.G:X2}{color.B:X2}"
|
||||
: $"#{color.R:X2}{color.G:X2}{color.B:X2}",
|
||||
ISolidColorBrush brush => withAlpha
|
||||
? $"#{brush.Color.A:X2}{brush.Color.R:X2}{brush.Color.G:X2}{brush.Color.B:X2}"
|
||||
: $"#{brush.Color.R:X2}{brush.Color.G:X2}{brush.Color.B:X2}",
|
||||
_ => string.Empty
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -3,15 +3,13 @@ using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using Avalonia;
|
||||
using Avalonia.Data.Converters;
|
||||
using Avalonia.Media;
|
||||
using Avalonia.Metadata;
|
||||
|
||||
namespace Semi.Avalonia.TreeDataGrid.Demo.Converters;
|
||||
namespace Semi.Avalonia.Demo.Converters;
|
||||
|
||||
public class FileIconConverter: IMultiValueConverter
|
||||
public class FileIconConverter : IMultiValueConverter
|
||||
{
|
||||
[Content]
|
||||
public Dictionary<string, PathGeometry> Items { get; set; } = new Dictionary<string, PathGeometry>();
|
||||
[Content] public IDictionary<string, object?> Items { get; } = new Dictionary<string, object?>();
|
||||
|
||||
public object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
@@ -21,8 +19,10 @@ public class FileIconConverter: IMultiValueConverter
|
||||
{
|
||||
return Items["file"];
|
||||
}
|
||||
|
||||
return isOpen ? Items["folderOpen"] : Items["folderClosed"];
|
||||
}
|
||||
|
||||
return AvaloniaProperty.UnsetValue;
|
||||
}
|
||||
}
|
||||
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
@@ -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:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
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:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
x:CompileBindings="False"
|
||||
x:DataType="local:AutoCompleteBoxDemoViewModel"
|
||||
x:DataType="vm:AutoCompleteBoxDemoViewModel"
|
||||
mc:Ignorable="d">
|
||||
<Design.DataContext>
|
||||
<local:AutoCompleteBoxDemoViewModel />
|
||||
<vm:AutoCompleteBoxDemoViewModel />
|
||||
</Design.DataContext>
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
||||
<StackPanel.Styles>
|
||||
@@ -21,7 +20,7 @@
|
||||
<Binding Path="States" />
|
||||
</Setter>
|
||||
<Setter Property="ItemTemplate">
|
||||
<DataTemplate DataType="local:StateData">
|
||||
<DataTemplate DataType="vm:StateData">
|
||||
<TextBlock Text="{Binding Name}" />
|
||||
</DataTemplate>
|
||||
</Setter>
|
||||
@@ -30,40 +29,40 @@
|
||||
|
||||
<AutoCompleteBox
|
||||
Watermark="Please select a State"
|
||||
ValueMemberBinding="{Binding Name}" />
|
||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||
<AutoCompleteBox
|
||||
Classes="Large"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||
<AutoCompleteBox
|
||||
Classes="Small"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||
<AutoCompleteBox
|
||||
Classes="Bordered"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||
<AutoCompleteBox
|
||||
IsEnabled="False"
|
||||
Watermark="Disabled"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||
<AutoCompleteBox
|
||||
InnerLeftContent="https://"
|
||||
InnerRightContent=".com"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<AutoCompleteBox
|
||||
Width="100"
|
||||
Classes="Large"
|
||||
Watermark="Large"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||
<AutoCompleteBox
|
||||
Width="100"
|
||||
Watermark="Default"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||
<AutoCompleteBox
|
||||
Width="100"
|
||||
Classes="Small"
|
||||
Watermark="Small"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
@@ -71,17 +70,17 @@
|
||||
Width="100"
|
||||
IsEnabled="False"
|
||||
Watermark="Disabled"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||
<AutoCompleteBox
|
||||
Width="100"
|
||||
Classes="Bordered"
|
||||
Watermark="Bordered"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||
<AutoCompleteBox
|
||||
Width="100"
|
||||
Classes="Bordered"
|
||||
IsEnabled="False"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||
</StackPanel>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using System.Collections.Generic;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using Semi.Avalonia.Demo.ViewModels;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
@@ -14,86 +10,4 @@ public partial class AutoCompleteBoxDemo : UserControl
|
||||
InitializeComponent();
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -18,4 +18,4 @@
|
||||
<TextBlock>Shadow on Pointerover</TextBlock>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -1,6 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
|
||||
@@ -112,14 +112,14 @@
|
||||
IsEnabled="False" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<DropDownButton Content="Default" Classes="Success"/>
|
||||
<DropDownButton Content="Solid" Theme="{DynamicResource SolidDropDownButton}" Classes="Success"/>
|
||||
<DropDownButton Content="Outline" Theme="{DynamicResource OutlineDropDownButton}" Classes="Success"/>
|
||||
<DropDownButton Content="Borderless" Theme="{DynamicResource BorderlessDropDownButton}" Classes="Success"/>
|
||||
<DropDownButton Content="Default" Classes="Success" IsEnabled="False"/>
|
||||
<DropDownButton Content="Solid" Theme="{DynamicResource SolidDropDownButton}" Classes="Success" IsEnabled="False"/>
|
||||
<DropDownButton Content="Outline" Theme="{DynamicResource OutlineDropDownButton}" Classes="Success" IsEnabled="False"/>
|
||||
<DropDownButton Content="Borderless" Theme="{DynamicResource BorderlessDropDownButton}" Classes="Success" IsEnabled="False"/>
|
||||
<DropDownButton Content="Default" Classes="Success" />
|
||||
<DropDownButton Content="Solid" Theme="{DynamicResource SolidDropDownButton}" Classes="Success" />
|
||||
<DropDownButton Content="Outline" Theme="{DynamicResource OutlineDropDownButton}" Classes="Success" />
|
||||
<DropDownButton Content="Borderless" Theme="{DynamicResource BorderlessDropDownButton}" Classes="Success" />
|
||||
<DropDownButton Content="Default" Classes="Success" IsEnabled="False" />
|
||||
<DropDownButton Content="Solid" Theme="{DynamicResource SolidDropDownButton}" Classes="Success" IsEnabled="False" />
|
||||
<DropDownButton Content="Outline" Theme="{DynamicResource OutlineDropDownButton}" Classes="Success" IsEnabled="False" />
|
||||
<DropDownButton Content="Borderless" Theme="{DynamicResource BorderlessDropDownButton}" Classes="Success" IsEnabled="False" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<DropDownButton Classes="Small" Content="Small" />
|
||||
@@ -139,7 +139,7 @@
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<SplitButton Content="Default" Classes="Success" />
|
||||
<SplitButton Content="Solid" Theme="{DynamicResource SolidSplitButton}" 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" />
|
||||
@@ -165,7 +165,7 @@
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<ToggleSplitButton Content="Default" Classes="Success" />
|
||||
<ToggleSplitButton Content="Checked" Classes="Success" IsChecked="True" />
|
||||
<ToggleSplitButton Content="Checked" Classes="Success" IsChecked="True" />
|
||||
<ToggleSplitButton Content="Default" Classes="Success" IsEnabled="False" />
|
||||
<ToggleSplitButton Content="Checked" Classes="Success" IsChecked="True" IsEnabled="False" />
|
||||
</StackPanel>
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
|
||||
@@ -8,6 +8,10 @@
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<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
|
||||
Height="30"
|
||||
AllowSpin="{Binding #allowSpinCheck.IsChecked}"
|
||||
@@ -32,4 +36,4 @@
|
||||
Text="A.S.I.A" />
|
||||
</ButtonSpinner>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -1,7 +1,5 @@
|
||||
using System;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
@@ -31,7 +29,6 @@ public partial class ButtonSpinnerDemo : UserControl
|
||||
|
||||
txtBox.Text = _mountains[value];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private readonly string[] _mountains = new[]
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
|
||||
@@ -11,4 +11,4 @@
|
||||
<Calendar />
|
||||
<Calendar SelectionMode="SingleRange" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -1,6 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
@@ -10,9 +8,4 @@ public partial class CalendarDemo : UserControl
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
@@ -8,20 +8,26 @@
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Styles>
|
||||
<Style Selector="Border">
|
||||
<Style Selector="Carousel">
|
||||
<Setter Property="Height" Value="200" />
|
||||
<Style Selector="^ TextBlock">
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Foreground" Value="#1C1F23" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="TextBlock">
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Foreground" Value="#1C1F23" />
|
||||
<Style Selector="RadioButton">
|
||||
<Setter Property="Theme" Value="{DynamicResource ButtonRadioButton}" />
|
||||
</Style>
|
||||
</UserControl.Styles>
|
||||
<StackPanel Spacing="20">
|
||||
<Carousel Theme="{DynamicResource FullCarousel}">
|
||||
<Carousel.PageTransition>
|
||||
<PageSlide Orientation="Horizontal" Duration="0.25" />
|
||||
</Carousel.PageTransition>
|
||||
<Carousel Theme="{DynamicResource FullCarousel}"
|
||||
Classes.Dot="{Binding #DotButton.IsChecked}"
|
||||
Classes.Columnar="{Binding #ColumnarButton.IsChecked}"
|
||||
Classes.Line="{Binding #LineButton.IsChecked}"
|
||||
Classes.Left="{Binding #LeftButton.IsChecked}"
|
||||
Classes.Center="{Binding #CenterButton.IsChecked}"
|
||||
Classes.Right="{Binding #RightButton.IsChecked}">
|
||||
<Border Background="#EAF5FF">
|
||||
<TextBlock Text="Text 1" />
|
||||
</Border>
|
||||
@@ -35,39 +41,39 @@
|
||||
<TextBlock Text="Text 4" />
|
||||
</Border>
|
||||
</Carousel>
|
||||
<Carousel Classes="Line" Theme="{DynamicResource FullCarousel}">
|
||||
<Carousel.PageTransition>
|
||||
<PageSlide Orientation="Horizontal" Duration="0.25" />
|
||||
</Carousel.PageTransition>
|
||||
<Border Background="#EAF5FF">
|
||||
<TextBlock Text="Text 1" />
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<TextBlock VerticalAlignment="Center" Text="Type" />
|
||||
<Border Theme="{DynamicResource RadioButtonGroupBorder}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<RadioButton
|
||||
Name="DotButton"
|
||||
IsChecked="True"
|
||||
Content="Dot" />
|
||||
<RadioButton
|
||||
Name="ColumnarButton"
|
||||
Content="Columnar" />
|
||||
<RadioButton
|
||||
Name="LineButton"
|
||||
Content="Line" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border Background="#F9F9F9">
|
||||
<TextBlock Text="Text 2" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<TextBlock VerticalAlignment="Center" Text="Position" />
|
||||
<Border Theme="{DynamicResource RadioButtonGroupBorder}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<RadioButton
|
||||
Name="LeftButton"
|
||||
IsChecked="True"
|
||||
Content="Left" />
|
||||
<RadioButton
|
||||
Name="CenterButton"
|
||||
Content="Center" />
|
||||
<RadioButton
|
||||
Name="RightButton"
|
||||
Content="Right" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border Background="#FFF8EA">
|
||||
<TextBlock Text="Text 3" />
|
||||
</Border>
|
||||
<Border Background="#FEF2ED">
|
||||
<TextBlock Text="Text 4" />
|
||||
</Border>
|
||||
</Carousel>
|
||||
<Carousel Classes="Columnar Left" Theme="{DynamicResource FullCarousel}">
|
||||
<Carousel.PageTransition>
|
||||
<PageSlide Orientation="Horizontal" Duration="0.25" />
|
||||
</Carousel.PageTransition>
|
||||
<Border Background="#EAF5FF">
|
||||
<TextBlock Text="Text 1" />
|
||||
</Border>
|
||||
<Border Background="#F9F9F9">
|
||||
<TextBlock Text="Text 2" />
|
||||
</Border>
|
||||
<Border Background="#FFF8EA">
|
||||
<TextBlock Text="Text 3" />
|
||||
</Border>
|
||||
<Border Background="#FEF2ED">
|
||||
<TextBlock Text="Text 4" />
|
||||
</Border>
|
||||
</Carousel>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -1,7 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
x:Class="Semi.Avalonia.Demo.Pages.ColorPickerDemo"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:semi="https://irihi.tech/semi"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="1450"
|
||||
@@ -11,18 +10,15 @@
|
||||
mc:Ignorable="d">
|
||||
<ScrollViewer>
|
||||
<StackPanel Spacing="20">
|
||||
<StackPanel
|
||||
VerticalAlignment="Top"
|
||||
Orientation="Horizontal"
|
||||
Spacing="20">
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<ColorView Name="Test" ColorSpectrumShape="Ring" />
|
||||
<ColorView ColorSpectrumShape="Box" />
|
||||
<ColorView Palette="{DynamicResource SemiColorPalette}" />
|
||||
</StackPanel>
|
||||
<StackPanel VerticalAlignment="Top" Orientation="Horizontal">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ColorView
|
||||
Name="SimpleColorViewTest"
|
||||
HsvColor="hsv(120,11%,10%)"
|
||||
HsvColor="hsv(180,80%,70%)"
|
||||
IsAlphaVisible="True"
|
||||
Theme="{StaticResource SimpleColorView}" />
|
||||
<StackPanel>
|
||||
@@ -30,63 +26,55 @@
|
||||
<TextBlock Text="{Binding #SimpleColorViewTest.Color}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
||||
<ColorPicker Margin="8" ColorSpectrumShape="Ring">
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<ColorPicker ColorSpectrumShape="Ring">
|
||||
<ColorPicker.Palette>
|
||||
<controls:FlatHalfColorPalette />
|
||||
<FlatHalfColorPalette />
|
||||
</ColorPicker.Palette>
|
||||
</ColorPicker>
|
||||
<ColorPicker Margin="8" ColorSpectrumShape="Box">
|
||||
<ColorPicker ColorSpectrumShape="Box">
|
||||
<ColorPicker.Palette>
|
||||
<colorPicker:SemiColorLightPalette />
|
||||
<semi:SemiColorLightPalette />
|
||||
</ColorPicker.Palette>
|
||||
</ColorPicker>
|
||||
|
||||
<ColorPicker
|
||||
Margin="8"
|
||||
ColorSpectrumShape="Box"
|
||||
Theme="{DynamicResource HexColorPicker}">
|
||||
Theme="{DynamicResource HexColorPicker}"
|
||||
ColorSpectrumShape="Box">
|
||||
<ColorPicker.Palette>
|
||||
<colorPicker:SemiColorLightPalette />
|
||||
<semi:SemiColorLightPalette />
|
||||
</ColorPicker.Palette>
|
||||
</ColorPicker>
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Left" >
|
||||
<TextBlock Text="Use Style to customize button"></TextBlock>
|
||||
<StackPanel HorizontalAlignment="Left">
|
||||
<TextBlock Text="Use Style to customize button" />
|
||||
<ColorPicker
|
||||
Margin="8"
|
||||
Width="32"
|
||||
HsvColor="hsv(120,11%,10%)"
|
||||
>
|
||||
MinWidth="32"
|
||||
HsvColor="hsv(180,80%,70%)">
|
||||
<ColorPicker.Content>
|
||||
<Border
|
||||
Margin="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Background="{Binding $parent[ColorPicker].HsvColor,
|
||||
Converter={StaticResource ToBrushConverter}}"
|
||||
Background="{Binding $parent[ColorPicker].HsvColor, Converter={StaticResource ToBrushConverter}}"
|
||||
CornerRadius="1" />
|
||||
</ColorPicker.Content>
|
||||
<ColorPicker.Styles>
|
||||
<Style Selector="DropDownButton">
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Style Selector="^ /template/ PathIcon">
|
||||
<Setter Property="IsVisible" Value="False"/>
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
</Style>
|
||||
</ColorPicker.Styles>
|
||||
</ColorPicker>
|
||||
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
||||
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<ColorPicker
|
||||
Margin="8"
|
||||
HsvColor="hsv(120,11%,10%)"
|
||||
Theme="{StaticResource SimpleColorPicker}" />
|
||||
Theme="{StaticResource SimpleColorPicker}"
|
||||
HsvColor="hsv(180,80%,70%)" />
|
||||
<ColorPicker
|
||||
Margin="8"
|
||||
HsvColor="hsv(120,11%,10%)"
|
||||
Theme="{StaticResource HexSimpleColorPicker}" />
|
||||
Theme="{StaticResource HexSimpleColorPicker}"
|
||||
HsvColor="hsv(180,80%,70%)" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
|
||||
@@ -4,40 +4,54 @@
|
||||
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:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
|
||||
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
|
||||
d:DesignHeight="800"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
mc:Ignorable="d"
|
||||
x:DataType="vm:ComboBoxDemoViewModel">
|
||||
<Design.DataContext>
|
||||
<pages:ComboBoxDemoViewModel />
|
||||
<vm:ComboBoxDemoViewModel />
|
||||
</Design.DataContext>
|
||||
<StackPanel Spacing="20">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="ComboBox">
|
||||
<Setter Property="Width" Value="300" />
|
||||
<Setter Property="ItemsSource" Value="{Binding Items}" />
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<ScrollViewer>
|
||||
<StackPanel Spacing="20">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="ComboBox">
|
||||
<Setter Property="Width" Value="300" />
|
||||
<Setter Property="ItemsSource" Value="{Binding Items}" />
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
|
||||
<ComboBox />
|
||||
<ComboBox Classes="ClearButton" />
|
||||
<ComboBox PlaceholderText="Please Select" />
|
||||
<ComboBox IsEnabled="False" />
|
||||
<ComboBox Classes="Large" IsEnabled="False" />
|
||||
<ComboBox Classes="Small" />
|
||||
<ComboBox Classes="Bordered" />
|
||||
<ComboBox Classes="Bordered" IsEnabled="False" />
|
||||
<ComboBox />
|
||||
<ComboBox Classes="ClearButton" />
|
||||
<ComboBox PlaceholderText="Please Select" />
|
||||
<ComboBox IsEnabled="False" />
|
||||
<ComboBox Classes="Large" IsEnabled="False" />
|
||||
<ComboBox Classes="Small" />
|
||||
<ComboBox Classes="Bordered" />
|
||||
<ComboBox Classes="Bordered" IsEnabled="False" />
|
||||
<ComboBox>
|
||||
<ComboBox.SelectionBoxItemTemplate>
|
||||
<DataTemplate DataType="x:String">
|
||||
<ContentControl BorderThickness="1"
|
||||
BorderBrush="Gold"
|
||||
Content="{Binding}" />
|
||||
</DataTemplate>
|
||||
</ComboBox.SelectionBoxItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ComboBox Width="100" Classes="Large" PlaceholderText="Large" />
|
||||
<ComboBox Width="100" PlaceholderText="Default" />
|
||||
<ComboBox Width="100" Classes="Small" PlaceholderText="Small" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ComboBox Width="100" Classes="Large" PlaceholderText="Large" />
|
||||
<ComboBox Width="100" PlaceholderText="Default" />
|
||||
<ComboBox Width="100" Classes="Small" PlaceholderText="Small" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ComboBox Width="100" IsEnabled="False" PlaceholderText="Disabled" />
|
||||
<ComboBox Width="100" Classes="Bordered" PlaceholderText="Bordered" />
|
||||
<ComboBox Width="100" Classes="Bordered" IsEnabled="False" />
|
||||
</StackPanel>
|
||||
<ToggleSwitch Name="toggle" IsChecked="True" Content="IsEditable" />
|
||||
<ComboBox IsEditable="{Binding #toggle.IsChecked}" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ComboBox Width="100" IsEnabled="False" PlaceholderText="Disabled" />
|
||||
<ComboBox Width="100" Classes="Bordered" PlaceholderText="Bordered" />
|
||||
<ComboBox Width="100" Classes="Bordered" IsEnabled="False" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using Avalonia.Controls;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using Semi.Avalonia.Demo.ViewModels;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
@@ -11,9 +10,4 @@ public partial class ComboBoxDemo : UserControl
|
||||
InitializeComponent();
|
||||
this.DataContext = new ComboBoxDemoViewModel();
|
||||
}
|
||||
}
|
||||
|
||||
public class ComboBoxDemoViewModel : ObservableObject
|
||||
{
|
||||
public ObservableCollection<string> Items { get; set; } = ["Ding", "Otter", "Husky", "Mr.17", "Cass"];
|
||||
}
|
||||
@@ -3,62 +3,62 @@
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="using:Semi.Avalonia.Demo.Pages"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels;assembly=Semi.Avalonia.Demo"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
x:CompileBindings="True"
|
||||
x:DataType="vm:DataGridDemoViewModel"
|
||||
mc:Ignorable="d">
|
||||
<TabControl>
|
||||
<TabItem Header="DataGrid">
|
||||
<Grid RowDefinitions="Auto, *">
|
||||
<StackPanel Grid.Row="0" Orientation="Horizontal">
|
||||
<ToggleSwitch Content="Disable" Name="DisableToggle" />
|
||||
<ToggleSwitch Content="ScrollViewerHide" Name="ScrollViewerHide" />
|
||||
</StackPanel>
|
||||
<DataGrid Grid.Row="1"
|
||||
Margin="8"
|
||||
CanUserReorderColumns="True"
|
||||
CanUserResizeColumns="True"
|
||||
CanUserSortColumns="True"
|
||||
HeadersVisibility="All"
|
||||
IsReadOnly="True"
|
||||
ScrollViewer.AllowAutoHide="{Binding #ScrollViewerHide.IsChecked}"
|
||||
IsEnabled="{Binding #DisableToggle.IsChecked}"
|
||||
ItemsSource="{Binding GridData1}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="6*"
|
||||
x:DataType="vm:Song"
|
||||
Binding="{Binding Title}"
|
||||
Header="Title" />
|
||||
<DataGridTextColumn
|
||||
Width="6*"
|
||||
x:DataType="vm:Song"
|
||||
Binding="{Binding Artist}"
|
||||
Header="Artist" />
|
||||
<DataGridTextColumn
|
||||
Width="6*"
|
||||
x:DataType="vm:Song"
|
||||
Binding="{Binding Album}"
|
||||
Header="Album" />
|
||||
<DataGridTemplateColumn Header="Duration" SortMemberPath="Duration">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock
|
||||
Margin="8,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Duration}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
<Grid RowDefinitions="Auto, *">
|
||||
<StackPanel Grid.Row="0" Orientation="Horizontal">
|
||||
<ToggleSwitch Content="Enable" Name="enable" IsChecked="True" />
|
||||
<ToggleSwitch Content="Inset Content" Name="inset" />
|
||||
<ToggleSwitch Content="ScrollBar Auto Hide" Name="autohide" />
|
||||
</StackPanel>
|
||||
<DataGrid Grid.Row="1"
|
||||
Margin="8"
|
||||
CanUserReorderColumns="True"
|
||||
CanUserResizeColumns="True"
|
||||
CanUserSortColumns="True"
|
||||
HeadersVisibility="All"
|
||||
IsReadOnly="True"
|
||||
Classes.InsetContent="{Binding #inset.IsChecked}"
|
||||
ScrollViewer.AllowAutoHide="{Binding #autohide.IsChecked}"
|
||||
IsEnabled="{Binding #enable.IsChecked}"
|
||||
ItemsSource="{Binding GridData1}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="6*"
|
||||
x:DataType="vm:Song"
|
||||
Binding="{Binding Title}"
|
||||
Header="Title" />
|
||||
<DataGridTextColumn
|
||||
Width="6*"
|
||||
x:DataType="vm:Song"
|
||||
Binding="{Binding Artist}"
|
||||
Header="Artist" />
|
||||
<DataGridTextColumn
|
||||
Width="6*"
|
||||
x:DataType="vm:Song"
|
||||
Binding="{Binding Album}"
|
||||
Header="Album" />
|
||||
<DataGridTemplateColumn Header="Duration" SortMemberPath="Duration">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock
|
||||
Margin="8,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Duration}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
|
||||
</DataGrid>
|
||||
|
||||
</Grid>
|
||||
</DataGrid>
|
||||
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="Grouping">
|
||||
<DataGrid
|
||||
@@ -101,7 +101,7 @@
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</TabItem>
|
||||
<TabItem x:Name="EditableTab" Header="Editable">
|
||||
<TabItem Name="EditableTab" Header="Editable">
|
||||
<Grid Margin="8" RowDefinitions="Auto,*,Auto">
|
||||
<StackPanel
|
||||
Grid.Row="0"
|
||||
@@ -109,14 +109,14 @@
|
||||
Spacing="4">
|
||||
<TextBlock VerticalAlignment="Center" Text="FontSize:" />
|
||||
<Slider
|
||||
x:Name="FontSizeSlider"
|
||||
Name="FontSizeSlider"
|
||||
Width="100"
|
||||
VerticalAlignment="Center"
|
||||
Maximum="30"
|
||||
Minimum="5"
|
||||
Value="14" />
|
||||
<CheckBox
|
||||
x:Name="IsThreeStateCheckBox"
|
||||
Name="IsThreeStateCheckBox"
|
||||
Content="IsThreeState"
|
||||
IsChecked="False" />
|
||||
</StackPanel>
|
||||
@@ -176,4 +176,4 @@
|
||||
</Grid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -1,18 +1,4 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using Avalonia;
|
||||
using Avalonia.Collections;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Data;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Input.Raw;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.Threading;
|
||||
using Semi.Avalonia.Demo.ViewModels;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
@@ -80,4 +80,4 @@
|
||||
</TextBox>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -1,6 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
@@ -10,9 +8,4 @@ public partial class DataValidationErrorsDemo : UserControl
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
@@ -26,4 +26,4 @@
|
||||
</StackPanel>
|
||||
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -1,7 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
@@ -11,14 +8,4 @@ public partial class DatePickerDemo : UserControl
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
|
||||
public override void Render(DrawingContext context)
|
||||
{
|
||||
base.Render(context);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.LogicalTree;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class GridSplitter : UserControl
|
||||
{
|
||||
public GridSplitter()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<UserControl
|
||||
x:Class="Semi.Avalonia.Demo.Pages.GridSplitter"
|
||||
x:Class="Semi.Avalonia.Demo.Pages.GridSplitterDemo"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
@@ -14,13 +14,13 @@
|
||||
RowDefinitions="*, Auto, *">
|
||||
<Border
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="#FEFBCB"
|
||||
Background="{DynamicResource SemiGrey0Color}"
|
||||
CornerRadius="10" />
|
||||
<GridSplitter Grid.Row="1" ShowsPreview="True" />
|
||||
<Border
|
||||
Grid.Row="2"
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="#FEFBCB"
|
||||
Background="{DynamicResource SemiGrey0Color}"
|
||||
CornerRadius="10" />
|
||||
</Grid>
|
||||
<Grid
|
||||
@@ -29,14 +29,14 @@
|
||||
ColumnDefinitions="*, Auto, *">
|
||||
<Border
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="#FEFBCB"
|
||||
Background="{DynamicResource SemiGrey0Color}"
|
||||
CornerRadius="10" />
|
||||
<GridSplitter Grid.Column="1" ShowsPreview="True" />
|
||||
<Border
|
||||
Grid.Column="2"
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="#FEFBCB"
|
||||
Background="{DynamicResource SemiGrey0Color}"
|
||||
CornerRadius="10" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
11
demo/Semi.Avalonia.Demo/Pages/GridSplitterDemo.axaml.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class GridSplitterDemo : UserControl
|
||||
{
|
||||
public GridSplitterDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="1450"
|
||||
x:Class="Semi.Avalonia.Demo.Pages.HeaderedContentControlDemo">
|
||||
<ScrollViewer>
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
||||
@@ -27,12 +27,18 @@
|
||||
</WrapPanel>
|
||||
<TextBlock>GroupBox Theme</TextBlock>
|
||||
<HeaderedContentControl
|
||||
HorizontalAlignment="Left"
|
||||
Theme="{DynamicResource GroupBox}"
|
||||
Header="Semi Design"
|
||||
Width="400"
|
||||
Height="200">
|
||||
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统。设计系统包含设计语言以及一整套可复用的前端组件,帮助设计师与开发者更容易地打造高质量的、用户体验一致的、符合设计规范的 Web 应用。</TextBlock>
|
||||
HorizontalAlignment="Left"
|
||||
MaxWidth="360">
|
||||
<HeaderedContentControl.Header>
|
||||
<Panel>
|
||||
<SelectableTextBlock Text="Semi Design" />
|
||||
<HyperlinkButton HorizontalAlignment="Right" Content="更多" />
|
||||
</Panel>
|
||||
</HeaderedContentControl.Header>
|
||||
<HeaderedContentControl.Content>
|
||||
<SelectableTextBlock Text="Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统。设计系统包含设计语言以及一整套可复用的前端组件,帮助设计师与开发者更容易地打造高质量的、用户体验一致的、符合设计规范的 Web 应用。" />
|
||||
</HeaderedContentControl.Content>
|
||||
</HeaderedContentControl>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
327
demo/Semi.Avalonia.Demo/Pages/HighContrastDemo.axaml
Normal file
@@ -0,0 +1,327 @@
|
||||
<UserControl 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:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
|
||||
xmlns:controls="clr-namespace:Semi.Avalonia.Demo.Controls"
|
||||
xmlns:cvt="clr-namespace:Semi.Avalonia.Demo.Converters"
|
||||
xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
|
||||
mc:Ignorable="d" d:DesignWidth="1000" d:DesignHeight="1450"
|
||||
x:DataType="vm:HighContrastDemoViewModel"
|
||||
x:Class="Semi.Avalonia.Demo.Pages.HighContrastDemo">
|
||||
<Design.DataContext>
|
||||
<vm:HighContrastDemoViewModel />
|
||||
</Design.DataContext>
|
||||
<SplitView
|
||||
Name="splitView"
|
||||
CompactPaneLength="50"
|
||||
DisplayMode="CompactInline"
|
||||
IsPaneOpen="{Binding #toggle.IsChecked, Mode=TwoWay}"
|
||||
OpenPaneLength="300"
|
||||
PanePlacement="Right">
|
||||
<SplitView.Pane>
|
||||
<StackPanel>
|
||||
<ToggleSwitch
|
||||
Name="toggle"
|
||||
HorizontalAlignment="Right"
|
||||
IsChecked="True"
|
||||
Theme="{DynamicResource IconBorderlessToggleSwitch}"
|
||||
Content="{StaticResource SemiIconSidebar}" />
|
||||
<Border IsVisible="{Binding #splitView.IsPaneOpen}" Theme="{DynamicResource CardBorder}">
|
||||
<Panel>
|
||||
<TextBlock
|
||||
IsVisible="{Binding SelectedColorResource, Converter={x:Static ObjectConverters.IsNull}}"
|
||||
Text="Click on Color to Check Details"
|
||||
TextWrapping="Wrap" />
|
||||
<controls:ColorDetailControl
|
||||
Background="{Binding SelectedColorResource.Brush}"
|
||||
IsVisible="{Binding SelectedColorResource, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
ResourceKey="{Binding SelectedColorResource.ResourceKey}"
|
||||
ResourceName="{Binding SelectedColorResource.ResourceKey}" />
|
||||
</Panel>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</SplitView.Pane>
|
||||
<SplitView.Content>
|
||||
<ScrollViewer>
|
||||
<StackPanel Spacing="10">
|
||||
<TextBlock Text="Theme Preview" FontWeight="SemiBold" />
|
||||
<ListBox
|
||||
Theme="{StaticResource PureCardRadioGroupListBox}"
|
||||
ItemsSource="{Binding ThemeVariants}"
|
||||
SelectedItem="{Binding SelectedThemeVariant}">
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="5" MinWidth="200">
|
||||
<ThemeVariantScope RequestedThemeVariant="{Binding}">
|
||||
<Border
|
||||
Padding="5 25 5 5"
|
||||
HorizontalAlignment="Left"
|
||||
Background="{DynamicResource WindowColor}"
|
||||
BorderBrush="{DynamicResource WindowTextColor}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="3">
|
||||
<StackPanel Spacing="10">
|
||||
<StackPanel Orientation="Horizontal" Spacing="50">
|
||||
<StackPanel Spacing="5">
|
||||
<TextBlock
|
||||
FontSize="50"
|
||||
Text="Aa" />
|
||||
<StackPanel Orientation="Horizontal" Spacing="3">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="Border">
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource WindowTextColor}" />
|
||||
<Setter Property="CornerRadius" Value="5" />
|
||||
<Setter Property="Width" Value="10" />
|
||||
<Setter Property="Height" Value="{Binding $self.Width}" />
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<Border Background="{DynamicResource WindowColor}" />
|
||||
<Border Background="{DynamicResource HotlightColor}" />
|
||||
<Border Background="{DynamicResource GrayTextColor}" />
|
||||
<Border Background="{DynamicResource HighlightTextColor}" />
|
||||
<Border Background="{DynamicResource HighlightColor}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<Border
|
||||
BorderThickness="1"
|
||||
BorderBrush="{DynamicResource WindowTextColor}"
|
||||
CornerRadius="3"
|
||||
Padding="8">
|
||||
<Panel>
|
||||
<StackPanel Spacing="5">
|
||||
<Border
|
||||
Width="50"
|
||||
Height="1"
|
||||
Background="{DynamicResource WindowTextColor}" />
|
||||
<Border
|
||||
Height="1"
|
||||
Background="{DynamicResource WindowTextColor}" />
|
||||
<Border
|
||||
Height="1"
|
||||
Background="{DynamicResource WindowTextColor}" />
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Bottom"
|
||||
Orientation="Horizontal"
|
||||
Spacing="2">
|
||||
<Border
|
||||
Width="20"
|
||||
Height="5"
|
||||
Background="{DynamicResource HighlightColor}"
|
||||
CornerRadius="1" />
|
||||
<Border
|
||||
Width="20"
|
||||
Height="5"
|
||||
BorderThickness="1"
|
||||
BorderBrush="{DynamicResource ButtonTextColor}"
|
||||
CornerRadius="1" />
|
||||
</StackPanel>
|
||||
</Panel>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
<Border
|
||||
Height="1"
|
||||
Background="{DynamicResource WindowTextColor}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</ThemeVariantScope>
|
||||
<TextBlock Text="{Binding}" FontWeight="SemiBold" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<ThemeVariantScope
|
||||
MinWidth="400"
|
||||
RequestedThemeVariant="{Binding SelectedThemeVariant}">
|
||||
<Border Padding="10" Background="{DynamicResource WindowColor}">
|
||||
<StackPanel Spacing="16">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="TextBlock">
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="FontWeight" Value="SemiBold" />
|
||||
</Style>
|
||||
<Style Selector="controls|ColorItemControl.ColorBlock">
|
||||
<Setter Property="Width" Value="44" />
|
||||
<Setter Property="Height" Value="{Binding $self.Width}" />
|
||||
<Setter Property="HorizontalAlignment" Value="Right" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource WindowTextColor}" />
|
||||
<Setter Property="CornerRadius" Value="3" />
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<Panel>
|
||||
<TextBlock
|
||||
Foreground="{DynamicResource WindowTextColor}"
|
||||
Text="Background" />
|
||||
<controls:ColorItemControl
|
||||
Classes="ColorBlock"
|
||||
DataContext="{Binding ColorResources[0]}"
|
||||
Background="{DynamicResource WindowColor}" />
|
||||
</Panel>
|
||||
<Panel>
|
||||
<TextBlock
|
||||
Foreground="{DynamicResource WindowTextColor}"
|
||||
Text="Text" />
|
||||
<controls:ColorItemControl
|
||||
Classes="ColorBlock"
|
||||
DataContext="{Binding ColorResources[1]}"
|
||||
Background="{DynamicResource WindowTextColor}" />
|
||||
</Panel>
|
||||
<Panel>
|
||||
<TextBlock
|
||||
Foreground="{DynamicResource HotlightColor}"
|
||||
TextDecorations="Underline"
|
||||
Text="Hyperlink" />
|
||||
<controls:ColorItemControl
|
||||
Classes="ColorBlock"
|
||||
DataContext="{Binding ColorResources[2]}"
|
||||
Background="{DynamicResource HotlightColor}" />
|
||||
</Panel>
|
||||
<Panel>
|
||||
<TextBlock
|
||||
Foreground="{DynamicResource GrayTextColor}"
|
||||
Text="Inactive Text" />
|
||||
<controls:ColorItemControl
|
||||
Classes="ColorBlock"
|
||||
DataContext="{Binding ColorResources[3]}"
|
||||
Background="{DynamicResource GrayTextColor}" />
|
||||
</Panel>
|
||||
<Panel>
|
||||
<TextBlock
|
||||
Foreground="{DynamicResource HighlightTextColor}"
|
||||
Background="{DynamicResource HighlightColor}"
|
||||
Text="Selected text" />
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Spacing="4">
|
||||
<controls:ColorItemControl
|
||||
Classes="ColorBlock"
|
||||
DataContext="{Binding ColorResources[4]}"
|
||||
Background="{DynamicResource HighlightTextColor}" />
|
||||
<controls:ColorItemControl
|
||||
Classes="ColorBlock"
|
||||
DataContext="{Binding ColorResources[5]}"
|
||||
Background="{DynamicResource HighlightColor}" />
|
||||
</StackPanel>
|
||||
</Panel>
|
||||
<Panel>
|
||||
<Border
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
BorderBrush="{DynamicResource ButtonTextColor}"
|
||||
Background="{DynamicResource ButtonFaceColor}"
|
||||
BorderThickness="2"
|
||||
CornerRadius="3">
|
||||
<TextBlock
|
||||
Foreground="{DynamicResource ButtonTextColor}"
|
||||
Padding="16 6"
|
||||
Text="Button text" />
|
||||
</Border>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Spacing="4">
|
||||
<controls:ColorItemControl
|
||||
Classes="ColorBlock"
|
||||
DataContext="{Binding ColorResources[6]}"
|
||||
Background="{DynamicResource ButtonTextColor}" />
|
||||
<controls:ColorItemControl
|
||||
Classes="ColorBlock"
|
||||
DataContext="{Binding ColorResources[7]}"
|
||||
Background="{DynamicResource ButtonFaceColor}" />
|
||||
</StackPanel>
|
||||
</Panel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</ThemeVariantScope>
|
||||
|
||||
<DataGrid
|
||||
HorizontalAlignment="Left"
|
||||
CanUserSortColumns="False"
|
||||
AutoGenerateColumns="False"
|
||||
ItemsSource="{Binding ColorResources}"
|
||||
GridLinesVisibility="All"
|
||||
BorderBrush="{DynamicResource SemiColorBorder}"
|
||||
BorderThickness="1"
|
||||
Padding="5">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn Header="Color">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<controls:ColorItemControl
|
||||
Width="40"
|
||||
Height="20"
|
||||
CornerRadius="3"
|
||||
Background="{Binding Brush}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<DataGridTemplateColumn Header="ResourceKey">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<SelectableTextBlock
|
||||
Margin="12 0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding ResourceKey}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<DataGridTemplateColumn Header="Hex">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<SelectableTextBlock
|
||||
Margin="12 0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Brush,
|
||||
Converter={x:Static cvt:ColorConverter.ToHex},ConverterParameter={x:False}}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<DataGridTemplateColumn Header="Description">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<SelectableTextBlock
|
||||
Margin="12 0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Description}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<DataGridTemplateColumn Header="Pair With">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<SelectableTextBlock
|
||||
Margin="12 0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding PairWith}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<DataGridTemplateColumn Width="100" Header="CopyText">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate DataType="vm:ColorResource">
|
||||
<Button
|
||||
Command="{Binding $parent[pages:HighContrastDemo].Copy}"
|
||||
CommandParameter="{Binding CopyText}"
|
||||
Theme="{DynamicResource IconBorderlessButton}"
|
||||
Content="{StaticResource SemiIconCopy}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</SplitView.Content>
|
||||
</SplitView>
|
||||
</UserControl>
|
||||
24
demo/Semi.Avalonia.Demo/Pages/HighContrastDemo.axaml.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia.Controls;
|
||||
using Semi.Avalonia.Demo.ViewModels;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class HighContrastDemo : UserControl
|
||||
{
|
||||
public HighContrastDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = new HighContrastDemoViewModel();
|
||||
}
|
||||
|
||||
public async Task Copy(object? o)
|
||||
{
|
||||
if (o is null) return;
|
||||
var toplevel = TopLevel.GetTopLevel(this);
|
||||
if (toplevel?.Clipboard is { } c)
|
||||
{
|
||||
await c.SetTextAsync(o.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,36 +8,22 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
||||
<HyperlinkButton
|
||||
NavigateUri="https://www.irihi.tech/"
|
||||
Content="IRIHI Homepage" />
|
||||
<HyperlinkButton
|
||||
Classes="Underline"
|
||||
IsEnabled="False"
|
||||
NavigateUri="https://www.irihi.tech/"
|
||||
Content="Not Enabled" />
|
||||
<HyperlinkButton
|
||||
Classes="WithIcon Underline"
|
||||
Height="20"
|
||||
NavigateUri="https://www.irihi.tech/"
|
||||
Content="带下划线的网页链接" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<HyperlinkButton Height="20" NavigateUri="http://www.irihi.tech/">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
Text="iRihi Homepage"
|
||||
TextDecorations="Underline"
|
||||
VerticalAlignment="Center" />
|
||||
</HyperlinkButton>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<HyperlinkButton Height="20" IsEnabled="False">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
Text="Not Enabled"
|
||||
TextDecorations="Underline"
|
||||
VerticalAlignment="Center" />
|
||||
</HyperlinkButton>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<HyperlinkButton
|
||||
BorderThickness="1"
|
||||
Classes="WithIcon"
|
||||
Height="20"
|
||||
NavigateUri="http://www.irihi.tech/">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
Text="Link with Icon"
|
||||
TextDecorations="Underline"
|
||||
VerticalAlignment="Center" />
|
||||
</HyperlinkButton>
|
||||
<HyperlinkButton Classes="OnlyIcon" NavigateUri="https://www.irihi.tech/" />
|
||||
<HyperlinkButton Classes="OnlyIcon" NavigateUri="https://www.irihi.tech/" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
|
||||
95
demo/Semi.Avalonia.Demo/Pages/IconDemo.axaml
Normal file
@@ -0,0 +1,95 @@
|
||||
<UserControl 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:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:DataType="vm:IconDemoViewModel"
|
||||
x:Class="Semi.Avalonia.Demo.Pages.IconDemo">
|
||||
<Design.DataContext>
|
||||
<vm:IconDemoViewModel />
|
||||
</Design.DataContext>
|
||||
<Grid RowDefinitions="Auto, *">
|
||||
<TextBox
|
||||
Grid.Row="0"
|
||||
Width="600"
|
||||
Margin="8"
|
||||
Classes="ClearButton"
|
||||
Text="{Binding SearchText}"
|
||||
Watermark="Input Icon Name" />
|
||||
|
||||
<TabControl Grid.Row="1">
|
||||
<TabItem Header="Filled Icons">
|
||||
<ScrollViewer>
|
||||
<ItemsControl ItemsSource="{Binding FilteredFilledIcons}">
|
||||
<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>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</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>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
47
demo/Semi.Avalonia.Demo/Pages/IconDemo.axaml.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Notifications;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Input.Platform;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Threading;
|
||||
using Semi.Avalonia.Demo.ViewModels;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class IconDemo : UserControl
|
||||
{
|
||||
private IClipboard? _clipboard;
|
||||
private WindowNotificationManager? _windowNotificationManager;
|
||||
|
||||
public IconDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = new IconDemoViewModel();
|
||||
}
|
||||
|
||||
protected override async void OnApplyTemplate(TemplateAppliedEventArgs e)
|
||||
{
|
||||
base.OnApplyTemplate(e);
|
||||
var vm = this.DataContext as IconDemoViewModel;
|
||||
await Dispatcher.UIThread.InvokeAsync(() => { vm?.InitializeResources(); });
|
||||
}
|
||||
|
||||
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
|
||||
{
|
||||
base.OnAttachedToVisualTree(e);
|
||||
var topLevel = TopLevel.GetTopLevel(this);
|
||||
_windowNotificationManager = new WindowNotificationManager(topLevel) { MaxItems = 3 };
|
||||
_clipboard = topLevel?.Clipboard;
|
||||
}
|
||||
|
||||
private async void Button_Clicked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (_clipboard is null) return;
|
||||
if (sender is not Button { DataContext: IconItem s }) return;
|
||||
await _clipboard.SetTextAsync(s.ResourceKey);
|
||||
_windowNotificationManager?.Show(
|
||||
new Notification("Copied", s.ResourceKey),
|
||||
NotificationType.Success);
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="450"
|
||||
d:DesignHeight="800"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<ScrollViewer>
|
||||
@@ -13,15 +13,13 @@
|
||||
<Style Selector="Label">
|
||||
<Setter Property="Margin" Value="4" />
|
||||
</Style>
|
||||
<Style Selector="Grid > TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="4" />
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Auto">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="Label, TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="4" />
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<HeaderedContentControl
|
||||
Width="400"
|
||||
Height="400"
|
||||
@@ -32,62 +30,62 @@
|
||||
<Grid
|
||||
VerticalAlignment="Top"
|
||||
ColumnDefinitions="Auto, *"
|
||||
RowDefinitions="*,*,*,*,*,*,*,*,*,*,*,*">
|
||||
<TextBlock Grid.Row="1" Grid.Column="0">Classes</TextBlock>
|
||||
<TextBlock Grid.Row="2" Grid.Column="0">-</TextBlock>
|
||||
<TextBlock Grid.Row="3" Grid.Column="0">Secondary</TextBlock>
|
||||
<TextBlock Grid.Row="4" Grid.Column="0">Tertiary</TextBlock>
|
||||
<TextBlock Grid.Row="5" Grid.Column="0">Quaternary</TextBlock>
|
||||
<TextBlock Grid.Row="6" Grid.Column="0">Success</TextBlock>
|
||||
<TextBlock Grid.Row="7" Grid.Column="0">Warning</TextBlock>
|
||||
<TextBlock Grid.Row="8" Grid.Column="0">Danger</TextBlock>
|
||||
<TextBlock Grid.Row="9" Grid.Column="0">Mark</TextBlock>
|
||||
<TextBlock Grid.Row="10" Grid.Column="0">Code</TextBlock>
|
||||
<Label Grid.Row="2" Grid.Column="1">Text</Label>
|
||||
RowDefinitions="*,*,*,*,*,*,*,*,*,*,*">
|
||||
<TextBlock Grid.Row="0" Grid.Column="0">Classes</TextBlock>
|
||||
<TextBlock Grid.Row="1" Grid.Column="0">-</TextBlock>
|
||||
<TextBlock Grid.Row="2" Grid.Column="0">Secondary</TextBlock>
|
||||
<TextBlock Grid.Row="3" Grid.Column="0">Tertiary</TextBlock>
|
||||
<TextBlock Grid.Row="4" Grid.Column="0">Quaternary</TextBlock>
|
||||
<TextBlock Grid.Row="5" Grid.Column="0">Success</TextBlock>
|
||||
<TextBlock Grid.Row="6" Grid.Column="0">Warning</TextBlock>
|
||||
<TextBlock Grid.Row="7" Grid.Column="0">Danger</TextBlock>
|
||||
<TextBlock Grid.Row="8" Grid.Column="0">Mark</TextBlock>
|
||||
<TextBlock Grid.Row="9" Grid.Column="0">Code</TextBlock>
|
||||
<Label Grid.Row="1" Grid.Column="1">Text</Label>
|
||||
<Label
|
||||
Grid.Row="3"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Classes="Secondary">
|
||||
Secondary
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="4"
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Classes="Tertiary">
|
||||
Tertiary
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="5"
|
||||
Grid.Row="4"
|
||||
Grid.Column="1"
|
||||
Classes="Quaternary">
|
||||
Quaternary
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="6"
|
||||
Grid.Row="5"
|
||||
Grid.Column="1"
|
||||
Classes="Success">
|
||||
Success
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="7"
|
||||
Grid.Row="6"
|
||||
Grid.Column="1"
|
||||
Classes="Warning">
|
||||
Warning
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="8"
|
||||
Grid.Row="7"
|
||||
Grid.Column="1"
|
||||
Classes="Danger">
|
||||
Danger
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="9"
|
||||
Grid.Row="8"
|
||||
Grid.Column="1"
|
||||
Classes="Mark">
|
||||
Default Mark
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="10"
|
||||
Grid.Row="9"
|
||||
Grid.Column="1"
|
||||
Classes="Code">
|
||||
Code
|
||||
@@ -104,51 +102,51 @@
|
||||
<Grid
|
||||
VerticalAlignment="Top"
|
||||
ColumnDefinitions="Auto, *"
|
||||
RowDefinitions="*,*,*,*,*,*,*,*">
|
||||
<TextBlock Grid.Row="1" Grid.Column="0">Classes</TextBlock>
|
||||
<TextBlock Grid.Row="2" Grid.Column="0">H1</TextBlock>
|
||||
<TextBlock Grid.Row="3" Grid.Column="0">H2</TextBlock>
|
||||
<TextBlock Grid.Row="4" Grid.Column="0">H3</TextBlock>
|
||||
<TextBlock Grid.Row="5" Grid.Column="0">H4</TextBlock>
|
||||
<TextBlock Grid.Row="6" Grid.Column="0">H5</TextBlock>
|
||||
<TextBlock Grid.Row="7" Grid.Column="0">H6</TextBlock>
|
||||
RowDefinitions="*,*,*,*,*,*,*">
|
||||
<TextBlock Grid.Row="0" Grid.Column="0">Classes</TextBlock>
|
||||
<TextBlock Grid.Row="1" Grid.Column="0">H1</TextBlock>
|
||||
<TextBlock Grid.Row="2" Grid.Column="0">H2</TextBlock>
|
||||
<TextBlock Grid.Row="3" Grid.Column="0">H3</TextBlock>
|
||||
<TextBlock Grid.Row="4" Grid.Column="0">H4</TextBlock>
|
||||
<TextBlock Grid.Row="5" Grid.Column="0">H5</TextBlock>
|
||||
<TextBlock Grid.Row="6" Grid.Column="0">H6</TextBlock>
|
||||
<Label
|
||||
Grid.Row="2"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Classes="H1"
|
||||
Theme="{StaticResource TitleLabel}">
|
||||
Header 1
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="3"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Classes="H2"
|
||||
Theme="{StaticResource TitleLabel}">
|
||||
Header 2
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="4"
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Classes="H3"
|
||||
Theme="{StaticResource TitleLabel}">
|
||||
Header 3
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="5"
|
||||
Grid.Row="4"
|
||||
Grid.Column="1"
|
||||
Classes="H4"
|
||||
Theme="{StaticResource TitleLabel}">
|
||||
Header 4
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="6"
|
||||
Grid.Row="5"
|
||||
Grid.Column="1"
|
||||
Classes="H5"
|
||||
Theme="{StaticResource TitleLabel}">
|
||||
Header 5
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="7"
|
||||
Grid.Row="6"
|
||||
Grid.Column="1"
|
||||
Classes="H6"
|
||||
Theme="{StaticResource TitleLabel}">
|
||||
@@ -223,4 +221,4 @@
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -1,6 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
Header="Default">
|
||||
<ScrollViewer>
|
||||
<StackPanel Spacing="20">
|
||||
<TextBlock Text="Theme: Default"/>
|
||||
<TextBlock Text="Theme: Default" />
|
||||
<ListBox ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
|
||||
<ListBox IsEnabled="False">
|
||||
<ListBoxItem IsSelected="True">Avalonia</ListBoxItem>
|
||||
@@ -31,7 +31,7 @@
|
||||
Theme="{DynamicResource GroupBox}"
|
||||
Header="RadioGroupListBox">
|
||||
<StackPanel Spacing="20">
|
||||
<TextBlock Text="Theme: RadioGroupListBox"/>
|
||||
<TextBlock Text="Theme: RadioGroupListBox" />
|
||||
<ListBox
|
||||
Theme="{DynamicResource RadioGroupListBox}"
|
||||
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
|
||||
@@ -40,7 +40,7 @@
|
||||
<ListBoxItem IsSelected="True">WPF</ListBoxItem>
|
||||
</ListBox>
|
||||
|
||||
<TextBlock Text="Theme: ButtonRadioGroupListBox"/>
|
||||
<TextBlock Text="Theme: ButtonRadioGroupListBox" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Border HorizontalAlignment="Left" Theme="{StaticResource RadioButtonGroupBorder}">
|
||||
<ListBox Theme="{DynamicResource ButtonRadioGroupListBox}">
|
||||
@@ -93,7 +93,7 @@
|
||||
</Border>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Text="Theme: CardRadioGroupListBox"/>
|
||||
<TextBlock Text="Theme: CardRadioGroupListBox" />
|
||||
<ListBox Theme="{DynamicResource CardRadioGroupListBox}"
|
||||
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
|
||||
<ListBox Theme="{DynamicResource CardRadioGroupListBox}" IsEnabled="False">
|
||||
@@ -101,7 +101,7 @@
|
||||
<ListBoxItem>WPF</ListBoxItem>
|
||||
</ListBox>
|
||||
|
||||
<TextBlock Text="Theme: PureCardRadioGroupListBox"/>
|
||||
<TextBlock Text="Theme: PureCardRadioGroupListBox" />
|
||||
<ListBox Theme="{DynamicResource PureCardRadioGroupListBox}"
|
||||
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
|
||||
<ListBox Theme="{DynamicResource PureCardRadioGroupListBox}" IsEnabled="False">
|
||||
@@ -117,25 +117,25 @@
|
||||
Header="CheckGroupListBox">
|
||||
<ScrollViewer>
|
||||
<StackPanel Spacing="20">
|
||||
<TextBlock Text="Theme: CheckGroupListBox"/>
|
||||
<TextBlock Text="Theme: CheckGroupListBox" />
|
||||
<ListBox
|
||||
SelectionMode="Multiple"
|
||||
SelectionMode="Multiple,Toggle"
|
||||
Theme="{DynamicResource CheckGroupListBox}"
|
||||
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
|
||||
<ListBox Theme="{DynamicResource CheckGroupListBox}"
|
||||
SelectionMode="Multiple"
|
||||
SelectionMode="Multiple,Toggle"
|
||||
IsEnabled="False">
|
||||
<ListBoxItem IsSelected="True">Avalonia</ListBoxItem>
|
||||
<ListBoxItem>WPF</ListBoxItem>
|
||||
</ListBox>
|
||||
|
||||
<TextBlock Text="Theme: CardCheckGroupListBox"/>
|
||||
<TextBlock Text="Theme: CardCheckGroupListBox" />
|
||||
<ListBox
|
||||
SelectionMode="Multiple"
|
||||
SelectionMode="Multiple,Toggle"
|
||||
Theme="{DynamicResource CardCheckGroupListBox}"
|
||||
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
|
||||
<ListBox Theme="{DynamicResource CardCheckGroupListBox}"
|
||||
SelectionMode="Multiple"
|
||||
SelectionMode="Multiple,Toggle"
|
||||
IsEnabled="False">
|
||||
<ListBoxItem>Avalonia</ListBoxItem>
|
||||
<ListBoxItem IsSelected="True">WPF</ListBoxItem>
|
||||
|
||||
@@ -17,4 +17,4 @@
|
||||
<Button Name="SelectFolderButton" Content="Select Folder" />
|
||||
<Button Name="SaveFileButton" Content="Save File" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -145,4 +145,4 @@
|
||||
<TextBlock Text="Right Click to show Context Flyout" />
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -1,6 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
@@ -11,8 +9,4 @@ public partial class MenuDemo : UserControl
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,8 @@ public partial class NotificationDemo : UserControl
|
||||
if (sender is RadioButton b && b.Content is string s)
|
||||
{
|
||||
Enum.TryParse<NotificationPosition>(s, out var t);
|
||||
_manager.Position = t;
|
||||
if (_manager is not null)
|
||||
_manager.Position = t;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
@@ -11,8 +9,4 @@ public partial class NumericUpDownDemo : UserControl
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
@@ -31,19 +31,19 @@
|
||||
<PathIcon
|
||||
Width="32"
|
||||
Height="32"
|
||||
Data="M10.6201 17.5C6.06377 17.5 2.37012 13.8063 2.37012 9.25C2.37012 4.69365 6.06377 1 10.6201 1V17.5ZM13.3701 6.5C17.9265 6.5 21.6201 10.1936 21.6201 14.75C21.6201 19.3063 17.9265 23 13.3701 23V6.5Z" />
|
||||
Data="{StaticResource SemiIconSemiLogo}" />
|
||||
<PathIcon
|
||||
Width="10"
|
||||
Height="10"
|
||||
Margin="20,0"
|
||||
Data="M20.5 13.5C21.3284 13.5 22 12.8284 22 12C22 11.1716 21.3284 10.5 20.5 10.5L13.5 10.5L13.5 3.5C13.5 2.67157 12.8284 2 12 2C11.1716 2 10.5 2.67157 10.5 3.5L10.5 10.5L3.5 10.5C2.67157 10.5 2 11.1716 2 12C2 12.8284 2.67157 13.5 3.5 13.5L10.5 13.5V20.5C10.5 21.3284 11.1716 22 12 22C12.8284 22 13.5 21.3284 13.5 20.5V13.5L20.5 13.5Z" />
|
||||
Data="{StaticResource SemiIconPlus}" />
|
||||
<Image Width="32" Height="32">
|
||||
<Image.Source>
|
||||
<DrawingImage>
|
||||
<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="#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="#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="#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="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="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>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
@@ -234,7 +234,7 @@
|
||||
VerticalAlignment="Top"
|
||||
Palette="{DynamicResource SemiColorPalette}"
|
||||
SelectedIndex="2"
|
||||
Color="#8B44AC" />
|
||||
Color="#0D6EFD" />
|
||||
<StackPanel Width="300" Margin="8">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Slider
|
||||
@@ -348,7 +348,7 @@
|
||||
Classes="H5"
|
||||
Text="Start to install"
|
||||
Theme="{DynamicResource TitleTextBlock}" />
|
||||
<TabControl Padding="8">
|
||||
<TabControl Theme="{StaticResource LineTabControl}">
|
||||
<TabItem Header="Main">
|
||||
<StackPanel>
|
||||
<TextBlock Text="Install via nuget: " />
|
||||
@@ -409,6 +409,51 @@
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
<TabItem Header="Dock">
|
||||
<StackPanel>
|
||||
<TextBlock Text="Install via nuget: " />
|
||||
<Border Margin="0,16" Classes="CodeBlock">
|
||||
<SelectableTextBlock FontFamily="Consolas" Text="{Binding $parent[local:Overview].DockInstall}" />
|
||||
</Border>
|
||||
<TextBlock Text="Reference styles: " />
|
||||
<Border Margin="0,16" Classes="CodeBlock">
|
||||
<SelectableTextBlock
|
||||
FontFamily="Consolas"
|
||||
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 FontFamily="Consolas" Text="{Binding $parent[local:Overview].TabaloniaInstall}" />
|
||||
</Border>
|
||||
<TextBlock Text="Reference styles: " />
|
||||
<Border Margin="0,16" Classes="CodeBlock">
|
||||
<SelectableTextBlock
|
||||
FontFamily="Consolas"
|
||||
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 FontFamily="Consolas" Text="{Binding $parent[local:Overview].AvaloniaEditInstall}" />
|
||||
</Border>
|
||||
<TextBlock Text="Reference styles: " />
|
||||
<Border Margin="0,16" Classes="CodeBlock">
|
||||
<SelectableTextBlock
|
||||
FontFamily="Consolas"
|
||||
Text="{Binding $parent[local:Overview].AvaloniaEditStyle}"
|
||||
TextWrapping="Wrap" />
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
@@ -9,41 +9,66 @@ public partial class Overview : UserControl
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public string MainInstall { get; set; } = "dotnet add package Semi.Avalonia --version 11.1.0";
|
||||
public string MainInstall { get; set; } = "dotnet add package Semi.Avalonia";
|
||||
|
||||
public string MainStyle { get; set; } =
|
||||
"""
|
||||
<Application.Styles>
|
||||
<!-- You can still reference in old way. -->
|
||||
<!-- <StyleInclude Source="avares://Semi.Avalonia/Themes/Index.axaml" /> -->
|
||||
<semi:SemiTheme Locale="zh-cn" />
|
||||
<semi:SemiTheme Locale="zh-CN" />
|
||||
</Application.Styles>
|
||||
""";
|
||||
|
||||
public string ColorPickerInstall { get; set; } = "dotnet add package Semi.Avalonia.ColorPicker --version 11.1.0";
|
||||
public string ColorPickerInstall { get; set; } = "dotnet add package Semi.Avalonia.ColorPicker";
|
||||
|
||||
public string ColorPickerStyle { get; set; } =
|
||||
"""
|
||||
<Application.Styles>
|
||||
<StyleInclude Source="avares://Semi.Avalonia.ColorPicker/Index.axaml" />
|
||||
<semi:ColorPickerSemiTheme />
|
||||
</Application.Styles>
|
||||
""";
|
||||
|
||||
public string DataGridInstall { get; set; } = "dotnet add package Semi.Avalonia.DataGrid --version 11.1.0";
|
||||
public string DataGridInstall { get; set; } = "dotnet add package Semi.Avalonia.DataGrid";
|
||||
|
||||
public string DataGridStyle { get; set; } =
|
||||
"""
|
||||
<Application.Styles>
|
||||
<StyleInclude Source="avares://Semi.Avalonia.DataGrid/Index.axaml" />
|
||||
<semi:DataGridSemiTheme />
|
||||
</Application.Styles>
|
||||
""";
|
||||
|
||||
public string TreeDataGridInstall { get; set; } = "dotnet add package Semi.Avalonia.TreeDataGrid --version 11.1.0";
|
||||
public string TreeDataGridInstall { get; set; } = "dotnet add package Semi.Avalonia.TreeDataGrid";
|
||||
|
||||
public string TreeDataGridStyle { get; set; } =
|
||||
"""
|
||||
<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>
|
||||
""";
|
||||
}
|
||||
@@ -8,22 +8,11 @@
|
||||
xmlns:viewModels="clr-namespace:Semi.Avalonia.Demo.ViewModels"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
x:CompileBindings="True"
|
||||
x:DataType="viewModels:PaletteDemoViewModel"
|
||||
mc:Ignorable="d">
|
||||
<Design.DataContext>
|
||||
<viewModels:PaletteDemoViewModel />
|
||||
</Design.DataContext>
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceInclude Source="../Themes/ToggleButton.axaml" />
|
||||
<ResourceInclude Source="../Controls/ColorItemControl.axaml" />
|
||||
<ResourceInclude Source="../Controls/ColorDetailControl.axaml" />
|
||||
<ResourceInclude Source="../Controls/FunctionalColorGroupControl.axaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
<SplitView
|
||||
Name="splitView"
|
||||
CompactPaneLength="50"
|
||||
@@ -33,11 +22,12 @@
|
||||
PanePlacement="Right">
|
||||
<SplitView.Pane>
|
||||
<StackPanel>
|
||||
<ToggleButton
|
||||
<ToggleSwitch
|
||||
Name="toggle"
|
||||
HorizontalAlignment="Right"
|
||||
IsChecked="True"
|
||||
Theme="{DynamicResource SplitViewToggleButton}" />
|
||||
Theme="{DynamicResource IconBorderlessToggleSwitch}"
|
||||
Content="{StaticResource SemiIconSidebar}" />
|
||||
<Border IsVisible="{Binding #splitView.IsPaneOpen}" Theme="{DynamicResource CardBorder}">
|
||||
<Panel>
|
||||
<TextBlock
|
||||
@@ -115,7 +105,6 @@
|
||||
<ItemsControl ItemsSource="{Binding FunctionalColors}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<!-- -->
|
||||
<controls:FunctionalColorGroupControl
|
||||
Title="{Binding Title}"
|
||||
DarkColors="{Binding DarkColors}"
|
||||
@@ -123,8 +112,20 @@
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
<ItemsControl ItemsSource="{Binding Shadows}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<controls:ShadowGroupControl
|
||||
Title="{Binding Title}"
|
||||
DarkShadows="{Binding DarkShadows}"
|
||||
LightShadows="{Binding LightShadows}" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</SplitView.Content>
|
||||
</SplitView>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -1,8 +1,6 @@
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.Threading;
|
||||
using Semi.Avalonia.Demo.ViewModels;
|
||||
|
||||
@@ -16,13 +14,20 @@ public partial class PaletteDemo : UserControl
|
||||
this.DataContext = new PaletteDemoViewModel();
|
||||
}
|
||||
|
||||
protected override async void OnApplyTemplate(TemplateAppliedEventArgs e)
|
||||
protected override async void OnApplyTemplate(TemplateAppliedEventArgs e)
|
||||
{
|
||||
base.OnApplyTemplate(e);
|
||||
PaletteDemoViewModel? vm = this.DataContext as PaletteDemoViewModel;
|
||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
||||
await Dispatcher.UIThread.InvokeAsync(() => { vm?.InitializeResources(); });
|
||||
}
|
||||
|
||||
public async Task Copy(object? o)
|
||||
{
|
||||
if (o is null) return;
|
||||
var toplevel = TopLevel.GetTopLevel(this);
|
||||
if (toplevel?.Clipboard is { } c)
|
||||
{
|
||||
vm?.InitializeResources();
|
||||
});
|
||||
await c.SetTextAsync(o.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,16 +7,30 @@
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel HorizontalAlignment="Left" >
|
||||
<TextBlock Text="Size"></TextBlock>
|
||||
<Slider Name="width" Minimum="0" Maximum="100" Value="20" Width="300"></Slider>
|
||||
<ToggleSwitch Name="active" Content="Active"></ToggleSwitch>
|
||||
<StackPanel HorizontalAlignment="Left">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="PathIcon">
|
||||
<Setter Property="Theme" Value="{DynamicResource InnerPathIcon}" />
|
||||
<Setter Property="Data" Value="{StaticResource SemiIconSearch}" />
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<PathIcon Classes="ExtraSmall" />
|
||||
<PathIcon Classes="Small" />
|
||||
<PathIcon />
|
||||
<PathIcon Classes="Large" />
|
||||
<PathIcon Classes="ExtraLarge" />
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Text="Size" />
|
||||
<Slider Name="width" Minimum="0" Maximum="100" Value="20" Width="300" />
|
||||
<ToggleSwitch Name="active" Content="Active" />
|
||||
<PathIcon
|
||||
Classes.Active="{Binding ElementName=active, Path=IsChecked}"
|
||||
BorderBrush="{DynamicResource SemiRed6}"
|
||||
Classes.Active="{Binding #active.IsChecked}"
|
||||
Width="{Binding #width.Value}"
|
||||
Height="{Binding #width.Value}"
|
||||
Data="M12 3L2 12H5V20H19V12H22L12 3M13 18H11V16H13V18M13 14H11V8H13V14Z"
|
||||
Foreground="{DynamicResource SemiBlue6}" />
|
||||
Foreground="{DynamicResource SemiBlue6}"
|
||||
BorderBrush="{DynamicResource SemiRed6}"
|
||||
Data="{StaticResource SemiIconHome}" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -1,6 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
|
||||
@@ -20,15 +20,16 @@
|
||||
Minimum="{Binding #slider.Minimum}"
|
||||
Theme="{DynamicResource ProgressRing}"
|
||||
Value="{Binding #slider.Value}"
|
||||
ShowProgressText="True"/>
|
||||
ShowProgressText="True" />
|
||||
<ProgressBar
|
||||
Width="100"
|
||||
Height="100"
|
||||
IsIndeterminate="True"
|
||||
BorderThickness="16"
|
||||
Maximum="{Binding #slider.Maximum}"
|
||||
Minimum="{Binding #slider.Minimum}"
|
||||
Theme="{DynamicResource ProgressRing}"
|
||||
ShowProgressText="True"/>
|
||||
ShowProgressText="True" />
|
||||
</StackPanel>
|
||||
<Slider
|
||||
Name="slider"
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
@@ -10,9 +8,4 @@ public partial class ProgressBarDemo : UserControl
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
|
||||
@@ -4,11 +4,10 @@
|
||||
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:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
|
||||
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
x:DataType="pages:RefreshContainerDemoViewModel"
|
||||
x:CompileBindings="True"
|
||||
x:DataType="vm:RefreshContainerDemoViewModel"
|
||||
mc:Ignorable="d">
|
||||
<DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Top">
|
||||
<Label DockPanel.Dock="Top">A control that supports pull to refresh</Label>
|
||||
@@ -24,4 +23,4 @@
|
||||
ItemsSource="{Binding Items}" />
|
||||
</RefreshContainer>
|
||||
</DockPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -1,8 +1,5 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia.Controls;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using Semi.Avalonia.Demo.ViewModels;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
@@ -13,34 +10,14 @@ public partial class RefreshContainerDemo : UserControl
|
||||
public RefreshContainerDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
_viewModel = new RefreshContainerDemoViewModel();
|
||||
|
||||
DataContext = _viewModel;
|
||||
}
|
||||
|
||||
private async void RefreshContainerPage_RefreshRequested(object? sender, RefreshRequestedEventArgs e)
|
||||
{
|
||||
var deferral = e.GetDeferral();
|
||||
|
||||
await _viewModel.AddToTop();
|
||||
|
||||
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,6 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
|
||||
@@ -9,66 +9,22 @@
|
||||
mc:Ignorable="d">
|
||||
<ScrollViewer>
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
||||
<ToggleSwitch Name="inset" Content="Inset Content" />
|
||||
<ToggleSwitch Name="autohide" Content="Allow AutoHide" />
|
||||
<ScrollViewer
|
||||
Width="200"
|
||||
Height="200"
|
||||
Margin="10"
|
||||
Width="200" Height="200"
|
||||
AllowAutoHide="{Binding #autohide.IsChecked}"
|
||||
Classes.InsetContent="{Binding #inset.IsChecked}"
|
||||
HorizontalScrollBarVisibility="Auto">
|
||||
<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
|
||||
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>
|
||||
<UniformGrid
|
||||
Rows="2" Columns="2"
|
||||
Width="300" Height="300">
|
||||
<Rectangle Fill="{DynamicResource SemiYellow2}" />
|
||||
<Rectangle Fill="{DynamicResource SemiBlue2}" />
|
||||
<Rectangle Fill="{DynamicResource SemiPink2}" />
|
||||
<Rectangle Fill="{DynamicResource SemiGreen2}" />
|
||||
</UniformGrid>
|
||||
</ScrollViewer>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
@@ -10,9 +8,4 @@ public partial class ScrollViewerDemo : UserControl
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
@@ -4,13 +4,13 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="450"
|
||||
d:DesignHeight="600"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="SelectableTextBlock">
|
||||
<Style Selector="Grid > SelectableTextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="4" />
|
||||
</Style>
|
||||
@@ -25,70 +25,76 @@
|
||||
<Grid
|
||||
VerticalAlignment="Top"
|
||||
ColumnDefinitions="Auto, *"
|
||||
RowDefinitions="*,*,*,*,*,*,*,*,*,*,*,*">
|
||||
<SelectableTextBlock Grid.Row="1" Grid.Column="0">Classes</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="2" Grid.Column="0">-</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="3" Grid.Column="0">Secondary</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="4" Grid.Column="0">Tertiary</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="5" Grid.Column="0">Quaternary</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="6" Grid.Column="0">Success</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="7" Grid.Column="0">Warning</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="8" Grid.Column="0">Danger</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="9" Grid.Column="0">Mark</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="10" Grid.Column="0">Underline</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="11" Grid.Column="0">Delete</SelectableTextBlock>
|
||||
RowDefinitions="*,*,*,*,*,*,*,*,*,*,*">
|
||||
<Grid.Styles>
|
||||
<Style Selector="SelectableTextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="4" />
|
||||
</Style>
|
||||
</Grid.Styles>
|
||||
<SelectableTextBlock Grid.Row="0" Grid.Column="0">Classes</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="1" Grid.Column="0">-</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="2" Grid.Column="0">Secondary</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="3" Grid.Column="0">Tertiary</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="4" Grid.Column="0">Quaternary</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="5" Grid.Column="0">Success</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="6" Grid.Column="0">Warning</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="7" Grid.Column="0">Danger</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="8" Grid.Column="0">Mark</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="9" Grid.Column="0">Underline</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="10" Grid.Column="0">Delete</SelectableTextBlock>
|
||||
|
||||
<SelectableTextBlock Grid.Row="2" Grid.Column="1">Text</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="1" Grid.Column="1">Text</SelectableTextBlock>
|
||||
<SelectableTextBlock
|
||||
Grid.Row="3"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Classes="Secondary">
|
||||
Secondary
|
||||
</SelectableTextBlock>
|
||||
<SelectableTextBlock
|
||||
Grid.Row="4"
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Classes="Tertiary">
|
||||
Tertiary
|
||||
</SelectableTextBlock>
|
||||
<SelectableTextBlock
|
||||
Grid.Row="5"
|
||||
Grid.Row="4"
|
||||
Grid.Column="1"
|
||||
Classes="Quaternary">
|
||||
Quaternary
|
||||
</SelectableTextBlock>
|
||||
<SelectableTextBlock
|
||||
Grid.Row="6"
|
||||
Grid.Row="5"
|
||||
Grid.Column="1"
|
||||
Classes="Success">
|
||||
Success
|
||||
</SelectableTextBlock>
|
||||
<SelectableTextBlock
|
||||
Grid.Row="7"
|
||||
Grid.Row="6"
|
||||
Grid.Column="1"
|
||||
Classes="Warning">
|
||||
Warning
|
||||
</SelectableTextBlock>
|
||||
<SelectableTextBlock
|
||||
Grid.Row="8"
|
||||
Grid.Row="7"
|
||||
Grid.Column="1"
|
||||
Classes="Danger">
|
||||
Danger
|
||||
</SelectableTextBlock>
|
||||
<SelectableTextBlock
|
||||
Grid.Row="9"
|
||||
Grid.Row="8"
|
||||
Grid.Column="1"
|
||||
Classes="Mark">
|
||||
Default Mark
|
||||
</SelectableTextBlock>
|
||||
<SelectableTextBlock
|
||||
Grid.Row="10"
|
||||
Grid.Row="9"
|
||||
Grid.Column="1"
|
||||
Classes="Underline">
|
||||
Underline
|
||||
</SelectableTextBlock>
|
||||
<SelectableTextBlock
|
||||
Grid.Row="11"
|
||||
Grid.Row="10"
|
||||
Grid.Column="1"
|
||||
Classes="Delete">
|
||||
Delete
|
||||
@@ -104,53 +110,52 @@
|
||||
Theme="{DynamicResource GroupBox}">
|
||||
<Grid
|
||||
VerticalAlignment="Top"
|
||||
Background="{Binding}"
|
||||
ColumnDefinitions="Auto, *"
|
||||
RowDefinitions="*,*,*,*,*,*,*,*">
|
||||
<SelectableTextBlock Grid.Row="1" Grid.Column="0">Classes</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="2" Grid.Column="0">H1</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="3" Grid.Column="0">H2</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="4" Grid.Column="0">H3</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="5" Grid.Column="0">H4</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="6" Grid.Column="0">H5</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="7" Grid.Column="0">H6</SelectableTextBlock>
|
||||
RowDefinitions="*,*,*,*,*,*,*">
|
||||
<SelectableTextBlock Grid.Row="0" Grid.Column="0">Classes</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="1" Grid.Column="0">H1</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="2" Grid.Column="0">H2</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="3" Grid.Column="0">H3</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="4" Grid.Column="0">H4</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="5" Grid.Column="0">H5</SelectableTextBlock>
|
||||
<SelectableTextBlock Grid.Row="6" Grid.Column="0">H6</SelectableTextBlock>
|
||||
<SelectableTextBlock
|
||||
Grid.Row="2"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Classes="H1"
|
||||
Theme="{StaticResource TitleSelectableTextBlock}">
|
||||
Header 1
|
||||
</SelectableTextBlock>
|
||||
<SelectableTextBlock
|
||||
Grid.Row="3"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Classes="H2"
|
||||
Theme="{StaticResource TitleSelectableTextBlock}">
|
||||
Header 2
|
||||
</SelectableTextBlock>
|
||||
<SelectableTextBlock
|
||||
Grid.Row="4"
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Classes="H3"
|
||||
Theme="{StaticResource TitleSelectableTextBlock}">
|
||||
Header 3
|
||||
</SelectableTextBlock>
|
||||
<SelectableTextBlock
|
||||
Grid.Row="5"
|
||||
Grid.Row="4"
|
||||
Grid.Column="1"
|
||||
Classes="H4"
|
||||
Theme="{StaticResource TitleSelectableTextBlock}">
|
||||
Header 4
|
||||
</SelectableTextBlock>
|
||||
<SelectableTextBlock
|
||||
Grid.Row="6"
|
||||
Grid.Row="5"
|
||||
Grid.Column="1"
|
||||
Classes="H5"
|
||||
Theme="{StaticResource TitleSelectableTextBlock}">
|
||||
Header 5
|
||||
</SelectableTextBlock>
|
||||
<SelectableTextBlock
|
||||
Grid.Row="7"
|
||||
Grid.Row="6"
|
||||
Grid.Column="1"
|
||||
Classes="H6"
|
||||
Theme="{StaticResource TitleSelectableTextBlock}">
|
||||
@@ -160,4 +165,4 @@
|
||||
</HeaderedContentControl>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -1,6 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
@@ -11,8 +9,4 @@ public partial class SelectableTextBlockDemo : UserControl
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
@@ -98,4 +98,4 @@
|
||||
Value="30" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||