Compare commits
517 Commits
v0.1.0-pre
...
main
Author | SHA1 | Date | |
---|---|---|---|
![]() |
002619a8b5 | ||
![]() |
f3c4714372 | ||
![]() |
9cabf55ebd | ||
![]() |
f318d33764 | ||
![]() |
e4445da37b | ||
![]() |
42aa2c7f17 | ||
![]() |
a909b6da6e | ||
![]() |
a8cdf5688b | ||
![]() |
2ce8bcdc1b | ||
![]() |
50b5159d17 | ||
![]() |
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 | ||
![]() |
8916697d6b | ||
![]() |
dd8989631e | ||
![]() |
dcb97ec368 | ||
![]() |
36d140ae4d | ||
![]() |
0d81c7d1bf | ||
![]() |
2c31bc4cce | ||
![]() |
9480f8808d | ||
![]() |
2bf3104816 | ||
![]() |
35abc7445f | ||
![]() |
ae0741977c | ||
![]() |
c56ce90341 | ||
![]() |
33f266f48d | ||
![]() |
2de1c40295 | ||
![]() |
a5b0a89196 | ||
![]() |
4447ffcb94 | ||
![]() |
7a07c285d0 | ||
![]() |
30754a160d | ||
![]() |
bac851a87f | ||
![]() |
8353a08bdd | ||
![]() |
77b0f70786 | ||
![]() |
9e31682dfe | ||
![]() |
1358715410 | ||
![]() |
8cada8c5bb | ||
![]() |
aa17c2210d | ||
![]() |
4728553ed8 | ||
![]() |
b1d0ac03f0 | ||
![]() |
bc53d0397e | ||
![]() |
56c30dcb8b | ||
![]() |
3e5fa9d5bf | ||
![]() |
72ccb80e5f | ||
![]() |
25c3e874f3 | ||
![]() |
5c8f2f7075 | ||
![]() |
5da85a27f6 | ||
![]() |
8db28efd8e | ||
![]() |
a28ac1c450 | ||
![]() |
cd0422a64e | ||
![]() |
2703002d5c | ||
![]() |
bc49ce78e0 | ||
![]() |
2dbfcb38e3 | ||
![]() |
646f56d60a | ||
![]() |
331cb35f46 | ||
![]() |
eb11d78fab | ||
![]() |
32ff9735ee | ||
![]() |
e4497df65d | ||
![]() |
92c13081f3 | ||
![]() |
ae1f4ffe60 | ||
![]() |
d42c8cce78 | ||
![]() |
ffe1188e15 | ||
![]() |
0974bbd580 | ||
![]() |
42f69e2585 | ||
![]() |
b0b06b4edc | ||
![]() |
16e8c475a1 | ||
![]() |
0ba0e10129 | ||
![]() |
62e1e31e18 | ||
![]() |
5e51de6db9 | ||
![]() |
21b61fad22 | ||
![]() |
f8778f76e5 | ||
![]() |
0f88c9d28d | ||
![]() |
f2bb8d848a | ||
![]() |
c3257d97fa | ||
![]() |
b9a1b2c81e | ||
![]() |
52a25d8441 | ||
![]() |
4bd73119ac | ||
![]() |
210b74aef6 | ||
![]() |
d27acf269e | ||
![]() |
40d7fbcf7f | ||
![]() |
e4c21aefc6 | ||
![]() |
e2420121eb | ||
![]() |
67ddbc1598 | ||
![]() |
e9f74ef3ed | ||
![]() |
dd042fd810 | ||
![]() |
ea79b0812e | ||
![]() |
421e8ec53f | ||
![]() |
b80deac692 | ||
![]() |
a3ed11fa10 | ||
![]() |
b13547ae23 | ||
![]() |
1b26941ec9 | ||
![]() |
6630d04565 | ||
![]() |
a328e2bb99 | ||
![]() |
38b9494aaf | ||
![]() |
ecde71c999 | ||
![]() |
f9ce88fbc3 | ||
![]() |
9b9c05773b | ||
![]() |
4d3c9630c3 | ||
![]() |
73687eb72f | ||
![]() |
e8d28c0233 | ||
![]() |
1cedc77ce1 | ||
![]() |
18fa51a572 | ||
![]() |
d3a933804b | ||
![]() |
d2a1f1e277 | ||
![]() |
3c0497c07a | ||
![]() |
4d89b82e16 | ||
![]() |
f564c98afd | ||
![]() |
472f91fab2 | ||
![]() |
f55faad641 | ||
![]() |
1b5a5d5ea1 | ||
![]() |
a81dcb20c5 | ||
![]() |
95744b7a64 | ||
![]() |
7a6c42e106 | ||
![]() |
4b71b18e72 | ||
![]() |
3849d7efeb | ||
![]() |
5644cf59dc | ||
![]() |
372e5d3410 | ||
![]() |
3af7e2f29a | ||
![]() |
d355410ff2 | ||
![]() |
a28cbf5ac2 | ||
![]() |
fae4a32507 | ||
![]() |
7698f92320 | ||
![]() |
8ad89d094e | ||
![]() |
259f8cb5bd | ||
![]() |
e336800bd5 | ||
![]() |
fdd4c99210 | ||
![]() |
2957521ef8 | ||
![]() |
7c63d45d5e | ||
![]() |
e1bef9fd04 | ||
![]() |
d90d7b9fe1 | ||
![]() |
1c0a3c7359 | ||
![]() |
2e2f183ed8 | ||
![]() |
ad7bcfc520 | ||
![]() |
b930a2dcf1 | ||
![]() |
2b39f14bba | ||
![]() |
88d834ac3a | ||
![]() |
0cc40c09c9 | ||
![]() |
0d8ea070cc | ||
![]() |
d959ef234c | ||
![]() |
8ebc6878b1 | ||
![]() |
9d2b2d37e2 | ||
![]() |
8982e610e2 | ||
![]() |
31e2c009fb | ||
![]() |
9259f06f57 | ||
![]() |
724a528b16 | ||
![]() |
09d23f8eaa | ||
![]() |
d3c909a83c | ||
![]() |
b505445b77 | ||
![]() |
74c1b2f2ee | ||
![]() |
8afe3a87bd | ||
![]() |
b5f4bacece | ||
![]() |
c46e6b9cf9 | ||
![]() |
ccc25b4801 | ||
![]() |
e6541b4741 | ||
![]() |
c4f5754129 | ||
![]() |
d7fce5c180 | ||
![]() |
4f685c712a | ||
![]() |
1378219b7a | ||
![]() |
0979141f54 | ||
![]() |
6a94e403c9 | ||
![]() |
2da1ecf5a0 | ||
![]() |
915c45c21f | ||
![]() |
db137ef718 | ||
![]() |
f66edd5782 | ||
![]() |
5b48f77dfb | ||
![]() |
a225feeb0d | ||
![]() |
99ddfcc952 | ||
![]() |
0daa884003 | ||
![]() |
93df1abf4a | ||
![]() |
942229acdc | ||
![]() |
139c0b926c | ||
![]() |
694dd863fa | ||
![]() |
b378cdf880 | ||
![]() |
57646f5390 | ||
![]() |
9e5d5298c4 | ||
![]() |
0fb1e585db | ||
![]() |
d5dce72a34 | ||
![]() |
b1a29c67a9 | ||
![]() |
471106f825 | ||
![]() |
ec070d2f67 | ||
![]() |
e263c917de | ||
![]() |
911a07d6a1 | ||
![]() |
f65ec4bb05 | ||
![]() |
e6e7d6042c | ||
![]() |
e44499db4e | ||
![]() |
b45272daa4 | ||
![]() |
2d61d93c93 | ||
![]() |
a49111c0c2 | ||
![]() |
9a738603d0 | ||
![]() |
49c7799431 | ||
![]() |
634e792f61 | ||
![]() |
5212f255e6 | ||
![]() |
e20f0a4161 | ||
![]() |
20b2cf3aaa | ||
![]() |
cf54ad51f9 | ||
![]() |
3dff0ccad5 | ||
![]() |
5036a53b7c | ||
![]() |
8c1c48bcf5 | ||
![]() |
67752d43d3 | ||
![]() |
5947fc70eb | ||
![]() |
9e26d5f20b | ||
![]() |
3be9b72148 | ||
![]() |
75ecc525a7 | ||
![]() |
0c1922a08b | ||
![]() |
92e0362eb6 | ||
![]() |
3716cc3bcc | ||
![]() |
e24e847f4b | ||
![]() |
ccc423c44e | ||
![]() |
28b89e2535 | ||
![]() |
52bfeae099 | ||
![]() |
6215a6a622 | ||
![]() |
c2c41f9275 | ||
![]() |
d7de64a4ef | ||
![]() |
04ffd38e14 | ||
![]() |
38958c1326 | ||
![]() |
9bb50a7190 | ||
![]() |
2e59ed73aa | ||
![]() |
b3dc2425f8 | ||
![]() |
4e7681d4d4 | ||
![]() |
48235b63a2 | ||
![]() |
8de7a1ae8c | ||
![]() |
8142dd48cd | ||
![]() |
76c9b57a4b | ||
![]() |
071a75a740 | ||
![]() |
4782dab745 | ||
![]() |
90fbd2a7e5 | ||
![]() |
1f0d83ded4 | ||
![]() |
6ff3ebc55b | ||
![]() |
3813091668 | ||
![]() |
47e5300a46 | ||
![]() |
41662706ab | ||
![]() |
91aa717189 | ||
![]() |
f6b936431a | ||
![]() |
8524e56166 | ||
![]() |
8328c69c46 | ||
![]() |
2470522209 | ||
![]() |
f1d87f7c4d | ||
![]() |
07278047a4 | ||
![]() |
6df8ea2101 | ||
![]() |
3b3fbd1265 | ||
![]() |
8b4a670be8 | ||
![]() |
dad406e995 | ||
![]() |
13e9364477 | ||
![]() |
3018f17e6d | ||
![]() |
627aa65e1f | ||
![]() |
b83525092c | ||
![]() |
dd3c4bdbae | ||
![]() |
17fe50d40b | ||
![]() |
27c4794c6c | ||
![]() |
a678a0f39d | ||
![]() |
33c56f87f8 | ||
![]() |
ffb1b9c0e8 | ||
![]() |
ef272815ea | ||
![]() |
d967583228 | ||
![]() |
ef36239161 | ||
![]() |
bb3966c36c | ||
![]() |
4b7674d7e2 | ||
![]() |
166490195f | ||
![]() |
3d267139fe | ||
![]() |
ede0f9f3db | ||
![]() |
f140a331d7 | ||
![]() |
bf1a2cac39 | ||
![]() |
4d14c846b0 | ||
![]() |
46e57925b9 | ||
![]() |
ca8f8d6c15 | ||
![]() |
7acd741ff0 | ||
![]() |
38cbc6da94 | ||
![]() |
c2d1d0c4eb | ||
![]() |
3fce633195 | ||
![]() |
30a7466fc9 | ||
![]() |
7fa99ed910 | ||
![]() |
801fea8269 | ||
![]() |
341fa7900a | ||
![]() |
fb0b4a08ac | ||
![]() |
a0797721a0 | ||
![]() |
8dee3ec364 | ||
![]() |
0ddcb39302 | ||
![]() |
5f72ed4a49 | ||
![]() |
71e276d478 | ||
![]() |
833ccadb58 | ||
![]() |
d33f38ea70 | ||
![]() |
386a3d297c | ||
![]() |
d19cc9d7b9 | ||
![]() |
30081a1717 | ||
![]() |
0d68df3711 | ||
![]() |
157d22a8f9 | ||
![]() |
4efc6bf4ec | ||
![]() |
a920dbc873 | ||
![]() |
cafd47f334 | ||
![]() |
3a83c67c6c | ||
![]() |
a5657a38cd | ||
![]() |
82f284b5fa | ||
![]() |
6459a8be1b | ||
![]() |
06240d4aa8 | ||
![]() |
5c2a42b69e | ||
![]() |
3c9a2f53ab | ||
![]() |
b565707db9 | ||
![]() |
380d28253a | ||
![]() |
3410b0df10 | ||
![]() |
a2d6469620 | ||
![]() |
c0c89cbfd7 | ||
![]() |
f3e72b6a6d | ||
![]() |
a9b9737065 | ||
![]() |
1a2628eff0 | ||
![]() |
53b468db4a | ||
![]() |
73000d30aa | ||
![]() |
a521efd39a | ||
![]() |
3531376eb2 | ||
![]() |
2ec97c023f | ||
![]() |
2b65a39c7a | ||
![]() |
ca4632ef3a | ||
![]() |
bc5e65ab6c | ||
![]() |
74140e9db1 | ||
![]() |
0bf7168cba | ||
![]() |
69002c3ff0 | ||
![]() |
d9c39cdd05 | ||
![]() |
1989736d45 | ||
![]() |
ecbe87bf3c | ||
![]() |
c9fd4c9605 | ||
![]() |
97b316c5f7 | ||
![]() |
589ec8784b | ||
![]() |
547d733f84 | ||
![]() |
8ff8057f07 | ||
![]() |
8059614a2e | ||
![]() |
98785417b2 | ||
![]() |
750f295c0f | ||
![]() |
cbea8156ad | ||
![]() |
1ad9fc2714 | ||
![]() |
a247eadd54 | ||
![]() |
6c80c65f62 | ||
![]() |
6c0623a9e1 | ||
![]() |
7646a296dc | ||
![]() |
b1c65da22b | ||
![]() |
1fa66bd469 | ||
![]() |
8ca57dc45b | ||
![]() |
f6624aca02 | ||
![]() |
1757b4c872 | ||
![]() |
98e8411fb6 | ||
![]() |
72f8d51eb1 | ||
![]() |
6d09d9f5ca | ||
![]() |
ce2e104286 | ||
![]() |
49b823f094 | ||
![]() |
ba2ce1decb | ||
![]() |
eb9a5b960b | ||
![]() |
d7a7153069 | ||
![]() |
90f982d673 | ||
![]() |
385e1e2cd5 | ||
![]() |
d638b0603d | ||
![]() |
a451b6b8b6 | ||
![]() |
e563f860ad | ||
![]() |
b8df9c2b96 | ||
![]() |
255e21d5ae | ||
![]() |
d54e4ab2b7 | ||
![]() |
d01f39e20d | ||
![]() |
de578d3b99 | ||
![]() |
bb392af76f | ||
![]() |
a2927266b4 | ||
![]() |
29dce1de51 | ||
![]() |
6a4065f3b7 | ||
![]() |
430a7e56ca | ||
![]() |
a1e17b0e19 | ||
![]() |
8a51f98532 | ||
![]() |
eef4e5b62a | ||
![]() |
a6fe50e6bc | ||
![]() |
e1588120f2 | ||
![]() |
437e9ea42b | ||
![]() |
1c98ce4682 | ||
![]() |
17fa10333a | ||
![]() |
3d174bf65f | ||
![]() |
591c728d69 | ||
![]() |
4b2f390fa3 | ||
![]() |
38aa8e6e5b | ||
![]() |
b665c0c7e3 | ||
![]() |
8c42a87e49 | ||
![]() |
ead6e07b24 | ||
![]() |
52f2b6503f | ||
![]() |
98fc651c45 | ||
![]() |
5e94fd7bfa | ||
![]() |
4cf29aeefd | ||
![]() |
9877014512 | ||
![]() |
694a9b4c3f | ||
![]() |
07074eb5e5 | ||
![]() |
eaff3ebad0 | ||
![]() |
95c7b9a807 | ||
![]() |
54bdd69b2a | ||
![]() |
cb9bf96b73 | ||
![]() |
3273fb1e91 | ||
![]() |
a8b141b402 | ||
![]() |
2132a4322f | ||
![]() |
c59e47409b | ||
![]() |
816af5a7b1 | ||
![]() |
e3bf028b7f | ||
![]() |
ad3aac5978 | ||
![]() |
b19a576dc9 | ||
![]() |
00130d6cf7 | ||
![]() |
86b437b3b0 | ||
![]() |
e640089aab | ||
![]() |
7a483d6de3 | ||
![]() |
c713888062 | ||
![]() |
b9a16e89d6 | ||
![]() |
2dc6e31d5a | ||
![]() |
db7f199003 | ||
![]() |
201610b9ab | ||
![]() |
112d1e3dd4 | ||
![]() |
5df492b20e | ||
![]() |
1b7c30c557 | ||
![]() |
40d179d4b4 | ||
![]() |
367aa0a386 | ||
![]() |
37daceca61 | ||
![]() |
2f04a72c9f | ||
![]() |
8f5b9f6c47 | ||
![]() |
ab8dacec4b | ||
![]() |
5d6d4de152 | ||
![]() |
0c21bb264f | ||
![]() |
8ae2d10f2e | ||
![]() |
19d48f4a1f | ||
![]() |
81565cac97 | ||
![]() |
b320c88e9e | ||
![]() |
e76c480f34 | ||
![]() |
11452fd21f | ||
![]() |
14c2ff6c02 | ||
![]() |
7a701a9c04 | ||
![]() |
7e1376f57e | ||
![]() |
ae237f38fb | ||
![]() |
93071d3715 | ||
![]() |
27e344950a | ||
![]() |
8bdfe2b7de | ||
![]() |
e631f3fa2d | ||
![]() |
793c2b273f | ||
![]() |
c79f696278 | ||
![]() |
5df262bc6d | ||
![]() |
7a6ce6f07e | ||
![]() |
7335d51e7a | ||
![]() |
f949793e10 | ||
![]() |
43b0f5b044 | ||
![]() |
5021ac683b | ||
![]() |
7a040120b5 | ||
![]() |
232e6e4b41 | ||
![]() |
6d3514308a | ||
![]() |
f7bcfb872d | ||
![]() |
7c1fd71e43 | ||
![]() |
8c8e13701b | ||
![]() |
ff2ff9c462 | ||
![]() |
20307f0c1b | ||
![]() |
21a07b703d | ||
![]() |
e6a3274db9 | ||
![]() |
f72ec20576 | ||
![]() |
071976dd05 | ||
![]() |
4842270a96 | ||
![]() |
49c95dcb5e | ||
![]() |
6c16d43980 | ||
![]() |
3289295278 | ||
![]() |
30d9dcb1e8 | ||
![]() |
c2b5b01f34 | ||
![]() |
e999aeac23 | ||
![]() |
da025e97c5 | ||
![]() |
9d17cd0087 | ||
![]() |
5d8297a392 | ||
![]() |
90a1b90b9a | ||
![]() |
5475ad8bcf | ||
![]() |
f29e60712b | ||
![]() |
cefa6bb4df |
55
.github/workflows/Pack.yml
vendored
55
.github/workflows/Pack.yml
vendored
@ -1,55 +0,0 @@
|
||||
name: Pack
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "release" ]
|
||||
pull_request:
|
||||
branches: [ "release" ]
|
||||
|
||||
jobs:
|
||||
nuget_desktop:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Nuget Semi.Avalonia
|
||||
run: dotnet pack ./src/Semi.Avalonia -o ./nugets
|
||||
|
||||
- name: Nuget Semi.Avalonia.DataGrid
|
||||
run: dotnet pack ./src/Semi.Avalonia.DataGrid -o ./nugets
|
||||
|
||||
- name: Nuget Semi.Avalonia.ColorPicker
|
||||
run: dotnet pack ./src/Semi.Avalonia.ColorPicker -o ./nugets
|
||||
|
||||
- name: Desktop
|
||||
run: dotnet publish ./demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true --self-contained true
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v3.1.2
|
||||
with:
|
||||
name: nuget_desktop
|
||||
path: |
|
||||
./nugets
|
||||
./**/publish/*.exe
|
||||
|
||||
android:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: CD Android
|
||||
run: cd ./demo/Semi.Avalonia.Demo.Android
|
||||
|
||||
- name: Restore Dependencies
|
||||
run: dotnet restore
|
||||
|
||||
- name: Build
|
||||
run: dotnet publish ./demo/Semi.Avalonia.Demo.Android -c Release -f net7.0-android --no-restore
|
||||
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v3.1.2
|
||||
with:
|
||||
name: android
|
||||
path: ./**/publish/*Signed.apk
|
44
.github/workflows/deploy.yml
vendored
Normal file
44
.github/workflows/deploy.yml
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
name: Deploy to GitHub Pages
|
||||
|
||||
env:
|
||||
PROJECT_PATH: demo/Semi.Avalonia.Demo.Web/Semi.Avalonia.Demo.Web.csproj
|
||||
OUTPUT_PATH: demo/Semi.Avalonia.Demo.Web/bin/Release/net8.0-browser/publish/wwwroot
|
||||
on:
|
||||
push:
|
||||
branches: [ "action/deploy" ]
|
||||
pull_request:
|
||||
branches: [ "action/deploy" ]
|
||||
|
||||
jobs:
|
||||
deploy-to-github-pages:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
|
||||
- name: Setup .NET 8
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 8.0.x
|
||||
|
||||
- name: Install wasm-tools
|
||||
run: dotnet workload install wasm-tools
|
||||
|
||||
- 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
|
||||
|
||||
- name: Add .nojekyll file
|
||||
run: touch $OUTPUT_PATH/.nojekyll
|
||||
|
||||
- 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 }}
|
26
.github/workflows/pack-tree.yml
vendored
Normal file
26
.github/workflows/pack-tree.yml
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
name: Pack TreeDataGrid Nuget
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "action/pack-tree" ]
|
||||
pull_request:
|
||||
branches: [ "action/pack-tree" ]
|
||||
|
||||
jobs:
|
||||
nuget:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
|
||||
- name: Nuget Semi.Avalonia.TreeDataGrid
|
||||
run: dotnet pack ./src/Semi.Avalonia.TreeDataGrid -o ./nugets
|
||||
|
||||
- name: Publish NuGet package
|
||||
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
|
||||
with:
|
||||
name: nugets
|
||||
path: ./nugets
|
32
.github/workflows/pack.yml
vendored
Normal file
32
.github/workflows/pack.yml
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
name: Pack Nuget
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "action/pack" ]
|
||||
pull_request:
|
||||
branches: [ "action/pack" ]
|
||||
|
||||
jobs:
|
||||
nuget:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
|
||||
- name: Nuget 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: Nuget Semi.Avalonia.DataGrid
|
||||
run: dotnet pack ./src/Semi.Avalonia.DataGrid -o ./nugets
|
||||
|
||||
- name: Publish NuGet package
|
||||
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
|
||||
with:
|
||||
name: nugets
|
||||
path: ./nugets
|
92
.github/workflows/publish.yml
vendored
Normal file
92
.github/workflows/publish.yml
vendored
Normal file
@ -0,0 +1,92 @@
|
||||
name: Publish Demo
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "action/publish" ]
|
||||
pull_request:
|
||||
branches: [ "action/publish" ]
|
||||
|
||||
jobs:
|
||||
windows:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
|
||||
- name: Make upload directory
|
||||
run: mkdir upload
|
||||
|
||||
- name: Publish win-x64
|
||||
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/win64
|
||||
|
||||
- name: Zip win-x64
|
||||
run: |
|
||||
$files = Get-ChildItem -Path ./publish/win64/* -Recurse -Exclude *.pdb
|
||||
Compress-Archive -Path $files.FullName -DestinationPath ./upload/Semi.Avalonia.Demo.Desktop.win-x64.zip
|
||||
|
||||
- name: Enable Native AOT in .csproj
|
||||
run: |
|
||||
sed -i 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
|
||||
sed -i 's#<!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>-->#<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
|
||||
|
||||
- name: Publish win-x64 AOT
|
||||
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o ./publish/win64-aot
|
||||
|
||||
- name: Zip win-x64 AOT
|
||||
run: |
|
||||
$files = Get-ChildItem -Path ./publish/win64-aot/* -Recurse -Exclude *.pdb
|
||||
Compress-Archive -Path $files.FullName -DestinationPath ./upload/Semi.Avalonia.Demo.Desktop.win-x64.NativeAOT.zip
|
||||
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: windows
|
||||
path: ./upload
|
||||
|
||||
linux:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
|
||||
- name: Make upload directory
|
||||
run: mkdir upload
|
||||
|
||||
- name: Publish linux-x64
|
||||
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r linux-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/linux64
|
||||
|
||||
- name: Zip linux-x64
|
||||
run: zip -j -r ./upload/Semi.Avalonia.Demo.Desktop.linux-x64.zip ./publish/linux64 -x "*.pdb"
|
||||
|
||||
- name: Publish linux-x64 DRM
|
||||
run: dotnet publish demo/Semi.Avalonia.Demo.Drm -r linux-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/drm
|
||||
|
||||
- name: Zip linux-x64 DRM
|
||||
run: zip -j -r ./upload/Semi.Avalonia.Demo.Drm.linux-x64.zip ./publish/drm -x "*.pdb"
|
||||
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: linux
|
||||
path: ./upload
|
||||
|
||||
android:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
|
||||
- name: CD Android
|
||||
run: cd ./demo/Semi.Avalonia.Demo.Android
|
||||
|
||||
- name: Restore Dependencies
|
||||
run: dotnet restore
|
||||
|
||||
- name: Publish Android
|
||||
run: dotnet publish demo/Semi.Avalonia.Demo.Android -c Release -f net8.0-android --no-restore -o ./publish
|
||||
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: android
|
||||
path: ./publish/*Signed.apk
|
@ -1,6 +1,6 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="SC-Single" type="DotNetFolderPublish" factoryName="Publish to folder">
|
||||
<riderPublish configuration="Release" include_native_libs_for_self_extract="true" platform="Any CPU" produce_single_file="true" runtime="win-x64" self_contained="true" target_folder="$PROJECT_DIR$/demo/Semi.Avalonia.Demo.Desktop/bin/Release/net7.0/win-x64/publish" target_framework="net7.0" uuid_high="3088527218258560748" uuid_low="-8649338673481336678" />
|
||||
<riderPublish configuration="Release" include_native_libs_for_self_extract="true" platform="Any CPU" produce_single_file="true" runtime="win-x64" self_contained="true" target_folder="$PROJECT_DIR$/demo/Semi.Avalonia.Demo.Desktop/bin/Release/net8.0/win-x64/publish" target_framework="net8.0" uuid_high="3088527218258560748" uuid_low="-8649338673481336678" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
78
README.md
78
README.md
@ -1,63 +1,78 @@
|
||||
# Semi.Avalonia
|
||||
# Semi Avalonia
|
||||
|
||||
[](https://www.nuget.org/packages/Semi.Avalonia/)
|
||||
[](https://www.nuget.org/packages/Semi.Avalonia/)
|
||||
|
||||
[中文](./README_CN.md)
|
||||
|
||||
Avalonia Theme inspired by Semi Design
|
||||
|
||||
> Semi.Avalonia is still in very early stage. Please don't use in production.
|
||||
Semi.Avalonia can be previewed in the browser [here](https://irihitech.github.io/Semi.Avalonia/)
|
||||
|
||||
# How to Use
|
||||
If you are looking for more detailed documentation, Please visit [Semi Documentation](https://docs.irihi.tech/semi/)
|
||||
|
||||
If you are looking for more customized controls, Please try [Ursa](https://github.com/irihitech/Ursa.Avalonia)
|
||||
|
||||

|
||||
|
||||
## How to Use
|
||||
|
||||
### Installation
|
||||
|
||||
## Installation
|
||||
```bash
|
||||
dotnet add package Semi.Avalonia --version 0.1.0-preview8
|
||||
dotnet add package Semi.Avalonia
|
||||
```
|
||||
|
||||
Include Semi Design Styles in application:
|
||||
|
||||
```xaml
|
||||
<Application.Styles>
|
||||
<StyleInclude Source="avares://Semi.Avalonia/Themes/Index.axaml" />
|
||||
</Application.Styles>
|
||||
<Application
|
||||
...
|
||||
xmlns:semi="https://irihi.tech/semi">
|
||||
<Application.Styles>
|
||||
<semi:SemiTheme Locale="zh-CN" />
|
||||
</Application.Styles>
|
||||
</Application>
|
||||
```
|
||||
|
||||
That's all.
|
||||
That's all.
|
||||
|
||||
ColorPicker, DataGrid and TreeDataGrid are distributed in separated packages. Please install if you need.
|
||||
|
||||
DataGrid and ColorPicker are distributed in separated packages. Please install if you need.
|
||||
```bash
|
||||
dotnet add package Semi.Avalonia.ColorPicker --version 0.1.0-preview8
|
||||
dotnet add package Semi.Avalonia.DataGrid --version 0.1.0-preview8
|
||||
dotnet add package Semi.Avalonia.ColorPicker
|
||||
dotnet add package Semi.Avalonia.DataGrid
|
||||
dotnet add package Semi.Avalonia.TreeDataGrid
|
||||
```
|
||||
|
||||
```xaml
|
||||
<Application.Styles>
|
||||
<StyleInclude Source="avares://Semi.Avalonia.DataGrid/Index.axaml" />
|
||||
<StyleInclude Source="avares://Semi.Avalonia.ColorPicker/Index.axaml" />
|
||||
<StyleInclude Source="avares://Semi.Avalonia.DataGrid/Index.axaml" />
|
||||
<StyleInclude Source="avares://Semi.Avalonia.TreeDataGrid/Index.axaml" />
|
||||
</Application.Styles>
|
||||
```
|
||||
|
||||
## Demo
|
||||
|
||||
You can always download demo executable to play around with Semi Avalonia Themes.
|
||||
https://github.com/irihitech/Semi.Avalonia/releases
|
||||
<https://github.com/irihitech/Semi.Avalonia/releases>
|
||||
|
||||
## Support
|
||||
|
||||
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 |
|
||||
|:--------------------|:-----------------|
|
||||
| 0.1.0-preview3 | 11.0-preview4 |
|
||||
| 0.1.0-preview5.x | 11.0-preview5 |
|
||||
| 0.1.0-preview6.x | 11.0-preview6 |
|
||||
| 0.1.0-preview7.x | 11.0-preview7 |
|
||||
| 0.1.0-preview8.x | 11.0-preview8 |
|
||||
|
||||
**NOTE**
|
||||
|
||||
Semi Avalonia theme is moving forward together with Avalonia preview versions now. So new feature/fixes are not backported to previous preview versions. If you need a feature/fix for outdated avalonia preview version, please raise an issue so we can do that for you.
|
||||
|
||||
|
||||
## TODO
|
||||
* DataValidationErrors
|
||||
* FocusAdorner
|
||||
| 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 |
|
||||
|
||||
## Credits
|
||||
|
||||
@ -71,10 +86,3 @@ Semi Avalonia theme is moving forward together with Avalonia preview versions no
|
||||
|
||||
[CommunityToolKit](https://github.com/CommunityToolkit/dotnet)
|
||||
|
||||
## Screenshot
|
||||
|
||||
Light Mode
|
||||

|
||||
|
||||
Dark Mode
|
||||

|
88
README_CN.md
Normal file
88
README_CN.md
Normal file
@ -0,0 +1,88 @@
|
||||
# Semi Avalonia
|
||||
|
||||
[](https://www.nuget.org/packages/Semi.Avalonia/)
|
||||
[](https://www.nuget.org/packages/Semi.Avalonia/)
|
||||
|
||||
[English](./README.md)
|
||||
|
||||
Avalonia UI 控件主题,灵感来自 Semi Design
|
||||
|
||||
Semi.Avalonia 现在可以在浏览器上 [查看效果](https://irihitech.github.io/Semi.Avalonia/)
|
||||
|
||||
如果您希望查看更详细的文档,请浏览 [Semi 文档](https://docs.irihi.tech/semi/)
|
||||
|
||||
如果您希望使用更多的拓展控件,欢迎尝试 [Ursa](https://github.com/irihitech/Ursa.Avalonia)
|
||||
|
||||

|
||||
|
||||
## 如何使用
|
||||
|
||||
### 安装
|
||||
|
||||
```bash
|
||||
dotnet add package Semi.Avalonia
|
||||
```
|
||||
|
||||
在样式中引用 Semi 主题:
|
||||
|
||||
```xaml
|
||||
<Application
|
||||
...
|
||||
xmlns:semi="https://irihi.tech/semi">
|
||||
<Application.Styles>
|
||||
<semi:SemiTheme Locale="zh-CN" />
|
||||
</Application.Styles>
|
||||
</Application>
|
||||
```
|
||||
|
||||
这样就可以了。
|
||||
|
||||
ColorPicker、DataGrid 和 TreeDataGrid 的样式单独分发,如果需要请安装并引用。
|
||||
|
||||
```bash
|
||||
dotnet add package Semi.Avalonia.ColorPicker
|
||||
dotnet add package Semi.Avalonia.DataGrid
|
||||
dotnet add package Semi.Avalonia.TreeDataGrid
|
||||
```
|
||||
|
||||
```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" />
|
||||
</Application.Styles>
|
||||
```
|
||||
|
||||
## 示例
|
||||
|
||||
您可以从 Semi Avalonia 的 release 页下载并试用 Semi Avalonia 的展示应用。
|
||||
<https://github.com/irihitech/Semi.Avalonia/releases>
|
||||
|
||||
## 社区支持
|
||||
|
||||
我们提供有限度的免费社区支持,如果您有任何问题或建议,除了在GitHub上提交issue或发起讨论,也欢迎加入我们的飞书交流群:
|
||||
|
||||

|
||||
|
||||
## 版本兼容性
|
||||
|
||||
| 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 |
|
||||
|
||||
## 致谢
|
||||
|
||||
[Semi Design](https://semi.design/)
|
||||
|
||||
[Avalonia](https://github.com/AvaloniaUI/Avalonia)
|
||||
|
||||
[FluentAvalonia](https://github.com/amwx/FluentAvalonia)
|
||||
|
||||
[Material Design Icons](https://pictogrammers.com/library/mdi/)
|
||||
|
||||
[CommunityToolKit](https://github.com/CommunityToolkit/dotnet)
|
||||
|
@ -12,6 +12,14 @@ 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-tree.yml = .github\workflows\pack-tree.yml
|
||||
.github\workflows\publish.yml = .github\workflows\publish.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}"
|
||||
@ -26,6 +34,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semi.Avalonia.ColorPicker",
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semi.Avalonia.Demo.Android", "demo\Semi.Avalonia.Demo.Android\Semi.Avalonia.Demo.Android.csproj", "{0C81FC1C-5D2D-478A-9876-923A0C85EC2F}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Semi.Avalonia.Demo.Drm", "demo\Semi.Avalonia.Demo.Drm\Semi.Avalonia.Demo.Drm.csproj", "{86D93406-412A-4429-93B2-92AAD0407784}"
|
||||
EndProject
|
||||
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
|
||||
@ -61,6 +75,18 @@ Global
|
||||
{0C81FC1C-5D2D-478A-9876-923A0C85EC2F}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
||||
{0C81FC1C-5D2D-478A-9876-923A0C85EC2F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0C81FC1C-5D2D-478A-9876-923A0C85EC2F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{86D93406-412A-4429-93B2-92AAD0407784}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{86D93406-412A-4429-93B2-92AAD0407784}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{86D93406-412A-4429-93B2-92AAD0407784}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{86D93406-412A-4429-93B2-92AAD0407784}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{398D2998-0835-41F5-99A3-608CAB8051E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{398D2998-0835-41F5-99A3-608CAB8051E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{398D2998-0835-41F5-99A3-608CAB8051E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{398D2998-0835-41F5-99A3-608CAB8051E2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{6178B545-4BB6-458C-A27C-EE11F3885D38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{6178B545-4BB6-458C-A27C-EE11F3885D38}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6178B545-4BB6-458C-A27C-EE11F3885D38}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6178B545-4BB6-458C-A27C-EE11F3885D38}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@ -70,6 +96,8 @@ Global
|
||||
{69A2C77D-6DB7-4AE4-B179-D1F5CF5E2DF0} = {43091528-9509-43CB-A003-9C5C11E96DD6}
|
||||
{D789AEDB-EBDF-4450-8E8E-B4A03FB257B0} = {43091528-9509-43CB-A003-9C5C11E96DD6}
|
||||
{0C81FC1C-5D2D-478A-9876-923A0C85EC2F} = {43091528-9509-43CB-A003-9C5C11E96DD6}
|
||||
{86D93406-412A-4429-93B2-92AAD0407784} = {43091528-9509-43CB-A003-9C5C11E96DD6}
|
||||
{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.0.0-preview8</AvaloniaVersion>
|
||||
<AvaloniaVersion>11.2.2</AvaloniaVersion>
|
||||
<CommunityToolkitVersion>8.3.2</CommunityToolkitVersion>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
@ -1,27 +0,0 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.ApplicationLifetimes;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Semi.Avalonia.Demo.Views;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Android;
|
||||
|
||||
public partial class App : Application
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
|
||||
public override void OnFrameworkInitializationCompleted()
|
||||
{
|
||||
if (ApplicationLifetime is ISingleViewApplicationLifetime single)
|
||||
{
|
||||
single.MainView = new MainView()
|
||||
{
|
||||
|
||||
};
|
||||
}
|
||||
base.OnFrameworkInitializationCompleted();
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.1 KiB |
@ -4,9 +4,13 @@ using Avalonia.Android;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Android;
|
||||
|
||||
[Activity(Label = "Semi.Avalonia.Demo.Android", Icon = "@drawable/Icon", Theme = "@style/MyTheme.NoActionBar",
|
||||
LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize)]
|
||||
public class MainActivity : AvaloniaMainActivity
|
||||
[Activity(
|
||||
Label = "Semi.Avalonia",
|
||||
Theme = "@style/MyTheme.NoActionBar",
|
||||
Icon = "@drawable/Icon",
|
||||
MainLauncher = true,
|
||||
LaunchMode = LaunchMode.SingleTop,
|
||||
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)]
|
||||
public class MainActivity : AvaloniaMainActivity<App>
|
||||
{
|
||||
|
||||
}
|
44
demo/Semi.Avalonia.Demo.Android/Resources/AboutResources.txt
Normal file
44
demo/Semi.Avalonia.Demo.Android/Resources/AboutResources.txt
Normal file
@ -0,0 +1,44 @@
|
||||
Images, layout descriptions, binary blobs and string dictionaries can be included
|
||||
in your application as resource files. Various Android APIs are designed to
|
||||
operate on the resource IDs instead of dealing with images, strings or binary blobs
|
||||
directly.
|
||||
|
||||
For example, a sample Android app that contains a user interface layout (main.axml),
|
||||
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
|
||||
would keep its resources in the "Resources" directory of the application:
|
||||
|
||||
Resources/
|
||||
drawable/
|
||||
icon.png
|
||||
|
||||
layout/
|
||||
main.axml
|
||||
|
||||
values/
|
||||
strings.xml
|
||||
|
||||
In order to get the build system to recognize Android resources, set the build action to
|
||||
"AndroidResource". The native Android APIs do not operate directly with filenames, but
|
||||
instead operate on resource IDs. When you compile an Android application that uses resources,
|
||||
the build system will package the resources for distribution and generate a class called "R"
|
||||
(this is an Android convention) that contains the tokens for each one of the resources
|
||||
included. For example, for the above Resources layout, this is what the R class would expose:
|
||||
|
||||
public class R {
|
||||
public class drawable {
|
||||
public const int icon = 0x123;
|
||||
}
|
||||
|
||||
public class layout {
|
||||
public const int main = 0x456;
|
||||
}
|
||||
|
||||
public class strings {
|
||||
public const int first_string = 0xabc;
|
||||
public const int second_string = 0xbcd;
|
||||
}
|
||||
}
|
||||
|
||||
You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
|
||||
to reference the layout/main.axml file, or R.strings.first_string to reference the first
|
||||
string in the dictionary file values/strings.xml.
|
@ -0,0 +1,66 @@
|
||||
<animated-vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt">
|
||||
<aapt:attr name="android:drawable">
|
||||
<vector
|
||||
android:name="vector"
|
||||
android:width="128dp"
|
||||
android:height="128dp"
|
||||
android:viewportWidth="128"
|
||||
android:viewportHeight="128">
|
||||
<group
|
||||
android:name="wrapper"
|
||||
android:translateX="21"
|
||||
android:translateY="21">
|
||||
<group android:name="group">
|
||||
<path
|
||||
android:name="path"
|
||||
android:pathData="M 74.853 85.823 L 75.368 85.823 C 80.735 85.823 85.144 81.803 85.761 76.602 L 85.836 41.76 C 85.225 18.593 66.254 0 42.939 0 C 19.24 0 0.028 19.212 0.028 42.912 C 0.028 66.357 18.831 85.418 42.18 85.823 L 74.853 85.823 Z"
|
||||
android:strokeWidth="1"/>
|
||||
<path
|
||||
android:name="path_1"
|
||||
android:pathData="M 43.059 14.614 C 29.551 14.614 18.256 24.082 15.445 36.743 C 18.136 37.498 20.109 39.968 20.109 42.899 C 20.109 45.831 18.136 48.301 15.445 49.055 C 18.256 61.716 29.551 71.184 43.059 71.184 C 47.975 71.184 52.599 69.93 56.628 67.723 L 56.628 70.993 L 71.344 70.993 L 71.344 44.072 C 71.357 43.714 71.344 43.26 71.344 42.899 C 71.344 27.278 58.68 14.614 43.059 14.614 Z M 29.51 42.899 C 29.51 35.416 35.576 29.35 43.059 29.35 C 50.541 29.35 56.607 35.416 56.607 42.899 C 56.607 50.382 50.541 56.448 43.059 56.448 C 35.576 56.448 29.51 50.382 29.51 42.899 Z"
|
||||
android:strokeWidth="1"
|
||||
android:fillType="evenOdd"/>
|
||||
<path
|
||||
android:name="path_2"
|
||||
android:pathData="M 18.105 42.88 C 18.105 45.38 16.078 47.407 13.579 47.407 C 11.079 47.407 9.052 45.38 9.052 42.88 C 9.052 40.381 11.079 38.354 13.579 38.354 C 16.078 38.354 18.105 40.381 18.105 42.88 Z"
|
||||
android:strokeWidth="1"/>
|
||||
</group>
|
||||
</group>
|
||||
</vector>
|
||||
</aapt:attr>
|
||||
<target android:name="path">
|
||||
<aapt:attr name="android:animation">
|
||||
<objectAnimator
|
||||
android:propertyName="fillColor"
|
||||
android:duration="1000"
|
||||
android:valueFrom="#00ffffff"
|
||||
android:valueTo="#161c2d"
|
||||
android:valueType="colorType"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in"/>
|
||||
</aapt:attr>
|
||||
</target>
|
||||
<target android:name="path_1">
|
||||
<aapt:attr name="android:animation">
|
||||
<objectAnimator
|
||||
android:propertyName="fillColor"
|
||||
android:duration="1000"
|
||||
android:valueFrom="#00ffffff"
|
||||
android:valueTo="#f9f9fb"
|
||||
android:valueType="colorType"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in"/>
|
||||
</aapt:attr>
|
||||
</target>
|
||||
<target android:name="path_2">
|
||||
<aapt:attr name="android:animation">
|
||||
<objectAnimator
|
||||
android:propertyName="fillColor"
|
||||
android:duration="1000"
|
||||
android:valueFrom="#00ffffff"
|
||||
android:valueTo="#f9f9fb"
|
||||
android:valueType="colorType"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in"/>
|
||||
</aapt:attr>
|
||||
</target>
|
||||
</animated-vector>
|
@ -0,0 +1,71 @@
|
||||
<animated-vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt">
|
||||
<aapt:attr name="android:drawable">
|
||||
<vector
|
||||
android:name="vector"
|
||||
android:width="128dp"
|
||||
android:height="128dp"
|
||||
android:viewportWidth="128"
|
||||
android:viewportHeight="128">
|
||||
<group
|
||||
android:name="wrapper"
|
||||
android:translateX="21"
|
||||
android:translateY="21">
|
||||
<group android:name="group">
|
||||
<path
|
||||
android:name="path"
|
||||
android:pathData="M 74.853 85.823 L 75.368 85.823 C 80.735 85.823 85.144 81.803 85.761 76.602 L 85.836 41.76 C 85.225 18.593 66.254 0 42.939 0 C 19.24 0 0.028 19.212 0.028 42.912 C 0.028 66.357 18.831 85.418 42.18 85.823 L 74.853 85.823 Z"
|
||||
android:fillColor="#00ffffff"
|
||||
android:strokeWidth="1"/>
|
||||
<path
|
||||
android:name="path_1"
|
||||
android:pathData="M 43.059 14.614 C 29.551 14.614 18.256 24.082 15.445 36.743 C 18.136 37.498 20.109 39.968 20.109 42.899 C 20.109 45.831 18.136 48.301 15.445 49.055 C 18.256 61.716 29.551 71.184 43.059 71.184 C 47.975 71.184 52.599 69.93 56.628 67.723 L 56.628 70.993 L 71.344 70.993 L 71.344 44.072 C 71.357 43.714 71.344 43.26 71.344 42.899 C 71.344 27.278 58.68 14.614 43.059 14.614 Z M 29.51 42.899 C 29.51 35.416 35.576 29.35 43.059 29.35 C 50.541 29.35 56.607 35.416 56.607 42.899 C 56.607 50.382 50.541 56.448 43.059 56.448 C 35.576 56.448 29.51 50.382 29.51 42.899 Z"
|
||||
android:fillColor="#00ffffff"
|
||||
android:strokeWidth="1"
|
||||
android:fillType="evenOdd"/>
|
||||
<path
|
||||
android:name="path_2"
|
||||
android:pathData="M 18.105 42.88 C 18.105 45.38 16.078 47.407 13.579 47.407 C 11.079 47.407 9.052 45.38 9.052 42.88 C 9.052 40.381 11.079 38.354 13.579 38.354 C 16.078 38.354 18.105 40.381 18.105 42.88 Z"
|
||||
android:fillColor="#00ffffff"
|
||||
android:strokeWidth="1"/>
|
||||
</group>
|
||||
</group>
|
||||
</vector>
|
||||
</aapt:attr>
|
||||
<target android:name="path_2">
|
||||
<aapt:attr name="android:animation">
|
||||
<objectAnimator
|
||||
android:propertyName="fillColor"
|
||||
android:startOffset="100"
|
||||
android:duration="900"
|
||||
android:valueFrom="#00ffffff"
|
||||
android:valueTo="#161c2d"
|
||||
android:valueType="colorType"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in"/>
|
||||
</aapt:attr>
|
||||
</target>
|
||||
<target android:name="path">
|
||||
<aapt:attr name="android:animation">
|
||||
<objectAnimator
|
||||
android:propertyName="fillColor"
|
||||
android:duration="500"
|
||||
android:valueFrom="#00ffffff"
|
||||
android:valueTo="#f9f9fb"
|
||||
android:valueType="colorType"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in"/>
|
||||
</aapt:attr>
|
||||
</target>
|
||||
<target android:name="path_1">
|
||||
<aapt:attr name="android:animation">
|
||||
<objectAnimator
|
||||
android:propertyName="fillColor"
|
||||
android:startOffset="100"
|
||||
android:duration="900"
|
||||
android:valueFrom="#00ffffff"
|
||||
android:valueTo="#161c2d"
|
||||
android:valueType="colorType"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in"/>
|
||||
</aapt:attr>
|
||||
</target>
|
||||
</animated-vector>
|
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="splash_background">#212121</color>
|
||||
</resources>
|
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<resources>
|
||||
|
||||
<style name="MyTheme">
|
||||
</style>
|
||||
|
||||
<style name="MyTheme.NoActionBar" parent="@style/Theme.AppCompat.NoActionBar">
|
||||
<item name="android:windowActionBar">false</item>
|
||||
<item name="android:windowBackground">@null</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:windowSplashScreenBackground">@color/splash_background</item>
|
||||
<item name="android:windowSplashScreenAnimatedIcon">@drawable/avalonia_anim</item>
|
||||
<item name="android:windowSplashScreenAnimationDuration">1000</item>
|
||||
<item name="postSplashScreenTheme">@style/MyTheme.Main</item>
|
||||
|
||||
</style>
|
||||
<style name="MyTheme.Main"
|
||||
parent ="MyTheme.NoActionBar">
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
</style>
|
||||
</resources>
|
@ -1,17 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<resources>
|
||||
|
||||
<style name="MyTheme">
|
||||
</style>
|
||||
|
||||
<style name="MyTheme.NoActionBar" parent="@style/Theme.AppCompat.NoActionBar">
|
||||
<style name="MyTheme.NoActionBar" parent="@style/Theme.AppCompat.DayNight.NoActionBar">
|
||||
<item name="android:windowActionBar">false</item>
|
||||
<item name="android:windowBackground">@drawable/splash_screen</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
</style>
|
||||
|
||||
<style name="MyTheme.Splash" parent ="MyTheme.NoActionBar">
|
||||
<item name="android:windowBackground">@drawable/splash_screen</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
@ -1,25 +1,30 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net7.0-android</TargetFramework>
|
||||
<TargetFramework>net8.0-android</TargetFramework>
|
||||
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<ApplicationId>com.irihitech.Semi.Avalonia</ApplicationId>
|
||||
<ApplicationVersion>1</ApplicationVersion>
|
||||
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
|
||||
<AndroidPackageFormat>apk</AndroidPackageFormat>
|
||||
<AndroidEnableProfiledAot>False</AndroidEnableProfiledAot>
|
||||
<AndroidEnableProfiledAot>false</AndroidEnableProfiledAot>
|
||||
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
|
||||
<RootNamespace>Semi.Avalonia.Demo.Android</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="../Directory.Build.props" />
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia.Android" Version="$(AvaloniaVersion)" />
|
||||
<AndroidResource Include="Icon.png">
|
||||
<Link>Resources\drawable\Icon.png</Link>
|
||||
</AndroidResource>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj" />
|
||||
<PackageReference Include="Avalonia.Android" Version="$(AvaloniaVersion)"/>
|
||||
<PackageReference Include="Xamarin.AndroidX.Core.SplashScreen" Version="1.0.1.1"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -1,22 +0,0 @@
|
||||
using Android.App;
|
||||
using Android.Content;
|
||||
using Avalonia;
|
||||
using Avalonia.Android;
|
||||
using Application = Android.App.Application;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Android;
|
||||
|
||||
[Activity(Theme = "@style/MyTheme.Splash", MainLauncher = true, NoHistory = true)]
|
||||
public class SplashActivity: AvaloniaSplashActivity<App>
|
||||
{
|
||||
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
|
||||
{
|
||||
return base.CustomizeAppBuilder(builder);
|
||||
}
|
||||
|
||||
protected override void OnResume()
|
||||
{
|
||||
base.OnResume();
|
||||
StartActivity(new Intent(Application.Context, typeof(MainActivity)));
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
<UserControl
|
||||
x:Class="Semi.Avalonia.Demo.Android.Views.MainView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
Welcome to Avalonia!
|
||||
</UserControl>
|
@ -1,13 +0,0 @@
|
||||
<Application
|
||||
x:Class="Semi.Avalonia.Demo.Desktop.App"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Semi.Avalonia.Demo.Desktop"
|
||||
RequestedThemeVariant="Light">
|
||||
<Application.Styles>
|
||||
<!--<StyleInclude Source="avares://Semi.Avalonia/Themes/Index.axaml" />-->
|
||||
<StyleInclude Source="avares://Semi.Avalonia/Themes/Index.axaml" />
|
||||
<StyleInclude Source="avares://Semi.Avalonia.DataGrid/Index.axaml" />
|
||||
<StyleInclude Source="avares://Semi.Avalonia.ColorPicker/Index.axaml" />
|
||||
</Application.Styles>
|
||||
</Application>
|
@ -1,7 +1,9 @@
|
||||
using System;
|
||||
using Avalonia;
|
||||
using Avalonia;
|
||||
using Avalonia.Dialogs;
|
||||
using Avalonia.Media;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Desktop;
|
||||
|
||||
@ -14,13 +16,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);
|
||||
|
||||
|
3
demo/Semi.Avalonia.Demo.Desktop/Roots.xml
Normal file
3
demo/Semi.Avalonia.Demo.Desktop/Roots.xml
Normal file
@ -0,0 +1,3 @@
|
||||
<linker>
|
||||
<assembly fullname="Semi.Avalonia.Demo" preserve="All"/>
|
||||
</linker>
|
@ -1,22 +1,25 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
||||
<!-- Uncomment below to enable Native AOT compilation-->
|
||||
<!--
|
||||
<PublishAot>true</PublishAot>
|
||||
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
|
||||
-->
|
||||
<!--<PublishAot>true</PublishAot>-->
|
||||
<!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>-->
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
|
||||
<IsTrimmable>true</IsTrimmable>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<RdXmlFile Include="rd.xml" />
|
||||
<TrimmerRootDescriptor Include="Roots.xml" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<!-- This manifest is used on Windows only.
|
||||
Don't remove it as it might cause problems with window transparency and embeded controls.
|
||||
Don't remove it as it might cause problems with window transparency and embedded controls.
|
||||
For more details visit https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests -->
|
||||
<assemblyIdentity version="1.0.0.0" name="Semi.Avalonia.Demo.Desktop"/>
|
||||
|
||||
|
@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Directives>
|
||||
<!--
|
||||
This file is part of RdXmlLibrary project.
|
||||
Visit https://github.com/kant2002/rdxmllibrary for latest version.
|
||||
If you have modifications specific to this Nuget package,
|
||||
please contribute back.
|
||||
-->
|
||||
<Application>
|
||||
<Assembly Name="Avalonia.Markup.Xaml" Dynamic="Required All"/>
|
||||
<Assembly Name="Semi.Avalonia" Dynamic="Required All"/>
|
||||
<Assembly Name="Semi.Avalonia.DataGrid" Dynamic="Required All"/>
|
||||
<Assembly Name="Semi.Avalonia.ColorPicker" Dynamic="Required All"/>
|
||||
<Assembly Name="Semi.Avalonia.Demo" Dynamic="Required All"/>
|
||||
</Application>
|
||||
</Directives>
|
56
demo/Semi.Avalonia.Demo.Drm/Program.cs
Normal file
56
demo/Semi.Avalonia.Demo.Drm/Program.cs
Normal file
@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using Avalonia;
|
||||
using Avalonia.Dialogs;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Drm;
|
||||
|
||||
class Program
|
||||
{
|
||||
// Initialization code. Don't use any Avalonia, third-party APIs or any
|
||||
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
|
||||
// yet and stuff might break.
|
||||
[STAThread]
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
var builder = BuildAvaloniaApp();
|
||||
|
||||
double GetScaling()
|
||||
{
|
||||
var idx = Array.IndexOf(args, "--scaling");
|
||||
if (idx != 0 && args.Length > idx + 1 &&
|
||||
double.TryParse(args[idx + 1], NumberStyles.Any, CultureInfo.InvariantCulture, out var scaling))
|
||||
return scaling;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (args.Contains("--drm"))
|
||||
{
|
||||
SilenceConsole();
|
||||
return builder.StartLinuxDrm(args, scaling: GetScaling());
|
||||
}
|
||||
|
||||
return builder.StartWithClassicDesktopLifetime(args);
|
||||
}
|
||||
|
||||
// Avalonia configuration, don't remove; also used by visual designer.
|
||||
public static AppBuilder BuildAvaloniaApp()
|
||||
=> AppBuilder.Configure<App>()
|
||||
.UseManagedSystemDialogs()
|
||||
.UsePlatformDetect()
|
||||
.With(new Win32PlatformOptions())
|
||||
.LogToTrace();
|
||||
|
||||
private static void SilenceConsole()
|
||||
{
|
||||
new Thread(() =>
|
||||
{
|
||||
Console.CursorVisible = false;
|
||||
while (true)
|
||||
Console.ReadKey(true);
|
||||
})
|
||||
{ IsBackground = true }.Start();
|
||||
}
|
||||
}
|
162
demo/Semi.Avalonia.Demo.Drm/README.md
Normal file
162
demo/Semi.Avalonia.Demo.Drm/README.md
Normal file
@ -0,0 +1,162 @@
|
||||
# DRM Start Steps
|
||||
|
||||
[中文](README_CN.md)
|
||||
|
||||
(Ubuntu 20.04 live server linux-x64 Virtual Machine Test Success)
|
||||
(Orange Pi Zero2 Ubuntu20.04-arm64 Test Success)
|
||||
|
||||
[Avalonia Official Reference Document](https://docs.avaloniaui.net/docs/next/guides/platforms/rpi/running-on-raspbian-lite-via-drm)
|
||||
|
||||
## Setup Running Environment
|
||||
|
||||
1. Run the following commands on the Linux side
|
||||
```bash
|
||||
sudo apt update
|
||||
sudo apt upgrade
|
||||
sudo reboot
|
||||
sudo apt-get install libgbm1 libgl1-mesa-dri libegl1-mesa libinput10
|
||||
```
|
||||
|
||||
2. Install the test tool (if a colored cube appears, the environment is installed)
|
||||
```bash
|
||||
sudo apt-get install kmscube
|
||||
sudo kmscube
|
||||
```
|
||||
|
||||
3. [Install .NET Runtime](https://learn.microsoft.com/dotnet/core/install/linux?WT.mc_id=dotnet-35129-website)
|
||||
|
||||
4. Add the Avalonia.LinuxFramebuffer package in NuGet
|
||||
|
||||
```bash
|
||||
dotnet add package Avalonia.LinuxFramebuffer
|
||||
```
|
||||
|
||||
5. Add StartLinuxDrm code
|
||||
|
||||
```csharp
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
var builder = BuildAvaloniaApp();
|
||||
if (args.Contains("--drm"))
|
||||
{
|
||||
SilenceConsole();
|
||||
// By default, Avalonia will try to detect output card automatically.
|
||||
// But you can specify one, for example "/dev/dri/card1".
|
||||
return builder.StartLinuxDrm(args: args, card: null, scaling: 1.0);
|
||||
}
|
||||
|
||||
return builder.StartWithClassicDesktopLifetime(args);
|
||||
}
|
||||
|
||||
private static void SilenceConsole()
|
||||
{
|
||||
new Thread(() =>
|
||||
{
|
||||
Console.CursorVisible = false;
|
||||
while (true)
|
||||
Console.ReadKey(true);
|
||||
})
|
||||
{ IsBackground = true }.Start();
|
||||
}
|
||||
```
|
||||
|
||||
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
|
||||
```
|
||||
|
||||
Add the following code to the csproj file for AOT publishing
|
||||
|
||||
```xml
|
||||
<PropertyGroup>
|
||||
<PublishAot>true</PublishAot>
|
||||
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
|
||||
</PropertyGroup>
|
||||
```
|
||||
|
||||
```bash
|
||||
dotnet publish demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj -c Release -r linu-x64
|
||||
```
|
||||
|
||||
7. Run the program
|
||||
|
||||
```bash
|
||||
sudo ./Semi.Avalonia.Demo.Drm --drm
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
1. Error message
|
||||
|
||||
> Unhandled exception. Avalonia.Markup.Xaml.XamlLoadException: No precompiled XAML found for avares://Semi.Avalonia/Themes/Light/Light.axaml (baseUri: avares://Semi.Avalonia/Themes/Index.axaml), make sure to specify x:Class and include your XAML file as AvaloniaResource
|
||||
|
||||
Solution:
|
||||
|
||||
If you use the Semi release file, do not trim it, otherwise an error will occur.
|
||||
|
||||
24.8.18 update: This issue has been fixed.
|
||||
|
||||
2. Error message
|
||||
|
||||
> Unhandled exception. System.TypeInitializationException: The type initializer for 'SkiaSharp.SKImageInfo' threw an exception.**
|
||||
**--->System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies.In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibSkiaSharp: cannot open shared object file: No such file or directory
|
||||
at SkiaSharp.SkiaApi.sk_colortype_get_default_8888()
|
||||
at SkiaSharp.SKImageInfo..cctor()
|
||||
|
||||
Solution:
|
||||
|
||||
Linux CLI installation
|
||||
|
||||
```bash
|
||||
sudo apt-get install -y libfontconfig1
|
||||
```
|
||||
[Reference](https://github.com/mono/SkiaSharp/issues/509)
|
||||
|
||||
3. Error message
|
||||
|
||||
> Permission denied
|
||||
|
||||
Solution:
|
||||
|
||||
add permission
|
||||
|
||||
```bash
|
||||
sudo chmod +x ./Semi.Avalonia.Demo.Drm
|
||||
```
|
||||
|
||||
4. Error message
|
||||
|
||||
> Unhandled exception. System.ComponentModel.Win32Exception (95): drmModeGetResources failed
|
||||
at Avalonia.LinuxFramebuffer.Output.DrmResources..ctor(Int32 fd, Boolean connectorsForceProbe) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs:line 91
|
||||
at Avalonia.LinuxFramebuffer.Output.DrmCard.GetResources(Boolean connectorsForceProbe) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs:line 171
|
||||
at Avalonia.LinuxFramebuffer.Output.DrmOutput..ctor(String path, Boolean connectorsForceProbe, DrmOutputOptions options) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs:line 60
|
||||
at LinuxFramebufferPlatformExtensions.StartLinuxDrm(AppBuilder builder, String[] args, String card, Double scaling, IInputBackend inputBackend) in /_/src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs:line 166
|
||||
at Semi.Avalonia.Demo.Drm.Program.Main(String[] args)
|
||||
|
||||
Solution:
|
||||
|
||||
The `program.cs` graphics card path is incorrect, it may not be `dev/dri/card1`, see if there are other graphics cards in the `dev/dri` directory such as `card0`.
|
||||
|
||||
24.8.18 update: Avalonia will now automatically detect the graphics card path, so you don't need to specify the graphics card path.
|
||||
|
||||
```csharp
|
||||
return builder.StartLinuxDrm(args: args, card: null, scaling: 1.0);
|
||||
```
|
||||
|
||||
5. Error message
|
||||
>Unhandled exception. System.ComponentModel.Win32Exception (2): Couldn't open /dev/dri/card1
|
||||
at Avalonia.LinuxFramebuffer.Output.DrmCard..ctor(String ) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs:line 167
|
||||
at Avalonia.LinuxFramebuffer.Output.DrmOutput..ctor(String , Boolean , DrmOutputOptions ) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs:line 58
|
||||
at LinuxFramebufferPlatformExtensions.StartLinuxDrm(AppBuilder, String[], String , Double , IInputBackend ) in /_/src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs:line 166
|
||||
at Semi.Avalonia.Demo.Drm.Program.Main(String[])
|
||||
|
||||
Solution:
|
||||
|
||||
Unable to open `/dev/dri/card1`, may be the graphics card is mounted to another folder.
|
||||
|
||||
24.8.18 update: Avalonia will now automatically detect the graphics card path, so you don't need to specify the graphics card path.
|
||||
|
||||
```csharp
|
||||
return builder.StartLinuxDrm(args: args, card: null, scaling: 1.0);
|
||||
```
|
162
demo/Semi.Avalonia.Demo.Drm/README_CN.md
Normal file
162
demo/Semi.Avalonia.Demo.Drm/README_CN.md
Normal file
@ -0,0 +1,162 @@
|
||||
# DRM启动步骤
|
||||
|
||||
[English](README.md)
|
||||
|
||||
(Ubuntu 20.04 live server linux-x64 虚拟机测试成功)
|
||||
(Orange Pi Zero2 Ubuntu20.04-arm64 测试成功)
|
||||
|
||||
[Avalonia 官方参考文档](https://docs.avaloniaui.net/docs/next/guides/platforms/rpi/running-on-raspbian-lite-via-drm)
|
||||
|
||||
## 搭建运行环境
|
||||
|
||||
1. Linux端运行命令
|
||||
```bash
|
||||
sudo apt update
|
||||
sudo apt upgrade
|
||||
sudo reboot
|
||||
sudo apt-get install libgbm1 libgl1-mesa-dri libegl1-mesa libinput10
|
||||
```
|
||||
|
||||
2. 安装测试工具(出现一个彩色立方体说明环境安装完成)
|
||||
```bash
|
||||
sudo apt-get install kmscube
|
||||
sudo kmscube
|
||||
```
|
||||
|
||||
3. [安装.net运行时](https://learn.microsoft.com/dotnet/core/install/linux?WT.mc_id=dotnet-35129-website)
|
||||
|
||||
4. NuGet里面添加Avalonia.LinuxFramebuffer包
|
||||
|
||||
```bash
|
||||
dotnet add package Avalonia.LinuxFramebuffer
|
||||
```
|
||||
|
||||
5. 添加StartLinuxDrm代码
|
||||
|
||||
```csharp
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
var builder = BuildAvaloniaApp();
|
||||
if (args.Contains("--drm"))
|
||||
{
|
||||
SilenceConsole();
|
||||
// By default, Avalonia will try to detect output card automatically.
|
||||
// But you can specify one, for example "/dev/dri/card1".
|
||||
return builder.StartLinuxDrm(args: args, card: null, scaling: 1.0);
|
||||
}
|
||||
|
||||
return builder.StartWithClassicDesktopLifetime(args);
|
||||
}
|
||||
|
||||
private static void SilenceConsole()
|
||||
{
|
||||
new Thread(() =>
|
||||
{
|
||||
Console.CursorVisible = false;
|
||||
while (true)
|
||||
Console.ReadKey(true);
|
||||
})
|
||||
{ IsBackground = true }.Start();
|
||||
}
|
||||
```
|
||||
|
||||
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
|
||||
```
|
||||
|
||||
AOT发布需要在csproj文件中添加以下代码
|
||||
|
||||
```xml
|
||||
<PropertyGroup>
|
||||
<PublishAot>true</PublishAot>
|
||||
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
|
||||
</PropertyGroup>
|
||||
```
|
||||
|
||||
```bash
|
||||
dotnet publish demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj -c Release -r linu-x64
|
||||
```
|
||||
|
||||
7. 运行程序
|
||||
|
||||
```bash
|
||||
sudo ./Semi.Avalonia.Demo.Drm --drm
|
||||
```
|
||||
|
||||
## 报错处理
|
||||
|
||||
1. 报错内容
|
||||
|
||||
> Unhandled exception. Avalonia.Markup.Xaml.XamlLoadException: No precompiled XAML found for avares://Semi.Avalonia/Themes/Light/Light.axaml (baseUri: avares://Semi.Avalonia/Themes/Index.axaml), make sure to specify x:Class and include your XAML file as AvaloniaResource
|
||||
|
||||
解决方法:
|
||||
|
||||
如果使用Semi发布文件不要裁剪,如果裁剪会报错。
|
||||
|
||||
24.8.18更新:现在已经修复了这个问题。
|
||||
|
||||
2. 报错内容
|
||||
|
||||
> Unhandled exception. System.TypeInitializationException: The type initializer for 'SkiaSharp.SKImageInfo' threw an exception.**
|
||||
**--->System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies.In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibSkiaSharp: cannot open shared object file: No such file or directory
|
||||
at SkiaSharp.SkiaApi.sk_colortype_get_default_8888()
|
||||
at SkiaSharp.SKImageInfo..cctor()
|
||||
|
||||
解决方法:
|
||||
|
||||
Linux 命令行安装
|
||||
|
||||
```bash
|
||||
sudo apt-get install -y libfontconfig1
|
||||
```
|
||||
|
||||
[参考网址](https://github.com/mono/SkiaSharp/issues/509)
|
||||
|
||||
3. 报错内容
|
||||
|
||||
> Permission denied
|
||||
|
||||
解决方法:
|
||||
|
||||
添加执行权限
|
||||
```bash
|
||||
sudo chmod +x ./Semi.Avalonia.Demo.Drm
|
||||
```
|
||||
|
||||
4. 报错内容
|
||||
|
||||
> Unhandled exception. System.ComponentModel.Win32Exception (95): drmModeGetResources failed
|
||||
at Avalonia.LinuxFramebuffer.Output.DrmResources..ctor(Int32 fd, Boolean connectorsForceProbe) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs:line 91
|
||||
at Avalonia.LinuxFramebuffer.Output.DrmCard.GetResources(Boolean connectorsForceProbe) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs:line 171
|
||||
at Avalonia.LinuxFramebuffer.Output.DrmOutput..ctor(String path, Boolean connectorsForceProbe, DrmOutputOptions options) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs:line 60
|
||||
at LinuxFramebufferPlatformExtensions.StartLinuxDrm(AppBuilder builder, String[] args, String card, Double scaling, IInputBackend inputBackend) in /_/src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs:line 166
|
||||
at Semi.Avalonia.Demo.Drm.Program.Main(String[] args)
|
||||
|
||||
解决方法:
|
||||
|
||||
`program.cs`的显卡路径错误,可能不是`dev/dri/card1`,看在`dev/dri`目录下有无其他的显卡如`card0`。
|
||||
|
||||
24.8.18更新:现在Avalonia会自动检测显卡路径,所以不需要指定显卡路径。
|
||||
|
||||
```csharp
|
||||
return builder.StartLinuxDrm(args: args, card: null, scaling: 1.0);
|
||||
```
|
||||
|
||||
5. 报错内容
|
||||
>Unhandled exception. System.ComponentModel.Win32Exception (2): Couldn't open /dev/dri/card1
|
||||
at Avalonia.LinuxFramebuffer.Output.DrmCard..ctor(String ) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs:line 167
|
||||
at Avalonia.LinuxFramebuffer.Output.DrmOutput..ctor(String , Boolean , DrmOutputOptions ) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs:line 58
|
||||
at LinuxFramebufferPlatformExtensions.StartLinuxDrm(AppBuilder, String[], String , Double , IInputBackend ) in /_/src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs:line 166
|
||||
at Semi.Avalonia.Demo.Drm.Program.Main(String[])
|
||||
|
||||
解决办法:
|
||||
|
||||
找不到显卡路径`dev/dri/card1`,可能是显卡挂载到别的文件夹下了。
|
||||
|
||||
24.8.18更新:现在Avalonia会自动检测显卡路径,所以不需要指定显卡路径。
|
||||
|
||||
```csharp
|
||||
return builder.StartLinuxDrm(args: args, card: null, scaling: 1.0);
|
||||
```
|
3
demo/Semi.Avalonia.Demo.Drm/Roots.xml
Normal file
3
demo/Semi.Avalonia.Demo.Drm/Roots.xml
Normal file
@ -0,0 +1,3 @@
|
||||
<linker>
|
||||
<assembly fullname="Semi.Avalonia.Demo" preserve="All"/>
|
||||
</linker>
|
35
demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj
Normal file
35
demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj
Normal file
@ -0,0 +1,35 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
||||
<!-- Uncomment below to enable Native AOT compilation-->
|
||||
<!--<PublishAot>true</PublishAot>-->
|
||||
<!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>-->
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
|
||||
<IsTrimmable>true</IsTrimmable>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<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)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
18
demo/Semi.Avalonia.Demo.Drm/app.manifest
Normal file
18
demo/Semi.Avalonia.Demo.Drm/app.manifest
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<!-- This manifest is used on Windows only.
|
||||
Don't remove it as it might cause problems with window transparency and embeded controls.
|
||||
For more details visit https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests -->
|
||||
<assemblyIdentity version="1.0.0.0" name="Semi.Avalonia.Demo.Drm.Desktop"/>
|
||||
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<!-- A list of the Windows versions that this application has been tested on
|
||||
and is designed to work with. Uncomment the appropriate elements
|
||||
and Windows will automatically select the most compatible environment. -->
|
||||
|
||||
<!-- Windows 10 -->
|
||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
|
||||
</application>
|
||||
</compatibility>
|
||||
</assembly>
|
@ -1,10 +0,0 @@
|
||||
<Application
|
||||
x:Class="Semi.Avalonia.Demo.Web.App"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Semi.Avalonia.Demo.Web">
|
||||
<Application.Styles>
|
||||
<FluentTheme />
|
||||
<StyleInclude Source="avares://Semi.Avalonia/Themes/LightTheme.axaml" />
|
||||
</Application.Styles>
|
||||
</Application>
|
@ -1,23 +0,0 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls.ApplicationLifetimes;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Semi.Avalonia.Demo.Views;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Web;
|
||||
|
||||
public partial class App : Application
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
|
||||
public override void OnFrameworkInitializationCompleted()
|
||||
{
|
||||
if (ApplicationLifetime is ISingleViewApplicationLifetime singleViewPlatform)
|
||||
{
|
||||
singleViewPlatform.MainView = new MainView();
|
||||
}
|
||||
base.OnFrameworkInitializationCompleted();
|
||||
}
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M30.4661 34.928C30.5364 34.928 30.6052 34.928 30.6754 34.928C32.8596 34.928 34.654 33.2918 34.9053 31.1752L34.9356 16.9955C34.6872 7.56697 26.9662 0 17.4777 0C7.83263 0 0.0137329 7.8189 0.0137329 17.464C0.0137329 27.0059 7.66618 34.7631 17.1687 34.928H30.4661Z" fill="white"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M17.5239 5.948C12.0268 5.948 7.42967 9.80117 6.286 14.954C7.38092 15.2609 8.18385 16.2664 8.18385 17.4593C8.18385 18.6523 7.38092 19.6577 6.286 19.9647C7.42966 25.1175 12.0268 28.9706 17.5239 28.9706C19.525 28.9706 21.4068 28.4601 23.0462 27.562V28.8927H29.0352V17.9365C29.0407 17.7908 29.0352 17.6063 29.0352 17.4593C29.0352 11.1018 23.8814 5.948 17.5239 5.948ZM12.0098 17.4593C12.0098 14.414 14.4786 11.9452 17.5239 11.9452C20.5693 11.9452 23.038 14.414 23.038 17.4593C23.038 20.5047 20.5693 22.9734 17.5239 22.9734C14.4786 22.9734 12.0098 20.5047 12.0098 17.4593Z" fill="#8B44AC"/>
|
||||
<path d="M7.36841 17.4517C7.36841 18.4691 6.54368 19.2938 5.52631 19.2938C4.50894 19.2938 3.6842 18.4691 3.6842 17.4517C3.6842 16.4343 4.50894 15.6096 5.52631 15.6096C6.54368 15.6096 7.36841 16.4343 7.36841 17.4517Z" fill="#8B44AC"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.2 KiB |
@ -1,67 +0,0 @@
|
||||
/* HTML styles for the splash screen */
|
||||
|
||||
.highlight {
|
||||
color: white;
|
||||
font-size: 2.5rem;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.purple {
|
||||
color: #8b44ac;
|
||||
}
|
||||
|
||||
.icon {
|
||||
opacity: 0.05;
|
||||
height: 35%;
|
||||
width: 35%;
|
||||
position: absolute;
|
||||
background-repeat: no-repeat;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
margin-right: 3%;
|
||||
margin-bottom: 5%;
|
||||
z-index: 5000;
|
||||
background-position: right bottom;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
#avalonia-splash a {
|
||||
color: whitesmoke;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.center {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
#avalonia-splash {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
color: whitesmoke;
|
||||
background: #1b2a4e;
|
||||
font-family: 'Nunito', sans-serif;
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.splash-close {
|
||||
animation: fadeout 0.25s linear forwards;
|
||||
}
|
||||
|
||||
@keyframes fadeout {
|
||||
0% {
|
||||
opacity: 100%;
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 0;
|
||||
visibility: collapse;
|
||||
}
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Semi.Avalonia.Demo.Web</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<base href="/" />
|
||||
<link rel="modulepreload" href="./main.js" />
|
||||
<link rel="modulepreload" href="./dotnet.js" />
|
||||
<link rel="modulepreload" href="./avalonia.js" />
|
||||
<link rel="stylesheet" href="./app.css" />
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
</head>
|
||||
|
||||
<body style="margin: 0px; overflow: hidden">
|
||||
<div id="out">
|
||||
<div id="avalonia-splash">
|
||||
<div class="center">
|
||||
<h2 class="purple">
|
||||
Powered by
|
||||
<a class="highlight" href="https://www.avaloniaui.net/" target="_blank">Avalonia UI</a>
|
||||
</h2>
|
||||
</div>
|
||||
<img class="icon" src="Logo.svg" alt="Avalonia Logo" />
|
||||
</div>
|
||||
</div>
|
||||
<script type='module' src="./main.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
Binary file not shown.
16
demo/Semi.Avalonia.Demo.Web/AvaloniaAppBuilderExtensions.cs
Normal file
16
demo/Semi.Avalonia.Demo.Web/AvaloniaAppBuilderExtensions.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Web;
|
||||
|
||||
public static class AvaloniaAppBuilderExtensions
|
||||
{
|
||||
private static string DefaultFontFamily => "avares://Semi.Avalonia.Demo.Web/Assets#Source Han Sans CN";
|
||||
|
||||
public static AppBuilder WithSourceHanSansCNFont(this AppBuilder builder) =>
|
||||
builder.With(new FontManagerOptions
|
||||
{
|
||||
DefaultFamilyName = DefaultFontFamily,
|
||||
FontFallbacks = [new FontFallback { FontFamily = new FontFamily(DefaultFontFamily) }]
|
||||
});
|
||||
}
|
@ -1,17 +1,17 @@
|
||||
using System.Runtime.Versioning;
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia;
|
||||
using Avalonia.Media;
|
||||
using Semi.Avalonia.Demo.Web;
|
||||
using Avalonia.Browser;
|
||||
|
||||
[assembly: SupportedOSPlatform("browser")]
|
||||
|
||||
internal partial class Program
|
||||
namespace Semi.Avalonia.Demo.Web;
|
||||
|
||||
internal sealed partial class Program
|
||||
{
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
BuildAvaloniaApp(); //.SetupBrowserApp("out");
|
||||
}
|
||||
private static Task Main(string[] args) => BuildAvaloniaApp()
|
||||
.WithSourceHanSansCNFont()
|
||||
.StartBrowserAppAsync("out");
|
||||
|
||||
public static AppBuilder BuildAvaloniaApp()
|
||||
=> AppBuilder.Configure<App>();
|
||||
|
1
demo/Semi.Avalonia.Demo.Web/Properties/AssemblyInfo.cs
Normal file
1
demo/Semi.Avalonia.Demo.Web/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1 @@
|
||||
[assembly: System.Runtime.Versioning.SupportedOSPlatform("browser")]
|
@ -6,8 +6,8 @@
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "https://localhost:5001;http://localhost:5000",
|
||||
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/debug?browser={browserInspectUri}"
|
||||
"applicationUrl": "https://localhost:7169;http://localhost:5235",
|
||||
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,29 +1,19 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk.WebAssembly">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
|
||||
<WasmMainJSPath>AppBundle\main.js</WasmMainJSPath>
|
||||
<TargetFramework>net8.0-browser</TargetFramework>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<WasmExtraFilesToDeploy Include="AppBundle\**" />
|
||||
<AvaloniaResource Include="Assets\**"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Assets\SourceHanSansCN-Regular.otf" />
|
||||
<PackageReference Include="Avalonia.Browser" Version="$(AvaloniaVersion)"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<AvaloniaResource Include="Assets\SourceHanSansCN-Regular.otf" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia.Browser" Version="$(AvaloniaVersion)" />
|
||||
<PackageReference Include="Avalonia.Themes.Fluent" Version="$(AvaloniaVersion)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj" />
|
||||
<ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj"/>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
@ -1,11 +1,10 @@
|
||||
{
|
||||
"wasmHostProperties": {
|
||||
"perHostConfig": [
|
||||
{
|
||||
"name": "browser",
|
||||
"html-path": "index.html",
|
||||
"Host": "browser"
|
||||
}
|
||||
]
|
||||
}
|
||||
"wasmHostProperties": {
|
||||
"perHostConfig": [
|
||||
{
|
||||
"name": "browser",
|
||||
"host": "browser"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
58
demo/Semi.Avalonia.Demo.Web/wwwroot/app.css
Normal file
58
demo/Semi.Avalonia.Demo.Web/wwwroot/app.css
Normal file
@ -0,0 +1,58 @@
|
||||
/* HTML styles for the splash screen */
|
||||
.avalonia-splash {
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background: white;
|
||||
font-family: 'Outfit', sans-serif;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
display: flex;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* Light theme styles */
|
||||
@media (prefers-color-scheme: light) {
|
||||
.avalonia-splash {
|
||||
background: white;
|
||||
}
|
||||
|
||||
.avalonia-splash h2 {
|
||||
color: #1b2a4e;
|
||||
}
|
||||
|
||||
.avalonia-splash a {
|
||||
color: #0D6EFD;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.avalonia-splash {
|
||||
background: #1b2a4e;
|
||||
}
|
||||
|
||||
.avalonia-splash h2 {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.avalonia-splash a {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
|
||||
.avalonia-splash h2 {
|
||||
font-weight: 400;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.avalonia-splash a {
|
||||
text-decoration: none;
|
||||
font-size: 2.5rem;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.avalonia-splash.splash-close {
|
||||
transition: opacity 200ms, display 200ms;
|
||||
display: none;
|
||||
opacity: 0;
|
||||
}
|
Before Width: | Height: | Size: 172 KiB After Width: | Height: | Size: 172 KiB |
36
demo/Semi.Avalonia.Demo.Web/wwwroot/index.html
Normal file
36
demo/Semi.Avalonia.Demo.Web/wwwroot/index.html
Normal file
@ -0,0 +1,36 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Semi.Avalonia.Demo.Web</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="./app.css" />
|
||||
</head>
|
||||
|
||||
<body style="margin: 0; overflow: hidden">
|
||||
<div id="out">
|
||||
<div class="avalonia-splash">
|
||||
<h2>
|
||||
Powered by
|
||||
<a href="https://www.avaloniaui.net/" target="_blank">
|
||||
<svg width="266" height="52" viewBox="0 0 266 52" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M55.8592 47.3941C54.9035 47.3941 54.1184 47.1723 53.504 46.7285C52.9237 46.2848 52.5483 45.6875 52.3776 44.9365C52.2411 44.1856 52.3947 43.3493 52.8384 42.4277L65.9456 13.7045C66.4917 12.544 67.1403 11.7077 67.8912 11.1957C68.6421 10.6496 69.5125 10.3765 70.5024 10.3765C71.4923 10.3765 72.3627 10.6496 73.1136 11.1957C73.8645 11.7077 74.496 12.544 75.008 13.7045L88.2176 42.4277C88.6613 43.3493 88.8149 44.2027 88.6784 44.9877C88.576 45.7387 88.2347 46.336 87.6544 46.7797C87.0741 47.1893 86.3232 47.3941 85.4016 47.3941C84.2411 47.3941 83.3365 47.1211 82.688 46.5749C82.0736 46.0288 81.5275 45.1755 81.0496 44.0149L78.9279 39.0997H62.0415L59.9552 44.0149C59.4432 45.2096 58.8971 46.08 58.3168 46.6261C57.7707 47.1381 56.9515 47.3941 55.8592 47.3941ZM70.4 19.2853L64.6844 32.9045H76.2627L70.5024 19.2853H70.4Z" fill="currentColor"/>
|
||||
<path d="M101.869 47.3941C100.879 47.3941 100.009 47.1381 99.258 46.6261C98.5071 46.08 97.9096 45.2779 97.4659 44.2197L89.7348 26.4021C89.3593 25.5147 89.2228 24.6955 89.3252 23.9445C89.4276 23.1595 89.786 22.5451 90.4004 22.1013C91.0489 21.6235 91.9364 21.3845 93.0628 21.3845C93.9844 21.3845 94.7353 21.6064 95.3156 22.0501C95.8959 22.4597 96.4079 23.2619 96.8516 24.4565L102.018 37.95L107.552 24.4053C108.03 23.2448 108.559 22.4597 109.14 22.0501C109.72 21.6064 110.522 21.3845 111.546 21.3845C112.433 21.3845 113.133 21.6235 113.645 22.1013C114.191 22.5451 114.516 23.1424 114.618 23.8933C114.755 24.6443 114.618 25.4635 114.208 26.3509L106.324 44.2197C105.88 45.312 105.283 46.1141 104.532 46.6261C103.815 47.1381 102.927 47.3941 101.869 47.3941Z" fill="currentColor"/>
|
||||
<path d="M126.569 47.4965C124.726 47.4965 123.07 47.1381 121.602 46.4213C120.135 45.7045 118.991 44.7317 118.172 43.5029C117.353 42.2741 116.943 40.8917 116.943 39.3557C116.943 37.5125 117.421 36.0619 118.377 35.0037C119.333 33.9115 120.886 33.1435 123.036 32.6997C125.186 32.2219 128.037 31.9829 131.586 31.9829H133.43V35.9765H131.638C129.897 35.9765 128.48 36.0789 127.388 36.2837C126.33 36.4544 125.562 36.7616 125.084 37.2053C124.64 37.6491 124.418 38.2635 124.418 39.0485C124.418 40.0043 124.743 40.7893 125.391 41.4037C126.074 42.0181 127.047 42.3253 128.31 42.3253C129.299 42.3253 130.17 42.1035 130.921 41.6597C131.706 41.1819 132.32 40.5504 132.764 39.7653C133.208 38.9461 133.43 38.0245 133.43 37.0005V31.1125C133.43 29.6107 133.088 28.5525 132.406 27.9381C131.723 27.2896 130.562 26.9653 128.924 26.9653C128.002 26.9653 126.995 27.0848 125.903 27.3237C124.845 27.5285 123.667 27.8869 122.37 28.3989C121.619 28.7403 120.954 28.8256 120.374 28.6549C119.793 28.4501 119.35 28.1088 119.042 27.6309C118.735 27.1189 118.582 26.5728 118.582 25.9925C118.582 25.3781 118.752 24.7979 119.094 24.2517C119.435 23.6715 119.998 23.2448 120.783 22.9717C122.387 22.3232 123.889 21.8795 125.289 21.6405C126.722 21.4016 128.037 21.2821 129.231 21.2821C131.859 21.2821 134.01 21.6747 135.682 22.4597C137.389 23.2107 138.669 24.3883 139.522 25.9925C140.376 27.5627 140.802 29.5936 140.802 32.0853V43.4517C140.802 44.7147 140.495 45.6875 139.881 46.3701C139.266 47.0528 138.379 47.3941 137.218 47.3941C136.058 47.3941 135.153 47.0528 134.505 46.3701C133.89 45.6875 133.583 44.7147 133.583 43.4517L133.594 43.15C133.594 43.15 133.293 44.032 132.61 44.8853C131.962 45.7045 131.126 46.3531 130.102 46.8309C129.078 47.2747 127.9 47.4965 126.569 47.4965Z" fill="currentColor"/>
|
||||
<path d="M155.632 47.4965C152.594 47.4965 150.324 46.6603 148.822 44.9877C147.321 43.2811 146.57 40.7552 146.57 37.4101V14.3189C146.57 13.0219 146.894 12.0491 147.542 11.4005C148.225 10.7179 149.198 10.3765 150.461 10.3765C151.69 10.3765 152.628 10.7179 153.277 11.4005C153.959 12.0491 154.301 13.0219 154.301 14.3189V37.1029C154.301 38.5024 154.591 39.5435 155.171 40.2261C155.786 40.8747 156.588 41.1989 157.578 41.1989C157.851 41.1989 158.107 41.1819 158.346 41.1477C158.585 41.1136 158.841 41.0965 159.114 41.0965C159.66 41.0283 160.035 41.1989 160.24 41.6085C160.479 41.984 160.598 42.752 160.598 43.9125C160.598 44.9365 160.394 45.7216 159.984 46.2677C159.574 46.7797 158.943 47.1211 158.09 47.2917C157.748 47.3259 157.356 47.36 156.912 47.3941C156.468 47.4624 156.042 47.4965 155.632 47.4965Z" fill="currentColor"/>
|
||||
<path d="M175.453 47.4965C172.756 47.4965 170.401 46.9675 168.387 45.9093C166.407 44.8512 164.871 43.3323 163.779 41.3525C162.687 39.3728 162.141 37.0347 162.141 34.3381C162.141 32.3243 162.448 30.5152 163.062 28.9109C163.677 27.3067 164.564 25.9413 165.725 24.8149C166.919 23.6544 168.336 22.784 169.974 22.2037C171.613 21.5893 173.439 21.2821 175.453 21.2821C178.149 21.2821 180.487 21.8112 182.467 22.8693C184.481 23.9275 186.034 25.4293 187.126 27.3749C188.253 29.3205 188.816 31.6416 188.816 34.3381C188.816 36.3861 188.492 38.2123 187.843 39.8165C187.229 41.4208 186.341 42.8032 185.181 43.9637C184.02 45.1243 182.604 46.0117 180.931 46.6261C179.293 47.2064 177.467 47.4965 175.453 47.4965ZM175.453 41.7109C176.579 41.7109 177.552 41.4379 178.371 40.8917C179.19 40.3456 179.839 39.5435 180.317 38.4853C180.795 37.3931 181.034 36.0107 181.034 34.3381C181.034 31.8464 180.522 30.0203 179.498 28.8597C178.474 27.6651 177.125 27.0677 175.453 27.0677C174.361 27.0677 173.388 27.3237 172.534 27.8357C171.715 28.3477 171.067 29.1499 170.589 30.2421C170.145 31.3003 169.923 32.6656 169.923 34.3381C169.923 36.8299 170.435 38.6901 171.459 39.9189C172.483 41.1136 173.814 41.7109 175.453 41.7109Z" fill="currentColor"/>
|
||||
<path d="M197.411 47.3941C196.148 47.3941 195.175 47.0528 194.492 46.3701C193.844 45.6875 193.52 44.7147 193.52 43.4517V25.2757C193.52 24.0128 193.844 23.0571 194.492 22.4085C195.175 21.7259 196.114 21.3845 197.308 21.3845C198.537 21.3845 199.476 21.7259 200.124 22.4085C200.773 23.0571 201.112 24.1871 201.112 25.45C201.141 25.3955 202.48 23.552 204.016 22.6645C205.586 21.7429 207.361 21.2821 209.34 21.2821C211.354 21.2821 213.01 21.6747 214.307 22.4597C215.604 23.2107 216.577 24.3712 217.225 25.9413C217.874 27.4773 218.198 29.44 218.198 31.8293V43.4517C218.198 44.7147 217.857 45.6875 217.174 46.3701C216.525 47.0528 215.57 47.3941 214.307 47.3941C213.078 47.3941 212.122 47.0528 211.44 46.3701C210.791 45.6875 210.467 44.7147 210.467 43.4517V32.1877C210.467 30.4469 210.143 29.2011 209.494 28.4501C208.88 27.6651 207.924 27.2725 206.627 27.2725C204.988 27.2725 203.674 27.7845 202.684 28.8085C201.729 29.8325 201.251 31.1979 201.251 32.9045V43.4517C201.251 46.08 199.971 47.3941 197.411 47.3941Z" fill="currentColor"/>
|
||||
<path d="M227.861 47.3429C226.598 47.3429 225.625 46.9845 224.942 46.2677C224.294 45.5168 223.97 44.4757 223.97 43.1445V25.6341C223.97 24.2688 224.294 23.2277 224.942 22.5109C225.625 21.76 226.598 21.3845 227.861 21.3845C229.09 21.3845 230.028 21.76 230.677 22.5109C231.359 23.2277 231.701 24.2688 231.701 25.6341V43.1445C231.701 44.4757 231.377 45.5168 230.728 46.2677C230.079 46.9845 229.124 47.3429 227.861 47.3429ZM227.861 17.1861C226.427 17.1861 225.318 16.8619 224.533 16.2133C223.782 15.5307 223.406 14.5749 223.406 13.3461C223.406 12.0832 223.782 11.1275 224.533 10.4789C225.318 9.79629 226.427 9.45496 227.861 9.45496C229.294 9.45496 230.387 9.79629 231.138 10.4789C231.889 11.1275 232.264 12.0832 232.264 13.3461C232.264 14.5749 231.889 15.5307 231.138 16.2133C230.387 16.8619 229.294 17.1861 227.861 17.1861Z" fill="currentColor"/>
|
||||
<path d="M246.169 47.4965C244.326 47.4965 242.67 47.1381 241.202 46.4213C239.735 45.7045 238.591 44.7317 237.772 43.5029C236.953 42.2741 236.543 40.8917 236.543 39.3557C236.543 37.5125 237.021 36.0619 237.977 35.0037C238.933 33.9115 240.486 33.1435 242.636 32.6997C244.786 32.2219 247.637 31.9829 251.186 31.9829H253.03V35.9765H251.238C249.497 35.9765 248.08 36.0789 246.988 36.2837C245.93 36.4544 245.162 36.7616 244.684 37.2053C244.24 37.6491 244.018 38.2635 244.018 39.0485C244.018 40.0043 244.343 40.7893 244.991 41.4037C245.674 42.0181 246.647 42.3253 247.91 42.3253C248.899 42.3253 249.77 42.1035 250.521 41.6597C251.306 41.1819 251.92 40.5504 252.364 39.7653C252.808 38.9461 253.03 38.0245 253.03 37.0005V31.1125C253.03 29.6107 252.688 28.5525 252.006 27.9381C251.323 27.2896 250.162 26.9653 248.524 26.9653C247.602 26.9653 246.595 27.0848 245.503 27.3237C244.445 27.5285 243.267 27.8869 241.97 28.3989C241.219 28.7403 240.554 28.8256 239.974 28.6549C239.393 28.4501 238.95 28.1088 238.642 27.6309C238.335 27.1189 238.182 26.5728 238.182 25.9925C238.182 25.3781 238.352 24.7979 238.694 24.2517C239.035 23.6715 239.598 23.2448 240.383 22.9717C241.987 22.3232 243.489 21.8795 244.889 21.6405C246.322 21.4016 247.637 21.2821 248.831 21.2821C251.459 21.2821 253.61 21.6747 255.282 22.4597C256.989 23.2107 258.269 24.3883 259.122 25.9925C259.976 27.5627 260.402 29.5936 260.402 32.0853V43.4517C260.402 44.7147 260.095 45.6875 259.481 46.3701C258.866 47.0528 257.979 47.3941 256.818 47.3941C255.658 47.3941 254.753 47.0528 254.105 46.3701C253.49 45.6875 253.183 44.7147 253.183 43.4517V43.1789C253.183 43.3144 252.893 44.032 252.21 44.8853C251.562 45.7045 250.726 46.3531 249.702 46.8309C248.678 47.2747 247.5 47.4965 246.169 47.4965Z" fill="currentColor"/>
|
||||
<path d="M22.3444 20.9916C18.7895 20.9916 15.9077 24.0073 15.9077 27.7274C15.9077 31.4475 18.7895 34.4632 22.3444 34.4632C25.8993 34.4632 28.7811 31.4475 28.7811 27.7274C28.7811 24.0073 25.8993 20.9916 22.3444 20.9916Z" fill="currentColor"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M37.6937 49.0667H21.9271C10.8346 48.8653 1.90173 39.3893 1.90173 27.7333C1.90173 15.9513 11.0289 6.40002 22.2878 6.40002C33.3638 6.40002 42.3768 15.6435 42.6667 27.161L42.6314 44.4824C42.338 47.0679 40.2434 49.0667 37.6937 49.0667ZM9.22617 24.667C10.5612 18.3725 15.9275 13.6656 22.3444 13.6656C29.7657 13.6656 35.7818 19.9613 35.7818 27.7274C35.7818 27.7857 35.7825 27.8488 35.7831 27.9136C35.7846 28.0483 35.7861 28.1901 35.7818 28.3103V41.6939H28.7907V40.0685C26.877 41.1655 24.6803 41.7892 22.3444 41.7892C15.9275 41.7892 10.5612 37.0823 9.22617 30.7878C10.5043 30.4129 11.4416 29.1847 11.4416 27.7274C11.4416 26.2701 10.5043 25.0419 9.22617 24.667ZM8.33937 29.9683C9.52696 29.9683 10.4897 28.9609 10.4897 27.7181C10.4897 26.4753 9.52696 25.4678 8.33937 25.4678C7.15178 25.4678 6.18904 26.4753 6.18904 27.7181C6.18904 28.9609 7.15178 29.9683 8.33937 29.9683Z" fill="currentColor"/>
|
||||
</svg>
|
||||
</a>
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
<script type='module' src="./main.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -1,5 +1,4 @@
|
||||
import { dotnet } from './dotnet.js'
|
||||
import { registerAvaloniaModule } from './avalonia.js';
|
||||
import { dotnet } from './_framework/dotnet.js'
|
||||
|
||||
const is_browser = typeof window != "undefined";
|
||||
if (!is_browser) throw new Error(`Expected to be running in a browser`);
|
||||
@ -9,8 +8,6 @@ const dotnetRuntime = await dotnet
|
||||
.withApplicationArgumentsFromQuery()
|
||||
.create();
|
||||
|
||||
await registerAvaloniaModule(dotnetRuntime);
|
||||
|
||||
const config = dotnetRuntime.getConfig();
|
||||
|
||||
await dotnetRuntime.runMainAndExit(config.mainAssemblyName, [window.location.search]);
|
||||
await dotnetRuntime.runMain(config.mainAssemblyName, [globalThis.location.href]);
|
@ -1,10 +1,12 @@
|
||||
<Application
|
||||
x:Class="Semi.Avalonia.Demo.Android.App"
|
||||
x:Class="Semi.Avalonia.Demo.App"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Semi.Avalonia.Demo.Android">
|
||||
xmlns:semi="https://irihi.tech/semi">
|
||||
<Application.Styles>
|
||||
<StyleInclude Source="avares://Semi.Avalonia/Themes/Index.axaml" />
|
||||
<!-- 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" />
|
||||
</Application.Styles>
|
33
demo/Semi.Avalonia.Demo/App.axaml.cs
Normal file
33
demo/Semi.Avalonia.Demo/App.axaml.cs
Normal file
@ -0,0 +1,33 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls.ApplicationLifetimes;
|
||||
using Avalonia.Data.Core.Plugins;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Semi.Avalonia.Demo.Views;
|
||||
|
||||
namespace Semi.Avalonia.Demo;
|
||||
|
||||
public partial class App : Application
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
|
||||
public override void OnFrameworkInitializationCompleted()
|
||||
{
|
||||
switch (ApplicationLifetime)
|
||||
{
|
||||
case IClassicDesktopStyleApplicationLifetime desktop:
|
||||
// Line below is needed to remove Avalonia data validation.
|
||||
// Without this line you will get duplicate validations from both Avalonia and CT
|
||||
BindingPlugins.DataValidators.RemoveAt(0);
|
||||
desktop.MainWindow = new MainWindow();
|
||||
break;
|
||||
case ISingleViewApplicationLifetime singleView:
|
||||
singleView.MainView = new MainView();
|
||||
break;
|
||||
}
|
||||
|
||||
base.OnFrameworkInitializationCompleted();
|
||||
}
|
||||
}
|
BIN
demo/Semi.Avalonia.Demo/Assets/WORLD.png
Normal file
BIN
demo/Semi.Avalonia.Demo/Assets/WORLD.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 MiB |
@ -5,9 +5,8 @@
|
||||
xmlns:viewModels="clr-namespace:Semi.Avalonia.Demo.ViewModels"
|
||||
x:CompileBindings="True"
|
||||
x:DataType="viewModels:ColorItemViewModel">
|
||||
<PathGeometry x:Key="CopyIcon">M5 7C3.89543 7 3 7.89543 3 9V19C3 20.1046 3.89543 21 5 21H15C16.1046 21 17 20.1046 17 19V9C17 7.89543 16.1046 7 15 7H5Z,M7 4C7 2.89543 7.89543 2 9 2H20C21.1046 2 22 2.89543 22 4V15C22 16.1046 21.1046 17 20 17H19V8C19 6 18 5 16 5H7V4Z</PathGeometry>
|
||||
<StreamGeometry x:Key="CopyIcon">M5 7C3.89543 7 3 7.89543 3 9V19C3 20.1046 3.89543 21 5 21H15C16.1046 21 17 20.1046 17 19V9C17 7.89543 16.1046 7 15 7H5Z,M7 4C7 2.89543 7.89543 2 9 2H20C21.1046 2 22 2.89543 22 4V15C22 16.1046 21.1046 17 20 17H19V8C19 6 18 5 16 5H7V4Z</StreamGeometry>
|
||||
<ControlTheme x:Key="{x:Type controls:ColorDetailControl}" TargetType="controls:ColorDetailControl">
|
||||
<!-- Add Resources Here -->
|
||||
<Setter Property="controls:ColorDetailControl.Template">
|
||||
<ControlTemplate TargetType="controls:ColorDetailControl">
|
||||
<StackPanel>
|
||||
|
@ -5,18 +5,16 @@
|
||||
xmlns:viewModels="clr-namespace:Semi.Avalonia.Demo.ViewModels"
|
||||
x:CompileBindings="True"
|
||||
x:DataType="viewModels:FunctionalColorGroupViewModel">
|
||||
<!-- Add Resources Here -->
|
||||
<ControlTheme x:Key="{x:Type controls:FunctionalColorGroupControl}" TargetType="controls:FunctionalColorGroupControl">
|
||||
<!-- Add Resources Here -->
|
||||
<Setter Property="controls:FunctionalColorGroupControl.Template">
|
||||
<ControlTemplate x:DataType="viewModels:FunctionalColorGroupViewModel" TargetType="controls:FunctionalColorGroupControl">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="controls:FunctionalColorGroupControl">
|
||||
<Grid RowDefinitions="Auto, *">
|
||||
<TextBlock
|
||||
<SelectableTextBlock
|
||||
Grid.Row="0"
|
||||
Margin="0,16,0,0"
|
||||
Classes="H3"
|
||||
Text="{TemplateBinding Title}"
|
||||
Theme="{DynamicResource TitleTextBlock}" />
|
||||
Theme="{DynamicResource TitleSelectableTextBlock}" />
|
||||
<TabControl Grid.Row="1">
|
||||
<TabItem Header="Light">
|
||||
<DataGrid IsReadOnly="True" ItemsSource="{TemplateBinding LightColors}">
|
||||
@ -45,7 +43,7 @@
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
x:DataType="viewModels:ColorItemViewModel"
|
||||
Binding="{ReflectionBinding ColorDisplayName}"
|
||||
Binding="{Binding ColorDisplayName}"
|
||||
CanUserSort="False"
|
||||
Header="Name" />
|
||||
<DataGridTemplateColumn Width="100" Header="Hex">
|
||||
@ -99,7 +97,7 @@
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
x:DataType="viewModels:ColorItemViewModel"
|
||||
Binding="{ReflectionBinding ColorDisplayName}"
|
||||
Binding="{Binding ColorDisplayName}"
|
||||
CanUserSort="False"
|
||||
Header="Name" />
|
||||
<DataGridTemplateColumn Width="100" Header="Hex">
|
||||
@ -131,4 +129,4 @@
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary>
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
}
|
88
demo/Semi.Avalonia.Demo/Controls/ShadowGroupControl.axaml
Normal file
88
demo/Semi.Avalonia.Demo/Controls/ShadowGroupControl.axaml
Normal file
@ -0,0 +1,88 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:Semi.Avalonia.Demo.Controls"
|
||||
xmlns:viewModels="clr-namespace:Semi.Avalonia.Demo.ViewModels"
|
||||
x:CompileBindings="True"
|
||||
x:DataType="viewModels:ShadowGroupViewModel">
|
||||
<ControlTheme x:Key="{x:Type controls:ShadowGroupControl}" TargetType="controls:ShadowGroupControl">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="controls:ShadowGroupControl">
|
||||
<Grid RowDefinitions="Auto, *">
|
||||
<SelectableTextBlock
|
||||
Grid.Row="0"
|
||||
Margin="0,16,0,0"
|
||||
Classes="H3"
|
||||
Text="{TemplateBinding Title}"
|
||||
Theme="{DynamicResource TitleSelectableTextBlock}" />
|
||||
<TabControl Grid.Row="1">
|
||||
<TabItem Header="Light">
|
||||
<DataGrid IsReadOnly="True" ItemsSource="{TemplateBinding LightShadows}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn Width="*" Header="ResourceKey">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate DataType="viewModels:ShadowItemViewModel">
|
||||
<SelectableTextBlock
|
||||
Margin="12,0,12,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding ResourceKey}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
x:DataType="viewModels:ShadowItemViewModel"
|
||||
Binding="{Binding ShadowDisplayName}"
|
||||
CanUserSort="False"
|
||||
Header="Name" />
|
||||
<DataGridTemplateColumn Width="300" Header="BoxShadows">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate DataType="viewModels:ShadowItemViewModel">
|
||||
<SelectableTextBlock
|
||||
Margin="12,0,12,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding BoxShadowValue}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</TabItem>
|
||||
<TabItem Header="Dark">
|
||||
<DataGrid IsReadOnly="True" ItemsSource="{TemplateBinding DarkShadows}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn Width="*" Header="ResourceKey">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate DataType="viewModels:ShadowItemViewModel">
|
||||
<SelectableTextBlock
|
||||
Margin="12,0,12,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding ResourceKey}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
x:DataType="viewModels:ShadowItemViewModel"
|
||||
Binding="{Binding ShadowDisplayName}"
|
||||
CanUserSort="False"
|
||||
Header="Name" />
|
||||
<DataGridTemplateColumn Width="300" Header="BoxShadows">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate DataType="viewModels:ShadowItemViewModel">
|
||||
<SelectableTextBlock
|
||||
Margin="12,0,12,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding BoxShadowValue}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
41
demo/Semi.Avalonia.Demo/Controls/ShadowGroupControl.cs
Normal file
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);
|
||||
}
|
||||
}
|
@ -17,58 +17,72 @@
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="AutoCompleteBox">
|
||||
<Setter Property="Width" Value="300" />
|
||||
<Setter Property="ItemsSource">
|
||||
<Binding Path="States" />
|
||||
</Setter>
|
||||
<Setter Property="ItemTemplate">
|
||||
<DataTemplate DataType="local:StateData">
|
||||
<TextBlock Text="{Binding Name}" />
|
||||
</DataTemplate>
|
||||
</Setter>
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
|
||||
<AutoCompleteBox
|
||||
ItemsSource="{Binding States}"
|
||||
ValueMemberBinding="{Binding Name}"
|
||||
Watermark="Please select a State">
|
||||
<AutoCompleteBox.ItemTemplate>
|
||||
<DataTemplate DataType="local:StateData">
|
||||
<TextBlock Text="{Binding Name}" />
|
||||
</DataTemplate>
|
||||
</AutoCompleteBox.ItemTemplate>
|
||||
</AutoCompleteBox>
|
||||
Watermark="Please select a State"
|
||||
ValueMemberBinding="{Binding Name}" />
|
||||
<AutoCompleteBox
|
||||
Classes="Large"
|
||||
ItemsSource="{Binding States}"
|
||||
ValueMemberBinding="{ReflectionBinding Name}">
|
||||
<AutoCompleteBox.ItemTemplate>
|
||||
<DataTemplate DataType="local:StateData">
|
||||
<TextBlock Text="{Binding Name}" />
|
||||
</DataTemplate>
|
||||
</AutoCompleteBox.ItemTemplate>
|
||||
</AutoCompleteBox>
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
<AutoCompleteBox
|
||||
Classes="Small"
|
||||
ItemsSource="{Binding States}"
|
||||
ValueMemberBinding="{ReflectionBinding Name}">
|
||||
<AutoCompleteBox.ItemTemplate>
|
||||
<DataTemplate DataType="local:StateData">
|
||||
<TextBlock Text="{Binding Name}" />
|
||||
</DataTemplate>
|
||||
</AutoCompleteBox.ItemTemplate>
|
||||
</AutoCompleteBox>
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
<AutoCompleteBox
|
||||
Classes="Bordered"
|
||||
ItemsSource="{Binding States}"
|
||||
ValueMemberBinding="{ReflectionBinding Name}">
|
||||
<AutoCompleteBox.ItemTemplate>
|
||||
<DataTemplate DataType="local:StateData">
|
||||
<TextBlock Text="{Binding Name}" />
|
||||
</DataTemplate>
|
||||
</AutoCompleteBox.ItemTemplate>
|
||||
</AutoCompleteBox>
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
<AutoCompleteBox
|
||||
IsEnabled="False"
|
||||
ItemsSource="{Binding States}"
|
||||
ValueMemberBinding="{ReflectionBinding Name}"
|
||||
Watermark="Disabled">
|
||||
<AutoCompleteBox.ItemTemplate>
|
||||
<DataTemplate DataType="local:StateData">
|
||||
<TextBlock Text="{Binding Name}" />
|
||||
</DataTemplate>
|
||||
</AutoCompleteBox.ItemTemplate>
|
||||
</AutoCompleteBox>
|
||||
Watermark="Disabled"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
<AutoCompleteBox
|
||||
InnerLeftContent="https://"
|
||||
InnerRightContent=".com"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<AutoCompleteBox
|
||||
Width="100"
|
||||
Classes="Large"
|
||||
Watermark="Large"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
<AutoCompleteBox
|
||||
Width="100"
|
||||
Watermark="Default"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
<AutoCompleteBox
|
||||
Width="100"
|
||||
Classes="Small"
|
||||
Watermark="Small"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<AutoCompleteBox
|
||||
Width="100"
|
||||
IsEnabled="False"
|
||||
Watermark="Disabled"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
<AutoCompleteBox
|
||||
Width="100"
|
||||
Classes="Bordered"
|
||||
Watermark="Bordered"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
<AutoCompleteBox
|
||||
Width="100"
|
||||
Classes="Bordered"
|
||||
IsEnabled="False"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
</StackPanel>
|
||||
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
@ -4,114 +4,176 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
||||
<TextBlock>Light (Default)</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<Button Classes="Primary">Primary</Button>
|
||||
<Button Classes="Secondary">Secondary</Button>
|
||||
<Button Classes="Tertiary">Tertiary</Button>
|
||||
<Button Classes="Success">Success</Button>
|
||||
<Button Classes="Warning">Warning</Button>
|
||||
<Button Classes="Danger">Danger</Button>
|
||||
<Button Classes="Primary" IsEnabled="False">Danger</Button>
|
||||
<ScrollViewer>
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="SplitButton">
|
||||
<Setter Property="Flyout">
|
||||
<MenuFlyout Placement="BottomEdgeAlignedRight">
|
||||
<MenuItem Header="Submit All" />
|
||||
<MenuItem Header="Submit Updated" />
|
||||
</MenuFlyout>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style Selector="DropDownButton">
|
||||
<Setter Property="Flyout">
|
||||
<MenuFlyout Placement="BottomEdgeAlignedRight">
|
||||
<MenuItem Header="Submit All" />
|
||||
<MenuItem Header="Submit Updated" />
|
||||
</MenuFlyout>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style Selector="ToggleSplitButton">
|
||||
<Setter Property="Flyout">
|
||||
<MenuFlyout Placement="BottomEdgeAlignedRight">
|
||||
<MenuItem Header="Submit All" />
|
||||
<MenuItem Header="Submit Updated" />
|
||||
</MenuFlyout>
|
||||
</Setter>
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
|
||||
<TextBlock>Light (Default)</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<Button Classes="Primary">Primary</Button>
|
||||
<Button Classes="Secondary">Secondary</Button>
|
||||
<Button Classes="Tertiary">Tertiary</Button>
|
||||
<Button Classes="Success">Success</Button>
|
||||
<Button Classes="Warning">Warning</Button>
|
||||
<Button Classes="Danger">Danger</Button>
|
||||
<Button Classes="Danger" IsEnabled="False">Disabled</Button>
|
||||
</StackPanel>
|
||||
<TextBlock>Solid</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<Button Classes="Primary" Theme="{DynamicResource SolidButton}">Primary</Button>
|
||||
<Button Classes="Secondary" Theme="{DynamicResource SolidButton}">Secondary</Button>
|
||||
<Button Classes="Tertiary" Theme="{DynamicResource SolidButton}">Tertiary</Button>
|
||||
<Button Classes="Success" Theme="{DynamicResource SolidButton}">Success</Button>
|
||||
<Button Classes="Warning" Theme="{DynamicResource SolidButton}">Warning</Button>
|
||||
<Button Classes="Danger" Theme="{DynamicResource SolidButton}">Danger</Button>
|
||||
<Button
|
||||
Classes="Danger"
|
||||
IsEnabled="False"
|
||||
Theme="{DynamicResource SolidButton}">
|
||||
Disabled
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<TextBlock>Outline</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<Button Classes="Primary" Theme="{DynamicResource OutlineButton}">Primary</Button>
|
||||
<Button Classes="Secondary" Theme="{DynamicResource OutlineButton}">Secondary</Button>
|
||||
<Button Classes="Tertiary" Theme="{DynamicResource OutlineButton}">Tertiary</Button>
|
||||
<Button Classes="Success" Theme="{DynamicResource OutlineButton}">Success</Button>
|
||||
<Button Classes="Warning" Theme="{DynamicResource OutlineButton}">Warning</Button>
|
||||
<Button Classes="Danger" Theme="{DynamicResource OutlineButton}">Danger</Button>
|
||||
<Button Classes="Danger" Theme="{DynamicResource OutlineButton}" IsEnabled="False">Disabled</Button>
|
||||
</StackPanel>
|
||||
<TextBlock>Borderless</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<Button Classes="Primary" Theme="{DynamicResource BorderlessButton}">Primary</Button>
|
||||
<Button Classes="Secondary" Theme="{DynamicResource BorderlessButton}">Secondary</Button>
|
||||
<Button Classes="Tertiary" Theme="{DynamicResource BorderlessButton}">Tertiary</Button>
|
||||
<Button Classes="Success" Theme="{DynamicResource BorderlessButton}">Success</Button>
|
||||
<Button Classes="Warning" Theme="{DynamicResource BorderlessButton}">Warning</Button>
|
||||
<Button Classes="Danger" Theme="{DynamicResource BorderlessButton}">Danger</Button>
|
||||
<Button
|
||||
Classes="Danger"
|
||||
IsEnabled="False"
|
||||
Theme="{DynamicResource BorderlessButton}">
|
||||
Disabled
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<TextBlock>Disabled</TextBlock>
|
||||
<StackPanel Background="{DynamicResource SemiColorBackground1}" Orientation="Horizontal" Spacing="20">
|
||||
<Button IsEnabled="False">Light</Button>
|
||||
<Button IsEnabled="False" Theme="{DynamicResource SolidButton}">Solid</Button>
|
||||
<Button IsEnabled="False" Theme="{DynamicResource OutlineButton}">Outline</Button>
|
||||
<Button IsEnabled="False" Theme="{DynamicResource BorderlessButton}">Borderless</Button>
|
||||
</StackPanel>
|
||||
<TextBlock>Size Classes</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<Button Classes="Primary Small">Small</Button>
|
||||
<Button Classes="Primary">Default</Button>
|
||||
<Button Classes="Primary Large">Large</Button>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock>DropDownButton</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<DropDownButton Content="Primary" />
|
||||
<DropDownButton Classes="Secondary" Content="Secondary" />
|
||||
<DropDownButton Classes="Tertiary" Content="Tertiary" />
|
||||
<DropDownButton Classes="Success" Content="Success" />
|
||||
<DropDownButton Classes="Warning" Content="Warning" />
|
||||
<DropDownButton Classes="Danger" Content="Danger" />
|
||||
<DropDownButton
|
||||
Classes="Danger"
|
||||
Content="Disabled"
|
||||
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"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<DropDownButton Classes="Small" Content="Small" />
|
||||
<DropDownButton Content="Default" />
|
||||
<DropDownButton Classes="Large" Content="Large" />
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock>SplitButton</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<SplitButton Content="Primary" />
|
||||
<SplitButton Classes="Secondary" Content="Secondary" />
|
||||
<SplitButton Classes="Tertiary" Content="Tertiary" />
|
||||
<SplitButton Classes="Success" Content="Success" />
|
||||
<SplitButton Classes="Warning" Content="Warning" />
|
||||
<SplitButton Classes="Danger" Content="Danger" />
|
||||
<SplitButton Classes="Danger" Content="Disabled" IsEnabled="False" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<SplitButton Content="Default" Classes="Success" />
|
||||
<SplitButton Content="Solid" Theme="{DynamicResource SolidSplitButton}" Classes="Success" />
|
||||
<SplitButton Content="Outline" Theme="{DynamicResource OutlineSplitButton}" Classes="Success" />
|
||||
<SplitButton Content="Borderless" Theme="{DynamicResource BorderlessSplitButton}" Classes="Success" />
|
||||
<SplitButton Content="Default" Classes="Success" IsEnabled="False" />
|
||||
<SplitButton Content="Solid" Theme="{DynamicResource SolidSplitButton}" Classes="Success" IsEnabled="False" />
|
||||
<SplitButton Content="Outline" Theme="{DynamicResource OutlineSplitButton}" Classes="Success" IsEnabled="False" />
|
||||
<SplitButton Content="Borderless" Theme="{DynamicResource BorderlessSplitButton}" Classes="Success" IsEnabled="False" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<SplitButton Classes="Small" Content="Small" />
|
||||
<SplitButton Content="Default" />
|
||||
<SplitButton Classes="Large" Content="Large" />
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock>ToggleSplitButton</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<ToggleSplitButton Content="Primary" />
|
||||
<ToggleSplitButton Classes="Secondary" Content="Secondary" />
|
||||
<ToggleSplitButton Classes="Tertiary" Content="Tertiary" />
|
||||
<ToggleSplitButton Classes="Success" Content="Success" />
|
||||
<ToggleSplitButton Classes="Warning" Content="Warning" />
|
||||
<ToggleSplitButton Classes="Danger" Content="Danger" />
|
||||
<ToggleSplitButton Classes="Danger" Content="Disabled" IsEnabled="False" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<ToggleSplitButton Content="Default" Classes="Success" />
|
||||
<ToggleSplitButton Content="Checked" Classes="Success" IsChecked="True" />
|
||||
<ToggleSplitButton Content="Default" Classes="Success" IsEnabled="False" />
|
||||
<ToggleSplitButton Content="Checked" Classes="Success" IsChecked="True" IsEnabled="False" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<ToggleSplitButton Classes="Small" Content="Small" />
|
||||
<ToggleSplitButton Content="Default" />
|
||||
<ToggleSplitButton Classes="Large" Content="Large" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<TextBlock>Solid</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<Button Classes="Primary" Theme="{DynamicResource SolidButton}">Primary</Button>
|
||||
<Button Classes="Secondary" Theme="{DynamicResource SolidButton}">Secondary</Button>
|
||||
<Button Classes="Tertiary" Theme="{DynamicResource SolidButton}">Tertiary</Button>
|
||||
<Button Classes="Success" Theme="{DynamicResource SolidButton}">Success</Button>
|
||||
<Button Classes="Warning" Theme="{DynamicResource SolidButton}">Warning</Button>
|
||||
<Button Classes="Danger" Theme="{DynamicResource SolidButton}">Danger</Button>
|
||||
<Button
|
||||
Classes="Primary"
|
||||
IsEnabled="False"
|
||||
Theme="{DynamicResource SolidButton}">
|
||||
Danger
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<TextBlock>Borderless</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<Button Classes="Primary" Theme="{DynamicResource BorderlessButton}">Primary</Button>
|
||||
<Button Classes="Secondary" Theme="{DynamicResource BorderlessButton}">Secondary</Button>
|
||||
<Button Classes="Tertiary" Theme="{DynamicResource BorderlessButton}">Tertiary</Button>
|
||||
<Button Classes="Success" Theme="{DynamicResource BorderlessButton}">Success</Button>
|
||||
<Button Classes="Warning" Theme="{DynamicResource BorderlessButton}">Warning</Button>
|
||||
<Button Classes="Danger" Theme="{DynamicResource BorderlessButton}">Danger</Button>
|
||||
<Button
|
||||
Classes="Primary"
|
||||
IsEnabled="False"
|
||||
Theme="{DynamicResource BorderlessButton}">
|
||||
Danger
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<TextBlock>DropDownButton</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<DropDownButton Content="Submit">
|
||||
<DropDownButton.Flyout>
|
||||
<MenuFlyout Placement="BottomEdgeAlignedRight">
|
||||
<MenuItem Header="Submit All" />
|
||||
<MenuItem Header="Submit Updated" />
|
||||
</MenuFlyout>
|
||||
</DropDownButton.Flyout>
|
||||
</DropDownButton>
|
||||
<DropDownButton Content="Submit" Theme="{DynamicResource SolidDropDownButton}">
|
||||
<DropDownButton.Flyout>
|
||||
<MenuFlyout Placement="BottomEdgeAlignedRight">
|
||||
<MenuItem Header="Submit All" />
|
||||
<MenuItem Header="Submit Updated" />
|
||||
</MenuFlyout>
|
||||
</DropDownButton.Flyout>
|
||||
</DropDownButton>
|
||||
<DropDownButton Content="Submit" Theme="{DynamicResource BorderlessDropDownButton}">
|
||||
<DropDownButton.Flyout>
|
||||
<MenuFlyout Placement="BottomEdgeAlignedRight">
|
||||
<MenuItem Header="Submit All" />
|
||||
<MenuItem Header="Submit Updated" />
|
||||
</MenuFlyout>
|
||||
</DropDownButton.Flyout>
|
||||
</DropDownButton>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<SplitButton Content="Submit">
|
||||
<SplitButton.Flyout>
|
||||
<MenuFlyout Placement="BottomEdgeAlignedRight">
|
||||
<MenuItem Header="Submit All" />
|
||||
<MenuItem Header="Submit Updated" />
|
||||
</MenuFlyout>
|
||||
</SplitButton.Flyout>
|
||||
</SplitButton>
|
||||
<SplitButton Classes="Secondary" Content="Submit" />
|
||||
<SplitButton Classes="Tertiary" Content="Submit" />
|
||||
<SplitButton Classes="Success" Content="Submit" />
|
||||
<SplitButton Classes="Warning" Content="Submit" />
|
||||
<SplitButton Classes="Danger" Content="Submit" />
|
||||
<SplitButton
|
||||
Classes="Danger"
|
||||
Content="Submit"
|
||||
IsEnabled="False" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<ToggleSplitButton Content="Submit">
|
||||
<ToggleSplitButton.Flyout>
|
||||
<MenuFlyout Placement="BottomEdgeAlignedRight">
|
||||
<MenuItem Header="Submit All" />
|
||||
<MenuItem Header="Submit Updated" />
|
||||
</MenuFlyout>
|
||||
</ToggleSplitButton.Flyout>
|
||||
</ToggleSplitButton>
|
||||
<ToggleSplitButton Classes="Secondary" Content="Submit" />
|
||||
<ToggleSplitButton Classes="Tertiary" Content="Submit" />
|
||||
<ToggleSplitButton Classes="Success" Content="Submit" />
|
||||
<ToggleSplitButton Classes="Warning" Content="Submit" />
|
||||
<ToggleSplitButton Classes="Danger" Content="Submit" />
|
||||
<ToggleSplitButton
|
||||
Classes="Danger"
|
||||
Content="Submit"
|
||||
IsEnabled="False" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
@ -17,8 +17,7 @@
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Background="Gray"
|
||||
Text="Everest" />
|
||||
Text="A.S.I.A" />
|
||||
</ButtonSpinner>
|
||||
<ButtonSpinner
|
||||
Height="30"
|
||||
@ -30,8 +29,7 @@
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Background="Gray"
|
||||
Text="Everest" />
|
||||
Text="A.S.I.A" />
|
||||
</ButtonSpinner>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
@ -36,15 +36,20 @@ public partial class ButtonSpinnerDemo : UserControl
|
||||
|
||||
private readonly string[] _mountains = new[]
|
||||
{
|
||||
"Everest",
|
||||
"K2 (Mount Godwin Austen)",
|
||||
"Kangchenjunga",
|
||||
"Lhotse",
|
||||
"Makalu",
|
||||
"Cho Oyu",
|
||||
"Dhaulagiri",
|
||||
"Manaslu",
|
||||
"Nanga Parbat",
|
||||
"Annapurna"
|
||||
"A.S.I.A",
|
||||
"饕餮人间",
|
||||
"七步咙咚呛",
|
||||
"大惊小怪",
|
||||
"The ONE",
|
||||
"以梦为马 (壮志骄阳版)",
|
||||
"emo了",
|
||||
"一眼万年",
|
||||
"冲刺吧",
|
||||
"爱的赏味期限",
|
||||
"COSMIC ANTHEM / 手紙",
|
||||
"世界晚安",
|
||||
"明年也要好好长大",
|
||||
"320万年前",
|
||||
"W.O.R.L.D.",
|
||||
};
|
||||
}
|
@ -8,10 +8,22 @@
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
||||
<CalendarDatePicker />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<CalendarDatePicker Classes="Large" />
|
||||
<CalendarDatePicker />
|
||||
<CalendarDatePicker Classes="Small" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<CalendarDatePicker IsEnabled="False" />
|
||||
<CalendarDatePicker Classes="Bordered" />
|
||||
<CalendarDatePicker Classes="Bordered" IsEnabled="False" />
|
||||
</StackPanel>
|
||||
|
||||
<CalendarDatePicker Width="500" />
|
||||
<CalendarDatePicker Classes="Large" />
|
||||
<CalendarDatePicker Classes="Small" />
|
||||
|
||||
<CalendarDatePicker Classes="ClearButton" Width="200" />
|
||||
|
||||
<CalendarDatePicker
|
||||
Name="DatePicker2"
|
||||
Margin="0,0,0,8"
|
||||
@ -22,9 +34,5 @@
|
||||
CustomDateFormatString="ddd, MMM d"
|
||||
SelectedDateFormat="Custom" />
|
||||
<CalendarDatePicker Margin="0,0,0,8" Watermark="Watermark" />
|
||||
|
||||
<CalendarDatePicker IsEnabled="False" />
|
||||
<CalendarDatePicker Classes="Bordered" />
|
||||
<CalendarDatePicker Classes="Bordered" IsEnabled="False" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
@ -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,22 +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>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
@ -26,126 +26,100 @@
|
||||
</CheckBox>
|
||||
</StackPanel>
|
||||
<CheckBox Width="120" HorizontalAlignment="Left">Checkbox should wrap its text</CheckBox>
|
||||
<TextBlock Margin="0,16" Text="CardCheckBox" />
|
||||
<TextBlock Text="SimpleCheckBox" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<CheckBox Width="300" Theme="{DynamicResource CardCheckBox}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">复选框标题</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统</TextBlock>
|
||||
</StackPanel>
|
||||
</CheckBox>
|
||||
<CheckBox Theme="{StaticResource SimpleCheckBox}" />
|
||||
<CheckBox IsChecked="True" Theme="{StaticResource SimpleCheckBox}" />
|
||||
<CheckBox
|
||||
Width="300"
|
||||
IsChecked="True"
|
||||
Theme="{DynamicResource CardCheckBox}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">复选框标题</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统</TextBlock>
|
||||
</StackPanel>
|
||||
</CheckBox>
|
||||
<CheckBox
|
||||
Width="300"
|
||||
IsChecked="{x:Null}"
|
||||
IsThreeState="True"
|
||||
Theme="{DynamicResource CardCheckBox}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">复选框标题</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统</TextBlock>
|
||||
</StackPanel>
|
||||
</CheckBox>
|
||||
Theme="{StaticResource SimpleCheckBox}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<CheckBox IsEnabled="False" Theme="{StaticResource SimpleCheckBox}" />
|
||||
<CheckBox
|
||||
Width="300"
|
||||
IsEnabled="False"
|
||||
Theme="{DynamicResource CardCheckBox}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">复选框标题</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统</TextBlock>
|
||||
</StackPanel>
|
||||
</CheckBox>
|
||||
<CheckBox
|
||||
Width="300"
|
||||
IsChecked="True"
|
||||
IsEnabled="False"
|
||||
Theme="{DynamicResource CardCheckBox}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">复选框标题</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统</TextBlock>
|
||||
</StackPanel>
|
||||
</CheckBox>
|
||||
Theme="{StaticResource SimpleCheckBox}" />
|
||||
<CheckBox
|
||||
Width="300"
|
||||
IsChecked="{x:Null}"
|
||||
IsEnabled="False"
|
||||
IsThreeState="True"
|
||||
Theme="{DynamicResource CardCheckBox}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">复选框标题</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统</TextBlock>
|
||||
</StackPanel>
|
||||
</CheckBox>
|
||||
Theme="{StaticResource SimpleCheckBox}" />
|
||||
</StackPanel>
|
||||
<TextBlock Margin="0,16" Text="PureCardCheckBox" />
|
||||
<TextBlock Text="CardCheckBox" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<CheckBox Width="300" Theme="{DynamicResource PureCardCheckBox}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">复选框标题</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统</TextBlock>
|
||||
</StackPanel>
|
||||
</CheckBox>
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="CheckBox">
|
||||
<Setter Property="Width" Value="150" />
|
||||
<Setter Property="Margin" Value="8" />
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<CheckBox
|
||||
Width="300"
|
||||
Content="Windows"
|
||||
IsChecked="True"
|
||||
Theme="{DynamicResource PureCardCheckBox}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">复选框标题</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统</TextBlock>
|
||||
</StackPanel>
|
||||
</CheckBox>
|
||||
Theme="{DynamicResource CardCheckBox}" />
|
||||
<CheckBox
|
||||
Width="300"
|
||||
Content="macOS"
|
||||
IsChecked="True"
|
||||
IsEnabled="False"
|
||||
Theme="{DynamicResource CardCheckBox}" />
|
||||
<CheckBox
|
||||
Content="Linux"
|
||||
IsChecked="True"
|
||||
Theme="{DynamicResource CardCheckBox}" />
|
||||
<CheckBox
|
||||
Content="iOS"
|
||||
IsChecked="{x:Null}"
|
||||
IsEnabled="True"
|
||||
IsThreeState="True"
|
||||
Theme="{DynamicResource PureCardCheckBox}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">复选框标题</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统</TextBlock>
|
||||
</StackPanel>
|
||||
</CheckBox>
|
||||
Theme="{DynamicResource CardCheckBox}" />
|
||||
<CheckBox
|
||||
Content="Android"
|
||||
IsChecked="{x:Null}"
|
||||
IsThreeState="True"
|
||||
Theme="{DynamicResource CardCheckBox}" />
|
||||
<CheckBox
|
||||
Content="Wasm"
|
||||
IsChecked="False"
|
||||
IsThreeState="True"
|
||||
Theme="{DynamicResource CardCheckBox}" />
|
||||
</StackPanel>
|
||||
<TextBlock Text="PureCardCheckBox" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="CheckBox">
|
||||
<Setter Property="Width" Value="150" />
|
||||
<Setter Property="Margin" Value="8" />
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<CheckBox
|
||||
Width="300"
|
||||
IsEnabled="False"
|
||||
Theme="{DynamicResource PureCardCheckBox}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">复选框标题</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统</TextBlock>
|
||||
</StackPanel>
|
||||
</CheckBox>
|
||||
Content="Windows"
|
||||
IsChecked="True"
|
||||
Theme="{DynamicResource PureCardCheckBox}" />
|
||||
<CheckBox
|
||||
Width="300"
|
||||
Content="macOS"
|
||||
IsChecked="True"
|
||||
IsEnabled="False"
|
||||
Theme="{DynamicResource PureCardCheckBox}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">复选框标题</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统</TextBlock>
|
||||
</StackPanel>
|
||||
</CheckBox>
|
||||
Theme="{DynamicResource PureCardCheckBox}" />
|
||||
<CheckBox
|
||||
Width="300"
|
||||
Content="Linux"
|
||||
IsChecked="True"
|
||||
Theme="{DynamicResource PureCardCheckBox}" />
|
||||
<CheckBox
|
||||
Content="iOS"
|
||||
IsChecked="{x:Null}"
|
||||
IsEnabled="False"
|
||||
IsThreeState="True"
|
||||
Theme="{DynamicResource PureCardCheckBox}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">复选框标题</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统</TextBlock>
|
||||
</StackPanel>
|
||||
</CheckBox>
|
||||
Theme="{DynamicResource PureCardCheckBox}" />
|
||||
<CheckBox
|
||||
Content="Android"
|
||||
IsChecked="{x:Null}"
|
||||
IsThreeState="True"
|
||||
Theme="{DynamicResource PureCardCheckBox}" />
|
||||
<CheckBox
|
||||
Content="Wasm"
|
||||
IsChecked="False"
|
||||
IsThreeState="True"
|
||||
Theme="{DynamicResource PureCardCheckBox}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
@ -6,29 +6,88 @@
|
||||
xmlns:controls="using:Avalonia.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="450"
|
||||
d:DesignHeight="1450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel Spacing="20">
|
||||
<StackPanel
|
||||
VerticalAlignment="Top"
|
||||
Orientation="Horizontal"
|
||||
Spacing="20">
|
||||
<ColorView ColorSpectrumShape="Ring" />
|
||||
<ColorView ColorSpectrumShape="Box" />
|
||||
<ColorView Palette="{DynamicResource SemiColorPalette}" />
|
||||
<ScrollViewer>
|
||||
<StackPanel Spacing="20">
|
||||
<StackPanel
|
||||
VerticalAlignment="Top"
|
||||
Orientation="Horizontal"
|
||||
Spacing="20">
|
||||
<ColorView Name="Test" ColorSpectrumShape="Ring" />
|
||||
<ColorView ColorSpectrumShape="Box" />
|
||||
<ColorView Palette="{DynamicResource SemiColorPalette}" />
|
||||
</StackPanel>
|
||||
<StackPanel VerticalAlignment="Top" Orientation="Horizontal">
|
||||
<ColorView
|
||||
Name="SimpleColorViewTest"
|
||||
HsvColor="hsv(120,11%,10%)"
|
||||
IsAlphaVisible="True"
|
||||
Theme="{StaticResource SimpleColorView}" />
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding #SimpleColorViewTest.HsvColor}" />
|
||||
<TextBlock Text="{Binding #SimpleColorViewTest.Color}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
||||
<ColorPicker Margin="8" ColorSpectrumShape="Ring">
|
||||
<ColorPicker.Palette>
|
||||
<controls:FlatHalfColorPalette />
|
||||
</ColorPicker.Palette>
|
||||
</ColorPicker>
|
||||
<ColorPicker Margin="8" ColorSpectrumShape="Box">
|
||||
<ColorPicker.Palette>
|
||||
<colorPicker:SemiColorLightPalette />
|
||||
</ColorPicker.Palette>
|
||||
</ColorPicker>
|
||||
|
||||
<ColorPicker
|
||||
Margin="8"
|
||||
ColorSpectrumShape="Box"
|
||||
Theme="{DynamicResource HexColorPicker}">
|
||||
<ColorPicker.Palette>
|
||||
<colorPicker:SemiColorLightPalette />
|
||||
</ColorPicker.Palette>
|
||||
</ColorPicker>
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Left" >
|
||||
<TextBlock Text="Use Style to customize button"></TextBlock>
|
||||
<ColorPicker
|
||||
Margin="8"
|
||||
Width="32"
|
||||
HsvColor="hsv(120,11%,10%)"
|
||||
>
|
||||
<ColorPicker.Content>
|
||||
<Border
|
||||
Margin="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Background="{Binding $parent[ColorPicker].HsvColor,
|
||||
Converter={StaticResource ToBrushConverter}}"
|
||||
CornerRadius="1" />
|
||||
</ColorPicker.Content>
|
||||
<ColorPicker.Styles>
|
||||
<Style Selector="DropDownButton">
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Style Selector="^ /template/ PathIcon">
|
||||
<Setter Property="IsVisible" Value="False"/>
|
||||
</Style>
|
||||
</Style>
|
||||
</ColorPicker.Styles>
|
||||
</ColorPicker>
|
||||
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
||||
<ColorPicker
|
||||
Margin="8"
|
||||
HsvColor="hsv(120,11%,10%)"
|
||||
Theme="{StaticResource SimpleColorPicker}" />
|
||||
<ColorPicker
|
||||
Margin="8"
|
||||
HsvColor="hsv(120,11%,10%)"
|
||||
Theme="{StaticResource HexSimpleColorPicker}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
||||
<ColorPicker ColorSpectrumShape="Ring">
|
||||
<ColorPicker.Palette>
|
||||
<controls:FlatHalfColorPalette />
|
||||
</ColorPicker.Palette>
|
||||
</ColorPicker>
|
||||
<ColorPicker ColorSpectrumShape="Box">
|
||||
<ColorPicker.Palette>
|
||||
<colorPicker:SemiColorLightPalette />
|
||||
</ColorPicker.Palette>
|
||||
</ColorPicker>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
@ -4,50 +4,49 @@
|
||||
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"
|
||||
xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
|
||||
d:DesignHeight="800"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<Design.DataContext>
|
||||
<pages:ComboBoxDemoViewModel />
|
||||
</Design.DataContext>
|
||||
<StackPanel Spacing="20">
|
||||
<ComboBox Width="150">
|
||||
<ComboBoxItem>AAA</ComboBoxItem>
|
||||
<ComboBoxItem>BBB</ComboBoxItem>
|
||||
<ComboBoxItem>CCC</ComboBoxItem>
|
||||
</ComboBox>
|
||||
<ComboBox Width="150" PlaceholderText="Please Select">
|
||||
<ComboBoxItem>AAA</ComboBoxItem>
|
||||
<ComboBoxItem>BBB</ComboBoxItem>
|
||||
<ComboBoxItem>CCC</ComboBoxItem>
|
||||
</ComboBox>
|
||||
<ComboBox Width="150" IsEnabled="False">
|
||||
<ComboBoxItem>AAA</ComboBoxItem>
|
||||
<ComboBoxItem>BBB</ComboBoxItem>
|
||||
<ComboBoxItem>CCC</ComboBoxItem>
|
||||
</ComboBox>
|
||||
<ComboBox
|
||||
Width="150"
|
||||
Classes="Large"
|
||||
IsEnabled="False">
|
||||
<ComboBoxItem>AAA</ComboBoxItem>
|
||||
<ComboBoxItem>BBB</ComboBoxItem>
|
||||
<ComboBoxItem>CCC</ComboBoxItem>
|
||||
</ComboBox>
|
||||
<ComboBox Width="150" Classes="Small">
|
||||
<ComboBoxItem>AAA</ComboBoxItem>
|
||||
<ComboBoxItem>BBB</ComboBoxItem>
|
||||
<ComboBoxItem>CCC</ComboBoxItem>
|
||||
</ComboBox>
|
||||
<ComboBox Width="150" Classes="Bordered">
|
||||
<ComboBoxItem>AAA</ComboBoxItem>
|
||||
<ComboBoxItem>BBB</ComboBoxItem>
|
||||
<ComboBoxItem>CCC</ComboBoxItem>
|
||||
</ComboBox>
|
||||
<ComboBox
|
||||
Width="150"
|
||||
Classes="Bordered"
|
||||
IsEnabled="False">
|
||||
<ComboBoxItem>AAA</ComboBoxItem>
|
||||
<ComboBoxItem>BBB</ComboBoxItem>
|
||||
<ComboBoxItem>CCC</ComboBoxItem>
|
||||
<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.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>
|
||||
|
||||
<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>
|
||||
|
@ -1,6 +1,6 @@
|
||||
using Avalonia;
|
||||
using System.Collections.ObjectModel;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
@ -9,5 +9,11 @@ public partial class ComboBoxDemo : UserControl
|
||||
public ComboBoxDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = new ComboBoxDemoViewModel();
|
||||
}
|
||||
}
|
||||
|
||||
public class ComboBoxDemoViewModel : ObservableObject
|
||||
{
|
||||
public ObservableCollection<string> Items { get; set; } = ["Ding", "Otter", "Husky", "Mr.17", "Cass"];
|
||||
}
|
@ -5,168 +5,154 @@
|
||||
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">
|
||||
<DockPanel>
|
||||
<CheckBox
|
||||
x:Name="ShowGDP"
|
||||
Content="Toggle GDP Column Visibility"
|
||||
DockPanel.Dock="Top"
|
||||
IsChecked="True" />
|
||||
<DataGrid
|
||||
Name="dataGrid1"
|
||||
Margin="12"
|
||||
CanUserReorderColumns="True"
|
||||
CanUserResizeColumns="True"
|
||||
CanUserSortColumns="True"
|
||||
HeadersVisibility="All">
|
||||
<DataGrid.Columns>
|
||||
<!-- Using HeaderTemplate -->
|
||||
<DataGridTextColumn
|
||||
Width="6*"
|
||||
x:DataType="local:Country"
|
||||
Binding="{Binding Name}"
|
||||
Header="Country or Region" />
|
||||
<DataGridTextColumn
|
||||
Width="4*"
|
||||
x:DataType="local:Country"
|
||||
Binding="{Binding Region}"
|
||||
Header="Region" />
|
||||
<DataGridTextColumn
|
||||
Width="3*"
|
||||
x:DataType="local:Country"
|
||||
Binding="{Binding Population}"
|
||||
Header="Population" />
|
||||
<DataGridTextColumn
|
||||
Width="3*"
|
||||
x:DataType="local:Country"
|
||||
Binding="{Binding Area}"
|
||||
Header="Area" />
|
||||
<DataGridTextColumn
|
||||
Width="3*"
|
||||
MinWidth="200"
|
||||
x:DataType="local:Country"
|
||||
Binding="{Binding GDP}"
|
||||
Header="GDP"
|
||||
IsVisible="{Binding #ShowGDP.IsChecked}" />
|
||||
</DataGrid.Columns>
|
||||
<DataGrid.CellTheme>
|
||||
<ControlTheme BasedOn="{StaticResource {x:Type DataGridCell}}" TargetType="DataGridCell">
|
||||
<ControlTheme.Children>
|
||||
<Style Selector="^:nth-child(1)">
|
||||
<Setter Property="FontWeight" Value="Bold" />
|
||||
</Style>
|
||||
</ControlTheme.Children>
|
||||
</ControlTheme>
|
||||
</DataGrid.CellTheme>
|
||||
<DataGrid.ColumnHeaderTheme>
|
||||
<ControlTheme BasedOn="{StaticResource {x:Type DataGridColumnHeader}}" TargetType="DataGridColumnHeader">
|
||||
<ControlTheme.Children>
|
||||
<Style Selector="^:nth-child(1)">
|
||||
<Setter Property="FontWeight" Value="Bold" />
|
||||
</Style>
|
||||
</ControlTheme.Children>
|
||||
</ControlTheme>
|
||||
</DataGrid.ColumnHeaderTheme>
|
||||
</DataGrid>
|
||||
</DockPanel>
|
||||
<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>
|
||||
|
||||
</DataGrid>
|
||||
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="Grouping">
|
||||
<DataGrid Name="dataGridGrouping" Margin="12">
|
||||
<DataGrid
|
||||
Margin="8"
|
||||
CanUserReorderColumns="True"
|
||||
CanUserResizeColumns="True"
|
||||
CanUserSortColumns="True"
|
||||
HeadersVisibility="All"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding GridData2}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="6*"
|
||||
x:DataType="local:Country"
|
||||
Binding="{Binding Name}"
|
||||
Header="Country or Region" />
|
||||
x:DataType="vm:Song"
|
||||
Binding="{Binding Title}"
|
||||
Header="Title" />
|
||||
<DataGridTextColumn
|
||||
Width="4*"
|
||||
x:DataType="local:Country"
|
||||
Binding="{Binding Region}"
|
||||
Header="Region" />
|
||||
Width="6*"
|
||||
x:DataType="vm:Song"
|
||||
Binding="{Binding Artist}"
|
||||
Header="Artist" />
|
||||
<DataGridTextColumn
|
||||
Width="3*"
|
||||
x:DataType="local:Country"
|
||||
Binding="{Binding Population}"
|
||||
DisplayIndex="3"
|
||||
Header="Population" />
|
||||
<DataGridTextColumn
|
||||
Width="3*"
|
||||
x:DataType="local:Country"
|
||||
Binding="{Binding Area}"
|
||||
DisplayIndex="2"
|
||||
Header="Area" />
|
||||
<DataGridTextColumn
|
||||
Width="3*"
|
||||
x:DataType="local:Country"
|
||||
Binding="{Binding GDP}"
|
||||
Header="GDP" />
|
||||
Width="6*"
|
||||
x:DataType="vm:Song"
|
||||
Binding="{Binding Album}"
|
||||
Header="Album" />
|
||||
<DataGridTemplateColumn
|
||||
x:DataType="vm:Song"
|
||||
Header="Duration"
|
||||
SortMemberPath="Duration">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate x:DataType="vm:Song">
|
||||
<TextBlock
|
||||
Margin="8,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Duration}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
<DataGrid.RowTheme>
|
||||
<ControlTheme BasedOn="{StaticResource {x:Type DataGridRow}}" TargetType="DataGridRow">
|
||||
<ControlTheme.Children>
|
||||
<Style Selector="^:nth-child(5n+3)">
|
||||
<Setter Property="Foreground" Value="Red" />
|
||||
</Style>
|
||||
<Style Selector="^:nth-last-child(5n+1)">
|
||||
<Setter Property="Foreground" Value="Blue" />
|
||||
</Style>
|
||||
</ControlTheme.Children>
|
||||
</ControlTheme>
|
||||
</DataGrid.RowTheme>
|
||||
</DataGrid>
|
||||
</TabItem>
|
||||
<TabItem x:Name="EditableTab" Header="Editable">
|
||||
<Grid RowDefinitions="Auto,*,Auto">
|
||||
<TabItem Name="EditableTab" Header="Editable">
|
||||
<Grid Margin="8" RowDefinitions="Auto,*,Auto">
|
||||
<StackPanel
|
||||
Grid.Row="0"
|
||||
Orientation="Horizontal"
|
||||
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>
|
||||
<!-- Example of columns inheriting the data type from the Items source -->
|
||||
<DataGrid
|
||||
Name="dataGridEdit"
|
||||
Grid.Row="1"
|
||||
Margin="12"
|
||||
ItemsSource="{Binding DataGrid3Source}">
|
||||
Margin="8"
|
||||
ItemsSource="{Binding GridData3}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="2*"
|
||||
Binding="{Binding FirstName}"
|
||||
FontSize="{Binding #FontSizeSlider.Value, Mode=OneWay}"
|
||||
Header="First Name" />
|
||||
<DataGridTextColumn
|
||||
Width="2*"
|
||||
Binding="{Binding LastName}"
|
||||
FontSize="{Binding #FontSizeSlider.Value, Mode=OneWay}"
|
||||
Header="Last" />
|
||||
<DataGridCheckBoxColumn
|
||||
Width="*"
|
||||
Binding="{Binding IsBanned}"
|
||||
Header="Is Banned"
|
||||
Width="2*"
|
||||
Binding="{Binding IsSelected}"
|
||||
Header="Select"
|
||||
IsThreeState="{Binding #IsThreeStateCheckBox.IsChecked, Mode=OneWay}" />
|
||||
<DataGridTemplateColumn Header="Age">
|
||||
<DataGridTextColumn
|
||||
Width="6*"
|
||||
x:DataType="vm:SongViewModel"
|
||||
Binding="{Binding Title}"
|
||||
FontSize="{Binding #FontSizeSlider.Value, Mode=OneWay}"
|
||||
Header="Title" />
|
||||
<DataGridTextColumn
|
||||
Width="6*"
|
||||
x:DataType="vm:SongViewModel"
|
||||
Binding="{Binding Artist}"
|
||||
Header="Artist" />
|
||||
<DataGridTextColumn
|
||||
Width="6*"
|
||||
x:DataType="vm:SongViewModel"
|
||||
Binding="{Binding Album}"
|
||||
Header="Album" />
|
||||
<DataGridTemplateColumn Width="2*" Header="Comments">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Age, StringFormat='{}{0} years'}" />
|
||||
Text="{Binding CountOfComment}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.CellEditingTemplate>
|
||||
@ -174,20 +160,18 @@
|
||||
<NumericUpDown
|
||||
HorizontalAlignment="Stretch"
|
||||
FormatString="N0"
|
||||
Maximum="120"
|
||||
Minimum="0"
|
||||
TemplateApplied="NumericUpDown_OnTemplateApplied"
|
||||
Value="{Binding Age}" />
|
||||
Value="{Binding CountOfComment}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellEditingTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<Button
|
||||
Name="btnAdd"
|
||||
Grid.Row="2"
|
||||
Margin="12,0,12,12"
|
||||
HorizontalAlignment="Right"
|
||||
Command="{Binding AddCommand}"
|
||||
Content="Add" />
|
||||
</Grid>
|
||||
</TabItem>
|
||||
|
@ -13,6 +13,7 @@ using Avalonia.Input;
|
||||
using Avalonia.Input.Raw;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.Threading;
|
||||
using Semi.Avalonia.Demo.ViewModels;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
@ -21,488 +22,6 @@ public partial class DataGridDemo : UserControl
|
||||
public DataGridDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
var dataGridSortDescription = DataGridSortDescription.FromPath(nameof(Country.Region), ListSortDirection.Ascending, new ReversedStringComparer());
|
||||
var collectionView1 = new DataGridCollectionView(Countries.All);
|
||||
collectionView1.SortDescriptions.Add(dataGridSortDescription);
|
||||
var dg1 = this.Get<DataGrid>("dataGrid1");
|
||||
dg1.IsReadOnly = true;
|
||||
dg1.LoadingRow += Dg1_LoadingRow;
|
||||
dg1.Sorting += (s, a) =>
|
||||
{
|
||||
var binding = (a.Column as DataGridBoundColumn)?.Binding as Binding;
|
||||
|
||||
if (binding?.Path is string property
|
||||
&& property == dataGridSortDescription.PropertyPath
|
||||
&& !collectionView1.SortDescriptions.Contains(dataGridSortDescription))
|
||||
{
|
||||
collectionView1.SortDescriptions.Add(dataGridSortDescription);
|
||||
}
|
||||
};
|
||||
dg1.ItemsSource = collectionView1;
|
||||
|
||||
var dg2 = this.Get<DataGrid>("dataGridGrouping");
|
||||
dg2.IsReadOnly = true;
|
||||
|
||||
var collectionView2 = new DataGridCollectionView(Countries.All);
|
||||
collectionView2.GroupDescriptions.Add(new DataGridPathGroupDescription("Region"));
|
||||
|
||||
dg2.ItemsSource = collectionView2;
|
||||
|
||||
var dg3 = this.Get<DataGrid>("dataGridEdit");
|
||||
dg3.IsReadOnly = false;
|
||||
|
||||
var list = new ObservableCollection<Person>
|
||||
{
|
||||
new Person { FirstName = "John", LastName = "Doe" , Age = 30},
|
||||
new Person { FirstName = "Elizabeth", LastName = "Thomas", IsBanned = true , Age = 40 },
|
||||
new Person { FirstName = "Zack", LastName = "Ward" , Age = 50 }
|
||||
};
|
||||
DataGrid3Source = list;
|
||||
|
||||
var addButton = this.Get<Button>("btnAdd");
|
||||
addButton.Click += (a, b) => list.Add(new Person());
|
||||
|
||||
DataContext = this;
|
||||
}
|
||||
|
||||
public IEnumerable<Person> DataGrid3Source { get; }
|
||||
|
||||
private void Dg1_LoadingRow(object? sender, DataGridRowEventArgs e)
|
||||
{
|
||||
e.Row.Header = e.Row.GetIndex() + 1;
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
|
||||
private class ReversedStringComparer : IComparer<object>, IComparer
|
||||
{
|
||||
public int Compare(object? x, object? y)
|
||||
{
|
||||
if (x is string left && y is string right)
|
||||
{
|
||||
var reversedLeft = new string(left.Reverse().ToArray());
|
||||
var reversedRight = new string(right.Reverse().ToArray());
|
||||
return reversedLeft.CompareTo(reversedRight);
|
||||
}
|
||||
|
||||
return Comparer.Default.Compare(x, y);
|
||||
}
|
||||
}
|
||||
|
||||
private void NumericUpDown_OnTemplateApplied(object sender, TemplateAppliedEventArgs e)
|
||||
{
|
||||
// We want to focus the TextBox of the NumericUpDown. To do so we search for this control when the template
|
||||
// is applied, but we postpone the action until the control is actually loaded.
|
||||
if (e.NameScope.Find<TextBox>("PART_TextBox") is {} textBox)
|
||||
{
|
||||
Dispatcher.UIThread.InvokeAsync(() =>
|
||||
{
|
||||
textBox.Focus();
|
||||
textBox.SelectAll();
|
||||
}, DispatcherPriority.Loaded);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class Person : INotifyDataErrorInfo, INotifyPropertyChanged
|
||||
{
|
||||
string _firstName = string.Empty;
|
||||
string _lastName = string.Empty;
|
||||
bool _isBanned;
|
||||
private int _age;
|
||||
|
||||
public string FirstName
|
||||
{
|
||||
get => _firstName;
|
||||
set
|
||||
{
|
||||
_firstName = value;
|
||||
if (string.IsNullOrWhiteSpace(value))
|
||||
SetError(nameof(FirstName), "First Name Required");
|
||||
else
|
||||
SetError(nameof(FirstName), null);
|
||||
|
||||
OnPropertyChanged(nameof(FirstName));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public string LastName
|
||||
{
|
||||
get => _lastName;
|
||||
set
|
||||
{
|
||||
_lastName = value;
|
||||
if (string.IsNullOrWhiteSpace(value))
|
||||
SetError(nameof(LastName), "Last Name Required");
|
||||
else
|
||||
SetError(nameof(LastName), null);
|
||||
|
||||
OnPropertyChanged(nameof(LastName));
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsBanned
|
||||
{
|
||||
get => _isBanned;
|
||||
set
|
||||
{
|
||||
_isBanned = value;
|
||||
|
||||
OnPropertyChanged(nameof(_isBanned));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the age of the person
|
||||
/// </summary>
|
||||
public int Age
|
||||
{
|
||||
get => _age;
|
||||
set
|
||||
{
|
||||
_age = value;
|
||||
OnPropertyChanged(nameof(Age));
|
||||
}
|
||||
}
|
||||
|
||||
Dictionary<string, List<string>> _errorLookup = new Dictionary<string, List<string>>();
|
||||
|
||||
void SetError(string propertyName, string? error)
|
||||
{
|
||||
if (string.IsNullOrEmpty(error))
|
||||
{
|
||||
if (_errorLookup.Remove(propertyName))
|
||||
OnErrorsChanged(propertyName);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_errorLookup.TryGetValue(propertyName, out var errorList))
|
||||
{
|
||||
errorList.Clear();
|
||||
errorList.Add(error!);
|
||||
}
|
||||
else
|
||||
{
|
||||
var errors = new List<string> { error! };
|
||||
_errorLookup.Add(propertyName, errors);
|
||||
}
|
||||
|
||||
OnErrorsChanged(propertyName);
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasErrors => _errorLookup.Count > 0;
|
||||
|
||||
public event EventHandler<DataErrorsChangedEventArgs>? ErrorsChanged;
|
||||
public event PropertyChangedEventHandler? PropertyChanged;
|
||||
|
||||
void OnErrorsChanged(string propertyName)
|
||||
{
|
||||
ErrorsChanged?.Invoke(this, new DataErrorsChangedEventArgs(propertyName));
|
||||
}
|
||||
void OnPropertyChanged(string propertyName)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
public IEnumerable GetErrors(string? propertyName)
|
||||
{
|
||||
if (propertyName is { } && _errorLookup.TryGetValue(propertyName, out var errorList))
|
||||
return errorList;
|
||||
else
|
||||
return Array.Empty<object>();
|
||||
}
|
||||
}
|
||||
|
||||
public static class Countries
|
||||
{
|
||||
static IEnumerable<Country> GetCountries()
|
||||
{
|
||||
yield return new Country("Afghanistan", "ASIA (EX. NEAR EAST)", 31056997, 647500, 48, 0, 23.06, 163.07, 700, 36, 3.2, 46.6, 20.34);
|
||||
yield return new Country("Albania", "EASTERN EUROPE", 3581655, 28748, 124.6, 1.26, -4.93, 21.52, 4500, 86.5, 71.2, 15.11, 5.22);
|
||||
yield return new Country("Algeria", "NORTHERN AFRICA", 32930091, 2381740, 13.8, 0.04, -0.39, 31, 6000, 70, 78.1, 17.14, 4.61);
|
||||
yield return new Country("American Samoa", "OCEANIA", 57794, 199, 290.4, 58.29, -20.71, 9.27, 8000, 97, 259.5, 22.46, 3.27);
|
||||
yield return new Country("Andorra", "WESTERN EUROPE", 71201, 468, 152.1, 0, 6.6, 4.05, 19000, 100, 497.2, 8.71, 6.25);
|
||||
yield return new Country("Angola", "SUB-SAHARAN AFRICA", 12127071, 1246700, 9.7, 0.13, 0, 191.19, 1900, 42, 7.8, 45.11, 24.2);
|
||||
yield return new Country("Anguilla", "LATIN AMER. & CARIB", 13477, 102, 132.1, 59.8, 10.76, 21.03, 8600, 95, 460, 14.17, 5.34);
|
||||
yield return new Country("Antigua & Barbuda", "LATIN AMER. & CARIB", 69108, 443, 156, 34.54, -6.15, 19.46, 11000, 89, 549.9, 16.93, 5.37);
|
||||
yield return new Country("Argentina", "LATIN AMER. & CARIB", 39921833, 2766890, 14.4, 0.18, 0.61, 15.18, 11200, 97.1, 220.4, 16.73, 7.55);
|
||||
yield return new Country("Armenia", "C.W. OF IND. STATES", 2976372, 29800, 99.9, 0, -6.47, 23.28, 3500, 98.6, 195.7, 12.07, 8.23);
|
||||
yield return new Country("Aruba", "LATIN AMER. & CARIB", 71891, 193, 372.5, 35.49, 0, 5.89, 28000, 97, 516.1, 11.03, 6.68);
|
||||
yield return new Country("Australia", "OCEANIA", 20264082, 7686850, 2.6, 0.34, 3.98, 4.69, 29000, 100, 565.5, 12.14, 7.51);
|
||||
yield return new Country("Austria", "WESTERN EUROPE", 8192880, 83870, 97.7, 0, 2, 4.66, 30000, 98, 452.2, 8.74, 9.76);
|
||||
yield return new Country("Azerbaijan", "C.W. OF IND. STATES", 7961619, 86600, 91.9, 0, -4.9, 81.74, 3400, 97, 137.1, 20.74, 9.75);
|
||||
yield return new Country("The Bahamas", "LATIN AMER. & CARIB", 303770, 13940, 21.8, 25.41, -2.2, 25.21, 16700, 95.6, 460.6, 17.57, 9.05);
|
||||
yield return new Country("Bahrain", "NEAR EAST", 698585, 665, 1050.5, 24.21, 1.05, 17.27, 16900, 89.1, 281.3, 17.8, 4.14);
|
||||
yield return new Country("Bangladesh", "ASIA (EX. NEAR EAST)", 147365352, 144000, 1023.4, 0.4, -0.71, 62.6, 1900, 43.1, 7.3, 29.8, 8.27);
|
||||
yield return new Country("Barbados", "LATIN AMER. & CARIB", 279912, 431, 649.5, 22.51, -0.31, 12.5, 15700, 97.4, 481.9, 12.71, 8.67);
|
||||
yield return new Country("Belarus", "C.W. OF IND. STATES", 10293011, 207600, 49.6, 0, 2.54, 13.37, 6100, 99.6, 319.1, 11.16, 14.02);
|
||||
yield return new Country("Belgium", "WESTERN EUROPE", 10379067, 30528, 340, 0.22, 1.23, 4.68, 29100, 98, 462.6, 10.38, 10.27);
|
||||
yield return new Country("Belize", "LATIN AMER. & CARIB", 287730, 22966, 12.5, 1.68, 0, 25.69, 4900, 94.1, 115.7, 28.84, 5.72);
|
||||
yield return new Country("Benin", "SUB-SAHARAN AFRICA", 7862944, 112620, 69.8, 0.11, 0, 85, 1100, 40.9, 9.7, 38.85, 12.22);
|
||||
yield return new Country("Bermuda", "NORTHERN AMERICA", 65773, 53, 1241, 194.34, 2.49, 8.53, 36000, 98, 851.4, 11.4, 7.74);
|
||||
yield return new Country("Bhutan", "ASIA (EX. NEAR EAST)", 2279723, 47000, 48.5, 0, 0, 100.44, 1300, 42.2, 14.3, 33.65, 12.7);
|
||||
yield return new Country("Bolivia", "LATIN AMER. & CARIB", 8989046, 1098580, 8.2, 0, -1.32, 53.11, 2400, 87.2, 71.9, 23.3, 7.53);
|
||||
yield return new Country("Bosnia & Herzegovina", "EASTERN EUROPE", 4498976, 51129, 88, 0.04, 0.31, 21.05, 6100,null, 215.4, 8.77, 8.27);
|
||||
yield return new Country("Botswana", "SUB-SAHARAN AFRICA", 1639833, 600370, 2.7, 0, 0, 54.58, 9000, 79.8, 80.5, 23.08, 29.5);
|
||||
yield return new Country("Brazil", "LATIN AMER. & CARIB", 188078227, 8511965, 22.1, 0.09, -0.03, 29.61, 7600, 86.4, 225.3, 16.56, 6.17);
|
||||
yield return new Country("British Virgin Is.", "LATIN AMER. & CARIB", 23098, 153, 151, 52.29, 10.01, 18.05, 16000, 97.8, 506.5, 14.89, 4.42);
|
||||
yield return new Country("Brunei", "ASIA (EX. NEAR EAST)", 379444, 5770, 65.8, 2.79, 3.59, 12.61, 18600, 93.9, 237.2, 18.79, 3.45);
|
||||
yield return new Country("Bulgaria", "EASTERN EUROPE", 7385367, 110910, 66.6, 0.32, -4.58, 20.55, 7600, 98.6, 336.3, 9.65, 14.27);
|
||||
yield return new Country("Burkina Faso", "SUB-SAHARAN AFRICA", 13902972, 274200, 50.7, 0, 0, 97.57, 1100, 26.6, 7, 45.62, 15.6);
|
||||
yield return new Country("Burma", "ASIA (EX. NEAR EAST)", 47382633, 678500, 69.8, 0.28, -1.8, 67.24, 1800, 85.3, 10.1, 17.91, 9.83);
|
||||
yield return new Country("Burundi", "SUB-SAHARAN AFRICA", 8090068, 27830, 290.7, 0, -0.06, 69.29, 600, 51.6, 3.4, 42.22, 13.46);
|
||||
yield return new Country("Cambodia", "ASIA (EX. NEAR EAST)", 13881427, 181040, 76.7, 0.24, 0, 71.48, 1900, 69.4, 2.6, 26.9, 9.06);
|
||||
yield return new Country("Cameroon", "SUB-SAHARAN AFRICA", 17340702, 475440, 36.5, 0.08, 0, 68.26, 1800, 79, 5.7, 33.89, 13.47);
|
||||
yield return new Country("Canada", "NORTHERN AMERICA", 33098932, 9984670, 3.3, 2.02, 5.96, 4.75, 29800, 97, 552.2, 10.78, 7.8);
|
||||
yield return new Country("Cape Verde", "SUB-SAHARAN AFRICA", 420979, 4033, 104.4, 23.93, -12.07, 47.77, 1400, 76.6, 169.6, 24.87, 6.55);
|
||||
yield return new Country("Cayman Islands", "LATIN AMER. & CARIB", 45436, 262, 173.4, 61.07, 18.75, 8.19, 35000, 98, 836.3, 12.74, 4.89);
|
||||
yield return new Country("Central African Rep.", "SUB-SAHARAN AFRICA", 4303356, 622984, 6.9, 0, 0, 91, 1100, 51, 2.3, 33.91, 18.65);
|
||||
yield return new Country("Chad", "SUB-SAHARAN AFRICA", 9944201, 1284000, 7.7, 0, -0.11, 93.82, 1200, 47.5, 1.3, 45.73, 16.38);
|
||||
yield return new Country("Chile", "LATIN AMER. & CARIB", 16134219, 756950, 21.3, 0.85, 0, 8.8, 9900, 96.2, 213, 15.23, 5.81);
|
||||
yield return new Country("China", "ASIA (EX. NEAR EAST)", 1313973713, 9596960, 136.9, 0.15, -0.4, 24.18, 5000, 90.9, 266.7, 13.25, 6.97);
|
||||
yield return new Country("Colombia", "LATIN AMER. & CARIB", 43593035, 1138910, 38.3, 0.28, -0.31, 20.97, 6300, 92.5, 176.2, 20.48, 5.58);
|
||||
yield return new Country("Comoros", "SUB-SAHARAN AFRICA", 690948, 2170, 318.4, 15.67, 0, 74.93, 700, 56.5, 24.5, 36.93, 8.2);
|
||||
yield return new Country("Congo, Dem.Rep.", "SUB - SAHARAN AFRICA", 62660551, 2345410, 26.7, 0, 0, 94.69, 700, 65.5, 0.2, 43.69, 13.27);
|
||||
yield return new Country("Congo, Repub.of the", "SUB - SAHARAN AFRICA", 3702314, 342000, 10.8, 0.05, -0.17, 93.86, 700, 83.8, 3.7, 42.57, 12.93);
|
||||
yield return new Country("Cook Islands", "OCEANIA", 21388, 240, 89.1, 50,null,null, 5000, 95, 289.9, 21,null);
|
||||
yield return new Country("Costa Rica", "LATIN AMER. & CARIB", 4075261, 51100, 79.8, 2.52, 0.51, 9.95, 9100, 96, 340.7, 18.32, 4.36);
|
||||
yield return new Country("Cote d'Ivoire", "SUB-SAHARAN AFRICA", 17654843, 322460, 54.8, 0.16, -0.07, 90.83, 1400, 50.9, 14.6, 35.11, 14.84);
|
||||
yield return new Country("Croatia", "EASTERN EUROPE", 4494749, 56542, 79.5, 10.32, 1.58, 6.84, 10600, 98.5, 420.4, 9.61, 11.48);
|
||||
yield return new Country("Cuba", "LATIN AMER. & CARIB", 11382820, 110860, 102.7, 3.37, -1.58, 6.33, 2900, 97, 74.7, 11.89, 7.22);
|
||||
yield return new Country("Cyprus", "NEAR EAST", 784301, 9250, 84.8, 7.01, 0.43, 7.18, 19200, 97.6,null, 12.56, 7.68);
|
||||
yield return new Country("Czech Republic", "EASTERN EUROPE", 10235455, 78866, 129.8, 0, 0.97, 3.93, 15700, 99.9, 314.3, 9.02, 10.59);
|
||||
yield return new Country("Denmark", "WESTERN EUROPE", 5450661, 43094, 126.5, 16.97, 2.48, 4.56, 31100, 100, 614.6, 11.13, 10.36);
|
||||
yield return new Country("Djibouti", "SUB-SAHARAN AFRICA", 486530, 23000, 21.2, 1.37, 0, 104.13, 1300, 67.9, 22.8, 39.53, 19.31);
|
||||
yield return new Country("Dominica", "LATIN AMER. & CARIB", 68910, 754, 91.4, 19.63, -13.87, 14.15, 5400, 94, 304.8, 15.27, 6.73);
|
||||
yield return new Country("Dominican Republic", "LATIN AMER. & CARIB", 9183984, 48730, 188.5, 2.64, -3.22, 32.38, 6000, 84.7, 97.4, 23.22, 5.73);
|
||||
yield return new Country("East Timor", "ASIA (EX. NEAR EAST)", 1062777, 15007, 70.8, 4.7, 0, 47.41, 500, 58.6,null, 26.99, 6.24);
|
||||
yield return new Country("Ecuador", "LATIN AMER. & CARIB", 13547510, 283560, 47.8, 0.79, -8.58, 23.66, 3300, 92.5, 125.6, 22.29, 4.23);
|
||||
yield return new Country("Egypt", "NORTHERN AFRICA", 78887007, 1001450, 78.8, 0.24, -0.22, 32.59, 4000, 57.7, 131.8, 22.94, 5.23);
|
||||
yield return new Country("El Salvador", "LATIN AMER. & CARIB", 6822378, 21040, 324.3, 1.46, -3.74, 25.1, 4800, 80.2, 142.4, 26.61, 5.78);
|
||||
yield return new Country("Equatorial Guinea", "SUB-SAHARAN AFRICA", 540109, 28051, 19.3, 1.06, 0, 85.13, 2700, 85.7, 18.5, 35.59, 15.06);
|
||||
yield return new Country("Eritrea", "SUB-SAHARAN AFRICA", 4786994, 121320, 39.5, 1.84, 0, 74.87, 700, 58.6, 7.9, 34.33, 9.6);
|
||||
yield return new Country("Estonia", "BALTICS", 1324333, 45226, 29.3, 8.39, -3.16, 7.87, 12300, 99.8, 333.8, 10.04, 13.25);
|
||||
yield return new Country("Ethiopia", "SUB-SAHARAN AFRICA", 74777981, 1127127, 66.3, 0, 0, 95.32, 700, 42.7, 8.2, 37.98, 14.86);
|
||||
yield return new Country("Faroe Islands", "WESTERN EUROPE", 47246, 1399, 33.8, 79.84, 1.41, 6.24, 22000,null, 503.8, 14.05, 8.7);
|
||||
yield return new Country("Fiji", "OCEANIA", 905949, 18270, 49.6, 6.18, -3.14, 12.62, 5800, 93.7, 112.6, 22.55, 5.65);
|
||||
yield return new Country("Finland", "WESTERN EUROPE", 5231372, 338145, 15.5, 0.37, 0.95, 3.57, 27400, 100, 405.3, 10.45, 9.86);
|
||||
yield return new Country("France", "WESTERN EUROPE", 60876136, 547030, 111.3, 0.63, 0.66, 4.26, 27600, 99, 586.4, 11.99, 9.14);
|
||||
yield return new Country("French Guiana", "LATIN AMER. & CARIB", 199509, 91000, 2.2, 0.42, 6.27, 12.07, 8300, 83, 255.6, 20.46, 4.88);
|
||||
yield return new Country("French Polynesia", "OCEANIA", 274578, 4167, 65.9, 60.6, 2.94, 8.44, 17500, 98, 194.5, 16.68, 4.69);
|
||||
yield return new Country("Gabon", "SUB-SAHARAN AFRICA", 1424906, 267667, 5.3, 0.33, 0, 53.64, 5500, 63.2, 27.4, 36.16, 12.25);
|
||||
yield return new Country("Gambia, The", "SUB - SAHARAN AFRICA", 1641564, 11300, 145.3, 0.71, 1.57, 72.02, 1700, 40.1, 26.8, 39.37, 12.25);
|
||||
yield return new Country("Gaza Strip", "NEAR EAST", 1428757, 360, 3968.8, 11.11, 1.6, 22.93, 600,null, 244.3, 39.45, 3.8);
|
||||
yield return new Country("Georgia", "C.W. OF IND. STATES", 4661473, 69700, 66.9, 0.44, -4.7, 18.59, 2500, 99, 146.6, 10.41, 9.23);
|
||||
yield return new Country("Germany", "WESTERN EUROPE", 82422299, 357021, 230.9, 0.67, 2.18, 4.16, 27600, 99, 667.9, 8.25, 10.62);
|
||||
yield return new Country("Ghana", "SUB-SAHARAN AFRICA", 22409572, 239460, 93.6, 0.23, -0.64, 51.43, 2200, 74.8, 14.4, 30.52, 9.72);
|
||||
yield return new Country("Gibraltar", "WESTERN EUROPE", 27928, 7, 3989.7, 171.43, 0, 5.13, 17500,null, 877.7, 10.74, 9.31);
|
||||
yield return new Country("Greece", "WESTERN EUROPE", 10688058, 131940, 81, 10.37, 2.35, 5.53, 20000, 97.5, 589.7, 9.68, 10.24);
|
||||
yield return new Country("Greenland", "NORTHERN AMERICA", 56361, 2166086, 0, 2.04, -8.37, 15.82, 20000,null, 448.9, 15.93, 7.84);
|
||||
yield return new Country("Grenada", "LATIN AMER. & CARIB", 89703, 344, 260.8, 35.17, -13.92, 14.62, 5000, 98, 364.5, 22.08, 6.88);
|
||||
yield return new Country("Guadeloupe", "LATIN AMER. & CARIB", 452776, 1780, 254.4, 17.19, -0.15, 8.6, 8000, 90, 463.8, 15.05, 6.09);
|
||||
yield return new Country("Guam", "OCEANIA", 171019, 541, 316.1, 23.2, 0, 6.94, 21000, 99, 492, 18.79, 4.48);
|
||||
yield return new Country("Guatemala", "LATIN AMER. & CARIB", 12293545, 108890, 112.9, 0.37, -1.67, 35.93, 4100, 70.6, 92.1, 29.88, 5.2);
|
||||
yield return new Country("Guernsey", "WESTERN EUROPE", 65409, 78, 838.6, 64.1, 3.84, 4.71, 20000,null, 842.4, 8.81, 10.01);
|
||||
yield return new Country("Guinea", "SUB-SAHARAN AFRICA", 9690222, 245857, 39.4, 0.13, -3.06, 90.37, 2100, 35.9, 2.7, 41.76, 15.48);
|
||||
yield return new Country("Guinea-Bissau", "SUB-SAHARAN AFRICA", 1442029, 36120, 39.9, 0.97, -1.57, 107.17, 800, 42.4, 7.4, 37.22, 16.53);
|
||||
yield return new Country("Guyana", "LATIN AMER. & CARIB", 767245, 214970, 3.6, 0.21, -2.07, 33.26, 4000, 98.8, 143.5, 18.28, 8.28);
|
||||
yield return new Country("Haiti", "LATIN AMER. & CARIB", 8308504, 27750, 299.4, 6.38, -3.4, 73.45, 1600, 52.9, 16.9, 36.44, 12.17);
|
||||
yield return new Country("Honduras", "LATIN AMER. & CARIB", 7326496, 112090, 65.4, 0.73, -1.99, 29.32, 2600, 76.2, 67.5, 28.24, 5.28);
|
||||
yield return new Country("Hong Kong", "ASIA (EX. NEAR EAST)", 6940432, 1092, 6355.7, 67.12, 5.24, 2.97, 28800, 93.5, 546.7, 7.29, 6.29);
|
||||
yield return new Country("Hungary", "EASTERN EUROPE", 9981334, 93030, 107.3, 0, 0.86, 8.57, 13900, 99.4, 336.2, 9.72, 13.11);
|
||||
yield return new Country("Iceland", "WESTERN EUROPE", 299388, 103000, 2.9, 4.83, 2.38, 3.31, 30900, 99.9, 647.7, 13.64, 6.72);
|
||||
yield return new Country("India", "ASIA (EX. NEAR EAST)", 1095351995, 3287590, 333.2, 0.21, -0.07, 56.29, 2900, 59.5, 45.4, 22.01, 8.18);
|
||||
yield return new Country("Indonesia", "ASIA (EX. NEAR EAST)", 245452739, 1919440, 127.9, 2.85, 0, 35.6, 3200, 87.9, 52, 20.34, 6.25);
|
||||
yield return new Country("Iran", "ASIA (EX. NEAR EAST)", 68688433, 1648000, 41.7, 0.15, -0.84, 41.58, 7000, 79.4, 276.4, 17, 5.55);
|
||||
yield return new Country("Iraq", "NEAR EAST", 26783383, 437072, 61.3, 0.01, 0, 50.25, 1500, 40.4, 38.6, 31.98, 5.37);
|
||||
yield return new Country("Ireland", "WESTERN EUROPE", 4062235, 70280, 57.8, 2.06, 4.99, 5.39, 29600, 98, 500.5, 14.45, 7.82);
|
||||
yield return new Country("Isle of Man", "WESTERN EUROPE", 75441, 572, 131.9, 27.97, 5.36, 5.93, 21000,null, 676, 11.05, 11.19);
|
||||
yield return new Country("Israel", "NEAR EAST", 6352117, 20770, 305.8, 1.31, 0.68, 7.03, 19800, 95.4, 462.3, 17.97, 6.18);
|
||||
yield return new Country("Italy", "WESTERN EUROPE", 58133509, 301230, 193, 2.52, 2.07, 5.94, 26700, 98.6, 430.9, 8.72, 10.4);
|
||||
yield return new Country("Jamaica", "LATIN AMER. & CARIB", 2758124, 10991, 250.9, 9.3, -4.92, 12.36, 3900, 87.9, 124, 20.82, 6.52);
|
||||
yield return new Country("Japan", "ASIA (EX. NEAR EAST)", 127463611, 377835, 337.4, 7.87, 0, 3.26, 28200, 99, 461.2, 9.37, 9.16);
|
||||
yield return new Country("Jersey", "WESTERN EUROPE", 91084, 116, 785.2, 60.34, 2.76, 5.24, 24800,null, 811.3, 9.3, 9.28);
|
||||
yield return new Country("Jordan", "NEAR EAST", 5906760, 92300, 64, 0.03, 6.59, 17.35, 4300, 91.3, 104.5, 21.25, 2.65);
|
||||
yield return new Country("Kazakhstan", "C.W. OF IND. STATES", 15233244, 2717300, 5.6, 0, -3.35, 29.21, 6300, 98.4, 164.1, 16, 9.42);
|
||||
yield return new Country("Kenya", "SUB-SAHARAN AFRICA", 34707817, 582650, 59.6, 0.09, -0.1, 61.47, 1000, 85.1, 8.1, 39.72, 14.02);
|
||||
yield return new Country("Kiribati", "OCEANIA", 105432, 811, 130, 140.94, 0, 48.52, 800,null, 42.7, 30.65, 8.26);
|
||||
yield return new Country("North Korea", "ASIA(EX.NEAR EAST)", 23113019, 120540, 191.8, 2.07, 0, 24.04, 1300, 99, 42.4, 15.54, 7.13);
|
||||
yield return new Country("South Korea", "ASIA(EX.NEAR EAST)", 48846823, 98480, 496, 2.45, 0, 7.05, 17800, 97.9, 486.1, 10, 5.85);
|
||||
yield return new Country("Kuwait", "NEAR EAST", 2418393, 17820, 135.7, 2.8, 14.18, 9.95, 19000, 83.5, 211, 21.94, 2.41);
|
||||
yield return new Country("Kyrgyzstan", "C.W. OF IND. STATES", 5213898, 198500, 26.3, 0, -2.45, 35.64, 1600, 97, 84, 22.8, 7.08);
|
||||
yield return new Country("Laos", "ASIA (EX. NEAR EAST)", 6368481, 236800, 26.9, 0, 0, 85.22, 1700, 66.4, 14.1, 35.49, 11.55);
|
||||
yield return new Country("Latvia", "BALTICS", 2274735, 64589, 35.2, 0.82, -2.23, 9.55, 10200, 99.8, 321.4, 9.24, 13.66);
|
||||
yield return new Country("Lebanon", "NEAR EAST", 3874050, 10400, 372.5, 2.16, 0, 24.52, 4800, 87.4, 255.6, 18.52, 6.21);
|
||||
yield return new Country("Lesotho", "SUB-SAHARAN AFRICA", 2022331, 30355, 66.6, 0, -0.74, 84.23, 3000, 84.8, 23.7, 24.75, 28.71);
|
||||
yield return new Country("Liberia", "SUB-SAHARAN AFRICA", 3042004, 111370, 27.3, 0.52, 0, 128.87, 1000, 57.5, 2.3, 44.77, 23.1);
|
||||
yield return new Country("Libya", "NORTHERN AFRICA", 5900754, 1759540, 3.4, 0.1, 0, 24.6, 6400, 82.6, 127.1, 26.49, 3.48);
|
||||
yield return new Country("Liechtenstein", "WESTERN EUROPE", 33987, 160, 212.4, 0, 4.85, 4.7, 25000, 100, 585.5, 10.21, 7.18);
|
||||
yield return new Country("Lithuania", "BALTICS", 3585906, 65200, 55, 0.14, -0.71, 6.89, 11400, 99.6, 223.4, 8.75, 10.98);
|
||||
yield return new Country("Luxembourg", "WESTERN EUROPE", 474413, 2586, 183.5, 0, 8.97, 4.81, 55100, 100, 515.4, 11.94, 8.41);
|
||||
yield return new Country("Macau", "ASIA (EX. NEAR EAST)", 453125, 28, 16183, 146.43, 4.86, 4.39, 19400, 94.5, 384.9, 8.48, 4.47);
|
||||
yield return new Country("Macedonia", "EASTERN EUROPE", 2050554, 25333, 80.9, 0, -1.45, 10.09, 6700,null, 260, 12.02, 8.77);
|
||||
yield return new Country("Madagascar", "SUB-SAHARAN AFRICA", 18595469, 587040, 31.7, 0.82, 0, 76.83, 800, 68.9, 3.6, 41.41, 11.11);
|
||||
yield return new Country("Malawi", "SUB-SAHARAN AFRICA", 13013926, 118480, 109.8, 0, 0, 103.32, 600, 62.7, 7.9, 43.13, 19.33);
|
||||
yield return new Country("Malaysia", "ASIA (EX. NEAR EAST)", 24385858, 329750, 74, 1.42, 0, 17.7, 9000, 88.7, 179, 22.86, 5.05);
|
||||
yield return new Country("Maldives", "ASIA (EX. NEAR EAST)", 359008, 300, 1196.7, 214.67, 0, 56.52, 3900, 97.2, 90, 34.81, 7.06);
|
||||
yield return new Country("Mali", "SUB-SAHARAN AFRICA", 11716829, 1240000, 9.5, 0, -0.33, 116.79, 900, 46.4, 6.4, 49.82, 16.89);
|
||||
yield return new Country("Malta", "WESTERN EUROPE", 400214, 316, 1266.5, 62.28, 2.07, 3.89, 17700, 92.8, 505, 10.22, 8.1);
|
||||
yield return new Country("Marshall Islands", "OCEANIA", 60422, 11854, 5.1, 3.12, -6.04, 29.45, 1600, 93.7, 91.2, 33.05, 4.78);
|
||||
yield return new Country("Martinique", "LATIN AMER. & CARIB", 436131, 1100, 396.5, 31.82, -0.05, 7.09, 14400, 97.7, 394.4, 13.74, 6.48);
|
||||
yield return new Country("Mauritania", "SUB-SAHARAN AFRICA", 3177388, 1030700, 3.1, 0.07, 0, 70.89, 1800, 41.7, 12.9, 40.99, 12.16);
|
||||
yield return new Country("Mauritius", "SUB-SAHARAN AFRICA", 1240827, 2040, 608.3, 8.68, -0.9, 15.03, 11400, 85.6, 289.3, 15.43, 6.86);
|
||||
yield return new Country("Mayotte", "SUB-SAHARAN AFRICA", 201234, 374, 538.1, 49.52, 6.78, 62.4, 2600,null, 49.7, 40.95, 7.7);
|
||||
yield return new Country("Mexico", "LATIN AMER. & CARIB", 107449525, 1972550, 54.5, 0.47, -4.87, 20.91, 9000, 92.2, 181.6, 20.69, 4.74);
|
||||
yield return new Country("Micronesia, Fed.St.", "OCEANIA", 108004, 702, 153.9, 870.66, -20.99, 30.21, 2000, 89, 114.8, 24.68, 4.75);
|
||||
yield return new Country("Moldova", "C.W. OF IND. STATES", 4466706, 33843, 132, 0, -0.26, 40.42, 1800, 99.1, 208.1, 15.7, 12.64);
|
||||
yield return new Country("Monaco", "WESTERN EUROPE", 32543, 2, 16271.5, 205, 7.75, 5.43, 27000, 99, 1035.6, 9.19, 12.91);
|
||||
yield return new Country("Mongolia", "ASIA (EX. NEAR EAST)", 2832224, 1564116, 1.8, 0, 0, 53.79, 1800, 97.8, 55.1, 21.59, 6.95);
|
||||
yield return new Country("Montserrat", "LATIN AMER. & CARIB", 9439, 102, 92.5, 39.22, 0, 7.35, 3400, 97,null, 17.59, 7.1);
|
||||
yield return new Country("Morocco", "NORTHERN AFRICA", 33241259, 446550, 74.4, 0.41, -0.98, 41.62, 4000, 51.7, 40.4, 21.98, 5.58);
|
||||
yield return new Country("Mozambique", "SUB-SAHARAN AFRICA", 19686505, 801590, 24.6, 0.31, 0, 130.79, 1200, 47.8, 3.5, 35.18, 21.35);
|
||||
yield return new Country("Namibia", "SUB-SAHARAN AFRICA", 2044147, 825418, 2.5, 0.19, 0, 48.98, 7200, 84, 62.6, 24.32, 18.86);
|
||||
yield return new Country("Nauru", "OCEANIA", 13287, 21, 632.7, 142.86, 0, 9.95, 5000,null, 143, 24.76, 6.7);
|
||||
yield return new Country("Nepal", "ASIA (EX. NEAR EAST)", 28287147, 147181, 192.2, 0, 0, 66.98, 1400, 45.2, 15.9, 30.98, 9.31);
|
||||
yield return new Country("Netherlands", "WESTERN EUROPE", 16491461, 41526, 397.1, 1.09, 2.91, 5.04, 28600, 99, 460.8, 10.9, 8.68);
|
||||
yield return new Country("Netherlands Antilles", "LATIN AMER. & CARIB", 221736, 960, 231, 37.92, -0.41, 10.03, 11400, 96.7, 365.3, 14.78, 6.45);
|
||||
yield return new Country("New Caledonia", "OCEANIA", 219246, 19060, 11.5, 11.83, 0, 7.72, 15000, 91, 252.2, 18.11, 5.69);
|
||||
yield return new Country("New Zealand", "OCEANIA", 4076140, 268680, 15.2, 5.63, 4.05, 5.85, 21600, 99, 441.7, 13.76, 7.53);
|
||||
yield return new Country("Nicaragua", "LATIN AMER. & CARIB", 5570129, 129494, 43, 0.7, -1.22, 29.11, 2300, 67.5, 39.7, 24.51, 4.45);
|
||||
yield return new Country("Niger", "SUB-SAHARAN AFRICA", 12525094, 1267000, 9.9, 0, -0.67, 121.69, 800, 17.6, 1.9, 50.73, 20.91);
|
||||
yield return new Country("Nigeria", "SUB-SAHARAN AFRICA", 131859731, 923768, 142.7, 0.09, 0.26, 98.8, 900, 68, 9.3, 40.43, 16.94);
|
||||
yield return new Country("N. Mariana Islands", "OCEANIA", 82459, 477, 172.9, 310.69, 9.61, 7.11, 12500, 97, 254.7, 19.43, 2.29);
|
||||
yield return new Country("Norway", "WESTERN EUROPE", 4610820, 323802, 14.2, 7.77, 1.74, 3.7, 37800, 100, 461.7, 11.46, 9.4);
|
||||
yield return new Country("Oman", "NEAR EAST", 3102229, 212460, 14.6, 0.98, 0.28, 19.51, 13100, 75.8, 85.5, 36.24, 3.81);
|
||||
yield return new Country("Pakistan", "ASIA (EX. NEAR EAST)", 165803560, 803940, 206.2, 0.13, -2.77, 72.44, 2100, 45.7, 31.8, 29.74, 8.23);
|
||||
yield return new Country("Palau", "OCEANIA", 20579, 458, 44.9, 331.66, 2.85, 14.84, 9000, 92, 325.6, 18.03, 6.8);
|
||||
yield return new Country("Panama", "LATIN AMER. & CARIB", 3191319, 78200, 40.8, 3.18, -0.91, 20.47, 6300, 92.6, 137.9, 21.74, 5.36);
|
||||
yield return new Country("Papua New Guinea", "OCEANIA", 5670544, 462840, 12.3, 1.11, 0, 51.45, 2200, 64.6, 10.9, 29.36, 7.25);
|
||||
yield return new Country("Paraguay", "LATIN AMER. & CARIB", 6506464, 406750, 16, 0, -0.08, 25.63, 4700, 94, 49.2, 29.1, 4.49);
|
||||
yield return new Country("Peru", "LATIN AMER. & CARIB", 28302603, 1285220, 22, 0.19, -1.05, 31.94, 5100, 90.9, 79.5, 20.48, 6.23);
|
||||
yield return new Country("Philippines", "ASIA (EX. NEAR EAST)", 89468677, 300000, 298.2, 12.1, -1.5, 23.51, 4600, 92.6, 38.4, 24.89, 5.41);
|
||||
yield return new Country("Poland", "EASTERN EUROPE", 38536869, 312685, 123.3, 0.16, -0.49, 8.51, 11100, 99.8, 306.3, 9.85, 9.89);
|
||||
yield return new Country("Portugal", "WESTERN EUROPE", 10605870, 92391, 114.8, 1.94, 3.57, 5.05, 18000, 93.3, 399.2, 10.72, 10.5);
|
||||
yield return new Country("Puerto Rico", "LATIN AMER. & CARIB", 3927188, 13790, 284.8, 3.63, -1.46, 8.24, 16800, 94.1, 283.1, 12.77, 7.65);
|
||||
yield return new Country("Qatar", "NEAR EAST", 885359, 11437, 77.4, 4.92, 16.29, 18.61, 21500, 82.5, 232, 15.56, 4.72);
|
||||
yield return new Country("Reunion", "SUB-SAHARAN AFRICA", 787584, 2517, 312.9, 8.22, 0, 7.78, 5800, 88.9, 380.9, 18.9, 5.49);
|
||||
yield return new Country("Romania", "EASTERN EUROPE", 22303552, 237500, 93.9, 0.09, -0.13, 26.43, 7000, 98.4, 196.9, 10.7, 11.77);
|
||||
yield return new Country("Russia", "C.W. OF IND. STATES", 142893540, 17075200, 8.4, 0.22, 1.02, 15.39, 8900, 99.6, 280.6, 9.95, 14.65);
|
||||
yield return new Country("Rwanda", "SUB-SAHARAN AFRICA", 8648248, 26338, 328.4, 0, 0, 91.23, 1300, 70.4, 2.7, 40.37, 16.09);
|
||||
yield return new Country("Saint Helena", "SUB-SAHARAN AFRICA", 7502, 413, 18.2, 14.53, 0, 19, 2500, 97, 293.3, 12.13, 6.53);
|
||||
yield return new Country("Saint Kitts & Nevis", "LATIN AMER. & CARIB", 39129, 261, 149.9, 51.72, -7.11, 14.49, 8800, 97, 638.9, 18.02, 8.33);
|
||||
yield return new Country("Saint Lucia", "LATIN AMER. & CARIB", 168458, 616, 273.5, 25.65, -2.67, 13.53, 5400, 67, 303.3, 19.68, 5.08);
|
||||
yield return new Country("St Pierre & Miquelon", "NORTHERN AMERICA", 7026, 242, 29, 49.59, -4.86, 7.54, 6900, 99, 683.2, 13.52, 6.83);
|
||||
yield return new Country("Saint Vincent and the Grenadines", "LATIN AMER. & CARIB", 117848, 389, 303, 21.59, -7.64, 14.78, 2900, 96, 190.9, 16.18, 5.98);
|
||||
yield return new Country("Samoa", "OCEANIA", 176908, 2944, 60.1, 13.69, -11.7, 27.71, 5600, 99.7, 75.2, 16.43, 6.62);
|
||||
yield return new Country("San Marino", "WESTERN EUROPE", 29251, 61, 479.5, 0, 10.98, 5.73, 34600, 96, 704.3, 10.02, 8.17);
|
||||
yield return new Country("Sao Tome & Principe", "SUB-SAHARAN AFRICA", 193413, 1001, 193.2, 20.88, -2.72, 43.11, 1200, 79.3, 36.2, 40.25, 6.47);
|
||||
yield return new Country("Saudi Arabia", "NEAR EAST", 27019731, 1960582, 13.8, 0.13, -2.71, 13.24, 11800, 78.8, 140.6, 29.34, 2.58);
|
||||
yield return new Country("Senegal", "SUB-SAHARAN AFRICA", 11987121, 196190, 61.1, 0.27, 0.2, 55.51, 1600, 40.2, 22.2, 32.78, 9.42);
|
||||
yield return new Country("Serbia", "EASTERN EUROPE", 9396411, 88361, 106.3, 0, -1.33, 12.89, 2200, 93, 285.8,null,null);
|
||||
yield return new Country("Seychelles", "SUB-SAHARAN AFRICA", 81541, 455, 179.2, 107.91, -5.69, 15.53, 7800, 58, 262.4, 16.03, 6.29);
|
||||
yield return new Country("Sierra Leone", "SUB-SAHARAN AFRICA", 6005250, 71740, 83.7, 0.56, 0, 143.64, 500, 31.4, 4, 45.76, 23.03);
|
||||
yield return new Country("Singapore", "ASIA (EX. NEAR EAST)", 4492150, 693, 6482.2, 27.85, 11.53, 2.29, 23700, 92.5, 411.4, 9.34, 4.28);
|
||||
yield return new Country("Slovakia", "EASTERN EUROPE", 5439448, 48845, 111.4, 0, 0.3, 7.41, 13300,null, 220.1, 10.65, 9.45);
|
||||
yield return new Country("Slovenia", "EASTERN EUROPE", 2010347, 20273, 99.2, 0.23, 1.12, 4.45, 19000, 99.7, 406.1, 8.98, 10.31);
|
||||
yield return new Country("Solomon Islands", "OCEANIA", 552438, 28450, 19.4, 18.67, 0, 21.29, 1700,null, 13.4, 30.01, 3.92);
|
||||
yield return new Country("Somalia", "SUB-SAHARAN AFRICA", 8863338, 637657, 13.9, 0.47, 5.37, 116.7, 500, 37.8, 11.3, 45.13, 16.63);
|
||||
yield return new Country("South Africa", "SUB-SAHARAN AFRICA", 44187637, 1219912, 36.2, 0.23, -0.29, 61.81, 10700, 86.4, 107, 18.2, 22);
|
||||
yield return new Country("Spain", "WESTERN EUROPE", 40397842, 504782, 80, 0.98, 0.99, 4.42, 22000, 97.9, 453.5, 10.06, 9.72);
|
||||
yield return new Country("Sri Lanka", "ASIA (EX. NEAR EAST)", 20222240, 65610, 308.2, 2.04, -1.31, 14.35, 3700, 92.3, 61.5, 15.51, 6.52);
|
||||
yield return new Country("Sudan", "SUB-SAHARAN AFRICA", 41236378, 2505810, 16.5, 0.03, -0.02, 62.5, 1900, 61.1, 16.3, 34.53, 8.97);
|
||||
yield return new Country("Suriname", "LATIN AMER. & CARIB", 439117, 163270, 2.7, 0.24, -8.81, 23.57, 4000, 93, 184.7, 18.02, 7.27);
|
||||
yield return new Country("Swaziland", "SUB-SAHARAN AFRICA", 1136334, 17363, 65.5, 0, 0, 69.27, 4900, 81.6, 30.8, 27.41, 29.74);
|
||||
yield return new Country("Sweden", "WESTERN EUROPE", 9016596, 449964, 20, 0.72, 1.67, 2.77, 26800, 99, 715, 10.27, 10.31);
|
||||
yield return new Country("Switzerland", "WESTERN EUROPE", 7523934, 41290, 182.2, 0, 4.05, 4.39, 32700, 99, 680.9, 9.71, 8.49);
|
||||
yield return new Country("Syria", "NEAR EAST", 18881361, 185180, 102, 0.1, 0, 29.53, 3300, 76.9, 153.8, 27.76, 4.81);
|
||||
yield return new Country("Taiwan", "ASIA (EX. NEAR EAST)", 23036087, 35980, 640.3, 4.35, 0, 6.4, 23400, 96.1, 591, 12.56, 6.48);
|
||||
yield return new Country("Tajikistan", "C.W. OF IND. STATES", 7320815, 143100, 51.2, 0, -2.86, 110.76, 1000, 99.4, 33.5, 32.65, 8.25);
|
||||
yield return new Country("Tanzania", "SUB-SAHARAN AFRICA", 37445392, 945087, 39.6, 0.15, -2.06, 98.54, 600, 78.2, 4, 37.71, 16.39);
|
||||
yield return new Country("Thailand", "ASIA (EX. NEAR EAST)", 64631595, 514000, 125.7, 0.63, 0, 20.48, 7400, 92.6, 108.9, 13.87, 7.04);
|
||||
yield return new Country("Togo", "SUB-SAHARAN AFRICA", 5548702, 56785, 97.7, 0.1, 0, 66.61, 1500, 60.9, 10.6, 37.01, 9.83);
|
||||
yield return new Country("Tonga", "OCEANIA", 114689, 748, 153.3, 56.02, 0, 12.62, 2200, 98.5, 97.7, 25.37, 5.28);
|
||||
yield return new Country("Trinidad & Tobago", "LATIN AMER. & CARIB", 1065842, 5128, 207.9, 7.06, -10.83, 24.31, 9500, 98.6, 303.5, 12.9, 10.57);
|
||||
yield return new Country("Tunisia", "NORTHERN AFRICA", 10175014, 163610, 62.2, 0.7, -0.57, 24.77, 6900, 74.2, 123.6, 15.52, 5.13);
|
||||
yield return new Country("Turkey", "NEAR EAST", 70413958, 780580, 90.2, 0.92, 0, 41.04, 6700, 86.5, 269.5, 16.62, 5.97);
|
||||
yield return new Country("Turkmenistan", "C.W. OF IND. STATES", 5042920, 488100, 10.3, 0, -0.86, 73.08, 5800, 98, 74.6, 27.61, 8.6);
|
||||
yield return new Country("Turks & Caicos Is", "LATIN AMER. & CARIB", 21152, 430, 49.2, 90.47, 11.68, 15.67, 9600, 98, 269.5, 21.84, 4.21);
|
||||
yield return new Country("Tuvalu", "OCEANIA", 11810, 26, 454.2, 92.31, 0, 20.03, 1100,null, 59.3, 22.18, 7.11);
|
||||
yield return new Country("Uganda", "SUB-SAHARAN AFRICA", 28195754, 236040, 119.5, 0, 0, 67.83, 1400, 69.9, 3.6, 47.35, 12.24);
|
||||
yield return new Country("Ukraine", "C.W. OF IND. STATES", 46710816, 603700, 77.4, 0.46, -0.39, 20.34, 5400, 99.7, 259.9, 8.82, 14.39);
|
||||
yield return new Country("United Arab Emirates", "NEAR EAST", 2602713, 82880, 31.4, 1.59, 1.03, 14.51, 23200, 77.9, 475.3, 18.96, 4.4);
|
||||
yield return new Country("United Kingdom", "WESTERN EUROPE", 60609153, 244820, 247.6, 5.08, 2.19, 5.16, 27700, 99, 543.5, 10.71, 10.13);
|
||||
yield return new Country("United States", "NORTHERN AMERICA", 298444215, 9631420, 31, 0.21, 3.41, 6.5, 37800, 97, 898, 14.14, 8.26);
|
||||
yield return new Country("Uruguay", "LATIN AMER. & CARIB", 3431932, 176220, 19.5, 0.37, -0.32, 11.95, 12800, 98, 291.4, 13.91, 9.05);
|
||||
yield return new Country("Uzbekistan", "C.W. OF IND. STATES", 27307134, 447400, 61, 0, -1.72, 71.1, 1700, 99.3, 62.9, 26.36, 7.84);
|
||||
yield return new Country("Vanuatu", "OCEANIA", 208869, 12200, 17.1, 20.72, 0, 55.16, 2900, 53, 32.6, 22.72, 7.82);
|
||||
yield return new Country("Venezuela", "LATIN AMER. & CARIB", 25730435, 912050, 28.2, 0.31, -0.04, 22.2, 4800, 93.4, 140.1, 18.71, 4.92);
|
||||
yield return new Country("Vietnam", "ASIA (EX. NEAR EAST)", 84402966, 329560, 256.1, 1.05, -0.45, 25.95, 2500, 90.3, 187.7, 16.86, 6.22);
|
||||
yield return new Country("Virgin Islands", "LATIN AMER. & CARIB", 108605, 1910, 56.9, 9.84, -8.94, 8.03, 17200,null, 652.8, 13.96, 6.43);
|
||||
yield return new Country("Wallis and Futuna", "OCEANIA", 16025, 274, 58.5, 47.08,null,null, 3700, 50, 118.6,null,null);
|
||||
yield return new Country("West Bank", "NEAR EAST", 2460492, 5860, 419.9, 0, 2.98, 19.62, 800,null, 145.2, 31.67, 3.92);
|
||||
yield return new Country("Yemen", "NEAR EAST", 21456188, 527970, 40.6, 0.36, 0, 61.5, 800, 50.2, 37.2, 42.89, 8.3);
|
||||
yield return new Country("Zambia", "SUB-SAHARAN AFRICA", 11502010, 752614, 15.3, 0, 0, 88.29, 800, 80.6, 8.2, 41, 19.93);
|
||||
yield return new Country("Zimbabwe", "SUB-SAHARAN AFRICA", 12236805, 390580, 31.3, 0, 0, 67.69, 1900, 90.7, 26.8, 28.01, 21.84);
|
||||
}
|
||||
|
||||
static IReadOnlyList<Country>? _all;
|
||||
|
||||
public static IReadOnlyList<Country> All
|
||||
{
|
||||
get
|
||||
{
|
||||
if(_all == null)
|
||||
{
|
||||
_all = GetCountries().ToList().AsReadOnly();
|
||||
}
|
||||
|
||||
return _all;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class Country
|
||||
{
|
||||
public string Name { get; private set; }
|
||||
public string Region { get; private set; }
|
||||
public int Population { get; private set; }
|
||||
//Square Miles
|
||||
public int Area { get; private set; }
|
||||
//Per Square Mile
|
||||
public double PopulationDensity { get; private set; }
|
||||
//Coast / Area
|
||||
public double CoastLine { get; private set; }
|
||||
public double? NetMigration { get; private set; }
|
||||
//per 1000 births
|
||||
public double? InfantMortality { get; private set; }
|
||||
public int GDP { get; private set; }
|
||||
public double? LiteracyPercent { get; private set; }
|
||||
//per 1000
|
||||
public double? Phones { get; private set; }
|
||||
public double? BirthRate { get; private set; }
|
||||
public double? DeathRate { get; private set; }
|
||||
|
||||
public Country(string name, string region, int population, int area, double density, double coast, double? migration,
|
||||
double? infantMorality, int gdp, double? literacy, double? phones, double? birth, double? death)
|
||||
{
|
||||
Name = name;
|
||||
Region = region;
|
||||
Population = population;
|
||||
Area = area;
|
||||
PopulationDensity = density;
|
||||
CoastLine = coast;
|
||||
NetMigration = migration;
|
||||
InfantMortality = infantMorality;
|
||||
GDP = gdp;
|
||||
LiteracyPercent = literacy;
|
||||
BirthRate = birth;
|
||||
DeathRate = death;
|
||||
DataContext = new DataGridDemoViewModel();
|
||||
}
|
||||
}
|
@ -9,9 +9,21 @@
|
||||
mc:Ignorable="d">
|
||||
<StackPanel Spacing="20">
|
||||
<DatePicker />
|
||||
<DatePicker Classes="ClearButton" />
|
||||
<DatePicker DayFormat="d (ddd)" YearVisible="False" />
|
||||
<DatePicker IsEnabled="False" />
|
||||
<DatePicker Classes="Large" />
|
||||
<DatePicker Classes="Small" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<DatePicker Classes="Large" />
|
||||
<DatePicker />
|
||||
<DatePicker Classes="Small" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<DatePicker IsEnabled="False" />
|
||||
<DatePicker Classes="Bordered" />
|
||||
<DatePicker Classes="Bordered" IsEnabled="False" />
|
||||
</StackPanel>
|
||||
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
@ -36,4 +36,4 @@
|
||||
</Expander>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
@ -10,6 +10,7 @@
|
||||
<UserControl.Styles>
|
||||
<Style Selector="Button">
|
||||
<Setter Property="Margin" Value="8" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
</Style>
|
||||
</UserControl.Styles>
|
||||
<Grid
|
||||
@ -129,22 +130,22 @@
|
||||
<Button.Flyout>
|
||||
<Flyout FlyoutPresenterTheme="{StaticResource LightFlyout}" Placement="Top">
|
||||
<StackPanel>
|
||||
<Label Classes="Amber" Theme="{StaticResource TagLabel}">Amber</Label>
|
||||
<Label Classes="Blue" Theme="{StaticResource TagLabel}">Blue</Label>
|
||||
<Label Classes="Cyan" Theme="{StaticResource TagLabel}">Cyan</Label>
|
||||
<Label Classes="Green" Theme="{StaticResource TagLabel}">Green</Label>
|
||||
<Label Classes="Grey" Theme="{StaticResource TagLabel}">Grey</Label>
|
||||
<Label Classes="Indigo" Theme="{StaticResource TagLabel}">Indigo</Label>
|
||||
<Label Classes="LightBlue" Theme="{StaticResource TagLabel}">LightBlue</Label>
|
||||
<Label Classes="LightGreen" Theme="{StaticResource TagLabel}">LightGreen</Label>
|
||||
<Label Classes="Lime" Theme="{StaticResource TagLabel}">Lime</Label>
|
||||
<Label Classes="Orange" Theme="{StaticResource TagLabel}">Orange</Label>
|
||||
<Label Classes="Red" Theme="{StaticResource TagLabel}">Red</Label>
|
||||
<Label Classes="Pink" Theme="{StaticResource TagLabel}">Pink</Label>
|
||||
<Label Classes="Purple" Theme="{StaticResource TagLabel}">Purple</Label>
|
||||
<Label Classes="Red" Theme="{StaticResource TagLabel}">Red</Label>
|
||||
<Label Classes="Teal" Theme="{StaticResource TagLabel}">Teal</Label>
|
||||
<Label Classes="Violet" Theme="{StaticResource TagLabel}">Violet</Label>
|
||||
<Label Classes="Indigo" Theme="{StaticResource TagLabel}">Indigo</Label>
|
||||
<Label Classes="Blue" Theme="{StaticResource TagLabel}">Blue</Label>
|
||||
<Label Classes="LightBlue" Theme="{StaticResource TagLabel}">LightBlue</Label>
|
||||
<Label Classes="Cyan" Theme="{StaticResource TagLabel}">Cyan</Label>
|
||||
<Label Classes="Teal" Theme="{StaticResource TagLabel}">Teal</Label>
|
||||
<Label Classes="Green" Theme="{StaticResource TagLabel}">Green</Label>
|
||||
<Label Classes="LightGreen" Theme="{StaticResource TagLabel}">LightGreen</Label>
|
||||
<Label Classes="Lime" Theme="{StaticResource TagLabel}">Lime</Label>
|
||||
<Label Classes="Yellow" Theme="{StaticResource TagLabel}">Yellow</Label>
|
||||
<Label Classes="Amber" Theme="{StaticResource TagLabel}">Amber</Label>
|
||||
<Label Classes="Orange" Theme="{StaticResource TagLabel}">Orange</Label>
|
||||
<Label Classes="Grey" Theme="{StaticResource TagLabel}">Grey</Label>
|
||||
<Label Classes="White" Theme="{StaticResource TagLabel}">White</Label>
|
||||
</StackPanel>
|
||||
</Flyout>
|
||||
|
@ -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 SemiYellow3Color}"
|
||||
CornerRadius="10" />
|
||||
<GridSplitter Grid.Row="1" ShowsPreview="True" />
|
||||
<Border
|
||||
Grid.Row="2"
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="#FEFBCB"
|
||||
Background="{DynamicResource SemiYellow3Color}"
|
||||
CornerRadius="10" />
|
||||
</Grid>
|
||||
<Grid
|
||||
@ -29,13 +29,13 @@
|
||||
ColumnDefinitions="*, Auto, *">
|
||||
<Border
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="#FEFBCB"
|
||||
Background="{DynamicResource SemiYellow3Color}"
|
||||
CornerRadius="10" />
|
||||
<GridSplitter Grid.Column="1" ShowsPreview="True" />
|
||||
<Border
|
||||
Grid.Column="2"
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="#FEFBCB"
|
||||
Background="{DynamicResource SemiYellow3Color}"
|
||||
CornerRadius="10" />
|
||||
</Grid>
|
||||
</StackPanel>
|
@ -1,12 +1,11 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Android.Views;
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class MainView : UserControl
|
||||
public partial class GridSplitterDemo : UserControl
|
||||
{
|
||||
public MainView()
|
||||
public GridSplitterDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
<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"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="1450"
|
||||
x:Class="Semi.Avalonia.Demo.Pages.HeaderedContentControlDemo">
|
||||
<ScrollViewer>
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
||||
<TextBlock>Default Theme</TextBlock>
|
||||
<WrapPanel ItemWidth="400">
|
||||
<HeaderedContentControl
|
||||
Header="This is the text header!"
|
||||
BorderBrush="Gray"
|
||||
BorderThickness="1"
|
||||
CornerRadius="4">
|
||||
<TextBlock Text="Some content" />
|
||||
</HeaderedContentControl>
|
||||
<HeaderedContentControl Header="This is the image header!">
|
||||
<Image Source="/Assets/WORLD.png" />
|
||||
</HeaderedContentControl>
|
||||
<HeaderedContentControl>
|
||||
<HeaderedContentControl.Header>
|
||||
<Image Source="/Assets/WORLD.png" />
|
||||
</HeaderedContentControl.Header>
|
||||
<TextBlock Text="This is the content. But the header can also be non textual" />
|
||||
</HeaderedContentControl>
|
||||
</WrapPanel>
|
||||
<TextBlock>GroupBox Theme</TextBlock>
|
||||
<HeaderedContentControl
|
||||
Theme="{DynamicResource GroupBox}"
|
||||
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>
|
||||
</UserControl>
|
@ -0,0 +1,11 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class HeaderedContentControlDemo : UserControl
|
||||
{
|
||||
public HeaderedContentControlDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
29
demo/Semi.Avalonia.Demo/Pages/HyperlinkButtonDemo.axaml
Normal file
29
demo/Semi.Avalonia.Demo/Pages/HyperlinkButtonDemo.axaml
Normal file
@ -0,0 +1,29 @@
|
||||
<UserControl
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d"
|
||||
x:Class="Semi.Avalonia.Demo.Pages.HyperlinkButtonDemo"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
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 Classes="OnlyIcon" NavigateUri="https://www.irihi.tech/" />
|
||||
<HyperlinkButton Classes="OnlyIcon" NavigateUri="https://www.irihi.tech/" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
14
demo/Semi.Avalonia.Demo/Pages/HyperlinkButtonDemo.axaml.cs
Normal file
14
demo/Semi.Avalonia.Demo/Pages/HyperlinkButtonDemo.axaml.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class HyperlinkButtonDemo : UserControl
|
||||
{
|
||||
public HyperlinkButtonDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
@ -4,80 +4,221 @@
|
||||
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">
|
||||
<StackPanel
|
||||
Width="500"
|
||||
HorizontalAlignment="Left"
|
||||
Spacing="20">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="Label">
|
||||
<Setter Property="Margin" Value="4" />
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<WrapPanel>
|
||||
<Label Theme="{StaticResource TagLabel}">Label</Label>
|
||||
<Label Classes="Large" Theme="{StaticResource TagLabel}">Large Label</Label>
|
||||
<Label Classes="Circle" Theme="{StaticResource TagLabel}">Circle Label</Label>
|
||||
<Label Classes="Large Circle" Theme="{StaticResource TagLabel}">Large Circle Label</Label>
|
||||
</WrapPanel>
|
||||
<WrapPanel>
|
||||
<Label Classes="Amber" Theme="{StaticResource TagLabel}">Amber</Label>
|
||||
<Label Classes="Blue" Theme="{StaticResource TagLabel}">Blue</Label>
|
||||
<Label Classes="Cyan" Theme="{StaticResource TagLabel}">Cyan</Label>
|
||||
<Label Classes="Green" Theme="{StaticResource TagLabel}">Green</Label>
|
||||
<Label Classes="Grey" Theme="{StaticResource TagLabel}">Grey</Label>
|
||||
<Label Classes="Indigo" Theme="{StaticResource TagLabel}">Indigo</Label>
|
||||
<Label Classes="LightBlue" Theme="{StaticResource TagLabel}">LightBlue</Label>
|
||||
<Label Classes="LightGreen" Theme="{StaticResource TagLabel}">LightGreen</Label>
|
||||
<Label Classes="Lime" Theme="{StaticResource TagLabel}">Lime</Label>
|
||||
<Label Classes="Orange" Theme="{StaticResource TagLabel}">Orange</Label>
|
||||
<Label Classes="Pink" Theme="{StaticResource TagLabel}">Pink</Label>
|
||||
<Label Classes="Purple" Theme="{StaticResource TagLabel}">Purple</Label>
|
||||
<Label Classes="Red" Theme="{StaticResource TagLabel}">Red</Label>
|
||||
<Label Classes="Teal" Theme="{StaticResource TagLabel}">Teal</Label>
|
||||
<Label Classes="Violet" Theme="{StaticResource TagLabel}">Violet</Label>
|
||||
<Label Classes="Yellow" Theme="{StaticResource TagLabel}">Yellow</Label>
|
||||
<Label Classes="White" Theme="{StaticResource TagLabel}">White</Label>
|
||||
</WrapPanel>
|
||||
<WrapPanel>
|
||||
<Label Classes="Ghost Amber" Theme="{StaticResource TagLabel}">Amber</Label>
|
||||
<Label Classes="Ghost Blue" Theme="{StaticResource TagLabel}">Blue</Label>
|
||||
<Label Classes="Ghost Cyan" Theme="{StaticResource TagLabel}">Cyan</Label>
|
||||
<Label Classes="Ghost Green" Theme="{StaticResource TagLabel}">Green</Label>
|
||||
<Label Classes="Ghost Grey" Theme="{StaticResource TagLabel}">Grey</Label>
|
||||
<Label Classes="Ghost Indigo" Theme="{StaticResource TagLabel}">Indigo</Label>
|
||||
<Label Classes="Ghost LightBlue" Theme="{StaticResource TagLabel}">LightBlue</Label>
|
||||
<Label Classes="Ghost LightGreen" Theme="{StaticResource TagLabel}">LightGreen</Label>
|
||||
<Label Classes="Ghost Lime" Theme="{StaticResource TagLabel}">Lime</Label>
|
||||
<Label Classes="Ghost Orange" Theme="{StaticResource TagLabel}">Orange</Label>
|
||||
<Label Classes="Ghost Pink" Theme="{StaticResource TagLabel}">Pink</Label>
|
||||
<Label Classes="Ghost Purple" Theme="{StaticResource TagLabel}">Purple</Label>
|
||||
<Label Classes="Ghost Red" Theme="{StaticResource TagLabel}">Red</Label>
|
||||
<Label Classes="Ghost Teal" Theme="{StaticResource TagLabel}">Teal</Label>
|
||||
<Label Classes="Ghost Violet" Theme="{StaticResource TagLabel}">Violet</Label>
|
||||
<Label Classes="Ghost Yellow" Theme="{StaticResource TagLabel}">Yellow</Label>
|
||||
<Label Classes="Ghost White" Theme="{StaticResource TagLabel}">White</Label>
|
||||
</WrapPanel>
|
||||
<WrapPanel>
|
||||
<Label Classes="Solid Amber" Theme="{StaticResource TagLabel}">Amber</Label>
|
||||
<Label Classes="Solid Blue" Theme="{StaticResource TagLabel}">Blue</Label>
|
||||
<Label Classes="Solid Cyan" Theme="{StaticResource TagLabel}">Cyan</Label>
|
||||
<Label Classes="Solid Green" Theme="{StaticResource TagLabel}">Green</Label>
|
||||
<Label Classes="Solid Grey" Theme="{StaticResource TagLabel}">Grey</Label>
|
||||
<Label Classes="Solid Indigo" Theme="{StaticResource TagLabel}">Indigo</Label>
|
||||
<Label Classes="Solid LightBlue" Theme="{StaticResource TagLabel}">LightBlue</Label>
|
||||
<Label Classes="Solid LightGreen" Theme="{StaticResource TagLabel}">LightGreen</Label>
|
||||
<Label Classes="Solid Lime" Theme="{StaticResource TagLabel}">Lime</Label>
|
||||
<Label Classes="Solid Orange" Theme="{StaticResource TagLabel}">Orange</Label>
|
||||
<Label Classes="Solid Pink" Theme="{StaticResource TagLabel}">Pink</Label>
|
||||
<Label Classes="Solid Purple" Theme="{StaticResource TagLabel}">Purple</Label>
|
||||
<Label Classes="Solid Red" Theme="{StaticResource TagLabel}">Red</Label>
|
||||
<Label Classes="Solid Teal" Theme="{StaticResource TagLabel}">Teal</Label>
|
||||
<Label Classes="Solid Violet" Theme="{StaticResource TagLabel}">Violet</Label>
|
||||
<Label Classes="Solid Yellow" Theme="{StaticResource TagLabel}">Yellow</Label>
|
||||
<Label Classes="Solid White" Theme="{StaticResource TagLabel}">White</Label>
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
<ScrollViewer>
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
||||
<StackPanel.Styles>
|
||||
<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">
|
||||
<HeaderedContentControl
|
||||
Width="400"
|
||||
Height="400"
|
||||
Margin="16"
|
||||
VerticalAlignment="Top"
|
||||
Header="Default Theme"
|
||||
Theme="{DynamicResource GroupBox}">
|
||||
<Grid
|
||||
VerticalAlignment="Top"
|
||||
ColumnDefinitions="Auto, *"
|
||||
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="2"
|
||||
Grid.Column="1"
|
||||
Classes="Secondary">
|
||||
Secondary
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Classes="Tertiary">
|
||||
Tertiary
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="4"
|
||||
Grid.Column="1"
|
||||
Classes="Quaternary">
|
||||
Quaternary
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="5"
|
||||
Grid.Column="1"
|
||||
Classes="Success">
|
||||
Success
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="6"
|
||||
Grid.Column="1"
|
||||
Classes="Warning">
|
||||
Warning
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="7"
|
||||
Grid.Column="1"
|
||||
Classes="Danger">
|
||||
Danger
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="8"
|
||||
Grid.Column="1"
|
||||
Classes="Mark">
|
||||
Default Mark
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="9"
|
||||
Grid.Column="1"
|
||||
Classes="Code">
|
||||
Code
|
||||
</Label>
|
||||
</Grid>
|
||||
</HeaderedContentControl>
|
||||
<HeaderedContentControl
|
||||
Width="400"
|
||||
Height="400"
|
||||
Margin="16"
|
||||
VerticalAlignment="Top"
|
||||
Header="Theme: TitleLabel"
|
||||
Theme="{DynamicResource GroupBox}">
|
||||
<Grid
|
||||
VerticalAlignment="Top"
|
||||
ColumnDefinitions="Auto, *"
|
||||
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="1"
|
||||
Grid.Column="1"
|
||||
Classes="H1"
|
||||
Theme="{StaticResource TitleLabel}">
|
||||
Header 1
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Classes="H2"
|
||||
Theme="{StaticResource TitleLabel}">
|
||||
Header 2
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Classes="H3"
|
||||
Theme="{StaticResource TitleLabel}">
|
||||
Header 3
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="4"
|
||||
Grid.Column="1"
|
||||
Classes="H4"
|
||||
Theme="{StaticResource TitleLabel}">
|
||||
Header 4
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="5"
|
||||
Grid.Column="1"
|
||||
Classes="H5"
|
||||
Theme="{StaticResource TitleLabel}">
|
||||
Header 5
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="6"
|
||||
Grid.Column="1"
|
||||
Classes="H6"
|
||||
Theme="{StaticResource TitleLabel}">
|
||||
Header 6
|
||||
</Label>
|
||||
</Grid>
|
||||
</HeaderedContentControl>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
<WrapPanel>
|
||||
<Label Theme="{StaticResource TagLabel}">Label</Label>
|
||||
<Label Classes="Large" Theme="{StaticResource TagLabel}">Large Label</Label>
|
||||
<Label Classes="Circle" Theme="{StaticResource TagLabel}">Circle Label</Label>
|
||||
<Label Classes="Large Circle" Theme="{StaticResource TagLabel}">Large Circle Label</Label>
|
||||
</WrapPanel>
|
||||
<WrapPanel>
|
||||
<Label Classes="Red" Theme="{StaticResource TagLabel}">Red</Label>
|
||||
<Label Classes="Pink" Theme="{StaticResource TagLabel}">Pink</Label>
|
||||
<Label Classes="Purple" Theme="{StaticResource TagLabel}">Purple</Label>
|
||||
<Label Classes="Violet" Theme="{StaticResource TagLabel}">Violet</Label>
|
||||
<Label Classes="Indigo" Theme="{StaticResource TagLabel}">Indigo</Label>
|
||||
<Label Classes="Blue" Theme="{StaticResource TagLabel}">Blue</Label>
|
||||
<Label Classes="LightBlue" Theme="{StaticResource TagLabel}">LightBlue</Label>
|
||||
<Label Classes="Cyan" Theme="{StaticResource TagLabel}">Cyan</Label>
|
||||
<Label Classes="Teal" Theme="{StaticResource TagLabel}">Teal</Label>
|
||||
<Label Classes="Green" Theme="{StaticResource TagLabel}">Green</Label>
|
||||
<Label Classes="LightGreen" Theme="{StaticResource TagLabel}">LightGreen</Label>
|
||||
<Label Classes="Lime" Theme="{StaticResource TagLabel}">Lime</Label>
|
||||
<Label Classes="Yellow" Theme="{StaticResource TagLabel}">Yellow</Label>
|
||||
<Label Classes="Amber" Theme="{StaticResource TagLabel}">Amber</Label>
|
||||
<Label Classes="Orange" Theme="{StaticResource TagLabel}">Orange</Label>
|
||||
<Label Classes="Grey" Theme="{StaticResource TagLabel}">Grey</Label>
|
||||
<Label Classes="White" Theme="{StaticResource TagLabel}">White</Label>
|
||||
</WrapPanel>
|
||||
<WrapPanel>
|
||||
<Label Classes="Ghost Red" Theme="{StaticResource TagLabel}">Red</Label>
|
||||
<Label Classes="Ghost Pink" Theme="{StaticResource TagLabel}">Pink</Label>
|
||||
<Label Classes="Ghost Purple" Theme="{StaticResource TagLabel}">Purple</Label>
|
||||
<Label Classes="Ghost Violet" Theme="{StaticResource TagLabel}">Violet</Label>
|
||||
<Label Classes="Ghost Indigo" Theme="{StaticResource TagLabel}">Indigo</Label>
|
||||
<Label Classes="Ghost Blue" Theme="{StaticResource TagLabel}">Blue</Label>
|
||||
<Label Classes="Ghost LightBlue" Theme="{StaticResource TagLabel}">LightBlue</Label>
|
||||
<Label Classes="Ghost Cyan" Theme="{StaticResource TagLabel}">Cyan</Label>
|
||||
<Label Classes="Ghost Teal" Theme="{StaticResource TagLabel}">Teal</Label>
|
||||
<Label Classes="Ghost Green" Theme="{StaticResource TagLabel}">Green</Label>
|
||||
<Label Classes="Ghost LightGreen" Theme="{StaticResource TagLabel}">LightGreen</Label>
|
||||
<Label Classes="Ghost Lime" Theme="{StaticResource TagLabel}">Lime</Label>
|
||||
<Label Classes="Ghost Yellow" Theme="{StaticResource TagLabel}">Yellow</Label>
|
||||
<Label Classes="Ghost Amber" Theme="{StaticResource TagLabel}">Amber</Label>
|
||||
<Label Classes="Ghost Orange" Theme="{StaticResource TagLabel}">Orange</Label>
|
||||
<Label Classes="Ghost Grey" Theme="{StaticResource TagLabel}">Grey</Label>
|
||||
<Label Classes="Ghost White" Theme="{StaticResource TagLabel}">White</Label>
|
||||
</WrapPanel>
|
||||
<WrapPanel>
|
||||
<Label Classes="Solid Red" Theme="{StaticResource TagLabel}">Red</Label>
|
||||
<Label Classes="Solid Pink" Theme="{StaticResource TagLabel}">Pink</Label>
|
||||
<Label Classes="Solid Purple" Theme="{StaticResource TagLabel}">Purple</Label>
|
||||
<Label Classes="Solid Violet" Theme="{StaticResource TagLabel}">Violet</Label>
|
||||
<Label Classes="Solid Indigo" Theme="{StaticResource TagLabel}">Indigo</Label>
|
||||
<Label Classes="Solid Blue" Theme="{StaticResource TagLabel}">Blue</Label>
|
||||
<Label Classes="Solid LightBlue" Theme="{StaticResource TagLabel}">LightBlue</Label>
|
||||
<Label Classes="Solid Cyan" Theme="{StaticResource TagLabel}">Cyan</Label>
|
||||
<Label Classes="Solid Teal" Theme="{StaticResource TagLabel}">Teal</Label>
|
||||
<Label Classes="Solid Green" Theme="{StaticResource TagLabel}">Green</Label>
|
||||
<Label Classes="Solid LightGreen" Theme="{StaticResource TagLabel}">LightGreen</Label>
|
||||
<Label Classes="Solid Lime" Theme="{StaticResource TagLabel}">Lime</Label>
|
||||
<Label Classes="Solid Yellow" Theme="{StaticResource TagLabel}">Yellow</Label>
|
||||
<Label Classes="Solid Amber" Theme="{StaticResource TagLabel}">Amber</Label>
|
||||
<Label Classes="Solid Orange" Theme="{StaticResource TagLabel}">Orange</Label>
|
||||
<Label Classes="Solid Grey" Theme="{StaticResource TagLabel}">Grey</Label>
|
||||
<Label Classes="Solid White" Theme="{StaticResource TagLabel}">White</Label>
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
|
@ -4,22 +4,145 @@
|
||||
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"
|
||||
xmlns:local="clr-namespace:Semi.Avalonia.Demo.Pages"
|
||||
d:DesignHeight="900"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<ListBox>
|
||||
<ListBoxItem>Item 1</ListBoxItem>
|
||||
<ListBoxItem>Item 2</ListBoxItem>
|
||||
<ListBoxItem IsEnabled="False">Item 3</ListBoxItem>
|
||||
<ListBoxItem>Item 4</ListBoxItem>
|
||||
<ListBoxItem>Item 5</ListBoxItem>
|
||||
<ListBoxItem>Item 6</ListBoxItem>
|
||||
<ListBoxItem>Item 7</ListBoxItem>
|
||||
<ListBoxItem IsEnabled="False">Item 8</ListBoxItem>
|
||||
<ListBoxItem>Item 9</ListBoxItem>
|
||||
<ListBoxItem>Item 10</ListBoxItem>
|
||||
<ListBoxItem>Item 11</ListBoxItem>
|
||||
<ListBoxItem>Item 12</ListBoxItem>
|
||||
<ListBoxItem>Item 13</ListBoxItem>
|
||||
</ListBox>
|
||||
</UserControl>
|
||||
<ScrollViewer>
|
||||
<Grid ColumnDefinitions="*,*,*">
|
||||
<HeaderedContentControl
|
||||
Grid.Column="0"
|
||||
Theme="{StaticResource GroupBox}"
|
||||
Header="Default">
|
||||
<ScrollViewer>
|
||||
<StackPanel Spacing="20">
|
||||
<TextBlock Text="Theme: Default"/>
|
||||
<ListBox ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
|
||||
<ListBox IsEnabled="False">
|
||||
<ListBoxItem IsSelected="True">Avalonia</ListBoxItem>
|
||||
<ListBoxItem>WPF</ListBoxItem>
|
||||
</ListBox>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</HeaderedContentControl>
|
||||
|
||||
<HeaderedContentControl
|
||||
Grid.Column="1"
|
||||
Theme="{DynamicResource GroupBox}"
|
||||
Header="RadioGroupListBox">
|
||||
<StackPanel Spacing="20">
|
||||
<TextBlock Text="Theme: RadioGroupListBox"/>
|
||||
<ListBox
|
||||
Theme="{DynamicResource RadioGroupListBox}"
|
||||
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
|
||||
<ListBox Theme="{DynamicResource RadioGroupListBox}" IsEnabled="False">
|
||||
<ListBoxItem>Avalonia</ListBoxItem>
|
||||
<ListBoxItem IsSelected="True">WPF</ListBoxItem>
|
||||
</ListBox>
|
||||
|
||||
<TextBlock Text="Theme: ButtonRadioGroupListBox"/>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Border HorizontalAlignment="Left" Theme="{StaticResource RadioButtonGroupBorder}">
|
||||
<ListBox Theme="{DynamicResource ButtonRadioGroupListBox}">
|
||||
<ListBoxItem Classes="Small" IsSelected="True">Small 1</ListBoxItem>
|
||||
<ListBoxItem Classes="Small">Small 2</ListBoxItem>
|
||||
</ListBox>
|
||||
</Border>
|
||||
<Border
|
||||
Margin="8,0"
|
||||
HorizontalAlignment="Left"
|
||||
Theme="{StaticResource RadioButtonGroupBorder}">
|
||||
<ListBox Theme="{DynamicResource ButtonRadioGroupListBox}" IsEnabled="False">
|
||||
<ListBoxItem Classes="Small" IsSelected="True">Small 1</ListBoxItem>
|
||||
<ListBoxItem Classes="Small">Small 2</ListBoxItem>
|
||||
</ListBox>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Border HorizontalAlignment="Left" Theme="{StaticResource RadioButtonGroupBorder}">
|
||||
<ListBox Theme="{DynamicResource ButtonRadioGroupListBox}">
|
||||
<ListBoxItem IsSelected="True">Default 1</ListBoxItem>
|
||||
<ListBoxItem>Default 2</ListBoxItem>
|
||||
</ListBox>
|
||||
</Border>
|
||||
<Border
|
||||
Margin="8,0"
|
||||
HorizontalAlignment="Left"
|
||||
Theme="{StaticResource RadioButtonGroupBorder}">
|
||||
<ListBox Theme="{DynamicResource ButtonRadioGroupListBox}" IsEnabled="False">
|
||||
<ListBoxItem IsSelected="True">Default 1</ListBoxItem>
|
||||
<ListBoxItem>Default 2</ListBoxItem>
|
||||
</ListBox>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Border HorizontalAlignment="Left" Theme="{StaticResource RadioButtonGroupBorder}">
|
||||
<ListBox Theme="{DynamicResource ButtonRadioGroupListBox}">
|
||||
<ListBoxItem Classes="Large" IsSelected="True">Large 1</ListBoxItem>
|
||||
<ListBoxItem Classes="Large">Large 2</ListBoxItem>
|
||||
</ListBox>
|
||||
</Border>
|
||||
<Border
|
||||
Margin="8,0"
|
||||
HorizontalAlignment="Left"
|
||||
Theme="{StaticResource RadioButtonGroupBorder}">
|
||||
<ListBox Theme="{DynamicResource ButtonRadioGroupListBox}" IsEnabled="False">
|
||||
<ListBoxItem Classes="Large" IsSelected="True">Large 1</ListBoxItem>
|
||||
<ListBoxItem Classes="Large">Large 2</ListBoxItem>
|
||||
</ListBox>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Text="Theme: CardRadioGroupListBox"/>
|
||||
<ListBox Theme="{DynamicResource CardRadioGroupListBox}"
|
||||
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
|
||||
<ListBox Theme="{DynamicResource CardRadioGroupListBox}" IsEnabled="False">
|
||||
<ListBoxItem IsSelected="True">Avalonia</ListBoxItem>
|
||||
<ListBoxItem>WPF</ListBoxItem>
|
||||
</ListBox>
|
||||
|
||||
<TextBlock Text="Theme: PureCardRadioGroupListBox"/>
|
||||
<ListBox Theme="{DynamicResource PureCardRadioGroupListBox}"
|
||||
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
|
||||
<ListBox Theme="{DynamicResource PureCardRadioGroupListBox}" IsEnabled="False">
|
||||
<ListBoxItem>Avalonia</ListBoxItem>
|
||||
<ListBoxItem IsSelected="True">WPF</ListBoxItem>
|
||||
</ListBox>
|
||||
</StackPanel>
|
||||
</HeaderedContentControl>
|
||||
|
||||
<HeaderedContentControl
|
||||
Grid.Column="2"
|
||||
Theme="{DynamicResource GroupBox}"
|
||||
Header="CheckGroupListBox">
|
||||
<ScrollViewer>
|
||||
<StackPanel Spacing="20">
|
||||
<TextBlock Text="Theme: CheckGroupListBox"/>
|
||||
<ListBox
|
||||
SelectionMode="Multiple"
|
||||
Theme="{DynamicResource CheckGroupListBox}"
|
||||
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
|
||||
<ListBox Theme="{DynamicResource CheckGroupListBox}"
|
||||
SelectionMode="Multiple"
|
||||
IsEnabled="False">
|
||||
<ListBoxItem IsSelected="True">Avalonia</ListBoxItem>
|
||||
<ListBoxItem>WPF</ListBoxItem>
|
||||
</ListBox>
|
||||
|
||||
<TextBlock Text="Theme: CardCheckGroupListBox"/>
|
||||
<ListBox
|
||||
SelectionMode="Multiple"
|
||||
Theme="{DynamicResource CardCheckGroupListBox}"
|
||||
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
|
||||
<ListBox Theme="{DynamicResource CardCheckGroupListBox}"
|
||||
SelectionMode="Multiple"
|
||||
IsEnabled="False">
|
||||
<ListBoxItem>Avalonia</ListBoxItem>
|
||||
<ListBoxItem IsSelected="True">WPF</ListBoxItem>
|
||||
</ListBox>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</HeaderedContentControl>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
@ -1,6 +1,6 @@
|
||||
using Avalonia;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
@ -10,4 +10,6 @@ public partial class ListBoxDemo : UserControl
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public IEnumerable Items { get; set; } = new List<string> { "Ding", "Otter", "Husky", "Mr.17", "Cass", };
|
||||
}
|
@ -8,8 +8,13 @@
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="10">
|
||||
<Button Name="openFileDialog">Open File</Button>
|
||||
<Button Name="selectFolderDialog">Select Folder</Button>
|
||||
<Button Name="saveFileDialog">Save File</Button>
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="Button">
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<Button Name="OpenFileButton" Content="Open File" />
|
||||
<Button Name="SelectFolderButton" Content="Select Folder" />
|
||||
<Button Name="SaveFileButton" Content="Save File" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
@ -1,10 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Dialogs;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.Platform.Storage;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
@ -14,14 +10,14 @@ public partial class ManagedFileChooserDemo : UserControl
|
||||
public ManagedFileChooserDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
openFileDialog.Click += OpenFileDialog;
|
||||
selectFolderDialog.Click += SelectFolderDialog;
|
||||
saveFileDialog.Click += SaveFileDialog;
|
||||
OpenFileButton.Click += OpenFileDialog;
|
||||
SelectFolderButton.Click += SelectFolderDialog;
|
||||
SaveFileButton.Click += SaveFileDialog;
|
||||
}
|
||||
|
||||
private async void OpenFileDialog(object sender, RoutedEventArgs args)
|
||||
private async void OpenFileDialog(object? sender, RoutedEventArgs args)
|
||||
{
|
||||
IStorageProvider? sp = GetStorageProvider();
|
||||
var sp = GetStorageProvider();
|
||||
if (sp is null) return;
|
||||
var result = await sp.OpenFilePickerAsync(new FilePickerOpenOptions()
|
||||
{
|
||||
@ -30,9 +26,10 @@ public partial class ManagedFileChooserDemo : UserControl
|
||||
AllowMultiple = true,
|
||||
});
|
||||
}
|
||||
private async void SelectFolderDialog(object sender, RoutedEventArgs args)
|
||||
|
||||
private async void SelectFolderDialog(object? sender, RoutedEventArgs args)
|
||||
{
|
||||
IStorageProvider? sp = GetStorageProvider();
|
||||
var sp = GetStorageProvider();
|
||||
if (sp is null) return;
|
||||
var result = await sp.OpenFolderPickerAsync(new FolderPickerOpenOptions()
|
||||
{
|
||||
@ -40,16 +37,17 @@ public partial class ManagedFileChooserDemo : UserControl
|
||||
AllowMultiple = true,
|
||||
});
|
||||
}
|
||||
private async void SaveFileDialog(object sender, RoutedEventArgs args)
|
||||
|
||||
private async void SaveFileDialog(object? sender, RoutedEventArgs args)
|
||||
{
|
||||
IStorageProvider? sp = GetStorageProvider();
|
||||
var sp = GetStorageProvider();
|
||||
if (sp is null) return;
|
||||
var result = await sp.SaveFilePickerAsync(new FilePickerSaveOptions()
|
||||
{
|
||||
Title = "Open File",
|
||||
Title = "Save File",
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private IStorageProvider? GetStorageProvider()
|
||||
{
|
||||
var topLevel = TopLevel.GetTopLevel(this);
|
||||
@ -58,10 +56,10 @@ public partial class ManagedFileChooserDemo : UserControl
|
||||
|
||||
List<FilePickerFileType>? GetFileTypes()
|
||||
{
|
||||
return new List<FilePickerFileType>
|
||||
{
|
||||
return
|
||||
[
|
||||
FilePickerFileTypes.All,
|
||||
FilePickerFileTypes.TextPlain
|
||||
};
|
||||
];
|
||||
}
|
||||
}
|
@ -25,14 +25,30 @@
|
||||
<MenuItem Header="Submenu Level 2" />
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Menu Item with _Checkbox">
|
||||
<MenuItem Header="Menu Item with _Icon">
|
||||
<MenuItem.Icon>
|
||||
<TextBlock>😊</TextBlock>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Menu Item with _Checkbox" ToggleType="CheckBox" />
|
||||
</MenuItem>
|
||||
<MenuItem Header="_Second">
|
||||
<MenuItem Header="Second _Menu Item" />
|
||||
<MenuItem IsChecked="True" Header="Second Menu toggle item" ToggleType="CheckBox" />
|
||||
<Separator />
|
||||
<MenuItem GroupName="A" Header="Radio 1 - group" ToggleType="Radio" />
|
||||
<MenuItem IsChecked="True" GroupName="A" Header="Radio 2 - group" ToggleType="Radio" />
|
||||
<MenuItem GroupName="A" Header="Radio 3 - group" ToggleType="Radio">
|
||||
<MenuItem Header="Radio 4 - group" ToggleType="Radio" GroupName="A" />
|
||||
<MenuItem Header="Radio 5 - group" ToggleType="Radio" GroupName="A" />
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem Header="Radio 1" ToggleType="Radio" />
|
||||
<MenuItem IsChecked="True" Header="Radio 2" ToggleType="Radio" />
|
||||
<MenuItem Header="Radio 3" ToggleType="Radio">
|
||||
<MenuItem Header="Radio 4" ToggleType="Radio" />
|
||||
<MenuItem Header="Radio 5" ToggleType="Radio" />
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Parent">
|
||||
<MenuItem Header="Child 1" />
|
||||
@ -86,7 +102,7 @@
|
||||
<MenuItem Header="Submenu _1" />
|
||||
<MenuItem Header="Submenu _2" />
|
||||
</MenuItem>
|
||||
<MenuItem Header="Menu Item with _Checkbox">
|
||||
<MenuItem Header="Menu Item with _Icon">
|
||||
<MenuItem.Icon>
|
||||
<CheckBox
|
||||
Padding="0"
|
||||
@ -95,6 +111,7 @@
|
||||
IsHitTestVisible="False" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Menu Item with _Checkbox" ToggleType="CheckBox" />
|
||||
<MenuItem Header="Menu Item that won't close on click" StaysOpenOnClick="True" />
|
||||
</ContextMenu>
|
||||
</Border.ContextMenu>
|
||||
@ -113,7 +130,7 @@
|
||||
<MenuItem Header="Submenu _1" />
|
||||
<MenuItem Header="Submenu _2" />
|
||||
</MenuItem>
|
||||
<MenuItem Header="Menu Item with _Checkbox">
|
||||
<MenuItem Header="Menu Item with _Icon">
|
||||
<MenuItem.Icon>
|
||||
<CheckBox
|
||||
Padding="0"
|
||||
@ -122,6 +139,7 @@
|
||||
IsHitTestVisible="False" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Menu Item with _Checkbox" ToggleType="CheckBox" />
|
||||
</MenuFlyout>
|
||||
</Border.ContextFlyout>
|
||||
<TextBlock Text="Right Click to show Context Flyout" />
|
||||
|
@ -7,10 +7,36 @@
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
||||
<Button Click="InfoButton_OnClick" Content="Information" />
|
||||
<Button Click="InfoButton_OnClick" Content="Success" />
|
||||
<Button Click="InfoButton_OnClick" Content="Warning" />
|
||||
<Button Click="InfoButton_OnClick" Content="Error" />
|
||||
<StackPanel Spacing="20">
|
||||
<UniformGrid Rows="2" Columns="3" Width="500" HorizontalAlignment="Left">
|
||||
<UniformGrid.Styles>
|
||||
<Style Selector="RadioButton">
|
||||
<Setter Property="Theme" Value="{DynamicResource PureCardRadioButton}" />
|
||||
</Style>
|
||||
</UniformGrid.Styles>
|
||||
<RadioButton Click="PositionButton_OnClick" Content="TopLeft" />
|
||||
<RadioButton Click="PositionButton_OnClick" Content="TopCenter" />
|
||||
<RadioButton Click="PositionButton_OnClick" Content="TopRight" IsChecked="True" />
|
||||
<RadioButton Click="PositionButton_OnClick" Content="BottomLeft" />
|
||||
<RadioButton Click="PositionButton_OnClick" Content="BottomCenter" />
|
||||
<RadioButton Click="PositionButton_OnClick" Content="BottomRight" />
|
||||
</UniformGrid>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<Button Click="NormalButton_OnClick" Content="Information" />
|
||||
<Button Click="NormalButton_OnClick" Content="Success" Classes="Success" />
|
||||
<Button Click="NormalButton_OnClick" Content="Warning" Classes="Warning" />
|
||||
<Button Click="NormalButton_OnClick" Content="Error" Classes="Danger" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="Button">
|
||||
<Setter Property="Theme" Value="{DynamicResource SolidButton}" />
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<Button Click="LightButton_OnClick" Content="Information" />
|
||||
<Button Click="LightButton_OnClick" Content="Success" Classes="Success" />
|
||||
<Button Click="LightButton_OnClick" Content="Warning" Classes="Warning" />
|
||||
<Button Click="LightButton_OnClick" Content="Error" Classes="Danger" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
@ -2,17 +2,14 @@ using System;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Notifications;
|
||||
using Avalonia.Controls.Presenters;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.VisualTree;
|
||||
using Semi.Avalonia.Demo.Views;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class NotificationDemo : UserControl
|
||||
{
|
||||
private WindowNotificationManager? _manager;
|
||||
|
||||
public NotificationDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
@ -22,14 +19,37 @@ public partial class NotificationDemo : UserControl
|
||||
{
|
||||
base.OnAttachedToVisualTree(e);
|
||||
var topLevel = TopLevel.GetTopLevel(this);
|
||||
_manager = new WindowNotificationManager(topLevel){ MaxItems = 3};
|
||||
_manager = new WindowNotificationManager(topLevel) { MaxItems = 3 };
|
||||
}
|
||||
|
||||
private void InfoButton_OnClick(object? sender, RoutedEventArgs e)
|
||||
private void PositionButton_OnClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button b && b.Content is string s && Enum.TryParse<NotificationType>(s, out NotificationType t))
|
||||
if (sender is RadioButton b && b.Content is string s)
|
||||
{
|
||||
_manager?.Show(new Notification(t.ToString(), "This is message", t));
|
||||
Enum.TryParse<NotificationPosition>(s, out var t);
|
||||
_manager.Position = t;
|
||||
}
|
||||
}
|
||||
|
||||
private void NormalButton_OnClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button b && b.Content is string s)
|
||||
{
|
||||
_manager?.Show(Enum.TryParse<NotificationType>(s, out var t)
|
||||
? new Notification(t.ToString(), "This is message", t)
|
||||
: new Notification(s, "This is message"));
|
||||
}
|
||||
}
|
||||
|
||||
private void LightButton_OnClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button b && b.Content is string s)
|
||||
{
|
||||
Enum.TryParse<NotificationType>(s, out var notificationType);
|
||||
_manager?.Show(
|
||||
new Notification(notificationType.ToString(), "This is message"),
|
||||
type: notificationType,
|
||||
classes: ["Light"]);
|
||||
}
|
||||
}
|
||||
}
|
@ -4,38 +4,53 @@
|
||||
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">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
||||
<NumericUpDown
|
||||
Width="200"
|
||||
Maximum="100"
|
||||
Minimum="0" />
|
||||
<NumericUpDown
|
||||
Width="200"
|
||||
Increment="10"
|
||||
Maximum="100"
|
||||
Minimum="0" />
|
||||
<NumericUpDown
|
||||
Width="200"
|
||||
ButtonSpinnerLocation="Left"
|
||||
Maximum="100"
|
||||
Minimum="0" />
|
||||
<NumericUpDown
|
||||
Width="200"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
ShowButtonSpinner="False" />
|
||||
<NumericUpDown
|
||||
Width="200"
|
||||
Classes="Large"
|
||||
Maximum="100"
|
||||
Minimum="0" />
|
||||
<NumericUpDown
|
||||
Width="200"
|
||||
Classes="Small"
|
||||
Maximum="100"
|
||||
Minimum="0" />
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="NumericUpDown">
|
||||
<Setter Property="Width" Value="300" />
|
||||
<Setter Property="Maximum" Value="100" />
|
||||
<Setter Property="Minimum" Value="0" />
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
|
||||
<NumericUpDown />
|
||||
<NumericUpDown Increment="10" />
|
||||
<NumericUpDown ButtonSpinnerLocation="Left" />
|
||||
<NumericUpDown ShowButtonSpinner="False" />
|
||||
<NumericUpDown Classes="Large" />
|
||||
<NumericUpDown Classes="Small" />
|
||||
<NumericUpDown InnerLeftContent="Price" InnerRightContent="$" />
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<NumericUpDown
|
||||
Width="100"
|
||||
Classes="Large"
|
||||
Watermark="Large"
|
||||
ButtonSpinnerLocation="Left" />
|
||||
<NumericUpDown
|
||||
Width="100"
|
||||
Watermark="Default"
|
||||
ShowButtonSpinner="False" />
|
||||
<NumericUpDown
|
||||
Width="100"
|
||||
Watermark="Small"
|
||||
Classes="Small" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<NumericUpDown Width="100" ButtonSpinnerLocation="Left" />
|
||||
<NumericUpDown Width="100" ShowButtonSpinner="False" />
|
||||
<NumericUpDown Width="100" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<NumericUpDown Width="100" ShowButtonSpinner="False" />
|
||||
<NumericUpDown Width="100" IsEnabled="False" />
|
||||
<NumericUpDown Width="100" ButtonSpinnerLocation="Left" />
|
||||
</StackPanel>
|
||||
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
@ -2,233 +2,414 @@
|
||||
x:Class="Semi.Avalonia.Demo.Pages.Overview"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:converters="clr-namespace:Avalonia.Markup.Xaml.Converters;assembly=Avalonia.Markup.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"
|
||||
d:DesignHeight="1000"
|
||||
d:DesignWidth="800"
|
||||
d:DesignWidth="1920"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<converters:ColorToBrushConverter x:Key="ColorToBrushConverter" />
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
<UserControl.Styles>
|
||||
<Style Selector="Border.CodeBlock">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource SemiColorBorder}" />
|
||||
<Setter Property="Padding" Value="16" />
|
||||
<Setter Property="CornerRadius" Value="6" />
|
||||
<Setter Property="Background" Value="{DynamicResource SemiColorFill0}" />
|
||||
</Style>
|
||||
</UserControl.Styles>
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Auto">
|
||||
<StackPanel Spacing="5">
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<Button Classes="Primary" Theme="{DynamicResource SolidButton}">Primary</Button>
|
||||
<Button Classes="Secondary" Theme="{DynamicResource SolidButton}">Secondary</Button>
|
||||
<Button Classes="Tertiary" Theme="{DynamicResource SolidButton}">Tertiary</Button>
|
||||
<Button Classes="Success" Theme="{DynamicResource SolidButton}">Success</Button>
|
||||
<Button Classes="Warning" Theme="{DynamicResource SolidButton}">Warning</Button>
|
||||
<Button Classes="Danger" Theme="{DynamicResource SolidButton}">Danger</Button>
|
||||
<Button
|
||||
Classes="Primary"
|
||||
IsEnabled="False"
|
||||
Theme="{DynamicResource SolidButton}">
|
||||
Danger
|
||||
</Button>
|
||||
<StackPanel Margin="20">
|
||||
<StackPanel
|
||||
Margin="20"
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<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" />
|
||||
<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" />
|
||||
<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" />
|
||||
</DrawingGroup>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<Label Theme="{StaticResource TagLabel}">Label</Label>
|
||||
<Label Classes="Large" Theme="{StaticResource TagLabel}">Large Label</Label>
|
||||
<Label Classes="Circle" Theme="{StaticResource TagLabel}">Circle Label</Label>
|
||||
<Label Classes="Large Circle" Theme="{StaticResource TagLabel}">Large Circle Label</Label>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
Classes="H1"
|
||||
Text="Semi Avalonia"
|
||||
Theme="{DynamicResource TitleTextBlock}" />
|
||||
<TextBlock
|
||||
MaxWidth="600"
|
||||
Margin="0,20,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
Classes="Secondary"
|
||||
Text="AvaloniaUI Theme inspired by Semi Design. An easy-to-customize modern design system that helps designers and developers create high-quality products."
|
||||
TextWrapping="Wrap" />
|
||||
<StackPanel
|
||||
Margin="0,10,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="12,0"
|
||||
FontWeight="600"
|
||||
Text="Modern" />
|
||||
<TextBlock
|
||||
Margin="12,0"
|
||||
FontWeight="600"
|
||||
Foreground="{Binding #color.Color, Converter={StaticResource ColorToBrushConverter}, Mode=TwoWay}"
|
||||
Text="Flexible" />
|
||||
<TextBlock
|
||||
Margin="12,0"
|
||||
FontWeight="600"
|
||||
Text="Simple" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<Label Classes="Blue" Theme="{StaticResource TagLabel}">Indigo</Label>
|
||||
<Label Classes="Ghost Blue" Theme="{StaticResource TagLabel}">Indigo</Label>
|
||||
<Label Classes="Solid Blue" Theme="{StaticResource TagLabel}">Indigo</Label>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel
|
||||
Margin="0,0,16,0"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<RadioButton Margin="0,0,8,0">Option 1</RadioButton>
|
||||
<RadioButton>Option 2</RadioButton>
|
||||
</StackPanel>
|
||||
<Border VerticalAlignment="Center" Theme="{StaticResource RadioButtonGroupBorder}">
|
||||
<StackPanel HorizontalAlignment="Center">
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<RadioButton IsChecked="True" Theme="{StaticResource ButtonRadioButton}">选项 1</RadioButton>
|
||||
<RadioButton Theme="{StaticResource ButtonRadioButton}">选项 2</RadioButton>
|
||||
<StackPanel Margin="16,0">
|
||||
<Button
|
||||
Margin="0,8"
|
||||
Classes="Primary"
|
||||
Content="Primary"
|
||||
HorizontalAlignment="Stretch"
|
||||
Theme="{DynamicResource SolidButton}" />
|
||||
<Button
|
||||
Margin="0,8"
|
||||
Classes="Secondary"
|
||||
Content="Secondary"
|
||||
HorizontalAlignment="Stretch"
|
||||
Theme="{DynamicResource SolidButton}" />
|
||||
<Button
|
||||
Margin="0,8"
|
||||
Classes="Tertiary"
|
||||
Content="Tertiary"
|
||||
HorizontalAlignment="Stretch"
|
||||
Theme="{DynamicResource SolidButton}" />
|
||||
<Button
|
||||
Margin="0,8"
|
||||
Classes="Success"
|
||||
Content="Success"
|
||||
HorizontalAlignment="Stretch"
|
||||
Theme="{DynamicResource SolidButton}" />
|
||||
<Button
|
||||
Margin="0,8"
|
||||
Classes="Warning"
|
||||
Content="Warning"
|
||||
HorizontalAlignment="Stretch"
|
||||
Theme="{DynamicResource SolidButton}" />
|
||||
<Button
|
||||
Margin="0,8"
|
||||
Classes="Danger"
|
||||
Content="Danger"
|
||||
HorizontalAlignment="Stretch"
|
||||
Theme="{DynamicResource SolidButton}" />
|
||||
</StackPanel>
|
||||
<Calendar Margin="16,0" />
|
||||
<StackPanel Margin="16,0">
|
||||
<TextBox
|
||||
Width="300"
|
||||
Margin="0,12"
|
||||
InnerLeftContent="https://"
|
||||
InnerRightContent=".com" />
|
||||
<DatePicker Width="300" Margin="0,12" />
|
||||
<CalendarDatePicker Width="300" Margin="0,12" />
|
||||
<NumericUpDown Width="300" Margin="0,12" />
|
||||
<ComboBox Width="300" Margin="0,12">
|
||||
<ComboBoxItem>Avalonia</ComboBoxItem>
|
||||
<ComboBoxItem>Semi Design</ComboBoxItem>
|
||||
<ComboBoxItem>IRIHI Technology</ComboBoxItem>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<UniformGrid HorizontalAlignment="Center" Columns="3">
|
||||
<UniformGrid.Styles>
|
||||
<Style Selector="CheckBox">
|
||||
<Setter Property="Margin" Value="4" />
|
||||
</Style>
|
||||
</UniformGrid.Styles>
|
||||
<CheckBox Content="Windows" IsChecked="True" />
|
||||
<CheckBox Content="macOS" IsChecked="True" />
|
||||
<CheckBox Content="Linux" IsChecked="True" />
|
||||
<CheckBox
|
||||
Content="iOS"
|
||||
IsChecked="{x:Null}"
|
||||
IsThreeState="True" />
|
||||
<CheckBox
|
||||
Content="Android"
|
||||
IsChecked="{x:Null}"
|
||||
IsThreeState="True" />
|
||||
<CheckBox
|
||||
Content="Wasm"
|
||||
IsChecked="{x:Null}"
|
||||
IsThreeState="True" />
|
||||
</UniformGrid>
|
||||
<UniformGrid HorizontalAlignment="Center" Columns="3">
|
||||
<UniformGrid.Styles>
|
||||
<Style Selector="CheckBox">
|
||||
<Setter Property="Margin" Value="4" />
|
||||
</Style>
|
||||
</UniformGrid.Styles>
|
||||
<CheckBox
|
||||
Content="Windows"
|
||||
IsChecked="True"
|
||||
Theme="{DynamicResource CardCheckBox}" />
|
||||
<CheckBox
|
||||
Content="macOS"
|
||||
IsChecked="True"
|
||||
Theme="{DynamicResource CardCheckBox}" />
|
||||
<CheckBox
|
||||
Content="Linux"
|
||||
IsChecked="True"
|
||||
Theme="{DynamicResource CardCheckBox}" />
|
||||
<CheckBox
|
||||
Content="iOS"
|
||||
IsChecked="{x:Null}"
|
||||
IsThreeState="True"
|
||||
Theme="{DynamicResource CardCheckBox}" />
|
||||
<CheckBox
|
||||
Content="Android"
|
||||
IsChecked="{x:Null}"
|
||||
IsThreeState="True"
|
||||
Theme="{DynamicResource CardCheckBox}" />
|
||||
<CheckBox
|
||||
Content="Wasm"
|
||||
IsChecked="{x:Null}"
|
||||
IsThreeState="True"
|
||||
Theme="{DynamicResource CardCheckBox}" />
|
||||
</UniformGrid>
|
||||
</StackPanel>
|
||||
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<RadioButton Margin="4" Theme="{StaticResource CardRadioButton}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">Option 1</TextBlock>
|
||||
<TextBlock Classes="Tertiary">Description 1</TextBlock>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel Margin="16,0">
|
||||
<Button
|
||||
Margin="0,8"
|
||||
HorizontalAlignment="Stretch"
|
||||
Classes="Primary"
|
||||
Content="Primary" />
|
||||
<Button
|
||||
Margin="0,8"
|
||||
HorizontalAlignment="Stretch"
|
||||
Classes="Secondary"
|
||||
Content="Secondary" />
|
||||
<Button
|
||||
Margin="0,8"
|
||||
HorizontalAlignment="Stretch"
|
||||
Classes="Tertiary"
|
||||
Content="Tertiary" />
|
||||
<Button
|
||||
Margin="0,8"
|
||||
HorizontalAlignment="Stretch"
|
||||
Classes="Success"
|
||||
Content="Success" />
|
||||
<Button
|
||||
Margin="0,8"
|
||||
HorizontalAlignment="Stretch"
|
||||
Classes="Warning"
|
||||
Content="Warning" />
|
||||
<Button
|
||||
Margin="0,8"
|
||||
HorizontalAlignment="Stretch"
|
||||
Classes="Danger"
|
||||
Content="Danger" />
|
||||
</StackPanel>
|
||||
</RadioButton>
|
||||
<RadioButton
|
||||
Margin="4"
|
||||
IsChecked="True"
|
||||
Theme="{StaticResource CardRadioButton}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">Option 2</TextBlock>
|
||||
<TextBlock Classes="Tertiary">Description 2</TextBlock>
|
||||
</StackPanel>
|
||||
</RadioButton>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<RadioButton Margin="4" Theme="{StaticResource PureCardRadioButton}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">Option 1</TextBlock>
|
||||
<TextBlock Classes="Tertiary">Description 1</TextBlock>
|
||||
</StackPanel>
|
||||
</RadioButton>
|
||||
<RadioButton
|
||||
Margin="4"
|
||||
IsChecked="True"
|
||||
Theme="{StaticResource PureCardRadioButton}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">Option 2</TextBlock>
|
||||
<TextBlock Classes="Tertiary">Description 2</TextBlock>
|
||||
</StackPanel>
|
||||
</RadioButton>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<CheckBox Margin="0,0,8,0">Avalonia</CheckBox>
|
||||
<CheckBox Margin="0,0,8,0" IsChecked="True">WPF</CheckBox>
|
||||
<CheckBox IsChecked="{x:Null}" IsThreeState="True">UWP</CheckBox>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<CheckBox Margin="4" Theme="{StaticResource CardCheckBox}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">Option 1</TextBlock>
|
||||
<TextBlock Classes="Tertiary">Description 1</TextBlock>
|
||||
</StackPanel>
|
||||
</CheckBox>
|
||||
<CheckBox
|
||||
Margin="4"
|
||||
IsChecked="True"
|
||||
Theme="{StaticResource CardCheckBox}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">Option 2</TextBlock>
|
||||
<TextBlock Classes="Tertiary">Description 2</TextBlock>
|
||||
</StackPanel>
|
||||
</CheckBox>
|
||||
<CheckBox
|
||||
Margin="4"
|
||||
IsChecked="{x:Null}"
|
||||
IsThreeState="True"
|
||||
Theme="{StaticResource CardCheckBox}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">Option 3</TextBlock>
|
||||
<TextBlock Classes="Tertiary">Description 3</TextBlock>
|
||||
</StackPanel>
|
||||
</CheckBox>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<CheckBox Margin="4" Theme="{StaticResource PureCardCheckBox}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">Option 1</TextBlock>
|
||||
<TextBlock Classes="Tertiary">Description 1</TextBlock>
|
||||
</StackPanel>
|
||||
</CheckBox>
|
||||
<CheckBox
|
||||
Margin="4"
|
||||
IsChecked="True"
|
||||
Theme="{StaticResource PureCardCheckBox}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">Option 2</TextBlock>
|
||||
<TextBlock Classes="Tertiary">Description 2</TextBlock>
|
||||
</StackPanel>
|
||||
</CheckBox>
|
||||
<CheckBox
|
||||
Margin="4"
|
||||
IsChecked="{x:Null}"
|
||||
IsThreeState="True"
|
||||
Theme="{StaticResource PureCardCheckBox}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">Option 3</TextBlock>
|
||||
<TextBlock Classes="Tertiary">Description 3</TextBlock>
|
||||
</StackPanel>
|
||||
</CheckBox>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ToggleSwitch
|
||||
Content="Content"
|
||||
OffContent="No"
|
||||
OnContent="Yes" />
|
||||
<ProgressBar
|
||||
Classes="Right"
|
||||
ShowProgressText="True"
|
||||
Value="20" />
|
||||
<Slider
|
||||
Width="200"
|
||||
Margin="30,0"
|
||||
Orientation="Horizontal"
|
||||
Value="30" />
|
||||
</StackPanel>
|
||||
<TabControl>
|
||||
<TabItem Header="Tab 1">
|
||||
<TextBlock Margin="8">Tab Content 1</TextBlock>
|
||||
</TabItem>
|
||||
<TabItem Header="Tab 2">
|
||||
<TextBlock Margin="8">Tab Content 2</TextBlock>
|
||||
</TabItem>
|
||||
<TabItem Header="Tab 3">
|
||||
<TextBlock Margin="8">Tab Content 3</TextBlock>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<ComboBox Width="200" PlaceholderText="Please Select">
|
||||
<ComboBoxItem>Item 1</ComboBoxItem>
|
||||
<ComboBoxItem>Item 2</ComboBoxItem>
|
||||
<ComboBoxItem>Item 3</ComboBoxItem>
|
||||
</ComboBox>
|
||||
<DatePicker />
|
||||
<TimePicker />
|
||||
<CalendarDatePicker />
|
||||
</StackPanel>
|
||||
<Grid ColumnDefinitions="*, *, *">
|
||||
<Border Theme="{StaticResource CardBorder}">
|
||||
<TextBlock>Card</TextBlock>
|
||||
</Border>
|
||||
<Border
|
||||
Grid.Column="1"
|
||||
Classes="Hover"
|
||||
Theme="{StaticResource CardBorder}">
|
||||
<TextBlock>Shadow on hover</TextBlock>
|
||||
</Border>
|
||||
<Border
|
||||
Grid.Column="2"
|
||||
Classes="Shadow"
|
||||
Theme="{StaticResource CardBorder}">
|
||||
<TextBlock>Shadow</TextBlock>
|
||||
</Border>
|
||||
</Grid>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<TextBox
|
||||
Width="200"
|
||||
InnerLeftContent="http://"
|
||||
InnerRightContent=".com" />
|
||||
<TextBox
|
||||
Width="200"
|
||||
Classes="revealPasswordButton"
|
||||
PasswordChar="*"
|
||||
Text="Avalonia" />
|
||||
<ColorView
|
||||
Name="color"
|
||||
VerticalAlignment="Top"
|
||||
Palette="{DynamicResource SemiColorPalette}"
|
||||
SelectedIndex="2"
|
||||
Color="#8B44AC" />
|
||||
<StackPanel Width="300" Margin="8">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Slider
|
||||
Name="slider"
|
||||
Width="200"
|
||||
Margin="16"
|
||||
Maximum="100"
|
||||
Minimum="0" />
|
||||
<ToggleSwitch Name="three" IsChecked="True" />
|
||||
</StackPanel>
|
||||
<UniformGrid Columns="2">
|
||||
<ProgressBar
|
||||
Width="100"
|
||||
MinWidth="100"
|
||||
Margin="0,16"
|
||||
IsIndeterminate="{Binding #three.IsChecked}"
|
||||
ShowProgressText="True"
|
||||
Value="{Binding #slider.Value}" />
|
||||
<ProgressBar
|
||||
Width="100"
|
||||
Height="100"
|
||||
IsIndeterminate="{Binding #three.IsChecked}"
|
||||
ShowProgressText="True"
|
||||
Theme="{DynamicResource ProgressRing}"
|
||||
Value="{Binding #slider.Value}" />
|
||||
</UniformGrid>
|
||||
<TabStrip Margin="0,8">
|
||||
<TabStripItem Content="Tab 1" />
|
||||
<TabStripItem Content="Tab 2" />
|
||||
<TabStripItem Content="Tab 3" />
|
||||
</TabStrip>
|
||||
<Menu Margin="0,8">
|
||||
<MenuItem Header="Menu 1">
|
||||
<MenuItem Header="SubMenu 1" />
|
||||
<MenuItem Header="SubMenu 2" />
|
||||
<MenuItem Header="SubMenu 3" />
|
||||
</MenuItem>
|
||||
<MenuItem Header="Menu 2">
|
||||
<MenuItem Header="SubMenu 1" />
|
||||
<MenuItem Header="SubMenu 2" />
|
||||
<MenuItem Header="SubMenu 3" />
|
||||
<MenuItem Header="SubMenu 4">
|
||||
<MenuItem Header="SubMenu 1" />
|
||||
<MenuItem Header="SubMenu 2" />
|
||||
<MenuItem Header="SubMenu 3" />
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Menu 3" />
|
||||
</Menu>
|
||||
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="8">
|
||||
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<TreeView>
|
||||
<TreeViewItem Header="Level 1" IsExpanded="True">
|
||||
<TreeViewItem Header="Level 2" />
|
||||
<TreeViewItem Header="Level 2" />
|
||||
<TreeViewItem Header="Level 2" IsExpanded="True">
|
||||
<TreeViewItem Header="Level 3" />
|
||||
<TreeViewItem Header="Level 3" />
|
||||
</TreeViewItem>
|
||||
</TreeViewItem>
|
||||
</TreeView>
|
||||
<ListBox SelectedIndex="3">
|
||||
<TextBlock>List Item 1</TextBlock>
|
||||
<TextBlock>List Item 2</TextBlock>
|
||||
<TextBlock>List Item 3</TextBlock>
|
||||
<TextBlock>List Item 4</TextBlock>
|
||||
<TextBlock>List Item 5</TextBlock>
|
||||
</ListBox>
|
||||
<Calendar />
|
||||
<UniformGrid HorizontalAlignment="Center" Columns="3">
|
||||
<UniformGrid.Styles>
|
||||
<Style Selector="RadioButton">
|
||||
<Setter Property="Margin" Value="4" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
</Style>
|
||||
</UniformGrid.Styles>
|
||||
<RadioButton Content="Avalonia" IsChecked="True" />
|
||||
<RadioButton Content="WPF" />
|
||||
<RadioButton Content="Xamarin" />
|
||||
</UniformGrid>
|
||||
<UniformGrid HorizontalAlignment="Center" Columns="3">
|
||||
<UniformGrid.Styles>
|
||||
<Style Selector="RadioButton">
|
||||
<Setter Property="Margin" Value="4" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
</Style>
|
||||
</UniformGrid.Styles>
|
||||
<RadioButton
|
||||
Content="Avalonia"
|
||||
IsChecked="True"
|
||||
Theme="{DynamicResource CardRadioButton}" />
|
||||
<RadioButton Content="WPF" Theme="{DynamicResource CardRadioButton}" />
|
||||
<RadioButton Content="Xamarin" Theme="{DynamicResource CardRadioButton}" />
|
||||
</UniformGrid>
|
||||
<WrapPanel Width="300">
|
||||
<WrapPanel.Styles>
|
||||
<Style Selector="Label">
|
||||
<Setter Property="Margin" Value="4" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
</Style>
|
||||
</WrapPanel.Styles>
|
||||
<Label Classes="Red" Theme="{StaticResource TagLabel}">Red</Label>
|
||||
<Label Classes="Pink" Theme="{StaticResource TagLabel}">Pink</Label>
|
||||
<Label Classes="Purple" Theme="{StaticResource TagLabel}">Purple</Label>
|
||||
<Label Classes="Violet" Theme="{StaticResource TagLabel}">Violet</Label>
|
||||
<Label Classes="Indigo" Theme="{StaticResource TagLabel}">Indigo</Label>
|
||||
<Label Classes="Blue" Theme="{StaticResource TagLabel}">Blue</Label>
|
||||
<Label Classes="LightBlue" Theme="{StaticResource TagLabel}">LightBlue</Label>
|
||||
<Label Classes="Cyan" Theme="{StaticResource TagLabel}">Cyan</Label>
|
||||
<Label Classes="Teal" Theme="{StaticResource TagLabel}">Teal</Label>
|
||||
<Label Classes="Green" Theme="{StaticResource TagLabel}">Green</Label>
|
||||
<Label Classes="LightGreen" Theme="{StaticResource TagLabel}">LightGreen</Label>
|
||||
<Label Classes="Lime" Theme="{StaticResource TagLabel}">Lime</Label>
|
||||
<Label Classes="Yellow" Theme="{StaticResource TagLabel}">Yellow</Label>
|
||||
<Label Classes="Amber" Theme="{StaticResource TagLabel}">Amber</Label>
|
||||
<Label Classes="Orange" Theme="{StaticResource TagLabel}">Orange</Label>
|
||||
<Label Classes="Grey" Theme="{StaticResource TagLabel}">Grey</Label>
|
||||
<Label Classes="White" Theme="{StaticResource TagLabel}">White</Label>
|
||||
<Label Classes="Large" Theme="{StaticResource TagLabel}">Large</Label>
|
||||
<Label Classes="Circle" Theme="{StaticResource TagLabel}">Circle</Label>
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<TextBlock
|
||||
Margin="0,32,0,16"
|
||||
Classes="H5"
|
||||
Text="Start to install"
|
||||
Theme="{DynamicResource TitleTextBlock}" />
|
||||
<TabControl Padding="8">
|
||||
<TabItem Header="Main">
|
||||
<StackPanel>
|
||||
<TextBlock Text="Install via nuget: " />
|
||||
<Border Margin="0,16" Classes="CodeBlock">
|
||||
<SelectableTextBlock FontFamily="Consolas" Text="{Binding $parent[local:Overview].MainInstall}" />
|
||||
</Border>
|
||||
<TextBlock Text="Reference styles: " />
|
||||
<Border Margin="0,16" Classes="CodeBlock">
|
||||
<SelectableTextBlock
|
||||
FontFamily="Consolas"
|
||||
Text="{Binding $parent[local:Overview].MainStyle}"
|
||||
TextWrapping="Wrap" />
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
<TabItem Header="ColorPicker">
|
||||
<StackPanel>
|
||||
<TextBlock Text="Install via nuget: " />
|
||||
<Border Margin="0,16" Classes="CodeBlock">
|
||||
<SelectableTextBlock FontFamily="Consolas" Text="{Binding $parent[local:Overview].ColorPickerInstall}" />
|
||||
</Border>
|
||||
<TextBlock Text="Reference styles: " />
|
||||
<Border Margin="0,16" Classes="CodeBlock">
|
||||
<SelectableTextBlock
|
||||
FontFamily="Consolas"
|
||||
Text="{Binding $parent[local:Overview].ColorPickerStyle}"
|
||||
TextWrapping="Wrap" />
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
<TabItem Header="DataGrid">
|
||||
<StackPanel>
|
||||
<TextBlock Text="Install via nuget: " />
|
||||
<Border Margin="0,16" Classes="CodeBlock">
|
||||
<SelectableTextBlock FontFamily="Consolas" Text="{Binding $parent[local:Overview].DataGridInstall}" />
|
||||
</Border>
|
||||
<TextBlock Text="Reference styles: " />
|
||||
<Border Margin="0,16" Classes="CodeBlock">
|
||||
<SelectableTextBlock
|
||||
FontFamily="Consolas"
|
||||
Text="{Binding $parent[local:Overview].DataGridStyle}"
|
||||
TextWrapping="Wrap" />
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
<TabItem Header="TreeDataGrid">
|
||||
<StackPanel>
|
||||
<TextBlock Text="Install via nuget: " />
|
||||
<Border Margin="0,16" Classes="CodeBlock">
|
||||
<SelectableTextBlock FontFamily="Consolas" Text="{Binding $parent[local:Overview].TreeDataGridInstall}" />
|
||||
</Border>
|
||||
<TextBlock Text="Reference styles: " />
|
||||
<Border Margin="0,16" Classes="CodeBlock">
|
||||
<SelectableTextBlock
|
||||
FontFamily="Consolas"
|
||||
Text="{Binding $parent[local:Overview].TreeDataGridStyle}"
|
||||
TextWrapping="Wrap" />
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
@ -1,8 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.Styling;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
@ -13,16 +9,41 @@ public partial class Overview : UserControl
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void ToggleButton_OnIsCheckedChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var variant = Application.Current!.RequestedThemeVariant;
|
||||
if (variant?.Key == "Dark")
|
||||
{
|
||||
Application.Current!.RequestedThemeVariant = ThemeVariant.Light;
|
||||
}
|
||||
else
|
||||
{
|
||||
Application.Current!.RequestedThemeVariant = ThemeVariant.Dark;
|
||||
}
|
||||
}
|
||||
public string MainInstall { get; set; } = "dotnet add package Semi.Avalonia --version 11.2.1.1";
|
||||
|
||||
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" />
|
||||
</Application.Styles>
|
||||
""";
|
||||
|
||||
public string ColorPickerInstall { get; set; } = "dotnet add package Semi.Avalonia.ColorPicker --version 11.2.1.1";
|
||||
|
||||
public string ColorPickerStyle { get; set; } =
|
||||
"""
|
||||
<Application.Styles>
|
||||
<StyleInclude Source="avares://Semi.Avalonia.ColorPicker/Index.axaml" />
|
||||
</Application.Styles>
|
||||
""";
|
||||
|
||||
public string DataGridInstall { get; set; } = "dotnet add package Semi.Avalonia.DataGrid --version 11.2.1.1";
|
||||
|
||||
public string DataGridStyle { get; set; } =
|
||||
"""
|
||||
<Application.Styles>
|
||||
<StyleInclude Source="avares://Semi.Avalonia.DataGrid/Index.axaml" />
|
||||
</Application.Styles>
|
||||
""";
|
||||
|
||||
public string TreeDataGridInstall { get; set; } = "dotnet add package Semi.Avalonia.TreeDataGrid --version 11.0.10.1";
|
||||
|
||||
public string TreeDataGridStyle { get; set; } =
|
||||
"""
|
||||
<Application.Styles>
|
||||
<StyleInclude Source="avares://Semi.Avalonia.TreeDataGrid/Index.axaml" />
|
||||
</Application.Styles>
|
||||
""";
|
||||
}
|
@ -17,10 +17,11 @@
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceInclude Source="../Themes/ToggleButton.axaml" />
|
||||
<ResourceInclude Source="../Themes/ToggleSwitch.axaml" />
|
||||
<ResourceInclude Source="../Controls/ColorItemControl.axaml" />
|
||||
<ResourceInclude Source="../Controls/ColorDetailControl.axaml" />
|
||||
<ResourceInclude Source="../Controls/FunctionalColorGroupControl.axaml" />
|
||||
<ResourceInclude Source="../Controls/ShadowGroupControl.axaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
@ -33,11 +34,11 @@
|
||||
PanePlacement="Right">
|
||||
<SplitView.Pane>
|
||||
<StackPanel>
|
||||
<ToggleButton
|
||||
<ToggleSwitch
|
||||
Name="toggle"
|
||||
HorizontalAlignment="Right"
|
||||
IsChecked="True"
|
||||
Theme="{DynamicResource SplitViewToggleButton}" />
|
||||
Theme="{DynamicResource SplitViewToggleSwitch}" />
|
||||
<Border IsVisible="{Binding #splitView.IsPaneOpen}" Theme="{DynamicResource CardBorder}">
|
||||
<Panel>
|
||||
<TextBlock
|
||||
@ -115,7 +116,6 @@
|
||||
<ItemsControl ItemsSource="{Binding FunctionalColors}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<!-- -->
|
||||
<controls:FunctionalColorGroupControl
|
||||
Title="{Binding Title}"
|
||||
DarkColors="{Binding DarkColors}"
|
||||
@ -123,8 +123,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>
|
@ -13,17 +13,16 @@ public partial class PaletteDemo : UserControl
|
||||
public PaletteDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.DataContext = new PaletteDemoViewModel();
|
||||
}
|
||||
|
||||
protected override async void OnApplyTemplate(TemplateAppliedEventArgs e)
|
||||
{
|
||||
base.OnApplyTemplate(e);
|
||||
PaletteDemoViewModel? vm = new PaletteDemoViewModel();
|
||||
PaletteDemoViewModel? vm = this.DataContext as PaletteDemoViewModel;
|
||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
||||
{
|
||||
vm.InitializeResources();
|
||||
vm?.InitializeResources();
|
||||
});
|
||||
DataContext = vm;
|
||||
}
|
||||
}
|
36
demo/Semi.Avalonia.Demo/Pages/PathIconDemo.axaml
Normal file
36
demo/Semi.Avalonia.Demo/Pages/PathIconDemo.axaml
Normal file
@ -0,0 +1,36 @@
|
||||
<UserControl
|
||||
x:Class="Semi.Avalonia.Demo.Pages.PathIconDemo"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel HorizontalAlignment="Left">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="PathIcon">
|
||||
<Setter Property="Theme" Value="{DynamicResource InnerPathIcon}" />
|
||||
<Setter Property="Data" Value="M10.5 2C5.80558 2 2 5.80558 2 10.5C2 15.1944 5.80558 19 10.5 19C12.3054 19 13.9794 18.4371 15.356 17.4773L19.4393 21.5606C20.0251 22.1464 20.9749 22.1464 21.5606 21.5606C22.1464 20.9749 22.1464 20.0251 21.5606 19.4393L17.4773 15.356C18.4371 13.9794 19 12.3054 19 10.5C19 5.80558 15.1944 2 10.5 2ZM5 10.5C5 7.46243 7.46243 5 10.5 5C13.5376 5 16 7.46243 16 10.5C16 13.5376 13.5376 16 10.5 16C7.46243 16 5 13.5376 5 10.5Z" />
|
||||
</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 #active.IsChecked}"
|
||||
Width="{Binding #width.Value}"
|
||||
Height="{Binding #width.Value}"
|
||||
Foreground="{DynamicResource SemiBlue6}"
|
||||
BorderBrush="{DynamicResource SemiRed6}"
|
||||
Data="M12 3L2 12H5V20H19V12H22L12 3M13 18H11V16H13V18M13 14H11V8H13V14Z" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
13
demo/Semi.Avalonia.Demo/Pages/PathIconDemo.axaml.cs
Normal file
13
demo/Semi.Avalonia.Demo/Pages/PathIconDemo.axaml.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class PathIconDemo : UserControl
|
||||
{
|
||||
public PathIconDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
@ -7,114 +7,159 @@
|
||||
d:DesignHeight="800"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
||||
<ProgressBar
|
||||
Width="200"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
ShowProgressText="True"
|
||||
Value="20" />
|
||||
<ProgressBar
|
||||
Width="200"
|
||||
IsIndeterminate="True"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
ShowProgressText="True"
|
||||
Value="20" />
|
||||
<ProgressBar
|
||||
Width="200"
|
||||
Classes="Left"
|
||||
IsIndeterminate="True"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
ShowProgressText="True"
|
||||
Value="20" />
|
||||
<ProgressBar
|
||||
Width="200"
|
||||
Classes="Left"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
ShowProgressText="True"
|
||||
Value="20" />
|
||||
<ProgressBar
|
||||
Width="200"
|
||||
Classes="Right"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
ShowProgressText="True"
|
||||
Value="20" />
|
||||
<StackPanel
|
||||
HorizontalAlignment="Left"
|
||||
Orientation="Horizontal"
|
||||
Spacing="20">
|
||||
<ProgressBar
|
||||
Classes="Left"
|
||||
<ScrollViewer>
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
||||
<StackPanel
|
||||
HorizontalAlignment="Left"
|
||||
Orientation="Horizontal"
|
||||
Spacing="20">
|
||||
<ProgressBar
|
||||
Width="100"
|
||||
Height="100"
|
||||
Maximum="{Binding #slider.Maximum}"
|
||||
Minimum="{Binding #slider.Minimum}"
|
||||
Theme="{DynamicResource ProgressRing}"
|
||||
Value="{Binding #slider.Value}"
|
||||
ShowProgressText="True"/>
|
||||
<ProgressBar
|
||||
Width="100"
|
||||
Height="100"
|
||||
IsIndeterminate="True"
|
||||
Maximum="{Binding #slider.Maximum}"
|
||||
Minimum="{Binding #slider.Minimum}"
|
||||
Theme="{DynamicResource ProgressRing}"
|
||||
ShowProgressText="True"/>
|
||||
</StackPanel>
|
||||
<Slider
|
||||
Name="slider"
|
||||
Width="300"
|
||||
IsSnapToTickEnabled="True"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
TickFrequency="10" />
|
||||
<ProgressBar
|
||||
Width="200"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
ShowProgressText="True"
|
||||
Value="{Binding #slider.Value}" />
|
||||
<ProgressBar
|
||||
Width="200"
|
||||
IsIndeterminate="True"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Orientation="Vertical"
|
||||
ShowProgressText="True"
|
||||
Value="20" />
|
||||
<ProgressBar
|
||||
Width="200"
|
||||
Classes="Left"
|
||||
IsIndeterminate="True"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
ShowProgressText="True"
|
||||
Value="20" />
|
||||
<ProgressBar
|
||||
Width="200"
|
||||
Classes="Left"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
ShowProgressText="True"
|
||||
Value="20" />
|
||||
<ProgressBar
|
||||
Width="200"
|
||||
Classes="Right"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Orientation="Vertical"
|
||||
ShowProgressText="True"
|
||||
Value="20" />
|
||||
<StackPanel
|
||||
HorizontalAlignment="Left"
|
||||
Orientation="Horizontal"
|
||||
Spacing="20">
|
||||
<ProgressBar
|
||||
Classes="Left"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Orientation="Vertical"
|
||||
ShowProgressText="True"
|
||||
Value="20" />
|
||||
<ProgressBar
|
||||
Classes="Right"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Orientation="Vertical"
|
||||
ShowProgressText="True"
|
||||
Value="20" />
|
||||
<ProgressBar
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Orientation="Vertical"
|
||||
ShowProgressText="True"
|
||||
Value="20" />
|
||||
<ProgressBar
|
||||
Classes="Left"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Orientation="Vertical"
|
||||
ShowProgressText="False"
|
||||
Value="20" />
|
||||
<ProgressBar
|
||||
IsIndeterminate="True"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Orientation="Vertical"
|
||||
ShowProgressText="True"
|
||||
Value="20" />
|
||||
<ProgressBar
|
||||
IsIndeterminate="True"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Orientation="Vertical"
|
||||
ShowProgressText="False"
|
||||
Value="20" />
|
||||
</StackPanel>
|
||||
<ProgressBar
|
||||
Width="200"
|
||||
Classes="Primary"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Orientation="Vertical"
|
||||
ShowProgressText="True"
|
||||
Value="20" />
|
||||
Value="60" />
|
||||
<ProgressBar
|
||||
Classes="Left"
|
||||
Width="200"
|
||||
Classes="Secondary"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Orientation="Vertical"
|
||||
ShowProgressText="False"
|
||||
Value="20" />
|
||||
<ProgressBar
|
||||
IsIndeterminate="True"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Orientation="Vertical"
|
||||
ShowProgressText="True"
|
||||
Value="20" />
|
||||
Value="60" />
|
||||
<ProgressBar
|
||||
IsIndeterminate="True"
|
||||
Width="200"
|
||||
Classes="Tertiary"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Orientation="Vertical"
|
||||
ShowProgressText="False"
|
||||
Value="20" />
|
||||
ShowProgressText="True"
|
||||
Value="60" />
|
||||
<ProgressBar
|
||||
Width="200"
|
||||
Classes="Success"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
ShowProgressText="True"
|
||||
Value="60" />
|
||||
<ProgressBar
|
||||
Width="200"
|
||||
Classes="Warning"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
ShowProgressText="True"
|
||||
Value="60" />
|
||||
<ProgressBar
|
||||
Width="200"
|
||||
Classes="Danger"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
ShowProgressText="True"
|
||||
Value="60" />
|
||||
</StackPanel>
|
||||
<ProgressBar
|
||||
Width="200"
|
||||
Classes="Success"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
ShowProgressText="True"
|
||||
Value="60" />
|
||||
<ProgressBar
|
||||
Width="200"
|
||||
Classes="Warning"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
ShowProgressText="True"
|
||||
Value="60" />
|
||||
<ProgressBar
|
||||
Width="200"
|
||||
Classes="Error"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
ShowProgressText="True"
|
||||
Value="60" />
|
||||
<ProgressBar
|
||||
Width="200"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
ShowProgressText="True"
|
||||
Value="60" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
@ -23,25 +23,28 @@
|
||||
<RadioButton Classes="Small" Theme="{DynamicResource ButtonRadioButton}">小1</RadioButton>
|
||||
<RadioButton
|
||||
Classes="Small"
|
||||
Theme="{DynamicResource ButtonRadioButton}"
|
||||
IsChecked="True">
|
||||
IsChecked="True"
|
||||
Theme="{DynamicResource ButtonRadioButton}">
|
||||
小2
|
||||
</RadioButton>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border Margin="8 0" HorizontalAlignment="Left" Theme="{StaticResource RadioButtonGroupBorder}">
|
||||
<Border
|
||||
Margin="8,0"
|
||||
HorizontalAlignment="Left"
|
||||
Theme="{StaticResource RadioButtonGroupBorder}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<RadioButton
|
||||
Classes="Small"
|
||||
Theme="{DynamicResource ButtonRadioButton}"
|
||||
IsEnabled="False">
|
||||
IsEnabled="False"
|
||||
Theme="{DynamicResource ButtonRadioButton}">
|
||||
小1
|
||||
</RadioButton>
|
||||
<RadioButton
|
||||
Classes="Small"
|
||||
Theme="{DynamicResource ButtonRadioButton}"
|
||||
IsChecked="True"
|
||||
IsEnabled="False">
|
||||
IsEnabled="False"
|
||||
Theme="{DynamicResource ButtonRadioButton}">
|
||||
小2
|
||||
</RadioButton>
|
||||
</StackPanel>
|
||||
@ -51,16 +54,19 @@
|
||||
<Border HorizontalAlignment="Left" Theme="{StaticResource RadioButtonGroupBorder}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<RadioButton Theme="{DynamicResource ButtonRadioButton}">默认1</RadioButton>
|
||||
<RadioButton Theme="{DynamicResource ButtonRadioButton}" IsChecked="True">默认2</RadioButton>
|
||||
<RadioButton IsChecked="True" Theme="{DynamicResource ButtonRadioButton}">默认2</RadioButton>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border Margin="8 0" HorizontalAlignment="Left" Theme="{StaticResource RadioButtonGroupBorder}">
|
||||
<Border
|
||||
Margin="8,0"
|
||||
HorizontalAlignment="Left"
|
||||
Theme="{StaticResource RadioButtonGroupBorder}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<RadioButton Theme="{DynamicResource ButtonRadioButton}" IsEnabled="False">默认1</RadioButton>
|
||||
<RadioButton IsEnabled="False" Theme="{DynamicResource ButtonRadioButton}">默认1</RadioButton>
|
||||
<RadioButton
|
||||
Theme="{DynamicResource ButtonRadioButton}"
|
||||
IsChecked="True"
|
||||
IsEnabled="False"
|
||||
IsChecked="True">
|
||||
Theme="{DynamicResource ButtonRadioButton}">
|
||||
默认2
|
||||
</RadioButton>
|
||||
</StackPanel>
|
||||
@ -72,25 +78,28 @@
|
||||
<RadioButton Classes="Large" Theme="{DynamicResource ButtonRadioButton}">大1</RadioButton>
|
||||
<RadioButton
|
||||
Classes="Large"
|
||||
Theme="{DynamicResource ButtonRadioButton}"
|
||||
IsChecked="True">
|
||||
IsChecked="True"
|
||||
Theme="{DynamicResource ButtonRadioButton}">
|
||||
大2
|
||||
</RadioButton>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border Margin="8 0" HorizontalAlignment="Left" Theme="{StaticResource RadioButtonGroupBorder}">
|
||||
<Border
|
||||
Margin="8,0"
|
||||
HorizontalAlignment="Left"
|
||||
Theme="{StaticResource RadioButtonGroupBorder}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<RadioButton
|
||||
Classes="Large"
|
||||
Theme="{DynamicResource ButtonRadioButton}"
|
||||
IsEnabled="False">
|
||||
IsEnabled="False"
|
||||
Theme="{DynamicResource ButtonRadioButton}">
|
||||
大1
|
||||
</RadioButton>
|
||||
<RadioButton
|
||||
Classes="Large"
|
||||
Theme="{DynamicResource ButtonRadioButton}"
|
||||
IsChecked="True"
|
||||
IsEnabled="False">
|
||||
IsEnabled="False"
|
||||
Theme="{DynamicResource ButtonRadioButton}">
|
||||
大2
|
||||
</RadioButton>
|
||||
</StackPanel>
|
||||
@ -98,69 +107,54 @@
|
||||
</StackPanel>
|
||||
<TextBlock Text="Radio Button as Card" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<RadioButton Width="300" Theme="{DynamicResource CardRadioButton}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">单选框标题</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统</TextBlock>
|
||||
</StackPanel>
|
||||
</RadioButton>
|
||||
<RadioButton IsChecked="True" Width="300" Theme="{DynamicResource CardRadioButton}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">单选框标题</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统</TextBlock>
|
||||
</StackPanel>
|
||||
</RadioButton>
|
||||
<RadioButton
|
||||
Width="300"
|
||||
Content="Avalonia"
|
||||
IsChecked="True"
|
||||
Theme="{DynamicResource CardRadioButton}" />
|
||||
<RadioButton
|
||||
Width="300"
|
||||
Content="WPF"
|
||||
IsChecked="True"
|
||||
Theme="{DynamicResource CardRadioButton}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<RadioButton IsEnabled="False" Width="300" Theme="{DynamicResource CardRadioButton}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">单选框标题</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统</TextBlock>
|
||||
</StackPanel>
|
||||
</RadioButton>
|
||||
<RadioButton
|
||||
<RadioButton
|
||||
Width="300"
|
||||
Content="Avalonia"
|
||||
IsEnabled="False"
|
||||
Theme="{DynamicResource CardRadioButton}" />
|
||||
<RadioButton
|
||||
Width="300"
|
||||
Content="WPF"
|
||||
IsChecked="True"
|
||||
IsEnabled="False"
|
||||
Width="300"
|
||||
Theme="{DynamicResource CardRadioButton}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">单选框标题</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统</TextBlock>
|
||||
</StackPanel>
|
||||
</RadioButton>
|
||||
Theme="{DynamicResource CardRadioButton}" />
|
||||
</StackPanel>
|
||||
<TextBlock Text="Radio Button as Pure Card" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<RadioButton Width="300" Theme="{DynamicResource PureCardRadioButton}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">单选框标题</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统</TextBlock>
|
||||
</StackPanel>
|
||||
</RadioButton>
|
||||
<RadioButton IsChecked="True" Width="300" Theme="{DynamicResource PureCardRadioButton}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">单选框标题</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统</TextBlock>
|
||||
</StackPanel>
|
||||
</RadioButton>
|
||||
<RadioButton
|
||||
Width="300"
|
||||
Content="Avalonia"
|
||||
IsChecked="True"
|
||||
Theme="{DynamicResource PureCardRadioButton}" />
|
||||
<RadioButton
|
||||
Width="300"
|
||||
Content="WPF"
|
||||
Theme="{DynamicResource PureCardRadioButton}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<RadioButton IsEnabled="False" Width="300" Theme="{DynamicResource PureCardRadioButton}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">单选框标题</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统</TextBlock>
|
||||
</StackPanel>
|
||||
</RadioButton>
|
||||
<RadioButton
|
||||
Width="300"
|
||||
Content="Avalonia"
|
||||
IsChecked="True"
|
||||
IsEnabled="False"
|
||||
Theme="{DynamicResource PureCardRadioButton}" />
|
||||
<RadioButton
|
||||
Width="300"
|
||||
Theme="{DynamicResource PureCardRadioButton}">
|
||||
<StackPanel>
|
||||
<TextBlock FontWeight="Bold">单选框标题</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统</TextBlock>
|
||||
</StackPanel>
|
||||
</RadioButton>
|
||||
Content="WPF"
|
||||
IsEnabled="False"
|
||||
Theme="{DynamicResource PureCardRadioButton}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
@ -4,12 +4,24 @@
|
||||
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"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
x:DataType="pages:RefreshContainerDemoViewModel"
|
||||
x:CompileBindings="True"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
||||
<RefreshContainer Name="container">
|
||||
<TextBlock Text="Content" />
|
||||
<DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Top">
|
||||
<Label DockPanel.Dock="Top">A control that supports pull to refresh</Label>
|
||||
<RefreshContainer Name="Refresh"
|
||||
DockPanel.Dock="Bottom"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
PullDirection="TopToBottom"
|
||||
RefreshRequested="RefreshContainerPage_RefreshRequested"
|
||||
Margin="5">
|
||||
<ListBox HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Top"
|
||||
ItemsSource="{Binding Items}" />
|
||||
</RefreshContainer>
|
||||
</StackPanel>
|
||||
</DockPanel>
|
||||
</UserControl>
|
||||
|
@ -1,14 +1,46 @@
|
||||
using Avalonia;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class RefreshContainerDemo : UserControl
|
||||
{
|
||||
private RefreshContainerDemoViewModel _viewModel;
|
||||
|
||||
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}");
|
||||
}
|
||||
}
|
@ -13,22 +13,39 @@
|
||||
<RepeatButton Classes="Primary">Primary</RepeatButton>
|
||||
<RepeatButton Classes="Secondary">Secondary</RepeatButton>
|
||||
<RepeatButton Classes="Tertiary">Tertiary</RepeatButton>
|
||||
<RepeatButton Classes="Success">Success</RepeatButton>
|
||||
<RepeatButton Classes="Warning">Warning</RepeatButton>
|
||||
<RepeatButton Classes="Danger">Danger</RepeatButton>
|
||||
<RepeatButton Classes="Primary" IsEnabled="False">Danger</RepeatButton>
|
||||
<RepeatButton Classes="Danger" IsEnabled="False">Disabled</RepeatButton>
|
||||
</StackPanel>
|
||||
<TextBlock>Solid</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<RepeatButton Classes="Primary" Theme="{DynamicResource SolidRepeatButton}">Primary</RepeatButton>
|
||||
<RepeatButton Classes="Secondary" Theme="{DynamicResource SolidRepeatButton}">Secondary</RepeatButton>
|
||||
<RepeatButton Classes="Tertiary" Theme="{DynamicResource SolidRepeatButton}">Tertiary</RepeatButton>
|
||||
<RepeatButton Classes="Success" Theme="{DynamicResource SolidRepeatButton}">Success</RepeatButton>
|
||||
<RepeatButton Classes="Warning" Theme="{DynamicResource SolidRepeatButton}">Warning</RepeatButton>
|
||||
<RepeatButton Classes="Danger" Theme="{DynamicResource SolidRepeatButton}">Danger</RepeatButton>
|
||||
<RepeatButton
|
||||
Classes="Primary"
|
||||
Classes="Danger"
|
||||
IsEnabled="False"
|
||||
Theme="{DynamicResource SolidRepeatButton}">
|
||||
Danger
|
||||
Disabled
|
||||
</RepeatButton>
|
||||
</StackPanel>
|
||||
<TextBlock>Outline</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<RepeatButton Classes="Primary" Theme="{DynamicResource OutlineRepeatButton}">Primary</RepeatButton>
|
||||
<RepeatButton Classes="Secondary" Theme="{DynamicResource OutlineRepeatButton}">Secondary</RepeatButton>
|
||||
<RepeatButton Classes="Tertiary" Theme="{DynamicResource OutlineRepeatButton}">Tertiary</RepeatButton>
|
||||
<RepeatButton Classes="Success" Theme="{DynamicResource OutlineRepeatButton}">Success</RepeatButton>
|
||||
<RepeatButton Classes="Warning" Theme="{DynamicResource OutlineRepeatButton}">Warning</RepeatButton>
|
||||
<RepeatButton Classes="Danger" Theme="{DynamicResource OutlineRepeatButton}">Danger</RepeatButton>
|
||||
<RepeatButton
|
||||
Classes="Danger"
|
||||
IsEnabled="False"
|
||||
Theme="{DynamicResource OutlineRepeatButton}">
|
||||
Disabled
|
||||
</RepeatButton>
|
||||
</StackPanel>
|
||||
<TextBlock>Borderless</TextBlock>
|
||||
@ -36,14 +53,28 @@
|
||||
<RepeatButton Classes="Primary" Theme="{DynamicResource BorderlessRepeatButton}">Primary</RepeatButton>
|
||||
<RepeatButton Classes="Secondary" Theme="{DynamicResource BorderlessRepeatButton}">Secondary</RepeatButton>
|
||||
<RepeatButton Classes="Tertiary" Theme="{DynamicResource BorderlessRepeatButton}">Tertiary</RepeatButton>
|
||||
<RepeatButton Classes="Success" Theme="{DynamicResource BorderlessRepeatButton}">Success</RepeatButton>
|
||||
<RepeatButton Classes="Warning" Theme="{DynamicResource BorderlessRepeatButton}">Warning</RepeatButton>
|
||||
<RepeatButton Classes="Danger" Theme="{DynamicResource BorderlessRepeatButton}">Danger</RepeatButton>
|
||||
<RepeatButton
|
||||
Classes="Primary"
|
||||
Classes="Danger"
|
||||
IsEnabled="False"
|
||||
Theme="{DynamicResource BorderlessRepeatButton}">
|
||||
Danger
|
||||
Disabled
|
||||
</RepeatButton>
|
||||
</StackPanel>
|
||||
<TextBlock>Disabled</TextBlock>
|
||||
<StackPanel Background="{DynamicResource SemiColorBackground1}" Orientation="Horizontal" Spacing="20">
|
||||
<Button IsEnabled="False">Light</Button>
|
||||
<Button IsEnabled="False" Theme="{DynamicResource SolidButton}">Solid</Button>
|
||||
<Button IsEnabled="False" Theme="{DynamicResource OutlineButton}">Outline</Button>
|
||||
<Button IsEnabled="False" Theme="{DynamicResource BorderlessButton}">Borderless</Button>
|
||||
</StackPanel>
|
||||
<TextBlock>Size Classes</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<RepeatButton Classes="Small">Small</RepeatButton>
|
||||
<RepeatButton>Default</RepeatButton>
|
||||
<RepeatButton Classes="Large">Large</RepeatButton>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user