Compare commits
581 Commits
v11.1.0-rc
...
v11.3.7.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d57c843032 | ||
|
|
a56b1e374a | ||
|
|
664d05db45 | ||
|
|
fdbfd91b8f | ||
|
|
3b0b007a40 | ||
|
|
c1eff9ddf8 | ||
|
|
4285e6e227 | ||
|
|
edacd88fa7 | ||
|
|
136d577667 | ||
|
|
4ef1520e64 | ||
|
|
5e751ccdbb | ||
|
|
13dcdbdd07 | ||
|
|
185fe8c984 | ||
|
|
622c8c23b7 | ||
|
|
104ba2f1f4 | ||
|
|
4895d2f51b | ||
|
|
414736443d | ||
|
|
65d2f88cab | ||
|
|
0a622772f4 | ||
|
|
5ef8f7ddaf | ||
|
|
ba9dd0a574 | ||
|
|
f784a2c927 | ||
|
|
69cc9b9ca3 | ||
|
|
9226858cda | ||
|
|
7f81aa3bde | ||
|
|
bc37be16ac | ||
|
|
7a831d35f7 | ||
|
|
5f8357ecbc | ||
|
|
4c7caa6dbf | ||
|
|
445b31893e | ||
|
|
301a4e954c | ||
|
|
dc80578c53 | ||
|
|
6c8825b3df | ||
|
|
aa105337fa | ||
|
|
f92b5f4373 | ||
|
|
bbff875d9c | ||
|
|
df75863ac5 | ||
|
|
c04e5e8579 | ||
|
|
9fca51b30d | ||
|
|
0ea632437d | ||
|
|
c0277a7004 | ||
|
|
2c527dc598 | ||
|
|
ab2cef9dc4 | ||
|
|
86daf6b428 | ||
|
|
8f7cdf52b4 | ||
|
|
176430f95f | ||
|
|
1062175204 | ||
|
|
0dda40d322 | ||
|
|
37feb8a9a7 | ||
|
|
c632c6c1f5 | ||
|
|
be2b25a94b | ||
|
|
47c6899b94 | ||
|
|
975d14a36f | ||
|
|
7a13de00a6 | ||
|
|
f7ce4aef30 | ||
|
|
f9a85734d1 | ||
|
|
9dd846f6be | ||
|
|
5384de7b23 | ||
|
|
7ccb6fd41a | ||
|
|
521ed1bd0f | ||
|
|
55d472300e | ||
|
|
a45f50005c | ||
|
|
cd9daf11da | ||
|
|
1c69f53c3c | ||
|
|
8da2e44d4c | ||
|
|
6f2129639a | ||
|
|
865b453b65 | ||
|
|
5622069446 | ||
|
|
76a3d4207f | ||
|
|
513bbba154 | ||
|
|
727fedaedf | ||
|
|
3082ef9ad0 | ||
|
|
985ad0c637 | ||
|
|
59576d4cfd | ||
|
|
c2a072041d | ||
|
|
a62655d25a | ||
|
|
2d2f2afec1 | ||
|
|
1f02f28f8b | ||
|
|
ec2202e2ef | ||
|
|
68dfaa8a57 | ||
|
|
16a8d6b37d | ||
|
|
6d0f3526a9 | ||
|
|
e5822ff6d1 | ||
|
|
08d55c2b7a | ||
|
|
297d4ab825 | ||
|
|
469e2080d4 | ||
|
|
4d93b387a7 | ||
|
|
69821dc15e | ||
|
|
a9463b8fad | ||
|
|
37598f94e6 | ||
|
|
1cb3fe956d | ||
|
|
7b41fd3f33 | ||
|
|
8e675538ba | ||
|
|
b61d939fce | ||
|
|
d206876c03 | ||
|
|
4522b48f22 | ||
|
|
ffa2f04842 | ||
|
|
d400a53784 | ||
|
|
a31b52cc29 | ||
|
|
5ffcb32b18 | ||
|
|
d9be5bef21 | ||
|
|
39e12eb6f8 | ||
|
|
7bc96775f7 | ||
|
|
f3a19f7383 | ||
|
|
57235c447d | ||
|
|
d03fe72fc2 | ||
|
|
9b70613b6a | ||
|
|
4e897596ac | ||
|
|
a2a36dbfcf | ||
|
|
d5e0675808 | ||
|
|
14a3384cd2 | ||
|
|
a9440fd656 | ||
|
|
e119edf8bb | ||
|
|
648bcc99f3 | ||
|
|
24a0d9aace | ||
|
|
d50af16ee5 | ||
|
|
42ceff91bb | ||
|
|
71984d3e10 | ||
|
|
1a30867902 | ||
|
|
55654c16ae | ||
|
|
2e157b39bb | ||
|
|
37004426fd | ||
|
|
5148c62d24 | ||
|
|
926ebc39da | ||
|
|
efdc6953e5 | ||
|
|
d3b9d4225e | ||
|
|
ac03334b19 | ||
|
|
4af5fb654f | ||
|
|
08ee7e4dc0 | ||
|
|
d67c573535 | ||
|
|
7056894c03 | ||
|
|
62030c581c | ||
|
|
bc6daf75a0 | ||
|
|
213f9ee0d7 | ||
|
|
cf79993d4a | ||
|
|
0ffc5e697a | ||
|
|
96cff5df74 | ||
|
|
04c810275a | ||
|
|
77ee768962 | ||
|
|
567027e089 | ||
|
|
0110a53e55 | ||
|
|
b3842a7866 | ||
|
|
d085c83d27 | ||
|
|
d2af636a1a | ||
|
|
7641a94a5a | ||
|
|
391e558721 | ||
|
|
b20edc3b01 | ||
|
|
82699e7317 | ||
|
|
1ae0585325 | ||
|
|
f50795cd25 | ||
|
|
31a219f36f | ||
|
|
6f98fbb21c | ||
|
|
cae26f2134 | ||
|
|
5bd08daaac | ||
|
|
efd94d1d97 | ||
|
|
49a3eada34 | ||
|
|
db24d4393b | ||
|
|
90ef903c22 | ||
|
|
cffcaee392 | ||
|
|
3c4da0f82c | ||
|
|
4120f59c90 | ||
|
|
471764f355 | ||
|
|
47d7e1d7a8 | ||
|
|
5843cbf430 | ||
|
|
c9e549c3e8 | ||
|
|
804f95e0e5 | ||
|
|
2569170ce1 | ||
|
|
b1e63a857d | ||
|
|
c898e9eb52 | ||
|
|
c062297031 | ||
|
|
2a70cd7ced | ||
|
|
8c0160c310 | ||
|
|
28a1336413 | ||
|
|
f008333683 | ||
|
|
4adfe739e0 | ||
|
|
4222e62b76 | ||
|
|
b61c9b081f | ||
|
|
c75d413699 | ||
|
|
39550a6010 | ||
|
|
610d7f4058 | ||
|
|
4a985f42bc | ||
|
|
74071f48fe | ||
|
|
eefc7dc3f2 | ||
|
|
b90b606b97 | ||
|
|
09a070e3a9 | ||
|
|
8e7581fbe7 | ||
|
|
051b137121 | ||
|
|
3f67c32f03 | ||
|
|
7302c59994 | ||
|
|
c1d663cefe | ||
|
|
45b1c9ab73 | ||
|
|
b780b793c8 | ||
|
|
3d83cd02e2 | ||
|
|
34d36b19c8 | ||
|
|
7751f417f0 | ||
|
|
c5e8bd6662 | ||
|
|
c447fd8d5d | ||
|
|
a7debb7886 | ||
|
|
de6dc99efb | ||
|
|
71b1c38ec4 | ||
|
|
992017951b | ||
|
|
a796cb828b | ||
|
|
3b41331c67 | ||
|
|
a6711ab453 | ||
|
|
9eab777faa | ||
|
|
ccdbf25004 | ||
|
|
626dff4e69 | ||
|
|
054b6f59d5 | ||
|
|
32687b1820 | ||
|
|
d0b9f2d7c9 | ||
|
|
a671ee3fcb | ||
|
|
67c0db10ac | ||
|
|
6cda56a830 | ||
|
|
d7690e464b | ||
|
|
41811a84a9 | ||
|
|
51abb760c9 | ||
|
|
f4c0e0d79a | ||
|
|
c3c6ef629f | ||
|
|
de08d4a20f | ||
|
|
9f432ddee6 | ||
|
|
21635cfb56 | ||
|
|
1d54b8ca4b | ||
|
|
cf90be7cea | ||
|
|
9aa24c066b | ||
|
|
d03e80d0ef | ||
|
|
5a1d87e163 | ||
|
|
86b2ad53fa | ||
|
|
7e33078f00 | ||
|
|
8022a80f0e | ||
|
|
08552cf57e | ||
|
|
ffbd8efef7 | ||
|
|
ea182c07f0 | ||
|
|
776ac47a98 | ||
|
|
af013bf938 | ||
|
|
2192aabf14 | ||
|
|
589221bf88 | ||
|
|
27b08caae7 | ||
|
|
a6855ab7db | ||
|
|
7a11884d97 | ||
|
|
6488c42ea9 | ||
|
|
645876fe32 | ||
|
|
74bd41a5c4 | ||
|
|
4e48cde1e7 | ||
|
|
90023554e8 | ||
|
|
f30b2dc263 | ||
|
|
8094582911 | ||
|
|
6dcc27acbc | ||
|
|
30f39d1383 | ||
|
|
42233d272c | ||
|
|
38e4866531 | ||
|
|
623ce798df | ||
|
|
19dcb020f1 | ||
|
|
9081855ab1 | ||
|
|
3210269589 | ||
|
|
857e14368b | ||
|
|
9ba6a22b6d | ||
|
|
251f884248 | ||
|
|
37211a07e7 | ||
|
|
3761a0a3fb | ||
|
|
d906a7754c | ||
|
|
d712f16642 | ||
|
|
947081302a | ||
|
|
28ce72dda9 | ||
|
|
78bc6c370b | ||
|
|
2999beefac | ||
|
|
77a05fb801 | ||
|
|
98dd72e9e3 | ||
|
|
5a954fbca8 | ||
|
|
2da0733bdf | ||
|
|
a5255bd032 | ||
|
|
7530061ca4 | ||
|
|
58c1c365a9 | ||
|
|
b5fe4d92a6 | ||
|
|
5d0116ca8e | ||
|
|
e981fe1c82 | ||
|
|
232ce71677 | ||
|
|
3fceec143d | ||
|
|
a99db733ed | ||
|
|
bb928fb239 | ||
|
|
371eb1b0d3 | ||
|
|
e56ef9d6ca | ||
|
|
0eeba47e88 | ||
|
|
96078a4115 | ||
|
|
26ef3ebf36 | ||
|
|
8615783b61 | ||
|
|
a0ca9fa4d0 | ||
|
|
e6ff4103ef | ||
|
|
2514d919f1 | ||
|
|
7a4b18e14a | ||
|
|
32e5e6b5f2 | ||
|
|
c253154e8f | ||
|
|
8955c83fd9 | ||
|
|
ea51867f0f | ||
|
|
8bb314984e | ||
|
|
af6c52660d | ||
|
|
f6962657fa | ||
|
|
8df91270b1 | ||
|
|
22f61cd836 | ||
|
|
86848b548f | ||
|
|
67fd0c4ca3 | ||
|
|
263c65dd18 | ||
|
|
26bb251d1e | ||
|
|
609dfbb5f0 | ||
|
|
ad4bead1bd | ||
|
|
02444f7f16 | ||
|
|
06d9e35add | ||
|
|
1200c9a1c9 | ||
|
|
7600b187f4 | ||
|
|
c55efe8835 | ||
|
|
1fe4df3716 | ||
|
|
c22211df24 | ||
|
|
6459863395 | ||
|
|
ab824fbcd2 | ||
|
|
e4adde26d2 | ||
|
|
057c31a311 | ||
|
|
ef8531d25d | ||
|
|
c44b9a0173 | ||
|
|
5715bba345 | ||
|
|
96b0999db1 | ||
|
|
ffd9b08acc | ||
|
|
64fd8a787a | ||
|
|
4087b685e8 | ||
|
|
70669406b2 | ||
|
|
9925f363f2 | ||
|
|
d328c66be0 | ||
|
|
049552f254 | ||
|
|
ec9233c51b | ||
|
|
6434c400d4 | ||
|
|
00b0e01198 | ||
|
|
19285645ee | ||
|
|
154a005b84 | ||
|
|
3c8ca20337 | ||
|
|
9947bffa07 | ||
|
|
0f872689a2 | ||
|
|
81f36f6559 | ||
|
|
2424c48070 | ||
|
|
40bf46dec5 | ||
|
|
5770065960 | ||
|
|
ecb15c978e | ||
|
|
5f5f9d2d60 | ||
|
|
382617f269 | ||
|
|
b13e719201 | ||
|
|
013eb39bac | ||
|
|
b25181c5bc | ||
|
|
0eb138d73c | ||
|
|
67cbcfe313 | ||
|
|
a6a4837151 | ||
|
|
9ac71cf726 | ||
|
|
d60b32adc6 | ||
|
|
04a113c546 | ||
|
|
9b4d6967a5 | ||
|
|
c302da6e4b | ||
|
|
dbae6edf40 | ||
|
|
8aa58355af | ||
|
|
1d18dd743a | ||
|
|
4ee9251b5a | ||
|
|
42285130d0 | ||
|
|
b03dfdf494 | ||
|
|
7ba3fbcb7a | ||
|
|
c437e6c79c | ||
|
|
f71e2630bb | ||
|
|
f891e05e4c | ||
|
|
77cd48ecfe | ||
|
|
329e041ced | ||
|
|
5222e64197 | ||
|
|
4c0f6dbf25 | ||
|
|
24f46bd12f | ||
|
|
afb5b65a51 | ||
|
|
25aa8fa3f2 | ||
|
|
50c3b7cf0b | ||
|
|
691e9987bc | ||
|
|
67f33125f6 | ||
|
|
729b92e35f | ||
|
|
e61c07f352 | ||
|
|
9ef0e418b8 | ||
|
|
de58cf9f3d | ||
|
|
d0f5b5ef7b | ||
|
|
5d51b158fa | ||
|
|
a02b017be7 | ||
|
|
d9b5eefd10 | ||
|
|
fb3f4fee16 | ||
|
|
3e295097df | ||
|
|
2aaec47fa6 | ||
|
|
9c96d6e476 | ||
|
|
ae9421f666 | ||
|
|
8e55ff1a6f | ||
|
|
8b3dbfc225 | ||
|
|
db28c82476 | ||
|
|
002619a8b5 | ||
|
|
f3c4714372 | ||
|
|
9cabf55ebd | ||
|
|
f318d33764 | ||
|
|
e4445da37b | ||
|
|
42aa2c7f17 | ||
|
|
a909b6da6e | ||
|
|
a8cdf5688b | ||
|
|
2ce8bcdc1b | ||
|
|
50b5159d17 | ||
|
|
fe380f9b0b | ||
|
|
2bded9434b | ||
|
|
3c8854f9de | ||
|
|
147d4fd968 | ||
|
|
142abbf3da | ||
|
|
b4d5a3f932 | ||
|
|
266fdade35 | ||
|
|
f138ae457e | ||
|
|
cc001e951e | ||
|
|
faee95f12f | ||
|
|
ed6b8c7469 | ||
|
|
7ac603b18e | ||
|
|
4803f0e65a | ||
|
|
ed84181b1c | ||
|
|
7207e595f6 | ||
|
|
f83dbafe7a | ||
|
|
53540e679b | ||
|
|
869fd70aef | ||
|
|
36d096d813 | ||
|
|
31e082f46e | ||
|
|
fa8b2d1f21 | ||
|
|
e4ecbfd1e8 | ||
|
|
bc050308fc | ||
|
|
904b7caa75 | ||
|
|
5af0fde583 | ||
|
|
5742412cb9 | ||
|
|
7cf453343a | ||
|
|
99d928ea15 | ||
|
|
b31b622a2e | ||
|
|
5f199d728e | ||
|
|
b6e458b81c | ||
|
|
8cdac330a4 | ||
|
|
8484d6ad86 | ||
|
|
d1d235a120 | ||
|
|
3a31924c6b | ||
|
|
252da729bb | ||
|
|
7f6a5615e6 | ||
|
|
1ee19246a1 | ||
|
|
46b1c5d1cc | ||
|
|
2437df392b | ||
|
|
580e780e58 | ||
|
|
3ce4067c3f | ||
|
|
d3f297730b | ||
|
|
dfcb3579b4 | ||
|
|
90ba261638 | ||
|
|
793d63a454 | ||
|
|
a4ee27778e | ||
|
|
021ca97865 | ||
|
|
d271b7e26c | ||
|
|
a38d4bdf55 | ||
|
|
30ac27d34a | ||
|
|
5451495c5c | ||
|
|
450fd5edbb | ||
|
|
1250d45ad8 | ||
|
|
f277c7c574 | ||
|
|
90dfa3ba8a | ||
|
|
8ba8ec69ca | ||
|
|
4b53300909 | ||
|
|
0858f01fec | ||
|
|
c5623faab1 | ||
|
|
fd68cad375 | ||
|
|
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 |
15
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: semiavalonia
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
||||
polar: # Replace with a single Polar username
|
||||
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
|
||||
thanks_dev: # Replace with a single thanks.dev username
|
||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||
26
.github/workflows/deploy.yml
vendored
@@ -2,24 +2,22 @@ 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
|
||||
OUTPUT_PATH: demo/Semi.Avalonia.Demo.Web/bin/Release/net10.0-browser/publish/wwwroot
|
||||
on:
|
||||
push:
|
||||
branches: [ "action/deploy" ]
|
||||
pull_request:
|
||||
branches: [ "action/deploy" ]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy-to-github-pages:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Setup .NET 8
|
||||
uses: actions/setup-dotnet@v4
|
||||
- name: Setup dotnet
|
||||
uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: 8.0.x
|
||||
dotnet-version: |
|
||||
10.0.x
|
||||
|
||||
- name: Install wasm-tools
|
||||
run: dotnet workload install wasm-tools
|
||||
@@ -27,9 +25,6 @@ jobs:
|
||||
- name: Publish .NET Project
|
||||
run: dotnet publish $PROJECT_PATH -c Release --nologo
|
||||
|
||||
- name: Change base-tag in index.html
|
||||
run: sed -i 's/<base href="\/" \/>/<base href="\/Semi.Avalonia\/" \/>/g' $OUTPUT_PATH/index.html
|
||||
|
||||
- name: copy index.html to 404.html
|
||||
run: cp $OUTPUT_PATH/index.html $OUTPUT_PATH/404.html
|
||||
|
||||
@@ -39,6 +34,7 @@ jobs:
|
||||
- name: Commit wwwroot to GitHub Pages
|
||||
uses: JamesIves/github-pages-deploy-action@v4.5.0
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
BRANCH: gh-pages
|
||||
FOLDER: ${{ env.OUTPUT_PATH }}
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: gh-pages
|
||||
folder: ${{ env.OUTPUT_PATH }}
|
||||
single-commit: true
|
||||
69
.github/workflows/pack-nightly.yml
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
name: Pack Nightly
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
Version_Prefix:
|
||||
description: 'Version Prefix'
|
||||
required: true
|
||||
default: '11.2.999'
|
||||
type: string
|
||||
Semi_Avalonia:
|
||||
description: 'Pack Semi.Avalonia'
|
||||
default: true
|
||||
type: boolean
|
||||
Semi_Avalonia_ColorPicker:
|
||||
description: 'Pack Semi.Avalonia.ColorPicker'
|
||||
default: true
|
||||
type: boolean
|
||||
Semi_Avalonia_DataGrid:
|
||||
description: 'Pack Semi.Avalonia.DataGrid'
|
||||
default: false
|
||||
type: boolean
|
||||
Semi_Avalonia_TreeDataGrid:
|
||||
description: 'Pack Semi.Avalonia.TreeDataGrid'
|
||||
default: false
|
||||
type: boolean
|
||||
|
||||
jobs:
|
||||
Pack_Nightly:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Get Version
|
||||
run: |
|
||||
VERSION_TIMESTAMP=$(date +'%Y%m%d%H%M%S')
|
||||
VERSION="${{ inputs.Version_Prefix }}-nightly-${VERSION_TIMESTAMP}"
|
||||
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||
|
||||
- name: Pack Semi.Avalonia
|
||||
if: ${{ inputs.Semi_Avalonia }}
|
||||
run: dotnet pack src/Semi.Avalonia -o nugets /p:Version=${{ env.VERSION }}
|
||||
|
||||
- name: Pack Semi.Avalonia.ColorPicker
|
||||
if: ${{ inputs.Semi_Avalonia_ColorPicker }}
|
||||
run: dotnet pack src/Semi.Avalonia.ColorPicker -o nugets /p:Version=${{ env.VERSION }}
|
||||
|
||||
- name: Pack Semi.Avalonia.DataGrid
|
||||
if: ${{ inputs.Semi_Avalonia_DataGrid }}
|
||||
run: dotnet pack src/Semi.Avalonia.DataGrid -o nugets /p:Version=${{ env.VERSION }}
|
||||
|
||||
- name: Pack Semi.Avalonia.TreeDataGrid
|
||||
if: ${{ inputs.Semi_Avalonia_TreeDataGrid }}
|
||||
run: dotnet pack src/Semi.Avalonia.TreeDataGrid -o nugets /p:Version=${{ env.VERSION }}
|
||||
|
||||
- name: Add NuGet Source
|
||||
run: dotnet nuget add source ${{ secrets.IRIHI_NUGET_NIGHTLY_FEED }} -n irihi.tech -u ${{ secrets.IRIHI_NUGET_USERNAME }} -p ${{ secrets.IRIHI_NUGET_PASSWORD }} --store-password-in-clear-text
|
||||
|
||||
- name: Publish Nightly Package
|
||||
run: dotnet nuget push "nugets/*.nupkg" --api-key ${{ secrets.IRIHI_NUGET_API_KEY }} --source irihi.tech --skip-duplicate
|
||||
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: nugets
|
||||
path: nugets
|
||||
if: always()
|
||||
107
.github/workflows/pack.yml
vendored
@@ -1,58 +1,77 @@
|
||||
name: Pack
|
||||
name: Pack to NuGet
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "action/pack" ]
|
||||
pull_request:
|
||||
branches: [ "action/pack" ]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
Upload_to_NuGet:
|
||||
description: 'Upload to NuGet'
|
||||
default: true
|
||||
type: boolean
|
||||
Semi_Avalonia:
|
||||
description: 'Pack Semi.Avalonia'
|
||||
default: true
|
||||
type: boolean
|
||||
Semi_Avalonia_ColorPicker:
|
||||
description: 'Pack Semi.Avalonia.ColorPicker'
|
||||
default: true
|
||||
type: boolean
|
||||
Semi_Avalonia_DataGrid:
|
||||
description: 'Pack Semi.Avalonia.DataGrid'
|
||||
default: false
|
||||
type: boolean
|
||||
Semi_Avalonia_TreeDataGrid:
|
||||
description: 'Pack Semi.Avalonia.TreeDataGrid'
|
||||
default: false
|
||||
type: boolean
|
||||
workflow_call:
|
||||
inputs:
|
||||
Upload_to_NuGet:
|
||||
type: boolean
|
||||
default: false
|
||||
Semi_Avalonia:
|
||||
type: boolean
|
||||
default: true
|
||||
Semi_Avalonia_ColorPicker:
|
||||
type: boolean
|
||||
default: true
|
||||
Semi_Avalonia_DataGrid:
|
||||
type: boolean
|
||||
default: true
|
||||
Semi_Avalonia_TreeDataGrid:
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
jobs:
|
||||
nuget_desktop:
|
||||
runs-on: windows-latest
|
||||
Pack_to_NuGet:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Nuget Semi.Avalonia
|
||||
run: dotnet pack ./src/Semi.Avalonia -o ./nugets
|
||||
- name: Pack Semi.Avalonia
|
||||
if: ${{ inputs.Semi_Avalonia }}
|
||||
run: dotnet pack src/Semi.Avalonia -o nugets
|
||||
|
||||
- name: Nuget Semi.Avalonia.ColorPicker
|
||||
run: dotnet pack ./src/Semi.Avalonia.ColorPicker -o ./nugets
|
||||
- name: Pack Semi.Avalonia.ColorPicker
|
||||
if: ${{ inputs.Semi_Avalonia_ColorPicker }}
|
||||
run: dotnet pack src/Semi.Avalonia.ColorPicker -o nugets
|
||||
|
||||
- name: Nuget Semi.Avalonia.DataGrid
|
||||
run: dotnet pack ./src/Semi.Avalonia.DataGrid -o ./nugets
|
||||
- name: Pack Semi.Avalonia.DataGrid
|
||||
if: ${{ inputs.Semi_Avalonia_DataGrid }}
|
||||
run: dotnet pack src/Semi.Avalonia.DataGrid -o nugets
|
||||
|
||||
- name: Nuget Semi.Avalonia.TreeDataGrid
|
||||
run: dotnet pack ./src/Semi.Avalonia.TreeDataGrid -o ./nugets
|
||||
- name: Pack Semi.Avalonia.TreeDataGrid
|
||||
if: ${{ inputs.Semi_Avalonia_TreeDataGrid }}
|
||||
run: dotnet pack src/Semi.Avalonia.TreeDataGrid -o nugets
|
||||
|
||||
- name: 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 to NuGet
|
||||
if: ${{ inputs.Upload_to_NuGet }}
|
||||
run: dotnet nuget push "nugets/*.nupkg" --api-key ${{ secrets.NUGET_ORG_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
|
||||
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: nuget_desktop
|
||||
path: |
|
||||
./nugets
|
||||
./**/publish/*.exe
|
||||
|
||||
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: Build
|
||||
run: dotnet publish ./demo/Semi.Avalonia.Demo.Android -c Release -f net8.0-android --no-restore
|
||||
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: android
|
||||
path: ./**/publish/*Signed.apk
|
||||
name: nugets
|
||||
path: nugets
|
||||
if: always()
|
||||
225
.github/workflows/publish.yml
vendored
Normal file
@@ -0,0 +1,225 @@
|
||||
name: Publish Demo
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
win-x64:
|
||||
description: 'Windows x64'
|
||||
default: false
|
||||
type: boolean
|
||||
win-x64-aot:
|
||||
description: 'Windows x64 AOT'
|
||||
default: false
|
||||
type: boolean
|
||||
linux-x64:
|
||||
description: 'Linux x64'
|
||||
default: false
|
||||
type: boolean
|
||||
linux-x64-aot:
|
||||
description: 'Linux x64 AOT'
|
||||
default: false
|
||||
type: boolean
|
||||
drm-linux-x64:
|
||||
description: 'DRM Linux x64'
|
||||
default: false
|
||||
type: boolean
|
||||
drm-linux-x64-aot:
|
||||
description: 'DRM Linux x64 AOT'
|
||||
default: false
|
||||
type: boolean
|
||||
osx-arm64:
|
||||
description: 'macOS arm64'
|
||||
default: false
|
||||
type: boolean
|
||||
osx-arm64-aot:
|
||||
description: 'macOS arm64 AOT'
|
||||
default: false
|
||||
type: boolean
|
||||
android-arm64:
|
||||
description: 'Android arm64'
|
||||
default: false
|
||||
type: boolean
|
||||
workflow_call:
|
||||
inputs:
|
||||
win-x64:
|
||||
type: boolean
|
||||
default: true
|
||||
win-x64-aot:
|
||||
type: boolean
|
||||
default: true
|
||||
linux-x64:
|
||||
type: boolean
|
||||
default: true
|
||||
linux-x64-aot:
|
||||
type: boolean
|
||||
default: true
|
||||
drm-linux-x64:
|
||||
type: boolean
|
||||
default: true
|
||||
drm-linux-x64-aot:
|
||||
type: boolean
|
||||
default: true
|
||||
osx-arm64:
|
||||
type: boolean
|
||||
default: true
|
||||
osx-arm64-aot:
|
||||
type: boolean
|
||||
default: true
|
||||
android-arm64:
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
jobs:
|
||||
win-x64:
|
||||
if: ${{inputs.win-x64}}
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
- name: Publish win-x64
|
||||
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o publish --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: Semi.Avalonia.Demo.Desktop.win-x64
|
||||
path: |
|
||||
publish
|
||||
!publish/*.pdb
|
||||
|
||||
win-x64-aot:
|
||||
if: ${{inputs.win-x64-aot}}
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
- name: Enable Native AOT in .csproj
|
||||
run: sed -i 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
|
||||
- name: Publish win-x64 AOT
|
||||
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o publish
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: Semi.Avalonia.Demo.Desktop.win-x64.NativeAOT
|
||||
path: |
|
||||
publish
|
||||
!publish/*.pdb
|
||||
|
||||
linux-x64:
|
||||
if: ${{inputs.linux-x64}}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
- name: Publish linux-x64
|
||||
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r linux-x64 -c Release -o publish --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: Semi.Avalonia.Demo.Desktop.linux-x64
|
||||
path: |
|
||||
publish
|
||||
!publish/*.pdb
|
||||
|
||||
linux-x64-aot:
|
||||
if: ${{inputs.linux-x64-aot}}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
- name: Enable Native AOT in .csproj
|
||||
run: sed -i 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
|
||||
- name: Publish linux-x64 AOT
|
||||
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r linux-x64 -c Release -o publish
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: Semi.Avalonia.Demo.Desktop.linux-x64.NativeAOT
|
||||
path: |
|
||||
publish
|
||||
!publish/*.pdb
|
||||
|
||||
drm-linux-x64:
|
||||
if: ${{inputs.drm-linux-x64}}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
- name: Publish linux-x64 DRM
|
||||
run: dotnet publish demo/Semi.Avalonia.Demo.Drm -r linux-x64 -c Release -o publish --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: Semi.Avalonia.Demo.Drm.linux-x64
|
||||
path: |
|
||||
publish
|
||||
!publish/*.pdb
|
||||
|
||||
drm-linux-x64-aot:
|
||||
if: ${{inputs.drm-linux-x64-aot}}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
- name: Enable Native AOT in .csproj
|
||||
run: sed -i 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj
|
||||
- name: Publish linux-x64 AOT
|
||||
run: dotnet publish demo/Semi.Avalonia.Demo.Drm -r linux-x64 -c Release -o publish
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: Semi.Avalonia.Demo.Drm.linux-x64.NativeAOT
|
||||
path: |
|
||||
publish
|
||||
!publish/*.pdb
|
||||
|
||||
osx-arm64:
|
||||
if: ${{inputs.osx-arm64}}
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
- name: Publish osx-arm64
|
||||
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r osx-arm64 -c Release -o publish --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: Semi.Avalonia.Demo.Desktop.osx-arm64
|
||||
path: |
|
||||
publish
|
||||
!publish/*.pdb
|
||||
|
||||
osx-arm64-aot:
|
||||
if: ${{inputs.osx-arm64-aot}}
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
- name: Enable Native AOT in .csproj
|
||||
run: sed -i '' 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
|
||||
- name: Publish osx-arm64 AOT
|
||||
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r osx-arm64 -c Release -o publish
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: Semi.Avalonia.Demo.Desktop.osx-arm64.NativeAOT
|
||||
path: |
|
||||
publish
|
||||
!publish/*.pdb
|
||||
|
||||
android-arm64:
|
||||
if: ${{inputs.android-arm64 }}
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
- name: Install Android workload
|
||||
run: dotnet workload install android
|
||||
- name: Restore Dependencies
|
||||
run: dotnet restore demo/Semi.Avalonia.Demo.Android
|
||||
- name: Publish Android
|
||||
run: dotnet publish demo/Semi.Avalonia.Demo.Android -c Release -f net10.0-android --no-restore -o publish /p:RuntimeIdentifier=android-arm64
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: android-arm64
|
||||
path: publish/*Signed.apk
|
||||
73
.github/workflows/release-tag.yml
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
name: Release Tag
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
Upload_to_NuGet:
|
||||
description: 'Upload to NuGet'
|
||||
default: false
|
||||
type: boolean
|
||||
Semi_Avalonia:
|
||||
description: 'Pack Semi.Avalonia'
|
||||
default: true
|
||||
type: boolean
|
||||
Semi_Avalonia_ColorPicker:
|
||||
description: 'Pack Semi.Avalonia.ColorPicker'
|
||||
default: true
|
||||
type: boolean
|
||||
Semi_Avalonia_DataGrid:
|
||||
description: 'Pack Semi.Avalonia.DataGrid'
|
||||
default: false
|
||||
type: boolean
|
||||
Semi_Avalonia_TreeDataGrid:
|
||||
description: 'Pack Semi.Avalonia.TreeDataGrid'
|
||||
default: false
|
||||
type: boolean
|
||||
|
||||
jobs:
|
||||
nuget:
|
||||
uses: ./.github/workflows/pack.yml
|
||||
with:
|
||||
Upload_to_NuGet: ${{ inputs.Upload_to_NuGet }}
|
||||
Semi_Avalonia: ${{ inputs.Semi_Avalonia }}
|
||||
Semi_Avalonia_ColorPicker: ${{ inputs.Semi_Avalonia_ColorPicker }}
|
||||
Semi_Avalonia_DataGrid: ${{ inputs.Semi_Avalonia_DataGrid }}
|
||||
Semi_Avalonia_TreeDataGrid: ${{ inputs.Semi_Avalonia_TreeDataGrid }}
|
||||
|
||||
publish:
|
||||
uses: ./.github/workflows/publish.yml
|
||||
|
||||
draft-release:
|
||||
needs: [ nuget,publish ]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4.3.0
|
||||
|
||||
- name: Display structure of downloaded files
|
||||
run: ls -R
|
||||
|
||||
- name: Zip artifacts
|
||||
run: |
|
||||
zip -rj Semi.Avalonia.Demo.Desktop.win-x64.zip Semi.Avalonia.Demo.Desktop.win-x64
|
||||
zip -rj Semi.Avalonia.Demo.Desktop.win-x64.NativeAOT.zip Semi.Avalonia.Demo.Desktop.win-x64.NativeAOT
|
||||
zip -rj Semi.Avalonia.Demo.Desktop.linux-x64.zip Semi.Avalonia.Demo.Desktop.linux-x64
|
||||
zip -rj Semi.Avalonia.Demo.Desktop.linux-x64.NativeAOT.zip Semi.Avalonia.Demo.Desktop.linux-x64.NativeAOT
|
||||
zip -rj Semi.Avalonia.Demo.Drm.linux-x64.zip Semi.Avalonia.Demo.Drm.linux-x64
|
||||
zip -rj Semi.Avalonia.Demo.Drm.linux-x64.NativeAOT.zip Semi.Avalonia.Demo.Drm.linux-x64.NativeAOT
|
||||
zip -rj Semi.Avalonia.Demo.Desktop.osx-arm64.zip Semi.Avalonia.Demo.Desktop.osx-arm64
|
||||
cd Semi.Avalonia.Demo.Desktop.osx-arm64.NativeAOT
|
||||
zip -r ../Semi.Avalonia.Demo.Desktop.osx-arm64.NativeAOT.zip .
|
||||
|
||||
- name: Display structure of zipped files
|
||||
run: ls -R
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2.3.2
|
||||
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
|
||||
with:
|
||||
generate_release_notes: true
|
||||
draft: true
|
||||
files: |
|
||||
nugets/*.nupkg
|
||||
android-arm64/*.apk
|
||||
*.zip
|
||||
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022 iriHi Technology
|
||||
Copyright (c) 2022 IRIHI Technology
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
72
README.md
@@ -2,11 +2,16 @@
|
||||
|
||||
[](https://www.nuget.org/packages/Semi.Avalonia/)
|
||||
[](https://www.nuget.org/packages/Semi.Avalonia/)
|
||||
[](https://gitcode.com/IRIHI_Technology/Semi.Avalonia)
|
||||
|
||||
[中文](./README_CN.md)
|
||||
|
||||
Avalonia Theme inspired by Semi Design
|
||||
|
||||
Semi.Avalonia can be previewed in the browser [here](https://irihitech.github.io/Semi.Avalonia/)
|
||||
|
||||
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)
|
||||
|
||||

|
||||
@@ -22,58 +27,40 @@ 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.
|
||||
|
||||
ColorPicker, DataGrid and TreeDataGrid are distributed in separated packages. Please install if you need.
|
||||
ColorPicker, DataGrid, TreeDataGrid, Dock, Tabalonia and AvaloniaEdit are distributed in separated packages. Please install if you need.
|
||||
|
||||
```bash
|
||||
dotnet add package Semi.Avalonia.ColorPicker
|
||||
dotnet add package Semi.Avalonia.DataGrid
|
||||
dotnet add package Semi.Avalonia.TreeDataGrid
|
||||
dotnet add package Semi.Avalonia.Dock
|
||||
dotnet add package Semi.Avalonia.Tabalonia
|
||||
dotnet add package Semi.Avalonia.AvaloniaEdit
|
||||
```
|
||||
|
||||
```xaml
|
||||
<Application.Styles>
|
||||
<StyleInclude Source="avares://Semi.Avalonia.ColorPicker/Index.axaml" />
|
||||
<StyleInclude Source="avares://Semi.Avalonia.DataGrid/Index.axaml" />
|
||||
<StyleInclude Source="avares://Semi.Avalonia.TreeDataGrid/Index.axaml" />
|
||||
<semi:ColorPickerSemiTheme />
|
||||
<semi:DataGridSemiTheme />
|
||||
<semi:TreeDataGridSemiTheme />
|
||||
<semi:DockSemiTheme />
|
||||
<semi:TabaloniaSemiTheme />
|
||||
<semi:AvaloniaEditSemiTheme />
|
||||
</Application.Styles>
|
||||
```
|
||||
|
||||
If AOT publishing is required, you need to include the rd.xml file in your project:
|
||||
|
||||
```xml
|
||||
<ItemGroup>
|
||||
<RdXmlFile Include="rd.xml"/>
|
||||
</ItemGroup>
|
||||
```
|
||||
|
||||
The contents of the rd.xml file should be as follows:
|
||||
|
||||
```xml
|
||||
<?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"/>
|
||||
<!-- If you don't use these, please don't include them.
|
||||
<Assembly Name="Semi.Avalonia.DataGrid" Dynamic="Required All"/>
|
||||
<Assembly Name="Semi.Avalonia.ColorPicker" Dynamic="Required All"/>
|
||||
-->
|
||||
</Application>
|
||||
</Directives>
|
||||
```
|
||||
Notice: Dock, Tabalonia and AvaloniaEdit are delivered via nuget for free, but not open source. Please read the license and agree to continue use these packages. If you need source code, please contact us via email: [contact@irihi.tech](contact@irihi.tech)
|
||||
|
||||
## Demo
|
||||
|
||||
@@ -84,15 +71,16 @@ You can always download demo executable to play around with Semi Avalonia Themes
|
||||
|
||||
We offer limited free community support for Semi Avalonia and Ursa. If you have any question or suggestion, feel free to raise issues and discussions via GitHub, and you are welcomed to join our group via FeiShu(Lark)
|
||||
|
||||

|
||||

|
||||
|
||||
## Version compatibility
|
||||
|
||||
| Semi Design Version | Avalonia Version |
|
||||
|:--------------------|:-----------------|
|
||||
| 11.1.0-rc | >=11.1.0-rc |
|
||||
| 11.0.7 | >=11.0.7 |
|
||||
| 11.0.1 | <=11.0.6 |
|
||||
| Semi Avalonia Version | Avalonia Version |
|
||||
|:----------------------|:-----------------|
|
||||
| 11.3.7 | >=11.3.7 |
|
||||
| 11.2.1 | >=11.2.1 |
|
||||
| 11.2.0 | End of Life |
|
||||
| 11.1.x | End of Life |
|
||||
|
||||
## Credits
|
||||
|
||||
|
||||
72
README_CN.md
@@ -2,11 +2,16 @@
|
||||
|
||||
[](https://www.nuget.org/packages/Semi.Avalonia/)
|
||||
[](https://www.nuget.org/packages/Semi.Avalonia/)
|
||||
[](https://gitcode.com/IRIHI_Technology/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)
|
||||
|
||||

|
||||
@@ -22,63 +27,44 @@ dotnet add package Semi.Avalonia
|
||||
在样式中引用 Semi 主题:
|
||||
|
||||
```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>
|
||||
```
|
||||
|
||||
这样就可以了。
|
||||
|
||||
ColorPicker, DataGrid 和 TreeDataGrid 的样式单独分发,如果需要请安装并引用。
|
||||
ColorPicker、DataGrid、TreeDataGrid、Dock、Tabalonia 和 AvaloniaEdit 的样式单独分发,如果需要请安装并引用。
|
||||
|
||||
```bash
|
||||
dotnet add package Semi.Avalonia.ColorPicker
|
||||
dotnet add package Semi.Avalonia.DataGrid
|
||||
dotnet add package Semi.Avalonia.TreeDataGrid
|
||||
dotnet add package Semi.Avalonia.Dock
|
||||
dotnet add package Semi.Avalonia.Tabalonia
|
||||
dotnet add package Semi.Avalonia.AvaloniaEdit
|
||||
```
|
||||
|
||||
```xaml
|
||||
<Application.Styles>
|
||||
<StyleInclude Source="avares://Semi.Avalonia.ColorPicker/Index.axaml" />
|
||||
<StyleInclude Source="avares://Semi.Avalonia.DataGrid/Index.axaml" />
|
||||
<StyleInclude Source="avares://Semi.Avalonia.TreeDataGrid/Index.axaml" />
|
||||
<semi:ColorPickerSemiTheme />
|
||||
<semi:DataGridSemiTheme />
|
||||
<semi:TreeDataGridSemiTheme />
|
||||
<semi:DockSemiTheme />
|
||||
<semi:TabaloniaSemiTheme />
|
||||
<semi:AvaloniaEditSemiTheme />
|
||||
</Application.Styles>
|
||||
```
|
||||
|
||||
如果需要进行 AOT 发布,则需要在项目中包含 rd.xml 文件:
|
||||
|
||||
```xml
|
||||
<ItemGroup>
|
||||
<RdXmlFile Include="rd.xml"/>
|
||||
</ItemGroup>
|
||||
```
|
||||
|
||||
rd.xml 文件的内容如下:
|
||||
|
||||
```xml
|
||||
<?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"/>
|
||||
<!-- If you don't use these, please don't include them.
|
||||
<Assembly Name="Semi.Avalonia.DataGrid" Dynamic="Required All"/>
|
||||
<Assembly Name="Semi.Avalonia.ColorPicker" Dynamic="Required All"/>
|
||||
-->
|
||||
</Application>
|
||||
</Directives>
|
||||
```
|
||||
注意:Dock、Tabalonia 和 AvaloniaEdit 是通过 NuGet 免费分发的,但不是开源的。请阅读许可协议并同意后继续使用这些包。如果您需要源代码,请通过电子邮件联系我们:[contact@irihi.tech](contact@irihi.tech)
|
||||
|
||||
## 示例
|
||||
|
||||
您可以从 Semi Avalonia 的 release 页下载并试用 Semi Avalonia 的展示应用。
|
||||
|
||||
<https://github.com/irihitech/Semi.Avalonia/releases>
|
||||
|
||||
## 社区支持
|
||||
@@ -87,14 +73,14 @@ rd.xml 文件的内容如下:
|
||||
|
||||

|
||||
|
||||
|
||||
## 版本兼容性
|
||||
|
||||
| Semi Design Version | Avalonia Version |
|
||||
|:--------------------|:-----------------|
|
||||
| 11.1.0-rc | >=11.1.0-rc |
|
||||
| 11.0.7 | >=11.0.7 |
|
||||
| 11.0.1 | <=11.0.6 |
|
||||
| Semi Avalonia Version | Avalonia Version |
|
||||
|:----------------------|:-----------------|
|
||||
| 11.3.7 | >=11.3.7 |
|
||||
| 11.2.1 | >=11.2.1 |
|
||||
| 11.2.0 | End of Life |
|
||||
| 11.1.x | End of Life |
|
||||
|
||||
## 致谢
|
||||
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.3.32929.385
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semi.Avalonia", "src\Semi.Avalonia\Semi.Avalonia.csproj", "{90D0B063-BC64-40AB-A56C-AC11909CF410}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution Files", "{B1E6A7D4-0AFB-4D32-9969-5FBDAC0CFF3E}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
demo\Directory.Build.props = demo\Directory.Build.props
|
||||
demo\global.json = demo\global.json
|
||||
src\Package.props = src\Package.props
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Demo", "Demo", "{43091528-9509-43CB-A003-9C5C11E96DD6}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semi.Avalonia.Demo.Desktop", "demo\Semi.Avalonia.Demo.Desktop\Semi.Avalonia.Demo.Desktop.csproj", "{2ADCA724-2B6D-46EC-87F7-604D7918B89A}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semi.Avalonia.Demo.Web", "demo\Semi.Avalonia.Demo.Web\Semi.Avalonia.Demo.Web.csproj", "{69A2C77D-6DB7-4AE4-B179-D1F5CF5E2DF0}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semi.Avalonia.Demo", "demo\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj", "{D789AEDB-EBDF-4450-8E8E-B4A03FB257B0}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semi.Avalonia.DataGrid", "src\Semi.Avalonia.DataGrid\Semi.Avalonia.DataGrid.csproj", "{8A90C292-8761-4F70-8E1F-EFC097FEADB3}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semi.Avalonia.ColorPicker", "src\Semi.Avalonia.ColorPicker\Semi.Avalonia.ColorPicker.csproj", "{0B64C2F2-FDCD-48E4-AB9D-7CCC63B006CA}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semi.Avalonia.Demo.Android", "demo\Semi.Avalonia.Demo.Android\Semi.Avalonia.Demo.Android.csproj", "{0C81FC1C-5D2D-478A-9876-923A0C85EC2F}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Semi.Avalonia.Demo.Drm", "demo\Semi.Avalonia.Demo.Drm\Semi.Avalonia.Demo.Drm.csproj", "{86D93406-412A-4429-93B2-92AAD0407784}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Semi.Avalonia.TreeDataGrid", "src\Semi.Avalonia.TreeDataGrid\Semi.Avalonia.TreeDataGrid.csproj", "{398D2998-0835-41F5-99A3-608CAB8051E2}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Semi.Avalonia.TreeDataGrid.Demo", "demo\Semi.Avalonia.TreeDataGrid.Demo\Semi.Avalonia.TreeDataGrid.Demo.csproj", "{6178B545-4BB6-458C-A27C-EE11F3885D38}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{90D0B063-BC64-40AB-A56C-AC11909CF410}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{90D0B063-BC64-40AB-A56C-AC11909CF410}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{90D0B063-BC64-40AB-A56C-AC11909CF410}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{90D0B063-BC64-40AB-A56C-AC11909CF410}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{2ADCA724-2B6D-46EC-87F7-604D7918B89A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{2ADCA724-2B6D-46EC-87F7-604D7918B89A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2ADCA724-2B6D-46EC-87F7-604D7918B89A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{2ADCA724-2B6D-46EC-87F7-604D7918B89A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{69A2C77D-6DB7-4AE4-B179-D1F5CF5E2DF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{69A2C77D-6DB7-4AE4-B179-D1F5CF5E2DF0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{69A2C77D-6DB7-4AE4-B179-D1F5CF5E2DF0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{69A2C77D-6DB7-4AE4-B179-D1F5CF5E2DF0}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D789AEDB-EBDF-4450-8E8E-B4A03FB257B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D789AEDB-EBDF-4450-8E8E-B4A03FB257B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D789AEDB-EBDF-4450-8E8E-B4A03FB257B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D789AEDB-EBDF-4450-8E8E-B4A03FB257B0}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8A90C292-8761-4F70-8E1F-EFC097FEADB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8A90C292-8761-4F70-8E1F-EFC097FEADB3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8A90C292-8761-4F70-8E1F-EFC097FEADB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8A90C292-8761-4F70-8E1F-EFC097FEADB3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{0B64C2F2-FDCD-48E4-AB9D-7CCC63B006CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0B64C2F2-FDCD-48E4-AB9D-7CCC63B006CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0B64C2F2-FDCD-48E4-AB9D-7CCC63B006CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0B64C2F2-FDCD-48E4-AB9D-7CCC63B006CA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{0C81FC1C-5D2D-478A-9876-923A0C85EC2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0C81FC1C-5D2D-478A-9876-923A0C85EC2F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0C81FC1C-5D2D-478A-9876-923A0C85EC2F}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
||||
{0C81FC1C-5D2D-478A-9876-923A0C85EC2F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0C81FC1C-5D2D-478A-9876-923A0C85EC2F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{86D93406-412A-4429-93B2-92AAD0407784}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{86D93406-412A-4429-93B2-92AAD0407784}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{86D93406-412A-4429-93B2-92AAD0407784}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{86D93406-412A-4429-93B2-92AAD0407784}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{398D2998-0835-41F5-99A3-608CAB8051E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{398D2998-0835-41F5-99A3-608CAB8051E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{398D2998-0835-41F5-99A3-608CAB8051E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{398D2998-0835-41F5-99A3-608CAB8051E2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{6178B545-4BB6-458C-A27C-EE11F3885D38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{6178B545-4BB6-458C-A27C-EE11F3885D38}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6178B545-4BB6-458C-A27C-EE11F3885D38}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6178B545-4BB6-458C-A27C-EE11F3885D38}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{2ADCA724-2B6D-46EC-87F7-604D7918B89A} = {43091528-9509-43CB-A003-9C5C11E96DD6}
|
||||
{69A2C77D-6DB7-4AE4-B179-D1F5CF5E2DF0} = {43091528-9509-43CB-A003-9C5C11E96DD6}
|
||||
{D789AEDB-EBDF-4450-8E8E-B4A03FB257B0} = {43091528-9509-43CB-A003-9C5C11E96DD6}
|
||||
{0C81FC1C-5D2D-478A-9876-923A0C85EC2F} = {43091528-9509-43CB-A003-9C5C11E96DD6}
|
||||
{86D93406-412A-4429-93B2-92AAD0407784} = {43091528-9509-43CB-A003-9C5C11E96DD6}
|
||||
{6178B545-4BB6-458C-A27C-EE11F3885D38} = {43091528-9509-43CB-A003-9C5C11E96DD6}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {7CA41ED3-2CED-40CC-AA21-28C3B42B1E86}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
28
Semi.Avalonia.slnx
Normal file
@@ -0,0 +1,28 @@
|
||||
<Solution>
|
||||
<Folder Name="/Demo/">
|
||||
<Project Path="demo/Semi.Avalonia.Demo.Android/Semi.Avalonia.Demo.Android.csproj"/>
|
||||
<Project Path="demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj"/>
|
||||
<Project Path="demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj"/>
|
||||
<Project Path="demo/Semi.Avalonia.Demo.Web/Semi.Avalonia.Demo.Web.csproj"/>
|
||||
<Project Path="demo/Semi.Avalonia.Demo/Semi.Avalonia.Demo.csproj"/>
|
||||
</Folder>
|
||||
<Folder Name="/GitHub Action/">
|
||||
<File Path=".github/workflows/deploy.yml"/>
|
||||
<File Path=".github/workflows/pack-nightly.yml"/>
|
||||
<File Path=".github/workflows/pack.yml"/>
|
||||
<File Path=".github/workflows/publish.yml"/>
|
||||
<File Path=".github/workflows/release-tag.yml"/>
|
||||
</Folder>
|
||||
<Folder Name="/Solution Items/Demo/">
|
||||
<File Path="demo/Directory.Packages.props"/>
|
||||
<File Path="demo/global.json"/>
|
||||
</Folder>
|
||||
<Folder Name="/Solution Items/Package/">
|
||||
<File Path="src/Directory.Packages.props"/>
|
||||
<File Path="src/Directory.Build.props"/>
|
||||
</Folder>
|
||||
<Project Path="src/Semi.Avalonia.ColorPicker/Semi.Avalonia.ColorPicker.csproj"/>
|
||||
<Project Path="src/Semi.Avalonia.DataGrid/Semi.Avalonia.DataGrid.csproj"/>
|
||||
<Project Path="src/Semi.Avalonia.TreeDataGrid/Semi.Avalonia.TreeDataGrid.csproj"/>
|
||||
<Project Path="src/Semi.Avalonia/Semi.Avalonia.csproj"/>
|
||||
</Solution>
|
||||
@@ -1,6 +0,0 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<Nullable>enable</Nullable>
|
||||
<AvaloniaVersion>11.1.0-rc2</AvaloniaVersion>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
27
demo/Directory.Packages.props
Normal file
@@ -0,0 +1,27 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||
<AvaloniaVersion>11.3.11</AvaloniaVersion>
|
||||
<DataGridVersion>11.3.11</DataGridVersion>
|
||||
<SkiaSharpVersion>3.119.1</SkiaSharpVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageVersion Include="Avalonia" Version="$(AvaloniaVersion)"/>
|
||||
<PackageVersion Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
|
||||
<PackageVersion Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
|
||||
<PackageVersion Include="Avalonia.LinuxFramebuffer" Version="$(AvaloniaVersion)"/>
|
||||
<PackageVersion Include="Avalonia.iOS" Version="$(AvaloniaVersion)" />
|
||||
<PackageVersion Include="Avalonia.Browser" Version="$(AvaloniaVersion)" />
|
||||
<PackageVersion Include="Avalonia.Android" Version="$(AvaloniaVersion)" />
|
||||
<PackageVersion Include="Avalonia.Controls.ColorPicker" Version="$(AvaloniaVersion)"/>
|
||||
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="$(DataGridVersion)"/>
|
||||
|
||||
<PackageVersion Include="SkiaSharp" Version="$(SkiaSharpVersion)"/>
|
||||
<PackageVersion Include="SkiaSharp.NativeAssets.WebAssembly" Version="$(SkiaSharpVersion)"/>
|
||||
|
||||
<PackageVersion Include="Xamarin.AndroidX.Core.SplashScreen" Version="1.2.0"/>
|
||||
|
||||
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.0"/>
|
||||
<PackageVersion Include="Irihi.Avalonia.Shared" Version="0.3.1"/>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
BIN
demo/Fonts/SourceHanSansCN-Bold.otf
Normal file
@@ -0,0 +1,16 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Android;
|
||||
|
||||
public static class AvaloniaAppBuilderExtensions
|
||||
{
|
||||
private static string DefaultFontFamily => "avares://Semi.Avalonia.Demo.Android/Assets#Source Han Sans CN";
|
||||
|
||||
public static AppBuilder WithSourceHanSansCNFont(this AppBuilder builder) =>
|
||||
builder.With(new FontManagerOptions
|
||||
{
|
||||
DefaultFamilyName = DefaultFontFamily,
|
||||
FontFallbacks = [new FontFallback { FontFamily = new FontFamily(DefaultFontFamily) }]
|
||||
});
|
||||
}
|
||||
BIN
demo/Semi.Avalonia.Demo.Android/Icon.png
Normal file
|
After Width: | Height: | Size: 717 B |
@@ -1,5 +1,6 @@
|
||||
using Android.App;
|
||||
using Android.Content.PM;
|
||||
using Avalonia;
|
||||
using Avalonia.Android;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Android;
|
||||
@@ -13,4 +14,9 @@ namespace Semi.Avalonia.Demo.Android;
|
||||
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)]
|
||||
public class MainActivity : AvaloniaMainActivity<App>
|
||||
{
|
||||
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
|
||||
{
|
||||
return base.CustomizeAppBuilder(builder)
|
||||
.WithSourceHanSansCNFont();
|
||||
}
|
||||
}
|
||||
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>
|
||||
|
Before Width: | Height: | Size: 7.1 KiB |
@@ -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,29 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0-android</TargetFramework>
|
||||
<TargetFramework>net10.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"/>
|
||||
<AvaloniaResource Include="..\Fonts\*" Link="Assets\Fonts\%(Filename)%(Extension)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj" />
|
||||
<PackageReference Include="Avalonia.Android"/>
|
||||
<PackageReference Include="Xamarin.AndroidX.Core.SplashScreen"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -1,13 +1,11 @@
|
||||
using Avalonia;
|
||||
using System;
|
||||
using Avalonia;
|
||||
using Avalonia.Dialogs;
|
||||
using Avalonia.Media;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Desktop;
|
||||
|
||||
class Program
|
||||
sealed class Program
|
||||
{
|
||||
// Initialization code. Don't use any Avalonia, third-party APIs or any
|
||||
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
|
||||
@@ -16,13 +14,13 @@ class Program
|
||||
public static void Main(string[] args) => BuildAvaloniaApp()
|
||||
.With(new FontManagerOptions
|
||||
{
|
||||
FontFallbacks = new[]
|
||||
{
|
||||
FontFallbacks =
|
||||
[
|
||||
new FontFallback
|
||||
{
|
||||
FontFamily = new FontFamily("Microsoft YaHei")
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
.StartWithClassicDesktopLifetime(args);
|
||||
|
||||
@@ -33,4 +31,4 @@ class Program
|
||||
.UsePlatformDetect()
|
||||
.With(new Win32PlatformOptions())
|
||||
.LogToTrace();
|
||||
}
|
||||
}
|
||||
@@ -4,11 +4,9 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
||||
<ApplicationIcon>..\Semi.Avalonia.Demo\Assets\irihi.ico</ApplicationIcon>
|
||||
<!-- Uncomment below to enable Native AOT compilation-->
|
||||
<!--
|
||||
<PublishAot>true</PublishAot>
|
||||
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
|
||||
-->
|
||||
<!--<PublishAot>true</PublishAot>-->
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
|
||||
@@ -21,16 +19,14 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<TrimmerRootDescriptor Include="Roots.xml" />
|
||||
<TrimmerRootDescriptor Include="Roots.xml"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
|
||||
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
|
||||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
|
||||
<PackageReference Include="Avalonia.Desktop"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj" />
|
||||
<ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj"/>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
|
||||
@@ -3,10 +3,11 @@ using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using Avalonia;
|
||||
using Avalonia.Dialogs;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Drm;
|
||||
|
||||
class Program
|
||||
sealed class Program
|
||||
{
|
||||
// Initialization code. Don't use any Avalonia, third-party APIs or any
|
||||
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
|
||||
@@ -28,7 +29,7 @@ class Program
|
||||
if (args.Contains("--drm"))
|
||||
{
|
||||
SilenceConsole();
|
||||
return builder.StartLinuxDrm(args: args, card: "/dev/dri/card1", scaling: GetScaling());
|
||||
return builder.StartLinuxDrm(args, scaling: GetScaling());
|
||||
}
|
||||
|
||||
return builder.StartWithClassicDesktopLifetime(args);
|
||||
@@ -37,7 +38,9 @@ class Program
|
||||
// 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()
|
||||
|
||||
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
@@ -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
@@ -0,0 +1,3 @@
|
||||
<linker>
|
||||
<assembly fullname="Semi.Avalonia.Demo" preserve="All"/>
|
||||
</linker>
|
||||
@@ -1,22 +1,33 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
||||
<ApplicationIcon>..\Semi.Avalonia.Demo\Assets\irihi.ico</ApplicationIcon>
|
||||
<!-- Uncomment below to enable Native AOT compilation-->
|
||||
<!--<PublishAot>true</PublishAot>-->
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
|
||||
<IsTrimmable>true</IsTrimmable>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
</PropertyGroup>
|
||||
|
||||
<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>
|
||||
<PropertyGroup>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<TrimmerRootDescriptor Include="Roots.xml"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia.Desktop"/>
|
||||
<PackageReference Include="Avalonia.LinuxFramebuffer"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj"/>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
# DRM启动步骤
|
||||
|
||||
(Ubuntu18.04Server版本 虚拟机测试OK)
|
||||
(Orange Pi Zero2 Ubuntu20.04-arm64 测试OK)
|
||||
|
||||
Avalonia官方参考文档:https://docs.avaloniaui.net/docs/next/guides/platforms/rpi/running-on-raspbian-lite-via-drm
|
||||
|
||||
1.Linux端运行命令
|
||||
```
|
||||
sudo apt update
|
||||
sudo apt upgrade
|
||||
sudo reboot
|
||||
sudo apt - get install libgbm1 libgl1 - mesa - dri libegl1 - mesa libinput10
|
||||
```
|
||||
|
||||
2.安装测试工具测试(出现一个彩色立方体说明环境安装完成)
|
||||
```
|
||||
sudo apt-get install kmscube
|
||||
sudo kmscube
|
||||
```
|
||||
|
||||
3.安装.net运行时(参考网址:https://learn.microsoft.com/zh-cn/dotnet/core/install/linux?WT.mc_id=dotnet-35129-website)
|
||||
|
||||
4.新建一个Avalonia项目,nuget里面添加Avalonia.LinuxFramebuffer包
|
||||
|
||||
5.添加StartLinuxDrm代码(不知道怎么添加看Semi.Avalonia.Demo.Drm项目代码)
|
||||
|
||||
6.发布程序到Linux(安装.net,怎么运行这些省略)
|
||||
|
||||
7.运行 ./Semi.Avalonia.Demo.Drm --drm
|
||||
|
||||
## 报错处理:
|
||||
|
||||
1. 报错内容
|
||||
|
||||
>Unhandled exception. Avalonia.Markup.Xaml.XamlLoadException: No precompiled XAML found for avares://Semi.Avalonia/Themes/Light/Light.axaml (baseUri: avares://Semi.Avalonia/Themes/Index.axaml), make sure to specify x:Class and include your XAML file as AvaloniaResource
|
||||
|
||||
解决方法:
|
||||
>如果使用Semi发布文件不要裁剪,如果裁剪会报错
|
||||
|
||||
|
||||
2. 报错内容
|
||||
>Unhandled exception. System.TypeInitializationException: The type initializer for 'SkiaSharp.SKImageInfo' threw an exception.**
|
||||
**--->System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies.In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibSkiaSharp: cannot open shared object file: No such file or directory
|
||||
at SkiaSharp.SkiaApi.sk_colortype_get_default_8888()
|
||||
at SkiaSharp.SKImageInfo..cctor()
|
||||
|
||||
解决方法:
|
||||
>Linux命令行安装一下 apt-get install -y libfontconfig1
|
||||
参考网址:https://github.com/mono/SkiaSharp/issues/509
|
||||
|
||||
3. 报错内容
|
||||
>Permission denied
|
||||
|
||||
解决方法:
|
||||
>sudo chmod +x ./Semi.Avalonia.Demo.Drm
|
||||
|
||||
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`。
|
||||
|
||||
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`,可能是显卡挂载到别的文件夹下了,待解决。
|
||||
@@ -11,6 +11,6 @@ public static class AvaloniaAppBuilderExtensions
|
||||
builder.With(new FontManagerOptions
|
||||
{
|
||||
DefaultFamilyName = DefaultFontFamily,
|
||||
FontFallbacks = new[] { new FontFallback { FontFamily = new FontFamily(DefaultFontFamily) } }
|
||||
FontFallbacks = [new FontFallback { FontFamily = new FontFamily(DefaultFontFamily) }]
|
||||
});
|
||||
}
|
||||
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,15 +1,19 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.WebAssembly">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0-browser</TargetFramework>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0-browser</TargetFramework>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<AvaloniaResource Include="Assets\**"/>
|
||||
<AvaloniaResource Include="..\Fonts\*" Link="Assets\Fonts\%(Filename)%(Extension)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia.Browser" Version="$(AvaloniaVersion)"/>
|
||||
<PackageReference Include="Avalonia.Browser"/>
|
||||
<PackageReference Include="SkiaSharp"/>
|
||||
<PackageReference Include="SkiaSharp.NativeAssets.WebAssembly"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
{
|
||||
"wasmHostProperties": {
|
||||
"perHostConfig": [
|
||||
{
|
||||
"name": "browser",
|
||||
"html-path": "index.html",
|
||||
"Host": "browser"
|
||||
}
|
||||
]
|
||||
}
|
||||
"wasmHostProperties": {
|
||||
"perHostConfig": [
|
||||
{
|
||||
"name": "browser",
|
||||
"host": "browser"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -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,74 +1,58 @@
|
||||
:root {
|
||||
--sat: env(safe-area-inset-top);
|
||||
--sar: env(safe-area-inset-right);
|
||||
--sab: env(safe-area-inset-bottom);
|
||||
--sal: env(safe-area-inset-left);
|
||||
}
|
||||
|
||||
/* HTML styles for the splash screen */
|
||||
|
||||
.highlight {
|
||||
color: white;
|
||||
font-size: 2.5rem;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.purple {
|
||||
color: #8b44ac;
|
||||
}
|
||||
|
||||
.icon {
|
||||
opacity: 0.05;
|
||||
height: 35%;
|
||||
width: 35%;
|
||||
/* HTML styles for the splash screen */
|
||||
.avalonia-splash {
|
||||
position: absolute;
|
||||
background-repeat: no-repeat;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
margin-right: 3%;
|
||||
margin-bottom: 5%;
|
||||
z-index: 5000;
|
||||
background-position: right bottom;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background: white;
|
||||
font-family: 'Outfit', sans-serif;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
display: flex;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
#avalonia-splash a {
|
||||
color: whitesmoke;
|
||||
/* 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;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
.avalonia-splash.splash-close {
|
||||
transition: opacity 200ms, display 200ms;
|
||||
display: none;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 172 KiB After Width: | Height: | Size: 162 KiB |
@@ -5,26 +5,33 @@
|
||||
<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="./_framework/dotnet.js" />
|
||||
<link rel="modulepreload" href="./_framework/avalonia.js" />
|
||||
<link rel="stylesheet" href="./app.css" />
|
||||
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
||||
</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>
|
||||
<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>
|
||||
<script type='module' src="./main.js"></script>
|
||||
</div>
|
||||
<script type='module' src="./main.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -10,4 +10,4 @@ const dotnetRuntime = await dotnet
|
||||
|
||||
const config = dotnetRuntime.getConfig();
|
||||
|
||||
await dotnetRuntime.runMain(config.mainAssemblyName, [window.location.search]);
|
||||
await dotnetRuntime.runMain(config.mainAssemblyName, [globalThis.location.href]);
|
||||
|
||||
@@ -1,13 +1,52 @@
|
||||
<Application
|
||||
Name="Semi Avalonia Demo"
|
||||
x:Class="Semi.Avalonia.Demo.App"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:semi="https://irihi.tech/semi">
|
||||
xmlns:semi="https://irihi.tech/semi"
|
||||
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
|
||||
x:DataType="vm:ApplicationViewModel">
|
||||
<Application.Styles>
|
||||
<!-- You can still reference in old way. -->
|
||||
<!-- <StyleInclude Source="avares://Semi.Avalonia/Themes/Index.axaml" /> -->
|
||||
<semi:SemiTheme Locale="zh-CN" />
|
||||
<StyleInclude Source="avares://Semi.Avalonia.DataGrid/Index.axaml" />
|
||||
<StyleInclude Source="avares://Semi.Avalonia.ColorPicker/Index.axaml" />
|
||||
<semi:SemiPopupAnimations />
|
||||
<semi:ColorPickerSemiTheme />
|
||||
<semi:DataGridSemiTheme />
|
||||
<semi:TreeDataGridSemiTheme />
|
||||
</Application.Styles>
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceInclude Source="Themes/_index.axaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
<NativeMenu.Menu>
|
||||
<NativeMenu>
|
||||
<NativeMenuItem
|
||||
Header="About Us"
|
||||
Command="{Binding JumpToCommand}"
|
||||
CommandParameter="{Binding $self.Header}" />
|
||||
</NativeMenu>
|
||||
</NativeMenu.Menu>
|
||||
<TrayIcon.Icons>
|
||||
<TrayIcons>
|
||||
<TrayIcon
|
||||
Icon="{OnPlatform Default=/Assets/irihi.ico, macOS=/Assets/irihi2.ico}"
|
||||
MacOSProperties.IsTemplateIcon="true"
|
||||
Command="{Binding ActivateCommand}"
|
||||
ToolTipText="Semi Avalonia Demo">
|
||||
<TrayIcon.Menu>
|
||||
<NativeMenu>
|
||||
<NativeMenuItem
|
||||
Header="About Us"
|
||||
Command="{Binding JumpToCommand}"
|
||||
CommandParameter="{Binding $self.Header}" />
|
||||
<NativeMenuItem
|
||||
Header="Exit"
|
||||
Command="{Binding ExitCommand}" />
|
||||
</NativeMenu>
|
||||
</TrayIcon.Menu>
|
||||
</TrayIcon>
|
||||
</TrayIcons>
|
||||
</TrayIcon.Icons>
|
||||
</Application>
|
||||
@@ -1,6 +1,8 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls.ApplicationLifetimes;
|
||||
using Avalonia.Data.Core.Plugins;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Semi.Avalonia.Demo.ViewModels;
|
||||
using Semi.Avalonia.Demo.Views;
|
||||
|
||||
namespace Semi.Avalonia.Demo;
|
||||
@@ -10,6 +12,7 @@ public partial class App : Application
|
||||
public override void Initialize()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
this.DataContext = new ApplicationViewModel();
|
||||
}
|
||||
|
||||
public override void OnFrameworkInitializationCompleted()
|
||||
@@ -17,6 +20,9 @@ public partial class App : Application
|
||||
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:
|
||||
@@ -24,6 +30,7 @@ public partial class App : Application
|
||||
break;
|
||||
}
|
||||
|
||||
this.RegisterFollowSystemTheme();
|
||||
base.OnFrameworkInitializationCompleted();
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 172 KiB |
BIN
demo/Semi.Avalonia.Demo/Assets/irihi.ico
Normal file
|
After Width: | Height: | Size: 162 KiB |
BIN
demo/Semi.Avalonia.Demo/Assets/irihi2.ico
Normal file
|
After Width: | Height: | Size: 948 B |
169
demo/Semi.Avalonia.Demo/Constant/ColorTokens.cs
Normal file
@@ -0,0 +1,169 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Constant;
|
||||
|
||||
public static class ColorTokens
|
||||
{
|
||||
public static IReadOnlyList<Tuple<string, string>> PrimaryTokens { get; } =
|
||||
[
|
||||
new("SemiColorPrimary", "Primary"),
|
||||
new("SemiColorPrimaryPointerover", "Primary Pointerover"),
|
||||
new("SemiColorPrimaryActive", "Primary Active"),
|
||||
new("SemiColorPrimaryDisabled", "Primary Disabled"),
|
||||
new("SemiColorPrimaryLight", "Primary Light"),
|
||||
new("SemiColorPrimaryLightPointerover", "Primary Light Pointerover"),
|
||||
new("SemiColorPrimaryLightActive", "Primary Light Active"),
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> SecondaryTokens { get; } =
|
||||
[
|
||||
new("SemiColorSecondary", "Secondary"),
|
||||
new("SemiColorSecondaryPointerover", "Secondary Pointerover"),
|
||||
new("SemiColorSecondaryActive", "Secondary Active"),
|
||||
new("SemiColorSecondaryDisabled", "Secondary Disabled"),
|
||||
new("SemiColorSecondaryLight", "Secondary Light"),
|
||||
new("SemiColorSecondaryLightPointerover", "Secondary Light Pointerover"),
|
||||
new("SemiColorSecondaryLightActive", "Secondary Light Active")
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> TertiaryTokens { get; } =
|
||||
[
|
||||
new("SemiColorTertiary", "Tertiary"),
|
||||
new("SemiColorTertiaryPointerover", "Tertiary Pointerover"),
|
||||
new("SemiColorTertiaryActive", "Tertiary Active"),
|
||||
new("SemiColorTertiaryLight", "Tertiary Light"),
|
||||
new("SemiColorTertiaryLightPointerover", "Tertiary Light Pointerover"),
|
||||
new("SemiColorTertiaryLightActive", "Tertiary Light Active")
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> InformationTokens { get; } =
|
||||
[
|
||||
new("SemiColorInformation", "Information"),
|
||||
new("SemiColorInformationPointerover", "Information Pointerover"),
|
||||
new("SemiColorInformationActive", "Information Active"),
|
||||
new("SemiColorInformationDisabled", "Information Disabled"),
|
||||
new("SemiColorInformationLight", "Information Light"),
|
||||
new("SemiColorInformationLightPointerover", "Information Light Pointerover"),
|
||||
new("SemiColorInformationLightActive", "Information Light Active")
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> SuccessTokens { get; } =
|
||||
[
|
||||
new("SemiColorSuccess", "Success"),
|
||||
new("SemiColorSuccessPointerover", "Success Pointerover"),
|
||||
new("SemiColorSuccessActive", "Success Active"),
|
||||
new("SemiColorSuccessDisabled", "Success Disabled"),
|
||||
new("SemiColorSuccessLight", "Success Light"),
|
||||
new("SemiColorSuccessLightPointerover", "Success Light Pointerover"),
|
||||
new("SemiColorSuccessLightActive", "Success Light Active")
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> WarningTokens { get; } =
|
||||
[
|
||||
new("SemiColorWarning", "Warning"),
|
||||
new("SemiColorWarningPointerover", "Warning Pointerover"),
|
||||
new("SemiColorWarningActive", "Warning Active"),
|
||||
new("SemiColorWarningLight", "Warning Light"),
|
||||
new("SemiColorWarningLightPointerover", "Warning Light Pointerover"),
|
||||
new("SemiColorWarningLightActive", "Warning Light Active")
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> DangerTokens { get; } =
|
||||
[
|
||||
new("SemiColorDanger", "Danger"),
|
||||
new("SemiColorDangerPointerover", "Danger Pointerover"),
|
||||
new("SemiColorDangerActive", "Danger Active"),
|
||||
new("SemiColorDangerLight", "Danger Light"),
|
||||
new("SemiColorDangerLightPointerover", "Danger Light Pointerover"),
|
||||
new("SemiColorDangerLightActive", "Danger Light Active")
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> AIGeneralTokens { get; } =
|
||||
[
|
||||
new("SemiColorAIGeneral", "AI General"),
|
||||
new("SemiColorAIGeneralPointerover", "AI General Pointerover"),
|
||||
new("SemiColorAIGeneralActive", "AI General Active"),
|
||||
new("SemiColorAIGeneralDisabled", "AI General Disabled")
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> AIPurpleTokens { get; } =
|
||||
[
|
||||
new("SemiColorAIPurple", "AI Purple"),
|
||||
new("SemiColorAIPurplePointerover", "AI Purple Pointerover"),
|
||||
new("SemiColorAIPurpleActive", "AI Purple Active"),
|
||||
new("SemiColorAIPurpleDisabled", "AI Purple Disabled")
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> AIBackgroundTokens { get; } =
|
||||
[
|
||||
new("SemiColorAIBackgroundBottom", "AI Bottom Background"),
|
||||
new("SemiColorAIBackgroundBottomPointerover", "AI Bottom Background Pointerover"),
|
||||
new("SemiColorAIBackgroundBottomActive", "AI Bottom Background Active"),
|
||||
new("SemiColorAIBackgroundTop", "AI Top Background"),
|
||||
new("SemiColorAIBackgroundTopPointerover", "AI Top Background Pointerover"),
|
||||
new("SemiColorAIBackgroundTopActive", "AI Top Background Active"),
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> TextTokens { get; } =
|
||||
[
|
||||
new("SemiColorText0", "Text 0"),
|
||||
new("SemiColorText1", "Text 1"),
|
||||
new("SemiColorText2", "Text 2"),
|
||||
new("SemiColorText3", "Text 3")
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> LinkTokens { get; } =
|
||||
[
|
||||
new("SemiColorLink", "Link"),
|
||||
new("SemiColorLinkPointerover", "Link Pointerover"),
|
||||
new("SemiColorLinkActive", "Link Active"),
|
||||
new("SemiColorLinkVisited", "Link Visited")
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> BackgroundTokens { get; } =
|
||||
[
|
||||
new("SemiColorBackground0", "Background 0"),
|
||||
new("SemiColorBackground1", "Background 1"),
|
||||
new("SemiColorBackground2", "Background 2"),
|
||||
new("SemiColorBackground3", "Background 3"),
|
||||
new("SemiColorBackground4", "Background 4")
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> FillTokens { get; } =
|
||||
[
|
||||
new("SemiColorFill0", "Fill 0"),
|
||||
new("SemiColorFill1", "Fill 1"),
|
||||
new("SemiColorFill2", "Fill 2")
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> BorderTokens { get; } =
|
||||
[
|
||||
new("SemiColorBorder", "Border"),
|
||||
new("SemiColorFocusBorder", "Focus Border")
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> DisabledTokens { get; } =
|
||||
[
|
||||
new("SemiColorDisabledText", "Disabled Text"),
|
||||
new("SemiColorDisabledBorder", "Disabled Border"),
|
||||
new("SemiColorDisabledBackground", "Disabled Background"),
|
||||
new("SemiColorDisabledFill", "Disabled Fill")
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> OtherTokens { get; } =
|
||||
[
|
||||
new("SemiColorWhite", "White"),
|
||||
new("SemiColorBlack", "Black"),
|
||||
new("SemiColorNavBackground", "Navigation Background"),
|
||||
new("SemiColorOverlayBackground", "Overlay Background"),
|
||||
new("SemiColorHighlightBackground", "Highlight Background"),
|
||||
new("SemiColorHighlight", "Highlight Text")
|
||||
];
|
||||
|
||||
public static IReadOnlyList<Tuple<string, string>> ShadowTokens { get; } =
|
||||
[
|
||||
new("SemiColorShadow", "Shadow"),
|
||||
new("SemiShadowElevated", "Shadow Elevated")
|
||||
];
|
||||
}
|
||||
@@ -1,30 +1,32 @@
|
||||
using System.Globalization;
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Input.Platform;
|
||||
using Avalonia.Media;
|
||||
using Avalonia.Media.Immutable;
|
||||
using Semi.Avalonia.Demo.Converters;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Controls;
|
||||
|
||||
public class ColorDetailControl: TemplatedControl
|
||||
public class ColorDetailControl : TemplatedControl
|
||||
{
|
||||
public const string KEY_ResourceKey = "ResourceKey";
|
||||
public const string KEY_Hex = "Hex";
|
||||
public const string KEY_Hex2 = "Hex2";
|
||||
public const string KEY_Opacity = "Opacity";
|
||||
public const string KEY_ColorResourceKey = "ColorResourceKey";
|
||||
|
||||
public static readonly StyledProperty<string?> ResourceKeyProperty = AvaloniaProperty.Register<ColorDetailControl, string?>(
|
||||
nameof(ResourceKey));
|
||||
|
||||
public static readonly StyledProperty<string?> ResourceKeyProperty =
|
||||
AvaloniaProperty.Register<ColorDetailControl, string?>(nameof(ResourceKey));
|
||||
|
||||
public string? ResourceKey
|
||||
{
|
||||
get => GetValue(ResourceKeyProperty);
|
||||
set => SetValue(ResourceKeyProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<string?> ResourceNameProperty = AvaloniaProperty.Register<ColorDetailControl, string?>(
|
||||
nameof(ResourceName));
|
||||
public static readonly StyledProperty<string?> ResourceNameProperty =
|
||||
AvaloniaProperty.Register<ColorDetailControl, string?>(nameof(ResourceName));
|
||||
|
||||
public string? ResourceName
|
||||
{
|
||||
@@ -32,8 +34,8 @@ public class ColorDetailControl: TemplatedControl
|
||||
set => SetValue(ResourceNameProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<string?> ColorResourceKeyProperty = AvaloniaProperty.Register<ColorDetailControl, string?>(
|
||||
nameof(ColorResourceKey));
|
||||
public static readonly StyledProperty<string?> ColorResourceKeyProperty =
|
||||
AvaloniaProperty.Register<ColorDetailControl, string?>(nameof(ColorResourceKey));
|
||||
|
||||
public string? ColorResourceKey
|
||||
{
|
||||
@@ -41,27 +43,39 @@ public class ColorDetailControl: TemplatedControl
|
||||
set => SetValue(ColorResourceKeyProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DirectProperty<ColorDetailControl, string?> HexProperty = AvaloniaProperty.RegisterDirect<ColorDetailControl, string?>(
|
||||
nameof(Hex), o => o.Hex);
|
||||
public static readonly DirectProperty<ColorDetailControl, string?> HexProperty =
|
||||
AvaloniaProperty.RegisterDirect<ColorDetailControl, string?>(nameof(Hex), o => o.Hex);
|
||||
|
||||
private string? _hex;
|
||||
|
||||
public string? Hex
|
||||
{
|
||||
get => _hex;
|
||||
private set => SetAndRaise(HexProperty, ref _hex, value);
|
||||
}
|
||||
|
||||
public static readonly DirectProperty<ColorDetailControl, string?> OpacityNumberProperty = AvaloniaProperty.RegisterDirect<ColorDetailControl, string?>(
|
||||
nameof(OpacityNumber), o => o.OpacityNumber);
|
||||
|
||||
private string? _hex2;
|
||||
|
||||
public static readonly DirectProperty<ColorDetailControl, string?> Hex2Property =
|
||||
AvaloniaProperty.RegisterDirect<ColorDetailControl, string?>(nameof(Hex2), o => o.Hex2);
|
||||
|
||||
public string? Hex2
|
||||
{
|
||||
get => _hex2;
|
||||
set => SetAndRaise(Hex2Property, ref _hex2, value);
|
||||
}
|
||||
|
||||
public static readonly DirectProperty<ColorDetailControl, string?> OpacityNumberProperty =
|
||||
AvaloniaProperty.RegisterDirect<ColorDetailControl, string?>(nameof(OpacityNumber), o => o.OpacityNumber);
|
||||
|
||||
private string? _opacityNumber;
|
||||
|
||||
public string? OpacityNumber
|
||||
{
|
||||
get => _opacityNumber;
|
||||
private set => SetAndRaise(OpacityNumberProperty, ref _opacityNumber, value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static ColorDetailControl()
|
||||
{
|
||||
BackgroundProperty.Changed.AddClassHandler<ColorDetailControl>((o, e) => o.OnBackgroundChanged(e));
|
||||
@@ -70,38 +84,42 @@ public class ColorDetailControl: TemplatedControl
|
||||
private void OnBackgroundChanged(AvaloniaPropertyChangedEventArgs args)
|
||||
{
|
||||
var color = args.GetNewValue<IBrush>();
|
||||
if (color is ISolidColorBrush b)
|
||||
if (color is ISolidColorBrush brush)
|
||||
{
|
||||
Hex = b.Color.ToString().ToUpperInvariant();
|
||||
OpacityNumber = b.Opacity.ToString(CultureInfo.InvariantCulture);
|
||||
var hex1 = ColorConverter.ToHex.Convert(brush.Color, typeof(string), false, CultureInfo.InvariantCulture);
|
||||
var hex2 = ColorConverter.ToHex.Convert(brush.Color, typeof(string), true, CultureInfo.InvariantCulture);
|
||||
Hex = hex1 as string;
|
||||
Hex2 = hex2 as string;
|
||||
OpacityNumber = brush.Opacity.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
else
|
||||
{
|
||||
Hex = null;
|
||||
Hex2 = null;
|
||||
OpacityNumber = null;
|
||||
}
|
||||
}
|
||||
|
||||
public async void Copy(object o)
|
||||
public async Task Copy(object o)
|
||||
{
|
||||
string? text = null;
|
||||
if (o is string s)
|
||||
{
|
||||
switch (s)
|
||||
text = s switch
|
||||
{
|
||||
case KEY_ResourceKey: text = ResourceKey;
|
||||
break;
|
||||
case KEY_Hex: text = Hex;
|
||||
break;
|
||||
case KEY_Opacity: text = OpacityNumber;
|
||||
break;
|
||||
case KEY_ColorResourceKey: text = ColorResourceKey;
|
||||
break;
|
||||
default: text = string.Empty; break;
|
||||
}
|
||||
KEY_ResourceKey => ResourceKey,
|
||||
KEY_Hex => Hex,
|
||||
KEY_Hex2 => Hex2,
|
||||
KEY_Opacity => OpacityNumber,
|
||||
KEY_ColorResourceKey => ColorResourceKey,
|
||||
_ => string.Empty
|
||||
};
|
||||
}
|
||||
|
||||
var toplevel = TopLevel.GetTopLevel(this);
|
||||
if (toplevel?.Clipboard is { } c)
|
||||
{
|
||||
await c.SetTextAsync(text??string.Empty);
|
||||
await c.SetTextAsync(text ?? string.Empty);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Input;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
@@ -9,8 +8,8 @@ namespace Semi.Avalonia.Demo.Controls;
|
||||
|
||||
public class ColorItemControl : TemplatedControl
|
||||
{
|
||||
public static readonly StyledProperty<string?> ColorNameProperty = AvaloniaProperty.Register<ColorItemControl, string?>(
|
||||
nameof(ColorName));
|
||||
public static readonly StyledProperty<string?> ColorNameProperty =
|
||||
AvaloniaProperty.Register<ColorItemControl, string?>(nameof(ColorName));
|
||||
|
||||
public string? ColorName
|
||||
{
|
||||
@@ -26,14 +25,18 @@ public class ColorItemControl : TemplatedControl
|
||||
get => GetValue(HexProperty);
|
||||
set => SetValue(HexProperty, value);
|
||||
}
|
||||
|
||||
|
||||
protected override void OnPointerPressed(PointerPressedEventArgs e)
|
||||
{
|
||||
base.OnPointerPressed(e);
|
||||
if (this.DataContext is ColorItemViewModel v)
|
||||
switch (this.DataContext)
|
||||
{
|
||||
WeakReferenceMessenger.Default.Send(v);
|
||||
case ColorItemViewModel colorItemViewModel:
|
||||
WeakReferenceMessenger.Default.Send(colorItemViewModel);
|
||||
break;
|
||||
case ColorResource colorResource:
|
||||
WeakReferenceMessenger.Default.Send(colorResource);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -4,33 +4,38 @@ using Avalonia.Controls.Primitives;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Controls;
|
||||
|
||||
public class FunctionalColorGroupControl: TemplatedControl
|
||||
public class FunctionalColorGroupControl : TemplatedControl
|
||||
{
|
||||
public static readonly StyledProperty<string?> TitleProperty = AvaloniaProperty.Register<FunctionalColorGroupControl, string?>(
|
||||
nameof(Title));
|
||||
public static readonly StyledProperty<string?> TitleProperty =
|
||||
AvaloniaProperty.Register<FunctionalColorGroupControl, string?>(nameof(Title));
|
||||
|
||||
public string? Title
|
||||
{
|
||||
get => GetValue(TitleProperty);
|
||||
set => SetValue(TitleProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DirectProperty<FunctionalColorGroupControl, IEnumerable?> LightColorsProperty = AvaloniaProperty.RegisterDirect<FunctionalColorGroupControl, IEnumerable?>(
|
||||
nameof(LightColors), o => o.LightColors, (o, v) => o.LightColors = v);
|
||||
|
||||
public static readonly DirectProperty<FunctionalColorGroupControl, IEnumerable?> LightColorsProperty =
|
||||
AvaloniaProperty.RegisterDirect<FunctionalColorGroupControl, IEnumerable?>(nameof(LightColors),
|
||||
o => o.LightColors, (o, v) => o.LightColors = v);
|
||||
|
||||
private IEnumerable? _lightColors;
|
||||
|
||||
public IEnumerable? LightColors
|
||||
{
|
||||
get => _lightColors;
|
||||
set => SetAndRaise(LightColorsProperty, ref _lightColors, value);
|
||||
}
|
||||
|
||||
public static readonly DirectProperty<FunctionalColorGroupControl, IEnumerable?> DarkColorsProperty = AvaloniaProperty.RegisterDirect<FunctionalColorGroupControl, IEnumerable?>(
|
||||
nameof(DarkColors), o => o.DarkColors, (o, v) => o.DarkColors = v);
|
||||
|
||||
public static readonly DirectProperty<FunctionalColorGroupControl, IEnumerable?> DarkColorsProperty =
|
||||
AvaloniaProperty.RegisterDirect<FunctionalColorGroupControl, IEnumerable?>(nameof(DarkColors),
|
||||
o => o.DarkColors, (o, v) => o.DarkColors = v);
|
||||
|
||||
private IEnumerable? _darkColors;
|
||||
|
||||
public IEnumerable? DarkColors
|
||||
{
|
||||
get => _darkColors;
|
||||
set => SetAndRaise(DarkColorsProperty, ref _darkColors, value);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
41
demo/Semi.Avalonia.Demo/Controls/ShadowGroupControl.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System.Collections;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls.Primitives;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Controls;
|
||||
|
||||
public class ShadowGroupControl : TemplatedControl
|
||||
{
|
||||
public static readonly StyledProperty<string?> TitleProperty =
|
||||
AvaloniaProperty.Register<ShadowGroupControl, string?>(nameof(Title));
|
||||
|
||||
public string? Title
|
||||
{
|
||||
get => GetValue(TitleProperty);
|
||||
set => SetValue(TitleProperty, value);
|
||||
}
|
||||
|
||||
private IEnumerable? _lightShadows;
|
||||
|
||||
public static readonly DirectProperty<ShadowGroupControl, IEnumerable?> LightShadowsProperty =
|
||||
AvaloniaProperty.RegisterDirect<ShadowGroupControl, IEnumerable?>(nameof(LightShadows),
|
||||
o => o.LightShadows, (o, v) => o.LightShadows = v);
|
||||
|
||||
public IEnumerable? LightShadows
|
||||
{
|
||||
get => _lightShadows;
|
||||
set => SetAndRaise(LightShadowsProperty, ref _lightShadows, value);
|
||||
}
|
||||
|
||||
private IEnumerable? _darkShadows;
|
||||
|
||||
public static readonly DirectProperty<ShadowGroupControl, IEnumerable?> DarkShadowsProperty =
|
||||
AvaloniaProperty.RegisterDirect<ShadowGroupControl, IEnumerable?>(nameof(DarkShadows),
|
||||
o => o.DarkShadows, (o, v) => o.DarkShadows = v);
|
||||
|
||||
public IEnumerable? DarkShadows
|
||||
{
|
||||
get => _darkShadows;
|
||||
set => SetAndRaise(DarkShadowsProperty, ref _darkShadows, value);
|
||||
}
|
||||
}
|
||||
22
demo/Semi.Avalonia.Demo/Converters/ColorConverter.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Avalonia.Data.Converters;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Converters;
|
||||
|
||||
public static class ColorConverter
|
||||
{
|
||||
public static readonly IValueConverter ToHex =
|
||||
new FuncValueConverter<object, bool, string>(
|
||||
(obj, withAlpha) =>
|
||||
obj switch
|
||||
{
|
||||
Color color => withAlpha
|
||||
? $"#{color.A:X2}{color.R:X2}{color.G:X2}{color.B:X2}"
|
||||
: $"#{color.R:X2}{color.G:X2}{color.B:X2}",
|
||||
ISolidColorBrush brush => withAlpha
|
||||
? $"#{brush.Color.A:X2}{brush.Color.R:X2}{brush.Color.G:X2}{brush.Color.B:X2}"
|
||||
: $"#{brush.Color.R:X2}{brush.Color.G:X2}{brush.Color.B:X2}",
|
||||
_ => string.Empty
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -3,15 +3,13 @@ using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using Avalonia;
|
||||
using Avalonia.Data.Converters;
|
||||
using Avalonia.Media;
|
||||
using Avalonia.Metadata;
|
||||
|
||||
namespace Semi.Avalonia.TreeDataGrid.Demo.Converters;
|
||||
namespace Semi.Avalonia.Demo.Converters;
|
||||
|
||||
public class FileIconConverter: IMultiValueConverter
|
||||
public class FileIconConverter : IMultiValueConverter
|
||||
{
|
||||
[Content]
|
||||
public Dictionary<string, PathGeometry> Items { get; set; } = new Dictionary<string, PathGeometry>();
|
||||
[Content] public IDictionary<string, object?> Items { get; } = new Dictionary<string, object?>();
|
||||
|
||||
public object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
@@ -21,8 +19,10 @@ public class FileIconConverter: IMultiValueConverter
|
||||
{
|
||||
return Items["file"];
|
||||
}
|
||||
|
||||
return isOpen ? Items["folderOpen"] : Items["folderClosed"];
|
||||
}
|
||||
|
||||
return AvaloniaProperty.UnsetValue;
|
||||
}
|
||||
}
|
||||
236
demo/Semi.Avalonia.Demo/Pages/AboutUs.axaml
Normal file
@@ -0,0 +1,236 @@
|
||||
<UserControl
|
||||
x:Class="Semi.Avalonia.Demo.Pages.AboutUs"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:collections="clr-namespace:Avalonia.Collections;assembly=Avalonia.Base"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:iri="https://irihi.tech/shared"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
|
||||
x:DataType="vm:AboutUsViewModel"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary x:Key="Light">
|
||||
<collections:AvaloniaList x:Key="CanvasPalette" x:TypeArguments="Color">
|
||||
<Color>#FFFDB7A5</Color>
|
||||
<Color>#FFF6A0B5</Color>
|
||||
<Color>#FFDD9BE0</Color>
|
||||
<Color>#FFC4A7E9</Color>
|
||||
<Color>#FFA7B3E1</Color>
|
||||
<Color>#FF98CDFD</Color>
|
||||
<Color>#FF95D8F8</Color>
|
||||
</collections:AvaloniaList>
|
||||
<LinearGradientBrush x:Key="TileTitleForeground" StartPoint="">
|
||||
<GradientStop Offset="0.0" Color="#FFA20B48" />
|
||||
<GradientStop Offset="0.3" Color="#FF71168A" />
|
||||
<GradientStop Offset="0.6" Color="#FF46259E" />
|
||||
<GradientStop Offset="1.0" Color="#FF28348C" />
|
||||
</LinearGradientBrush>
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="Dark">
|
||||
<collections:AvaloniaList x:Key="CanvasPalette" x:TypeArguments="Color">
|
||||
<Color>#FFB42019</Color>
|
||||
<Color>#FFA41751</Color>
|
||||
<Color>#FF731F8A</Color>
|
||||
<Color>#FF582EA0</Color>
|
||||
<Color>#FF29368E</Color>
|
||||
<Color>#FF135CB8</Color>
|
||||
<Color>#FF0366A9</Color>
|
||||
</collections:AvaloniaList>
|
||||
<LinearGradientBrush x:Key="TileTitleForeground">
|
||||
<GradientStop Offset="0.0" Color="#FFF7A8BC" />
|
||||
<GradientStop Offset="0.3" Color="#FFDDA0E1" />
|
||||
<GradientStop Offset="0.6" Color="#FFBEADE9" />
|
||||
<GradientStop Offset="1.0" Color="#FFA7B4E2" />
|
||||
</LinearGradientBrush>
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
<ControlTheme x:Key="TileButton" TargetType="Button">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
<Setter Property="Padding" Value="24" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Border
|
||||
Padding="0"
|
||||
Classes="Hover"
|
||||
Cursor="Hand"
|
||||
Theme="{DynamicResource CardBorder}">
|
||||
<Border.Transitions>
|
||||
<Transitions>
|
||||
<BrushTransition Property="BorderBrush" Duration="0.5" />
|
||||
</Transitions>
|
||||
</Border.Transitions>
|
||||
<ContentPresenter
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}" />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
<Style Selector="^:pointerover /template/ Border">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource TileTitleForeground}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
<UserControl.Styles>
|
||||
<Style Selector="TextBlock.TileTitle">
|
||||
<Setter Property="FontWeight" Value="700" />
|
||||
<Setter Property="FontSize" Value="24" />
|
||||
<Setter Property="Margin" Value="0 0 0 8" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource TileTitleForeground}" />
|
||||
</Style>
|
||||
</UserControl.Styles>
|
||||
<Grid RowDefinitions="*, Auto">
|
||||
<ScrollViewer>
|
||||
<StackPanel>
|
||||
<Grid
|
||||
Margin="0,96,0,48"
|
||||
HorizontalAlignment="Center"
|
||||
ColumnDefinitions="*, *"
|
||||
RowDefinitions="*, *">
|
||||
<iri:IrihiLogo
|
||||
Grid.Row="0"
|
||||
Grid.RowSpan="2"
|
||||
Grid.Column="0"
|
||||
Fill="{DynamicResource TextBlockSecondaryForeground}"
|
||||
Width="96"
|
||||
Margin="0,0,24,0"
|
||||
VerticalAlignment="Center" />
|
||||
<TextBlock
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Bottom"
|
||||
Classes="Secondary"
|
||||
FontSize="48"
|
||||
FontWeight="700"
|
||||
Text="铱泓科技" />
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Margin="12,0,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
Classes="Secondary"
|
||||
FontSize="16"
|
||||
Text="IRIHI Technology" />
|
||||
</Grid>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
Classes="Tertiary"
|
||||
FontSize="20"
|
||||
FontWeight="700"
|
||||
Text="聚焦生产力的美学进化" />
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
Classes="Tertiary"
|
||||
FontSize="20"
|
||||
Text="Aesthetic Evolution of Productivity" />
|
||||
<UniformGrid
|
||||
MaxWidth="810"
|
||||
Margin="24"
|
||||
HorizontalAlignment="Center"
|
||||
Columns="2">
|
||||
<Button
|
||||
Margin="8"
|
||||
Command="{Binding NavigateCommand}"
|
||||
CommandParameter="semi"
|
||||
Theme="{DynamicResource TileButton}">
|
||||
<StackPanel HorizontalAlignment="Left">
|
||||
<TextBlock Classes="TileTitle" Text="Semi" />
|
||||
<StackPanel Orientation="Horizontal" Margin="0 0 0 8">
|
||||
<Label Theme="{DynamicResource TagLabel}" Classes="Blue Ghost">Open Source</Label>
|
||||
</StackPanel>
|
||||
<TextBlock Text="开箱即用的独立主题库" />
|
||||
<TextBlock Text="A ready-to-use standalone theme library" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button
|
||||
Margin="8"
|
||||
Command="{Binding NavigateCommand}"
|
||||
CommandParameter="ursa"
|
||||
Theme="{DynamicResource TileButton}">
|
||||
<StackPanel HorizontalAlignment="Left">
|
||||
<TextBlock Classes="TileTitle" Text="Ursa" />
|
||||
<StackPanel Orientation="Horizontal" Margin="0 0 0 8">
|
||||
<Label Theme="{DynamicResource TagLabel}" Classes="Blue Ghost">Open Source</Label>
|
||||
</StackPanel>
|
||||
<TextBlock Text="高性能企业级桌面客户端控件库" />
|
||||
<TextBlock Text="High-performance enterprise level control library for desktop apps" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button
|
||||
Margin="8"
|
||||
Command="{Binding NavigateCommand}"
|
||||
CommandParameter="mantra"
|
||||
Theme="{DynamicResource TileButton}">
|
||||
<StackPanel HorizontalAlignment="Left">
|
||||
<TextBlock Classes="TileTitle" Text="Mantra" />
|
||||
<StackPanel Orientation="Horizontal" Margin="0 0 0 8">
|
||||
<Label Theme="{DynamicResource TagLabel}" Classes="Purple Ghost">Commercial</Label>
|
||||
</StackPanel>
|
||||
<TextBlock Text="高性能文字排版渲染控件库" />
|
||||
<TextBlock Text="High-performance typography control library" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button
|
||||
Margin="8"
|
||||
Command="{Binding NavigateCommand}"
|
||||
CommandParameter="huska"
|
||||
Theme="{DynamicResource TileButton}">
|
||||
<StackPanel HorizontalAlignment="Left">
|
||||
<TextBlock Classes="TileTitle" Text="Huska" />
|
||||
<StackPanel Orientation="Horizontal" Margin="0 0 0 8">
|
||||
<Label Theme="{DynamicResource TagLabel}" Classes="Purple Ghost">Commercial</Label>
|
||||
</StackPanel>
|
||||
<TextBlock Text="手绘风格主题库" />
|
||||
<TextBlock Text="Hand-drawing theme library" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</UniformGrid>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Margin="0,16"
|
||||
Spacing="32"
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<HyperlinkButton
|
||||
Classes="WithIcon"
|
||||
VerticalAlignment="Center"
|
||||
Content="Homepage"
|
||||
NavigateUri="https://irihi.tech">
|
||||
<HyperlinkButton.Styles>
|
||||
<Style Selector=".WithIcon /template/ PathIcon">
|
||||
<Setter Property="Data" Value="{StaticResource SemiIconHome}" />
|
||||
</Style>
|
||||
</HyperlinkButton.Styles>
|
||||
</HyperlinkButton>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<HyperlinkButton
|
||||
Classes="WithIcon"
|
||||
Content="GitHub"
|
||||
NavigateUri="https://github.com/irihitech">
|
||||
<HyperlinkButton.Styles>
|
||||
<Style Selector=".WithIcon /template/ PathIcon">
|
||||
<Setter Property="Data" Value="{StaticResource SemiIconGithubLogo}" />
|
||||
</Style>
|
||||
</HyperlinkButton.Styles>
|
||||
</HyperlinkButton>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
24
demo/Semi.Avalonia.Demo/Pages/AboutUs.axaml.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using Semi.Avalonia.Demo.ViewModels;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class AboutUs : UserControl
|
||||
{
|
||||
public AboutUs()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = new AboutUsViewModel();
|
||||
}
|
||||
|
||||
protected override void OnLoaded(RoutedEventArgs e)
|
||||
{
|
||||
base.OnLoaded(e);
|
||||
if (this.DataContext is AboutUsViewModel vm)
|
||||
{
|
||||
var launcher = TopLevel.GetTopLevel(this)?.Launcher;
|
||||
vm.Launcher = launcher;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,15 +3,14 @@
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Semi.Avalonia.Demo.Pages"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
x:CompileBindings="False"
|
||||
x:DataType="local:AutoCompleteBoxDemoViewModel"
|
||||
x:DataType="vm:AutoCompleteBoxDemoViewModel"
|
||||
mc:Ignorable="d">
|
||||
<Design.DataContext>
|
||||
<local:AutoCompleteBoxDemoViewModel />
|
||||
<vm:AutoCompleteBoxDemoViewModel />
|
||||
</Design.DataContext>
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
||||
<StackPanel.Styles>
|
||||
@@ -21,7 +20,7 @@
|
||||
<Binding Path="States" />
|
||||
</Setter>
|
||||
<Setter Property="ItemTemplate">
|
||||
<DataTemplate DataType="local:StateData">
|
||||
<DataTemplate DataType="vm:StateData">
|
||||
<TextBlock Text="{Binding Name}" />
|
||||
</DataTemplate>
|
||||
</Setter>
|
||||
@@ -30,40 +29,40 @@
|
||||
|
||||
<AutoCompleteBox
|
||||
Watermark="Please select a State"
|
||||
ValueMemberBinding="{Binding Name}" />
|
||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||
<AutoCompleteBox
|
||||
Classes="Large"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||
<AutoCompleteBox
|
||||
Classes="Small"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||
<AutoCompleteBox
|
||||
Classes="Bordered"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||
<AutoCompleteBox
|
||||
IsEnabled="False"
|
||||
Watermark="Disabled"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||
<AutoCompleteBox
|
||||
InnerLeftContent="https://"
|
||||
InnerRightContent=".com"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<AutoCompleteBox
|
||||
Width="100"
|
||||
Classes="Large"
|
||||
Watermark="Large"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||
<AutoCompleteBox
|
||||
Width="100"
|
||||
Watermark="Default"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||
<AutoCompleteBox
|
||||
Width="100"
|
||||
Classes="Small"
|
||||
Watermark="Small"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
@@ -71,17 +70,17 @@
|
||||
Width="100"
|
||||
IsEnabled="False"
|
||||
Watermark="Disabled"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||
<AutoCompleteBox
|
||||
Width="100"
|
||||
Classes="Bordered"
|
||||
Watermark="Bordered"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||
<AutoCompleteBox
|
||||
Width="100"
|
||||
Classes="Bordered"
|
||||
IsEnabled="False"
|
||||
ValueMemberBinding="{ReflectionBinding Name}" />
|
||||
ValueMemberBinding="{Binding Name,DataType=vm:StateData}" />
|
||||
</StackPanel>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using System.Collections.Generic;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using Semi.Avalonia.Demo.ViewModels;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
@@ -14,86 +10,4 @@ public partial class AutoCompleteBoxDemo : UserControl
|
||||
InitializeComponent();
|
||||
this.DataContext = new AutoCompleteBoxDemoViewModel();
|
||||
}
|
||||
}
|
||||
|
||||
public class AutoCompleteBoxDemoViewModel: ObservableObject
|
||||
{
|
||||
public ObservableCollection<StateData> States { get; set; }
|
||||
|
||||
public AutoCompleteBoxDemoViewModel()
|
||||
{
|
||||
States = new ObservableCollection<StateData>(GetStates());
|
||||
|
||||
}
|
||||
|
||||
private static List<StateData> GetStates()
|
||||
{
|
||||
return new List<StateData>
|
||||
{
|
||||
new StateData("Alabama", "AL", "Montgomery"),
|
||||
new StateData("Alaska", "AK", "Juneau"),
|
||||
new StateData("Arizona", "AZ", "Phoenix"),
|
||||
new StateData("Arkansas", "AR", "Little Rock"),
|
||||
new StateData("California", "CA", "Sacramento"),
|
||||
new StateData("Colorado", "CO", "Denver"),
|
||||
new StateData("Connecticut", "CT", "Hartford"),
|
||||
new StateData("Delaware", "DE", "Dover"),
|
||||
new StateData("Florida", "FL", "Tallahassee"),
|
||||
new StateData("Georgia", "GA", "Atlanta"),
|
||||
new StateData("Hawaii", "HI", "Honolulu"),
|
||||
new StateData("Idaho", "ID", "Boise"),
|
||||
new StateData("Illinois", "IL", "Springfield"),
|
||||
new StateData("Indiana", "IN", "Indianapolis"),
|
||||
new StateData("Iowa", "IA", "Des Moines"),
|
||||
new StateData("Kansas", "KS", "Topeka"),
|
||||
new StateData("Kentucky", "KY", "Frankfort"),
|
||||
new StateData("Louisiana", "LA", "Baton Rouge"),
|
||||
new StateData("Maine", "ME", "Augusta"),
|
||||
new StateData("Maryland", "MD", "Annapolis"),
|
||||
new StateData("Massachusetts", "MA", "Boston"),
|
||||
new StateData("Michigan", "MI", "Lansing"),
|
||||
new StateData("Minnesota", "MN", "St. Paul"),
|
||||
new StateData("Mississippi", "MS", "Jackson"),
|
||||
new StateData("Missouri", "MO", "Jefferson City"),
|
||||
new StateData("Montana", "MT", "Helena"),
|
||||
new StateData("Nebraska", "NE", "Lincoln"),
|
||||
new StateData("Nevada", "NV", "Carson City"),
|
||||
new StateData("New Hampshire", "NH", "Concord"),
|
||||
new StateData("New Jersey", "NJ", "Trenton"),
|
||||
new StateData("New Mexico", "NM", "Santa Fe"),
|
||||
new StateData("New York", "NY", "Albany"),
|
||||
new StateData("North Carolina", "NC", "Raleigh"),
|
||||
new StateData("North Dakota", "ND", "Bismarck"),
|
||||
new StateData("Ohio", "OH", "Columbus"),
|
||||
new StateData("Oklahoma", "OK", "Oklahoma City"),
|
||||
new StateData("Oregon", "OR", "Salem"),
|
||||
new StateData("Pennsylvania", "PA", "Harrisburg"),
|
||||
new StateData("Rhode Island", "RI", "Providence"),
|
||||
new StateData("South Carolina", "SC", "Columbia"),
|
||||
new StateData("South Dakota", "SD", "Pierre"),
|
||||
new StateData("Tennessee", "TN", "Nashville"),
|
||||
new StateData("Texas", "TX", "Austin"),
|
||||
new StateData("Utah", "UT", "Salt Lake City"),
|
||||
new StateData("Vermont", "VT", "Montpelier"),
|
||||
new StateData("Virginia", "VA", "Richmond"),
|
||||
new StateData("Washington", "WA", "Olympia"),
|
||||
new StateData("West Virginia", "WV", "Charleston"),
|
||||
new StateData("Wisconsin", "WI", "Madison"),
|
||||
new StateData("Wyoming", "WY", "Cheyenne"),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public class StateData
|
||||
{
|
||||
public string Name { get; private set; }
|
||||
public string Abbreviation { get; private set; }
|
||||
public string Capital { get; private set; }
|
||||
|
||||
public StateData(string name, string abbreviation, string capital)
|
||||
{
|
||||
Name = name;
|
||||
Abbreviation = abbreviation;
|
||||
Capital = capital;
|
||||
}
|
||||
}
|
||||
@@ -18,4 +18,4 @@
|
||||
<TextBlock>Shadow on Pointerover</TextBlock>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -1,6 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
|
||||
@@ -6,174 +6,369 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
<ScrollViewer>
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="8">
|
||||
<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">
|
||||
<Style Selector="SplitButton,DropDownButton,ToggleSplitButton">
|
||||
<Setter Property="Button.Flyout">
|
||||
<MenuFlyout>
|
||||
<MenuItem Header="Submit All" />
|
||||
<MenuItem Header="Submit Updated" />
|
||||
</MenuFlyout>
|
||||
</Setter>
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<HeaderedContentControl
|
||||
Theme="{StaticResource GroupBox}">
|
||||
<HeaderedContentControl.Header>
|
||||
<StackPanel Spacing="8">
|
||||
<TextBlock Text="Button/RepeatButton Theme" />
|
||||
<WrapPanel ItemSpacing="4">
|
||||
<TextBlock Text="Theme:" />
|
||||
<Label Theme="{StaticResource TagLabel}" Classes="Blue Solid" Content="Light" />
|
||||
<Label Theme="{StaticResource TagLabel}" Classes="Blue Solid" Content="Solid" />
|
||||
<Label Theme="{StaticResource TagLabel}" Classes="Blue Solid" Content="Outline" />
|
||||
<Label Theme="{StaticResource TagLabel}" Classes="Blue Solid" Content="Borderless" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="4">
|
||||
<TextBlock Text="Classes:" />
|
||||
<Label Theme="{StaticResource TagLabel}" Classes="Blue" Content="Primary" />
|
||||
<Label Theme="{StaticResource TagLabel}" Classes="Blue" Content="Secondary" />
|
||||
<Label Theme="{StaticResource TagLabel}" Classes="Blue" Content="Tertiary" />
|
||||
<Label Theme="{StaticResource TagLabel}" Classes="Blue" Content="Success" />
|
||||
<Label Theme="{StaticResource TagLabel}" Classes="Blue" Content="Warning" />
|
||||
<Label Theme="{StaticResource TagLabel}" Classes="Blue" Content="Danger" />
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
</HeaderedContentControl.Header>
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="16">
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<Button Content="Default" />
|
||||
<Button Content="Primary" Classes="Primary" />
|
||||
<Button Content="Secondary" Classes="Secondary" />
|
||||
<Button Content="Tertiary" Classes="Tertiary" />
|
||||
<Button Content="Success" Classes="Success" />
|
||||
<Button Content="Warning" Classes="Warning" />
|
||||
<Button Content="Danger" Classes="Danger" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<Button Content="Default" Theme="{StaticResource SolidButton}" />
|
||||
<Button Content="Primary" Classes="Primary" Theme="{StaticResource SolidButton}" />
|
||||
<Button Content="Secondary" Classes="Secondary" Theme="{StaticResource SolidButton}" />
|
||||
<Button Content="Tertiary" Classes="Tertiary" Theme="{StaticResource SolidButton}" />
|
||||
<Button Content="Success" Classes="Success" Theme="{StaticResource SolidButton}" />
|
||||
<Button Content="Warning" Classes="Warning" Theme="{StaticResource SolidButton}" />
|
||||
<Button Content="Danger" Classes="Danger" Theme="{StaticResource SolidButton}" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<Button Content="Default" Theme="{StaticResource OutlineButton}" />
|
||||
<Button Content="Primary" Classes="Primary" Theme="{StaticResource OutlineButton}" />
|
||||
<Button Content="Secondary" Classes="Secondary" Theme="{StaticResource OutlineButton}" />
|
||||
<Button Content="Tertiary" Classes="Tertiary" Theme="{StaticResource OutlineButton}" />
|
||||
<Button Content="Success" Classes="Success" Theme="{StaticResource OutlineButton}" />
|
||||
<Button Content="Warning" Classes="Warning" Theme="{StaticResource OutlineButton}" />
|
||||
<Button Content="Danger" Classes="Danger" Theme="{StaticResource OutlineButton}" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<Button Content="Default" Theme="{StaticResource BorderlessButton}" />
|
||||
<Button Content="Primary" Classes="Primary" Theme="{StaticResource BorderlessButton}" />
|
||||
<Button Content="Secondary" Classes="Secondary" Theme="{StaticResource BorderlessButton}" />
|
||||
<Button Content="Tertiary" Classes="Tertiary" Theme="{StaticResource BorderlessButton}" />
|
||||
<Button Content="Success" Classes="Success" Theme="{StaticResource BorderlessButton}" />
|
||||
<Button Content="Warning" Classes="Warning" Theme="{StaticResource BorderlessButton}" />
|
||||
<Button Content="Danger" Classes="Danger" Theme="{StaticResource BorderlessButton}" />
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
</HeaderedContentControl>
|
||||
|
||||
<TextBlock>Light (Default)</TextBlock>
|
||||
<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>
|
||||
<HeaderedContentControl
|
||||
Theme="{StaticResource GroupBox}"
|
||||
Header="Prohibited Status">
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<Button Content="Light" IsEnabled="False" />
|
||||
<Button Content="Solid" IsEnabled="False" Theme="{StaticResource SolidButton}" />
|
||||
<Button Content="Outline" IsEnabled="False" Theme="{StaticResource OutlineButton}" />
|
||||
<Button Content="Borderless" IsEnabled="False" Theme="{StaticResource BorderlessButton}" />
|
||||
</WrapPanel>
|
||||
</HeaderedContentControl>
|
||||
|
||||
<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>
|
||||
<HeaderedContentControl
|
||||
Theme="{StaticResource GroupBox}">
|
||||
<HeaderedContentControl.Header>
|
||||
<StackPanel Spacing="8">
|
||||
<WrapPanel ItemSpacing="4">
|
||||
<TextBlock Text="Size Classes:" />
|
||||
<Label Theme="{StaticResource TagLabel}" Classes="Blue" Content="Large" />
|
||||
<Label Theme="{StaticResource TagLabel}" Classes="Blue" Content="Small" />
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
</HeaderedContentControl.Header>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<Button Content="Large" Classes="Large" />
|
||||
<Button Content="Default" />
|
||||
<Button Content="Small" Classes="Small" />
|
||||
</WrapPanel>
|
||||
</HeaderedContentControl>
|
||||
|
||||
<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>
|
||||
<HeaderedContentControl
|
||||
Theme="{StaticResource GroupBox}">
|
||||
<HeaderedContentControl.Header>
|
||||
<StackPanel Spacing="8">
|
||||
<TextBlock Text="AI style - Colorful Button" />
|
||||
<WrapPanel ItemSpacing="4">
|
||||
<TextBlock Text="Theme:" />
|
||||
<Label Theme="{StaticResource TagLabel}" Classes="Colorful Gradient Solid" Content="Light" />
|
||||
<Label Theme="{StaticResource TagLabel}" Classes="Colorful Gradient Solid" Content="Solid" />
|
||||
<Label Theme="{StaticResource TagLabel}" Classes="Colorful Gradient Solid" Content="Outline" />
|
||||
<Label Theme="{StaticResource TagLabel}" Classes="Colorful Gradient Solid" Content="Borderless" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="4">
|
||||
<TextBlock Text="Classes:" />
|
||||
<Label Theme="{StaticResource TagLabel}" Classes="Colorful Gradient" Content="Colorful Primary" />
|
||||
<Label Theme="{StaticResource TagLabel}" Classes="Colorful Gradient" Content="Colorful Tertiary" />
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
</HeaderedContentControl.Header>
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="16">
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<Button Content="Primary" Classes="Colorful Primary" />
|
||||
<Button Content="Tertiary" Classes="Colorful Tertiary" />
|
||||
<Button Content="Disabled" Classes="Colorful Primary" IsEnabled="False" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<Button Content="Primary" Classes="Colorful Primary" Theme="{StaticResource SolidButton}" />
|
||||
<Button Content="Tertiary" Classes="Colorful Tertiary" Theme="{StaticResource SolidButton}" />
|
||||
<Button Content="Disabled" Classes="Colorful Primary" Theme="{StaticResource SolidButton}" IsEnabled="False" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<Button Content="Primary" Classes="Colorful Primary" Theme="{StaticResource OutlineButton}" />
|
||||
<Button Content="Tertiary" Classes="Colorful Tertiary" Theme="{StaticResource OutlineButton}" />
|
||||
<Button Content="Disabled" Classes="Colorful Primary" Theme="{StaticResource OutlineButton}" IsEnabled="False" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<Button Content="Primary" Classes="Colorful Primary" Theme="{StaticResource BorderlessButton}" />
|
||||
<Button Content="Tertiary" Classes="Colorful Tertiary" Theme="{StaticResource BorderlessButton}" />
|
||||
<Button Content="Disabled" Classes="Colorful Primary" Theme="{StaticResource BorderlessButton}" IsEnabled="False" />
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
</HeaderedContentControl>
|
||||
|
||||
<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>
|
||||
<HeaderedContentControl
|
||||
Theme="{StaticResource GroupBox}" Header="DropDownButton">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="16">
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<DropDownButton Content="Default" />
|
||||
<DropDownButton Content="Primary" Classes="Primary" />
|
||||
<DropDownButton Content="Secondary" Classes="Secondary" />
|
||||
<DropDownButton Content="Tertiary" Classes="Tertiary" />
|
||||
<DropDownButton Content="Success" Classes="Success" />
|
||||
<DropDownButton Content="Warning" Classes="Warning" />
|
||||
<DropDownButton Content="Danger" Classes="Danger" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<DropDownButton Content="Default" Theme="{StaticResource SolidDropDownButton}" />
|
||||
<DropDownButton Content="Primary" Classes="Primary" Theme="{StaticResource SolidDropDownButton}" />
|
||||
<DropDownButton Content="Secondary" Classes="Secondary" Theme="{StaticResource SolidDropDownButton}" />
|
||||
<DropDownButton Content="Tertiary" Classes="Tertiary" Theme="{StaticResource SolidDropDownButton}" />
|
||||
<DropDownButton Content="Success" Classes="Success" Theme="{StaticResource SolidDropDownButton}" />
|
||||
<DropDownButton Content="Warning" Classes="Warning" Theme="{StaticResource SolidDropDownButton}" />
|
||||
<DropDownButton Content="Danger" Classes="Danger" Theme="{StaticResource SolidDropDownButton}" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<DropDownButton Content="Default" Theme="{StaticResource OutlineDropDownButton}" />
|
||||
<DropDownButton Content="Primary" Classes="Primary" Theme="{StaticResource OutlineDropDownButton}" />
|
||||
<DropDownButton Content="Secondary" Classes="Secondary" Theme="{StaticResource OutlineDropDownButton}" />
|
||||
<DropDownButton Content="Tertiary" Classes="Tertiary" Theme="{StaticResource OutlineDropDownButton}" />
|
||||
<DropDownButton Content="Success" Classes="Success" Theme="{StaticResource OutlineDropDownButton}" />
|
||||
<DropDownButton Content="Warning" Classes="Warning" Theme="{StaticResource OutlineDropDownButton}" />
|
||||
<DropDownButton Content="Danger" Classes="Danger" Theme="{StaticResource OutlineDropDownButton}" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<DropDownButton Content="Default" Theme="{StaticResource BorderlessDropDownButton}" />
|
||||
<DropDownButton Content="Primary" Classes="Primary" Theme="{StaticResource BorderlessDropDownButton}" />
|
||||
<DropDownButton Content="Secondary" Classes="Secondary" Theme="{StaticResource BorderlessDropDownButton}" />
|
||||
<DropDownButton Content="Tertiary" Classes="Tertiary" Theme="{StaticResource BorderlessDropDownButton}" />
|
||||
<DropDownButton Content="Success" Classes="Success" Theme="{StaticResource BorderlessDropDownButton}" />
|
||||
<DropDownButton Content="Warning" Classes="Warning" Theme="{StaticResource BorderlessDropDownButton}" />
|
||||
<DropDownButton Content="Danger" Classes="Danger" Theme="{StaticResource BorderlessDropDownButton}" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<DropDownButton Content="Light" IsEnabled="False" />
|
||||
<DropDownButton Content="Solid" IsEnabled="False" Theme="{StaticResource SolidDropDownButton}" />
|
||||
<DropDownButton Content="Outline" IsEnabled="False" Theme="{StaticResource OutlineDropDownButton}" />
|
||||
<DropDownButton Content="Borderless" IsEnabled="False" Theme="{StaticResource BorderlessDropDownButton}" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<DropDownButton Content="Large" Classes="Large" />
|
||||
<DropDownButton Content="Default" />
|
||||
<DropDownButton Content="Small" Classes="Small" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<DropDownButton Content="Primary" Classes="Colorful Primary" />
|
||||
<DropDownButton Content="Tertiary" Classes="Colorful Tertiary" />
|
||||
<DropDownButton Content="Disabled" Classes="Colorful Primary" IsEnabled="False" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<DropDownButton Content="Primary" Classes="Colorful Primary" Theme="{StaticResource SolidDropDownButton}" />
|
||||
<DropDownButton Content="Tertiary" Classes="Colorful Tertiary" Theme="{StaticResource SolidDropDownButton}" />
|
||||
<DropDownButton Content="Disabled" Classes="Colorful Primary" Theme="{StaticResource SolidDropDownButton}" IsEnabled="False" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<DropDownButton Content="Primary" Classes="Colorful Primary" Theme="{StaticResource OutlineDropDownButton}" />
|
||||
<DropDownButton Content="Tertiary" Classes="Colorful Tertiary" Theme="{StaticResource OutlineDropDownButton}" />
|
||||
<DropDownButton Content="Disabled" Classes="Colorful Primary" Theme="{StaticResource OutlineDropDownButton}" IsEnabled="False" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<DropDownButton Content="Primary" Classes="Colorful Primary" Theme="{StaticResource BorderlessDropDownButton}" />
|
||||
<DropDownButton Content="Tertiary" Classes="Colorful Tertiary" Theme="{StaticResource BorderlessDropDownButton}" />
|
||||
<DropDownButton Content="Disabled" Classes="Colorful Primary" Theme="{StaticResource BorderlessDropDownButton}" IsEnabled="False" />
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
</HeaderedContentControl>
|
||||
|
||||
<HeaderedContentControl
|
||||
Theme="{StaticResource GroupBox}" Header="SplitButton">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="16">
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<SplitButton Content="Default" />
|
||||
<SplitButton Content="Primary" Classes="Primary" />
|
||||
<SplitButton Content="Secondary" Classes="Secondary" />
|
||||
<SplitButton Content="Tertiary" Classes="Tertiary" />
|
||||
<SplitButton Content="Success" Classes="Success" />
|
||||
<SplitButton Content="Warning" Classes="Warning" />
|
||||
<SplitButton Content="Danger" Classes="Danger" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<SplitButton Content="Default" Theme="{StaticResource SolidSplitButton}" />
|
||||
<SplitButton Content="Primary" Classes="Primary" Theme="{StaticResource SolidSplitButton}" />
|
||||
<SplitButton Content="Secondary" Classes="Secondary" Theme="{StaticResource SolidSplitButton}" />
|
||||
<SplitButton Content="Tertiary" Classes="Tertiary" Theme="{StaticResource SolidSplitButton}" />
|
||||
<SplitButton Content="Success" Classes="Success" Theme="{StaticResource SolidSplitButton}" />
|
||||
<SplitButton Content="Warning" Classes="Warning" Theme="{StaticResource SolidSplitButton}" />
|
||||
<SplitButton Content="Danger" Classes="Danger" Theme="{StaticResource SolidSplitButton}" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<SplitButton Content="Default" Theme="{StaticResource OutlineSplitButton}" />
|
||||
<SplitButton Content="Primary" Classes="Primary" Theme="{StaticResource OutlineSplitButton}" />
|
||||
<SplitButton Content="Secondary" Classes="Secondary" Theme="{StaticResource OutlineSplitButton}" />
|
||||
<SplitButton Content="Tertiary" Classes="Tertiary" Theme="{StaticResource OutlineSplitButton}" />
|
||||
<SplitButton Content="Success" Classes="Success" Theme="{StaticResource OutlineSplitButton}" />
|
||||
<SplitButton Content="Warning" Classes="Warning" Theme="{StaticResource OutlineSplitButton}" />
|
||||
<SplitButton Content="Danger" Classes="Danger" Theme="{StaticResource OutlineSplitButton}" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<SplitButton Content="Default" Theme="{StaticResource BorderlessSplitButton}" />
|
||||
<SplitButton Content="Primary" Classes="Primary" Theme="{StaticResource BorderlessSplitButton}" />
|
||||
<SplitButton Content="Secondary" Classes="Secondary" Theme="{StaticResource BorderlessSplitButton}" />
|
||||
<SplitButton Content="Tertiary" Classes="Tertiary" Theme="{StaticResource BorderlessSplitButton}" />
|
||||
<SplitButton Content="Success" Classes="Success" Theme="{StaticResource BorderlessSplitButton}" />
|
||||
<SplitButton Content="Warning" Classes="Warning" Theme="{StaticResource BorderlessSplitButton}" />
|
||||
<SplitButton Content="Danger" Classes="Danger" Theme="{StaticResource BorderlessSplitButton}" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<SplitButton Content="Light" IsEnabled="False" />
|
||||
<SplitButton Content="Solid" IsEnabled="False" Theme="{StaticResource SolidSplitButton}" />
|
||||
<SplitButton Content="Outline" IsEnabled="False" Theme="{StaticResource OutlineSplitButton}" />
|
||||
<SplitButton Content="Borderless" IsEnabled="False" Theme="{StaticResource BorderlessSplitButton}" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<SplitButton Content="Large" Classes="Large" />
|
||||
<SplitButton Content="Default" />
|
||||
<SplitButton Content="Small" Classes="Small" />
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
</HeaderedContentControl>
|
||||
|
||||
<HeaderedContentControl
|
||||
Theme="{StaticResource GroupBox}"
|
||||
Header="ToggleSplitButton">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="24">
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<ToggleSplitButton Content="Default" />
|
||||
<ToggleSplitButton Classes="Primary" Content="Primary" />
|
||||
<ToggleSplitButton Classes="Secondary" Content="Secondary" />
|
||||
<ToggleSplitButton Classes="Tertiary" Content="Tertiary" />
|
||||
<ToggleSplitButton Classes="Success" Content="Success" />
|
||||
<ToggleSplitButton Classes="Warning" Content="Warning" />
|
||||
<ToggleSplitButton Classes="Danger" Content="Danger" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<ToggleSplitButton Content="Default" IsChecked="True" />
|
||||
<ToggleSplitButton Classes="Primary" Content="Primary" IsChecked="True" />
|
||||
<ToggleSplitButton Classes="Secondary" Content="Secondary" IsChecked="True" />
|
||||
<ToggleSplitButton Classes="Tertiary" Content="Tertiary" IsChecked="True" />
|
||||
<ToggleSplitButton Classes="Success" Content="Success" IsChecked="True" />
|
||||
<ToggleSplitButton Classes="Warning" Content="Warning" IsChecked="True" />
|
||||
<ToggleSplitButton Classes="Danger" Content="Danger" IsChecked="True" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<ToggleSplitButton Content="Unchecked" Classes="Success" IsEnabled="False" />
|
||||
<ToggleSplitButton Content="Checked" Classes="Success" IsChecked="True" IsEnabled="False" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<ToggleSplitButton Content="Large" Classes="Large" />
|
||||
<ToggleSplitButton Content="Default" />
|
||||
<ToggleSplitButton Content="Small" Classes="Small" />
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
</HeaderedContentControl>
|
||||
|
||||
<HeaderedContentControl
|
||||
Theme="{StaticResource GroupBox}" Header="ToggleButton">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="16">
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<ToggleButton Content="Default" />
|
||||
<ToggleButton Content="Primary" Classes="Primary" />
|
||||
<ToggleButton Content="Secondary" Classes="Secondary" />
|
||||
<ToggleButton Content="Tertiary" Classes="Tertiary" />
|
||||
<ToggleButton Content="Success" Classes="Success" />
|
||||
<ToggleButton Content="Warning" Classes="Warning" />
|
||||
<ToggleButton Content="Danger" Classes="Danger" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<ToggleButton Content="Default" IsChecked="True" />
|
||||
<ToggleButton Content="Primary" Classes="Primary" IsChecked="True" />
|
||||
<ToggleButton Content="Secondary" Classes="Secondary" IsChecked="True" />
|
||||
<ToggleButton Content="Tertiary" Classes="Tertiary" IsChecked="True" />
|
||||
<ToggleButton Content="Success" Classes="Success" IsChecked="True" />
|
||||
<ToggleButton Content="Warning" Classes="Warning" IsChecked="True" />
|
||||
<ToggleButton Content="Danger" Classes="Danger" IsChecked="True" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<ToggleButton Content="Default" IsChecked="{x:Null}" IsThreeState="True" />
|
||||
<ToggleButton Content="Primary" Classes="Primary" IsChecked="{x:Null}" IsThreeState="True" />
|
||||
<ToggleButton Content="Secondary" Classes="Secondary" IsChecked="{x:Null}" IsThreeState="True" />
|
||||
<ToggleButton Content="Tertiary" Classes="Tertiary" IsChecked="{x:Null}" IsThreeState="True" />
|
||||
<ToggleButton Content="Success" Classes="Success" IsChecked="{x:Null}" IsThreeState="True" />
|
||||
<ToggleButton Content="Warning" Classes="Warning" IsChecked="{x:Null}" IsThreeState="True" />
|
||||
<ToggleButton Content="Danger" Classes="Danger" IsChecked="{x:Null}" IsThreeState="True" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<ToggleButton Content="Unchecked" IsEnabled="False" />
|
||||
<ToggleButton Content="Checked" IsEnabled="False" IsChecked="True" />
|
||||
<ToggleButton Content="Indeterminate" IsEnabled="False" IsChecked="{x:Null}" IsThreeState="True" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<ToggleButton Content="Large" Classes="Large" />
|
||||
<ToggleButton Content="Default" />
|
||||
<ToggleButton Content="Small" Classes="Small" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<ToggleButton Content="Primary" Classes="Colorful Primary" />
|
||||
<ToggleButton Content="Tertiary" Classes="Colorful Tertiary" />
|
||||
<ToggleButton Content="Disabled" Classes="Colorful Primary" IsEnabled="False" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<ToggleButton Content="Primary" Classes="Colorful Primary" IsChecked="True" />
|
||||
<ToggleButton Content="Tertiary" Classes="Colorful Tertiary" IsChecked="True" />
|
||||
<ToggleButton Content="Disabled" Classes="Colorful Primary" IsChecked="True" IsEnabled="False" />
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemSpacing="16" LineSpacing="16">
|
||||
<ToggleButton Content="Primary" Classes="Colorful Primary" IsChecked="{x:Null}" IsThreeState="True" />
|
||||
<ToggleButton Content="Tertiary" Classes="Colorful Tertiary" IsChecked="{x:Null}" IsThreeState="True" />
|
||||
<ToggleButton Content="Disabled" Classes="Colorful Primary" IsChecked="{x:Null}" IsThreeState="True" IsEnabled="False" />
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
</HeaderedContentControl>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
@@ -1,6 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
|
||||
@@ -8,6 +8,10 @@
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ToggleSwitch Name="showSpinCheck" IsChecked="True" Content="Show Button Spinner" />
|
||||
<ToggleSwitch Name="allowSpinCheck" IsChecked="True" Content="Allow Spin" />
|
||||
</StackPanel>
|
||||
<ButtonSpinner
|
||||
Height="30"
|
||||
AllowSpin="{Binding #allowSpinCheck.IsChecked}"
|
||||
@@ -32,4 +36,4 @@
|
||||
Text="A.S.I.A" />
|
||||
</ButtonSpinner>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -1,7 +1,5 @@
|
||||
using System;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
@@ -31,7 +29,6 @@ public partial class ButtonSpinnerDemo : UserControl
|
||||
|
||||
txtBox.Text = _mountains[value];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private readonly string[] _mountains = new[]
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
|
||||
@@ -11,4 +11,4 @@
|
||||
<Calendar />
|
||||
<Calendar SelectionMode="SingleRange" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -1,6 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
@@ -10,9 +8,4 @@ public partial class CalendarDemo : UserControl
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
@@ -8,20 +8,26 @@
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Styles>
|
||||
<Style Selector="Border">
|
||||
<Style Selector="Carousel">
|
||||
<Setter Property="Height" Value="200" />
|
||||
<Style Selector="^ TextBlock">
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Foreground" Value="#1C1F23" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="TextBlock">
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Foreground" Value="#1C1F23" />
|
||||
<Style Selector="RadioButton">
|
||||
<Setter Property="Theme" Value="{DynamicResource ButtonRadioButton}" />
|
||||
</Style>
|
||||
</UserControl.Styles>
|
||||
<StackPanel Spacing="20">
|
||||
<Carousel Theme="{DynamicResource FullCarousel}">
|
||||
<Carousel.PageTransition>
|
||||
<PageSlide Orientation="Horizontal" Duration="0.25" />
|
||||
</Carousel.PageTransition>
|
||||
<Carousel Theme="{DynamicResource FullCarousel}"
|
||||
Classes.Dot="{Binding #DotButton.IsChecked}"
|
||||
Classes.Columnar="{Binding #ColumnarButton.IsChecked}"
|
||||
Classes.Line="{Binding #LineButton.IsChecked}"
|
||||
Classes.Left="{Binding #LeftButton.IsChecked}"
|
||||
Classes.Center="{Binding #CenterButton.IsChecked}"
|
||||
Classes.Right="{Binding #RightButton.IsChecked}">
|
||||
<Border Background="#EAF5FF">
|
||||
<TextBlock Text="Text 1" />
|
||||
</Border>
|
||||
@@ -35,39 +41,39 @@
|
||||
<TextBlock Text="Text 4" />
|
||||
</Border>
|
||||
</Carousel>
|
||||
<Carousel Classes="Line" Theme="{DynamicResource FullCarousel}">
|
||||
<Carousel.PageTransition>
|
||||
<PageSlide Orientation="Horizontal" Duration="0.25" />
|
||||
</Carousel.PageTransition>
|
||||
<Border Background="#EAF5FF">
|
||||
<TextBlock Text="Text 1" />
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<TextBlock VerticalAlignment="Center" Text="Type" />
|
||||
<Border Theme="{DynamicResource RadioButtonGroupBorder}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<RadioButton
|
||||
Name="DotButton"
|
||||
IsChecked="True"
|
||||
Content="Dot" />
|
||||
<RadioButton
|
||||
Name="ColumnarButton"
|
||||
Content="Columnar" />
|
||||
<RadioButton
|
||||
Name="LineButton"
|
||||
Content="Line" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border Background="#F9F9F9">
|
||||
<TextBlock Text="Text 2" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<TextBlock VerticalAlignment="Center" Text="Position" />
|
||||
<Border Theme="{DynamicResource RadioButtonGroupBorder}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<RadioButton
|
||||
Name="LeftButton"
|
||||
IsChecked="True"
|
||||
Content="Left" />
|
||||
<RadioButton
|
||||
Name="CenterButton"
|
||||
Content="Center" />
|
||||
<RadioButton
|
||||
Name="RightButton"
|
||||
Content="Right" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border Background="#FFF8EA">
|
||||
<TextBlock Text="Text 3" />
|
||||
</Border>
|
||||
<Border Background="#FEF2ED">
|
||||
<TextBlock Text="Text 4" />
|
||||
</Border>
|
||||
</Carousel>
|
||||
<Carousel Classes="Columnar Left" Theme="{DynamicResource FullCarousel}">
|
||||
<Carousel.PageTransition>
|
||||
<PageSlide Orientation="Horizontal" Duration="0.25" />
|
||||
</Carousel.PageTransition>
|
||||
<Border Background="#EAF5FF">
|
||||
<TextBlock Text="Text 1" />
|
||||
</Border>
|
||||
<Border Background="#F9F9F9">
|
||||
<TextBlock Text="Text 2" />
|
||||
</Border>
|
||||
<Border Background="#FFF8EA">
|
||||
<TextBlock Text="Text 3" />
|
||||
</Border>
|
||||
<Border Background="#FEF2ED">
|
||||
<TextBlock Text="Text 4" />
|
||||
</Border>
|
||||
</Carousel>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -1,7 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
|
||||
@@ -2,39 +2,80 @@
|
||||
x:Class="Semi.Avalonia.Demo.Pages.ColorPickerDemo"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:colorPicker="clr-namespace:Semi.Avalonia.ColorPicker;assembly=Semi.Avalonia.ColorPicker"
|
||||
xmlns:controls="using:Avalonia.Controls"
|
||||
xmlns:semi="https://irihi.tech/semi"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="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 Orientation="Horizontal" Spacing="20">
|
||||
<ColorView Name="Test" ColorSpectrumShape="Ring" />
|
||||
<ColorView ColorSpectrumShape="Box" />
|
||||
<ColorView Palette="{DynamicResource SemiColorPalette}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ColorView
|
||||
Name="SimpleColorViewTest"
|
||||
HsvColor="hsv(180,80%,70%)"
|
||||
IsAlphaVisible="True"
|
||||
Theme="{StaticResource SimpleColorView}" />
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding #SimpleColorViewTest.HsvColor}" />
|
||||
<TextBlock Text="{Binding #SimpleColorViewTest.Color}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<ColorPicker ColorSpectrumShape="Ring">
|
||||
<ColorPicker.Palette>
|
||||
<FlatHalfColorPalette />
|
||||
</ColorPicker.Palette>
|
||||
</ColorPicker>
|
||||
<ColorPicker ColorSpectrumShape="Box">
|
||||
<ColorPicker.Palette>
|
||||
<semi:SemiColorLightPalette />
|
||||
</ColorPicker.Palette>
|
||||
</ColorPicker>
|
||||
<ColorPicker
|
||||
Theme="{DynamicResource HexColorPicker}"
|
||||
ColorSpectrumShape="Box">
|
||||
<ColorPicker.Palette>
|
||||
<semi:SemiColorLightPalette />
|
||||
</ColorPicker.Palette>
|
||||
</ColorPicker>
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Left">
|
||||
<TextBlock Text="Use Style to customize button" />
|
||||
<ColorPicker
|
||||
Margin="8"
|
||||
MinWidth="32"
|
||||
HsvColor="hsv(180,80%,70%)">
|
||||
<ColorPicker.Content>
|
||||
<Border
|
||||
Margin="1"
|
||||
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 Orientation="Horizontal" Spacing="8">
|
||||
<ColorPicker
|
||||
Theme="{StaticResource SimpleColorPicker}"
|
||||
HsvColor="hsv(180,80%,70%)" />
|
||||
<ColorPicker
|
||||
Theme="{StaticResource HexSimpleColorPicker}"
|
||||
HsvColor="hsv(180,80%,70%)" />
|
||||
</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>
|
||||
|
||||
<ColorPicker ColorSpectrumShape="Box" Theme="{DynamicResource HexColorPicker}">
|
||||
<ColorPicker.Palette>
|
||||
<colorPicker:SemiColorLightPalette />
|
||||
</ColorPicker.Palette>
|
||||
</ColorPicker>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
@@ -1,6 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
|
||||
@@ -4,40 +4,54 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
|
||||
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
|
||||
d:DesignHeight="800"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
mc:Ignorable="d"
|
||||
x:DataType="vm:ComboBoxDemoViewModel">
|
||||
<Design.DataContext>
|
||||
<pages:ComboBoxDemoViewModel />
|
||||
<vm:ComboBoxDemoViewModel />
|
||||
</Design.DataContext>
|
||||
<StackPanel Spacing="20">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="ComboBox">
|
||||
<Setter Property="Width" Value="300" />
|
||||
<Setter Property="ItemsSource" Value="{Binding Items}" />
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<ScrollViewer>
|
||||
<StackPanel Spacing="20">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="ComboBox">
|
||||
<Setter Property="Width" Value="300" />
|
||||
<Setter Property="ItemsSource" Value="{Binding Items}" />
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
|
||||
<ComboBox />
|
||||
<ComboBox Classes="ClearButton" />
|
||||
<ComboBox PlaceholderText="Please Select" />
|
||||
<ComboBox IsEnabled="False" />
|
||||
<ComboBox Classes="Large" IsEnabled="False" />
|
||||
<ComboBox Classes="Small" />
|
||||
<ComboBox Classes="Bordered" />
|
||||
<ComboBox Classes="Bordered" IsEnabled="False" />
|
||||
<ComboBox />
|
||||
<ComboBox Classes="ClearButton" />
|
||||
<ComboBox PlaceholderText="Please Select" />
|
||||
<ComboBox IsEnabled="False" />
|
||||
<ComboBox Classes="Large" IsEnabled="False" />
|
||||
<ComboBox Classes="Small" />
|
||||
<ComboBox Classes="Bordered" />
|
||||
<ComboBox Classes="Bordered" IsEnabled="False" />
|
||||
<ComboBox>
|
||||
<ComboBox.SelectionBoxItemTemplate>
|
||||
<DataTemplate DataType="x:String">
|
||||
<ContentControl BorderThickness="1"
|
||||
BorderBrush="Gold"
|
||||
Content="{Binding}" />
|
||||
</DataTemplate>
|
||||
</ComboBox.SelectionBoxItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ComboBox Width="100" Classes="Large" PlaceholderText="Large" />
|
||||
<ComboBox Width="100" PlaceholderText="Default" />
|
||||
<ComboBox Width="100" Classes="Small" PlaceholderText="Small" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ComboBox Width="100" Classes="Large" PlaceholderText="Large" />
|
||||
<ComboBox Width="100" PlaceholderText="Default" />
|
||||
<ComboBox Width="100" Classes="Small" PlaceholderText="Small" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ComboBox Width="100" IsEnabled="False" PlaceholderText="Disabled" />
|
||||
<ComboBox Width="100" Classes="Bordered" PlaceholderText="Bordered" />
|
||||
<ComboBox Width="100" Classes="Bordered" IsEnabled="False" />
|
||||
</StackPanel>
|
||||
<ToggleSwitch Name="toggle" IsChecked="True" Content="IsEditable" />
|
||||
<ComboBox IsEditable="{Binding #toggle.IsChecked}" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ComboBox Width="100" IsEnabled="False" PlaceholderText="Disabled" />
|
||||
<ComboBox Width="100" Classes="Bordered" PlaceholderText="Bordered" />
|
||||
<ComboBox Width="100" Classes="Bordered" IsEnabled="False" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using Avalonia.Controls;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using Semi.Avalonia.Demo.ViewModels;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
@@ -11,9 +10,4 @@ public partial class ComboBoxDemo : UserControl
|
||||
InitializeComponent();
|
||||
this.DataContext = new ComboBoxDemoViewModel();
|
||||
}
|
||||
}
|
||||
|
||||
public class ComboBoxDemoViewModel : ObservableObject
|
||||
{
|
||||
public ObservableCollection<string> Items { get; set; } = ["Ding", "Otter", "Husky", "Mr.17", "Cass"];
|
||||
}
|
||||
@@ -3,58 +3,62 @@
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="using:Semi.Avalonia.Demo.Pages"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels;assembly=Semi.Avalonia.Demo"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
x:CompileBindings="True"
|
||||
x:DataType="vm:DataGridDemoViewModel"
|
||||
mc:Ignorable="d">
|
||||
<TabControl>
|
||||
<TabItem Header="DataGrid">
|
||||
<Grid RowDefinitions="Auto, *">
|
||||
<ToggleSwitch Grid.Row="0" Content="Disable" Name="DisableToggle"></ToggleSwitch>
|
||||
<DataGrid Grid.Row="1"
|
||||
Margin="8"
|
||||
CanUserReorderColumns="True"
|
||||
CanUserResizeColumns="True"
|
||||
CanUserSortColumns="True"
|
||||
HeadersVisibility="All"
|
||||
IsReadOnly="True"
|
||||
IsEnabled="{Binding #DisableToggle.IsChecked}"
|
||||
ItemsSource="{Binding GridData1}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="6*"
|
||||
x:DataType="vm:Song"
|
||||
Binding="{Binding Title}"
|
||||
Header="Title" />
|
||||
<DataGridTextColumn
|
||||
Width="6*"
|
||||
x:DataType="vm:Song"
|
||||
Binding="{Binding Artist}"
|
||||
Header="Artist" />
|
||||
<DataGridTextColumn
|
||||
Width="6*"
|
||||
x:DataType="vm:Song"
|
||||
Binding="{Binding Album}"
|
||||
Header="Album" />
|
||||
<DataGridTemplateColumn Header="Duration" SortMemberPath="Duration">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock
|
||||
Margin="8,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Duration}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
<Grid RowDefinitions="Auto, *">
|
||||
<StackPanel Grid.Row="0" Orientation="Horizontal">
|
||||
<ToggleSwitch Content="Enable" Name="enable" IsChecked="True" />
|
||||
<ToggleSwitch Content="Inset Content" Name="inset" />
|
||||
<ToggleSwitch Content="ScrollBar Auto Hide" Name="autohide" />
|
||||
</StackPanel>
|
||||
<DataGrid Grid.Row="1"
|
||||
Margin="8"
|
||||
CanUserReorderColumns="True"
|
||||
CanUserResizeColumns="True"
|
||||
CanUserSortColumns="True"
|
||||
HeadersVisibility="All"
|
||||
IsReadOnly="True"
|
||||
Classes.InsetContent="{Binding #inset.IsChecked}"
|
||||
ScrollViewer.AllowAutoHide="{Binding #autohide.IsChecked}"
|
||||
IsEnabled="{Binding #enable.IsChecked}"
|
||||
ItemsSource="{Binding GridData1}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="6*"
|
||||
x:DataType="vm:Song"
|
||||
Binding="{Binding Title}"
|
||||
Header="Title" />
|
||||
<DataGridTextColumn
|
||||
Width="6*"
|
||||
x:DataType="vm:Song"
|
||||
Binding="{Binding Artist}"
|
||||
Header="Artist" />
|
||||
<DataGridTextColumn
|
||||
Width="6*"
|
||||
x:DataType="vm:Song"
|
||||
Binding="{Binding Album}"
|
||||
Header="Album" />
|
||||
<DataGridTemplateColumn Header="Duration" SortMemberPath="Duration">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock
|
||||
Margin="8,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Duration}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
|
||||
</DataGrid>
|
||||
|
||||
</Grid>
|
||||
</DataGrid>
|
||||
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="Grouping">
|
||||
<DataGrid
|
||||
@@ -97,7 +101,7 @@
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</TabItem>
|
||||
<TabItem x:Name="EditableTab" Header="Editable">
|
||||
<TabItem Name="EditableTab" Header="Editable">
|
||||
<Grid Margin="8" RowDefinitions="Auto,*,Auto">
|
||||
<StackPanel
|
||||
Grid.Row="0"
|
||||
@@ -105,14 +109,14 @@
|
||||
Spacing="4">
|
||||
<TextBlock VerticalAlignment="Center" Text="FontSize:" />
|
||||
<Slider
|
||||
x:Name="FontSizeSlider"
|
||||
Name="FontSizeSlider"
|
||||
Width="100"
|
||||
VerticalAlignment="Center"
|
||||
Maximum="30"
|
||||
Minimum="5"
|
||||
Value="14" />
|
||||
<CheckBox
|
||||
x:Name="IsThreeStateCheckBox"
|
||||
Name="IsThreeStateCheckBox"
|
||||
Content="IsThreeState"
|
||||
IsChecked="False" />
|
||||
</StackPanel>
|
||||
@@ -172,4 +176,4 @@
|
||||
</Grid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -1,18 +1,4 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using Avalonia;
|
||||
using Avalonia.Collections;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Data;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Input.Raw;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.Threading;
|
||||
using Semi.Avalonia.Demo.ViewModels;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
@@ -80,4 +80,4 @@
|
||||
</TextBox>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -1,6 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
@@ -10,9 +8,4 @@ public partial class DataValidationErrorsDemo : UserControl
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
@@ -26,4 +26,4 @@
|
||||
</StackPanel>
|
||||
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -1,7 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
@@ -11,14 +8,4 @@ public partial class DatePickerDemo : UserControl
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
|
||||
public override void Render(DrawingContext context)
|
||||
{
|
||||
base.Render(context);
|
||||
}
|
||||
}
|
||||
@@ -36,4 +36,4 @@
|
||||
</Expander>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -1,6 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.LogicalTree;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class GridSplitter : UserControl
|
||||
{
|
||||
public GridSplitter()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<UserControl
|
||||
x:Class="Semi.Avalonia.Demo.Pages.GridSplitter"
|
||||
x:Class="Semi.Avalonia.Demo.Pages.GridSplitterDemo"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
@@ -14,13 +14,13 @@
|
||||
RowDefinitions="*, Auto, *">
|
||||
<Border
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="#FEFBCB"
|
||||
Background="{DynamicResource SemiGrey0Color}"
|
||||
CornerRadius="10" />
|
||||
<GridSplitter Grid.Row="1" ShowsPreview="True" />
|
||||
<Border
|
||||
Grid.Row="2"
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="#FEFBCB"
|
||||
Background="{DynamicResource SemiGrey0Color}"
|
||||
CornerRadius="10" />
|
||||
</Grid>
|
||||
<Grid
|
||||
@@ -29,14 +29,14 @@
|
||||
ColumnDefinitions="*, Auto, *">
|
||||
<Border
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="#FEFBCB"
|
||||
Background="{DynamicResource SemiGrey0Color}"
|
||||
CornerRadius="10" />
|
||||
<GridSplitter Grid.Column="1" ShowsPreview="True" />
|
||||
<Border
|
||||
Grid.Column="2"
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="#FEFBCB"
|
||||
Background="{DynamicResource SemiGrey0Color}"
|
||||
CornerRadius="10" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
11
demo/Semi.Avalonia.Demo/Pages/GridSplitterDemo.axaml.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class GridSplitterDemo : UserControl
|
||||
{
|
||||
public GridSplitterDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="1450"
|
||||
x:Class="Semi.Avalonia.Demo.Pages.HeaderedContentControlDemo">
|
||||
<ScrollViewer>
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
||||
@@ -27,12 +27,18 @@
|
||||
</WrapPanel>
|
||||
<TextBlock>GroupBox Theme</TextBlock>
|
||||
<HeaderedContentControl
|
||||
HorizontalAlignment="Left"
|
||||
Theme="{DynamicResource GroupBox}"
|
||||
Header="Semi Design"
|
||||
Width="400"
|
||||
Height="200">
|
||||
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统。设计系统包含设计语言以及一整套可复用的前端组件,帮助设计师与开发者更容易地打造高质量的、用户体验一致的、符合设计规范的 Web 应用。</TextBlock>
|
||||
HorizontalAlignment="Left"
|
||||
MaxWidth="360">
|
||||
<HeaderedContentControl.Header>
|
||||
<Panel>
|
||||
<SelectableTextBlock Text="Semi Design" />
|
||||
<HyperlinkButton HorizontalAlignment="Right" Content="更多" />
|
||||
</Panel>
|
||||
</HeaderedContentControl.Header>
|
||||
<HeaderedContentControl.Content>
|
||||
<SelectableTextBlock Text="Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统。设计系统包含设计语言以及一整套可复用的前端组件,帮助设计师与开发者更容易地打造高质量的、用户体验一致的、符合设计规范的 Web 应用。" />
|
||||
</HeaderedContentControl.Content>
|
||||
</HeaderedContentControl>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
327
demo/Semi.Avalonia.Demo/Pages/HighContrastDemo.axaml
Normal file
@@ -0,0 +1,327 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
|
||||
xmlns:controls="clr-namespace:Semi.Avalonia.Demo.Controls"
|
||||
xmlns:cvt="clr-namespace:Semi.Avalonia.Demo.Converters"
|
||||
xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
|
||||
mc:Ignorable="d" d:DesignWidth="1000" d:DesignHeight="1450"
|
||||
x:DataType="vm:HighContrastDemoViewModel"
|
||||
x:Class="Semi.Avalonia.Demo.Pages.HighContrastDemo">
|
||||
<Design.DataContext>
|
||||
<vm:HighContrastDemoViewModel />
|
||||
</Design.DataContext>
|
||||
<SplitView
|
||||
Name="splitView"
|
||||
CompactPaneLength="50"
|
||||
DisplayMode="CompactInline"
|
||||
IsPaneOpen="{Binding #toggle.IsChecked, Mode=TwoWay}"
|
||||
OpenPaneLength="300"
|
||||
PanePlacement="Right">
|
||||
<SplitView.Pane>
|
||||
<StackPanel>
|
||||
<ToggleSwitch
|
||||
Name="toggle"
|
||||
HorizontalAlignment="Right"
|
||||
IsChecked="True"
|
||||
Theme="{DynamicResource IconBorderlessToggleSwitch}"
|
||||
Content="{StaticResource SemiIconSidebar}" />
|
||||
<Border IsVisible="{Binding #splitView.IsPaneOpen}" Theme="{DynamicResource CardBorder}">
|
||||
<Panel>
|
||||
<TextBlock
|
||||
IsVisible="{Binding SelectedColorResource, Converter={x:Static ObjectConverters.IsNull}}"
|
||||
Text="Click on Color to Check Details"
|
||||
TextWrapping="Wrap" />
|
||||
<controls:ColorDetailControl
|
||||
Background="{Binding SelectedColorResource.Brush}"
|
||||
IsVisible="{Binding SelectedColorResource, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
ResourceKey="{Binding SelectedColorResource.ResourceKey}"
|
||||
ResourceName="{Binding SelectedColorResource.ResourceKey}" />
|
||||
</Panel>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</SplitView.Pane>
|
||||
<SplitView.Content>
|
||||
<ScrollViewer>
|
||||
<StackPanel Spacing="10">
|
||||
<TextBlock Text="Theme Preview" FontWeight="SemiBold" />
|
||||
<ListBox
|
||||
Theme="{StaticResource PureCardRadioGroupListBox}"
|
||||
ItemsSource="{Binding ThemeVariants}"
|
||||
SelectedItem="{Binding SelectedThemeVariant}">
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="5" MinWidth="200">
|
||||
<ThemeVariantScope RequestedThemeVariant="{Binding}">
|
||||
<Border
|
||||
Padding="5 25 5 5"
|
||||
HorizontalAlignment="Left"
|
||||
Background="{DynamicResource WindowColor}"
|
||||
BorderBrush="{DynamicResource WindowTextColor}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="3">
|
||||
<StackPanel Spacing="10">
|
||||
<StackPanel Orientation="Horizontal" Spacing="50">
|
||||
<StackPanel Spacing="5">
|
||||
<TextBlock
|
||||
FontSize="50"
|
||||
Text="Aa" />
|
||||
<StackPanel Orientation="Horizontal" Spacing="3">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="Border">
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource WindowTextColor}" />
|
||||
<Setter Property="CornerRadius" Value="5" />
|
||||
<Setter Property="Width" Value="10" />
|
||||
<Setter Property="Height" Value="{Binding $self.Width}" />
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<Border Background="{DynamicResource WindowColor}" />
|
||||
<Border Background="{DynamicResource HotlightColor}" />
|
||||
<Border Background="{DynamicResource GrayTextColor}" />
|
||||
<Border Background="{DynamicResource HighlightTextColor}" />
|
||||
<Border Background="{DynamicResource HighlightColor}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<Border
|
||||
BorderThickness="1"
|
||||
BorderBrush="{DynamicResource WindowTextColor}"
|
||||
CornerRadius="3"
|
||||
Padding="8">
|
||||
<Panel>
|
||||
<StackPanel Spacing="5">
|
||||
<Border
|
||||
Width="50"
|
||||
Height="1"
|
||||
Background="{DynamicResource WindowTextColor}" />
|
||||
<Border
|
||||
Height="1"
|
||||
Background="{DynamicResource WindowTextColor}" />
|
||||
<Border
|
||||
Height="1"
|
||||
Background="{DynamicResource WindowTextColor}" />
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Bottom"
|
||||
Orientation="Horizontal"
|
||||
Spacing="2">
|
||||
<Border
|
||||
Width="20"
|
||||
Height="5"
|
||||
Background="{DynamicResource HighlightColor}"
|
||||
CornerRadius="1" />
|
||||
<Border
|
||||
Width="20"
|
||||
Height="5"
|
||||
BorderThickness="1"
|
||||
BorderBrush="{DynamicResource ButtonTextColor}"
|
||||
CornerRadius="1" />
|
||||
</StackPanel>
|
||||
</Panel>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
<Border
|
||||
Height="1"
|
||||
Background="{DynamicResource WindowTextColor}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</ThemeVariantScope>
|
||||
<TextBlock Text="{Binding}" FontWeight="SemiBold" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<ThemeVariantScope
|
||||
MinWidth="400"
|
||||
RequestedThemeVariant="{Binding SelectedThemeVariant}">
|
||||
<Border Padding="10" Background="{DynamicResource WindowColor}">
|
||||
<StackPanel Spacing="16">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="TextBlock">
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="FontWeight" Value="SemiBold" />
|
||||
</Style>
|
||||
<Style Selector="controls|ColorItemControl.ColorBlock">
|
||||
<Setter Property="Width" Value="44" />
|
||||
<Setter Property="Height" Value="{Binding $self.Width}" />
|
||||
<Setter Property="HorizontalAlignment" Value="Right" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource WindowTextColor}" />
|
||||
<Setter Property="CornerRadius" Value="3" />
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<Panel>
|
||||
<TextBlock
|
||||
Foreground="{DynamicResource WindowTextColor}"
|
||||
Text="Background" />
|
||||
<controls:ColorItemControl
|
||||
Classes="ColorBlock"
|
||||
DataContext="{Binding ColorResources[0]}"
|
||||
Background="{DynamicResource WindowColor}" />
|
||||
</Panel>
|
||||
<Panel>
|
||||
<TextBlock
|
||||
Foreground="{DynamicResource WindowTextColor}"
|
||||
Text="Text" />
|
||||
<controls:ColorItemControl
|
||||
Classes="ColorBlock"
|
||||
DataContext="{Binding ColorResources[1]}"
|
||||
Background="{DynamicResource WindowTextColor}" />
|
||||
</Panel>
|
||||
<Panel>
|
||||
<TextBlock
|
||||
Foreground="{DynamicResource HotlightColor}"
|
||||
TextDecorations="Underline"
|
||||
Text="Hyperlink" />
|
||||
<controls:ColorItemControl
|
||||
Classes="ColorBlock"
|
||||
DataContext="{Binding ColorResources[2]}"
|
||||
Background="{DynamicResource HotlightColor}" />
|
||||
</Panel>
|
||||
<Panel>
|
||||
<TextBlock
|
||||
Foreground="{DynamicResource GrayTextColor}"
|
||||
Text="Inactive Text" />
|
||||
<controls:ColorItemControl
|
||||
Classes="ColorBlock"
|
||||
DataContext="{Binding ColorResources[3]}"
|
||||
Background="{DynamicResource GrayTextColor}" />
|
||||
</Panel>
|
||||
<Panel>
|
||||
<TextBlock
|
||||
Foreground="{DynamicResource HighlightTextColor}"
|
||||
Background="{DynamicResource HighlightColor}"
|
||||
Text="Selected text" />
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Spacing="4">
|
||||
<controls:ColorItemControl
|
||||
Classes="ColorBlock"
|
||||
DataContext="{Binding ColorResources[4]}"
|
||||
Background="{DynamicResource HighlightTextColor}" />
|
||||
<controls:ColorItemControl
|
||||
Classes="ColorBlock"
|
||||
DataContext="{Binding ColorResources[5]}"
|
||||
Background="{DynamicResource HighlightColor}" />
|
||||
</StackPanel>
|
||||
</Panel>
|
||||
<Panel>
|
||||
<Border
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
BorderBrush="{DynamicResource ButtonTextColor}"
|
||||
Background="{DynamicResource ButtonFaceColor}"
|
||||
BorderThickness="2"
|
||||
CornerRadius="3">
|
||||
<TextBlock
|
||||
Foreground="{DynamicResource ButtonTextColor}"
|
||||
Padding="16 6"
|
||||
Text="Button text" />
|
||||
</Border>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Spacing="4">
|
||||
<controls:ColorItemControl
|
||||
Classes="ColorBlock"
|
||||
DataContext="{Binding ColorResources[6]}"
|
||||
Background="{DynamicResource ButtonTextColor}" />
|
||||
<controls:ColorItemControl
|
||||
Classes="ColorBlock"
|
||||
DataContext="{Binding ColorResources[7]}"
|
||||
Background="{DynamicResource ButtonFaceColor}" />
|
||||
</StackPanel>
|
||||
</Panel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</ThemeVariantScope>
|
||||
|
||||
<DataGrid
|
||||
HorizontalAlignment="Left"
|
||||
CanUserSortColumns="False"
|
||||
AutoGenerateColumns="False"
|
||||
ItemsSource="{Binding ColorResources}"
|
||||
GridLinesVisibility="All"
|
||||
BorderBrush="{DynamicResource SemiColorBorder}"
|
||||
BorderThickness="1"
|
||||
Padding="5">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn Header="Color">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<controls:ColorItemControl
|
||||
Width="40"
|
||||
Height="20"
|
||||
CornerRadius="3"
|
||||
Background="{Binding Brush}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<DataGridTemplateColumn Header="ResourceKey">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<SelectableTextBlock
|
||||
Margin="12 0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding ResourceKey}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<DataGridTemplateColumn Header="Hex">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<SelectableTextBlock
|
||||
Margin="12 0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Brush,
|
||||
Converter={x:Static cvt:ColorConverter.ToHex},ConverterParameter={x:False}}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<DataGridTemplateColumn Header="Description">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<SelectableTextBlock
|
||||
Margin="12 0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Description}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<DataGridTemplateColumn Header="Pair With">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<SelectableTextBlock
|
||||
Margin="12 0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding PairWith}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<DataGridTemplateColumn Width="100" Header="CopyText">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate DataType="vm:ColorResource">
|
||||
<Button
|
||||
Command="{Binding $parent[pages:HighContrastDemo].Copy}"
|
||||
CommandParameter="{Binding CopyText}"
|
||||
Theme="{DynamicResource IconBorderlessButton}"
|
||||
Content="{StaticResource SemiIconCopy}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</SplitView.Content>
|
||||
</SplitView>
|
||||
</UserControl>
|
||||
24
demo/Semi.Avalonia.Demo/Pages/HighContrastDemo.axaml.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia.Controls;
|
||||
using Semi.Avalonia.Demo.ViewModels;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class HighContrastDemo : UserControl
|
||||
{
|
||||
public HighContrastDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = new HighContrastDemoViewModel();
|
||||
}
|
||||
|
||||
public async Task Copy(object? o)
|
||||
{
|
||||
if (o is null) return;
|
||||
var toplevel = TopLevel.GetTopLevel(this);
|
||||
if (toplevel?.Clipboard is { } c)
|
||||
{
|
||||
await c.SetTextAsync(o.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,36 +8,22 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
||||
<HyperlinkButton
|
||||
NavigateUri="https://www.irihi.tech/"
|
||||
Content="IRIHI Homepage" />
|
||||
<HyperlinkButton
|
||||
Classes="Underline"
|
||||
IsEnabled="False"
|
||||
NavigateUri="https://www.irihi.tech/"
|
||||
Content="Not Enabled" />
|
||||
<HyperlinkButton
|
||||
Classes="WithIcon Underline"
|
||||
Height="20"
|
||||
NavigateUri="https://www.irihi.tech/"
|
||||
Content="带下划线的网页链接" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<HyperlinkButton Height="20" NavigateUri="http://www.irihi.tech/">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
Text="iRihi Homepage"
|
||||
TextDecorations="Underline"
|
||||
VerticalAlignment="Center" />
|
||||
</HyperlinkButton>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<HyperlinkButton Height="20" IsEnabled="False">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
Text="Not Enabled"
|
||||
TextDecorations="Underline"
|
||||
VerticalAlignment="Center" />
|
||||
</HyperlinkButton>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<HyperlinkButton
|
||||
BorderThickness="1"
|
||||
Classes="WithIcon"
|
||||
Height="20"
|
||||
NavigateUri="http://www.irihi.tech/">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
Text="Link with Icon"
|
||||
TextDecorations="Underline"
|
||||
VerticalAlignment="Center" />
|
||||
</HyperlinkButton>
|
||||
<HyperlinkButton Classes="OnlyIcon" NavigateUri="https://www.irihi.tech/" />
|
||||
<HyperlinkButton Classes="OnlyIcon" NavigateUri="https://www.irihi.tech/" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
|
||||
84
demo/Semi.Avalonia.Demo/Pages/IconDemo.axaml
Normal file
@@ -0,0 +1,84 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:DataType="vm:IconDemoViewModel"
|
||||
x:Class="Semi.Avalonia.Demo.Pages.IconDemo">
|
||||
<Design.DataContext>
|
||||
<vm:IconDemoViewModel />
|
||||
</Design.DataContext>
|
||||
<Grid RowDefinitions="Auto, *">
|
||||
<TextBox
|
||||
Grid.Row="0"
|
||||
Width="600"
|
||||
Margin="8"
|
||||
Classes="ClearButton"
|
||||
Text="{Binding SearchText}"
|
||||
Watermark="Input Icon Name" />
|
||||
|
||||
<TabControl
|
||||
Grid.Row="1"
|
||||
Theme="{StaticResource LineTabControl}"
|
||||
ItemsSource="{Binding IconTabs}">
|
||||
<TabControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<WrapPanel ItemSpacing="5">
|
||||
<TextBlock Text="{Binding Header}" />
|
||||
<Label
|
||||
Theme="{StaticResource TagLabel}"
|
||||
Classes="Purple"
|
||||
IsVisible="{Binding Header,
|
||||
Converter={x:Static ObjectConverters.Equal},
|
||||
ConverterParameter='AI Icons'}"
|
||||
Content="New" />
|
||||
</WrapPanel>
|
||||
</DataTemplate>
|
||||
</TabControl.ItemTemplate>
|
||||
|
||||
<TabControl.ContentTemplate>
|
||||
<DataTemplate DataType="vm:IconTab">
|
||||
<ScrollViewer>
|
||||
<ItemsControl
|
||||
Margin="0 10"
|
||||
ItemsSource="{Binding IconItems}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel
|
||||
ItemWidth="200"
|
||||
ItemHeight="120"
|
||||
ItemSpacing="10"
|
||||
LineSpacing="10" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Button Theme="{DynamicResource OutlineButton}"
|
||||
Classes="Tertiary"
|
||||
Padding="0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Click="Button_Clicked">
|
||||
<StackPanel Spacing="8">
|
||||
<PathIcon
|
||||
Theme="{DynamicResource InnerPathIcon}"
|
||||
HorizontalAlignment="Center"
|
||||
Classes="ExtraLarge"
|
||||
Data="{Binding Geometry}" />
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
FontSize="12"
|
||||
FontWeight="Normal"
|
||||
Text="{Binding ResourceKey}" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
</DataTemplate>
|
||||
</TabControl.ContentTemplate>
|
||||
</TabControl>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
47
demo/Semi.Avalonia.Demo/Pages/IconDemo.axaml.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Notifications;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Input.Platform;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Threading;
|
||||
using Semi.Avalonia.Demo.ViewModels;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class IconDemo : UserControl
|
||||
{
|
||||
private IClipboard? _clipboard;
|
||||
private WindowNotificationManager? _windowNotificationManager;
|
||||
|
||||
public IconDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = new IconDemoViewModel();
|
||||
}
|
||||
|
||||
protected override async void OnApplyTemplate(TemplateAppliedEventArgs e)
|
||||
{
|
||||
base.OnApplyTemplate(e);
|
||||
var vm = this.DataContext as IconDemoViewModel;
|
||||
await Dispatcher.UIThread.InvokeAsync(() => { vm?.InitializeResources(); });
|
||||
}
|
||||
|
||||
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
|
||||
{
|
||||
base.OnAttachedToVisualTree(e);
|
||||
var topLevel = TopLevel.GetTopLevel(this);
|
||||
_windowNotificationManager = new WindowNotificationManager(topLevel) { MaxItems = 3 };
|
||||
_clipboard = topLevel?.Clipboard;
|
||||
}
|
||||
|
||||
private async void Button_Clicked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (_clipboard is null) return;
|
||||
if (sender is not Button { DataContext: IconItem s }) return;
|
||||
await _clipboard.SetTextAsync(s.ResourceKey);
|
||||
_windowNotificationManager?.Show(
|
||||
new Notification("Copied", s.ResourceKey),
|
||||
NotificationType.Success);
|
||||
}
|
||||
}
|
||||
@@ -4,24 +4,19 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="450"
|
||||
d:DesignHeight="800"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<ScrollViewer>
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
||||
<StackPanel>
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="Label">
|
||||
<Setter Property="Margin" Value="4" />
|
||||
<Style Selector="Grid > TextBlock,Grid > Label">
|
||||
<Setter Property="Layoutable.VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Layoutable.Margin" Value="4" />
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Auto">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="Label, TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin" Value="4" />
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<HeaderedContentControl
|
||||
Width="400"
|
||||
Height="400"
|
||||
@@ -32,62 +27,62 @@
|
||||
<Grid
|
||||
VerticalAlignment="Top"
|
||||
ColumnDefinitions="Auto, *"
|
||||
RowDefinitions="*,*,*,*,*,*,*,*,*,*,*,*">
|
||||
<TextBlock Grid.Row="1" Grid.Column="0">Classes</TextBlock>
|
||||
<TextBlock Grid.Row="2" Grid.Column="0">-</TextBlock>
|
||||
<TextBlock Grid.Row="3" Grid.Column="0">Secondary</TextBlock>
|
||||
<TextBlock Grid.Row="4" Grid.Column="0">Tertiary</TextBlock>
|
||||
<TextBlock Grid.Row="5" Grid.Column="0">Quaternary</TextBlock>
|
||||
<TextBlock Grid.Row="6" Grid.Column="0">Success</TextBlock>
|
||||
<TextBlock Grid.Row="7" Grid.Column="0">Warning</TextBlock>
|
||||
<TextBlock Grid.Row="8" Grid.Column="0">Danger</TextBlock>
|
||||
<TextBlock Grid.Row="9" Grid.Column="0">Mark</TextBlock>
|
||||
<TextBlock Grid.Row="10" Grid.Column="0">Code</TextBlock>
|
||||
<Label Grid.Row="2" Grid.Column="1">Text</Label>
|
||||
RowDefinitions="*,*,*,*,*,*,*,*,*,*,*">
|
||||
<TextBlock Grid.Row="0" Grid.Column="0">Classes</TextBlock>
|
||||
<TextBlock Grid.Row="1" Grid.Column="0">-</TextBlock>
|
||||
<TextBlock Grid.Row="2" Grid.Column="0">Secondary</TextBlock>
|
||||
<TextBlock Grid.Row="3" Grid.Column="0">Tertiary</TextBlock>
|
||||
<TextBlock Grid.Row="4" Grid.Column="0">Quaternary</TextBlock>
|
||||
<TextBlock Grid.Row="5" Grid.Column="0">Success</TextBlock>
|
||||
<TextBlock Grid.Row="6" Grid.Column="0">Warning</TextBlock>
|
||||
<TextBlock Grid.Row="7" Grid.Column="0">Danger</TextBlock>
|
||||
<TextBlock Grid.Row="8" Grid.Column="0">Mark</TextBlock>
|
||||
<TextBlock Grid.Row="9" Grid.Column="0">Code</TextBlock>
|
||||
<Label Grid.Row="1" Grid.Column="1">Text</Label>
|
||||
<Label
|
||||
Grid.Row="3"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Classes="Secondary">
|
||||
Secondary
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="4"
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Classes="Tertiary">
|
||||
Tertiary
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="5"
|
||||
Grid.Row="4"
|
||||
Grid.Column="1"
|
||||
Classes="Quaternary">
|
||||
Quaternary
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="6"
|
||||
Grid.Row="5"
|
||||
Grid.Column="1"
|
||||
Classes="Success">
|
||||
Success
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="7"
|
||||
Grid.Row="6"
|
||||
Grid.Column="1"
|
||||
Classes="Warning">
|
||||
Warning
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="8"
|
||||
Grid.Row="7"
|
||||
Grid.Column="1"
|
||||
Classes="Danger">
|
||||
Danger
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="9"
|
||||
Grid.Row="8"
|
||||
Grid.Column="1"
|
||||
Classes="Mark">
|
||||
Default Mark
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="10"
|
||||
Grid.Row="9"
|
||||
Grid.Column="1"
|
||||
Classes="Code">
|
||||
Code
|
||||
@@ -104,51 +99,51 @@
|
||||
<Grid
|
||||
VerticalAlignment="Top"
|
||||
ColumnDefinitions="Auto, *"
|
||||
RowDefinitions="*,*,*,*,*,*,*,*">
|
||||
<TextBlock Grid.Row="1" Grid.Column="0">Classes</TextBlock>
|
||||
<TextBlock Grid.Row="2" Grid.Column="0">H1</TextBlock>
|
||||
<TextBlock Grid.Row="3" Grid.Column="0">H2</TextBlock>
|
||||
<TextBlock Grid.Row="4" Grid.Column="0">H3</TextBlock>
|
||||
<TextBlock Grid.Row="5" Grid.Column="0">H4</TextBlock>
|
||||
<TextBlock Grid.Row="6" Grid.Column="0">H5</TextBlock>
|
||||
<TextBlock Grid.Row="7" Grid.Column="0">H6</TextBlock>
|
||||
RowDefinitions="*,*,*,*,*,*,*">
|
||||
<TextBlock Grid.Row="0" Grid.Column="0">Classes</TextBlock>
|
||||
<TextBlock Grid.Row="1" Grid.Column="0">H1</TextBlock>
|
||||
<TextBlock Grid.Row="2" Grid.Column="0">H2</TextBlock>
|
||||
<TextBlock Grid.Row="3" Grid.Column="0">H3</TextBlock>
|
||||
<TextBlock Grid.Row="4" Grid.Column="0">H4</TextBlock>
|
||||
<TextBlock Grid.Row="5" Grid.Column="0">H5</TextBlock>
|
||||
<TextBlock Grid.Row="6" Grid.Column="0">H6</TextBlock>
|
||||
<Label
|
||||
Grid.Row="2"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Classes="H1"
|
||||
Theme="{StaticResource TitleLabel}">
|
||||
Header 1
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="3"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Classes="H2"
|
||||
Theme="{StaticResource TitleLabel}">
|
||||
Header 2
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="4"
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Classes="H3"
|
||||
Theme="{StaticResource TitleLabel}">
|
||||
Header 3
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="5"
|
||||
Grid.Row="4"
|
||||
Grid.Column="1"
|
||||
Classes="H4"
|
||||
Theme="{StaticResource TitleLabel}">
|
||||
Header 4
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="6"
|
||||
Grid.Row="5"
|
||||
Grid.Column="1"
|
||||
Classes="H5"
|
||||
Theme="{StaticResource TitleLabel}">
|
||||
Header 5
|
||||
</Label>
|
||||
<Label
|
||||
Grid.Row="7"
|
||||
Grid.Row="6"
|
||||
Grid.Column="1"
|
||||
Classes="H6"
|
||||
Theme="{StaticResource TitleLabel}">
|
||||
@@ -158,69 +153,89 @@
|
||||
</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>
|
||||
|
||||
<HeaderedContentControl
|
||||
Margin="16"
|
||||
Header="Theme: TagLabel"
|
||||
Theme="{DynamicResource GroupBox}">
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Auto">
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<StackPanel Spacing="4">
|
||||
<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>
|
||||
</StackPanel>
|
||||
<StackPanel Spacing="4">
|
||||
<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>
|
||||
</StackPanel>
|
||||
<StackPanel Spacing="4">
|
||||
<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>
|
||||
</StackPanel>
|
||||
<StackPanel Spacing="4">
|
||||
<Label Classes="Colorful Gradient" Theme="{DynamicResource TagLabel}">Light</Label>
|
||||
<Label Classes="Colorful Gradient Ghost" Theme="{DynamicResource TagLabel}">Ghost</Label>
|
||||
<Label Classes="Colorful Gradient Solid" Theme="{DynamicResource TagLabel}">Solid</Label>
|
||||
</StackPanel>
|
||||
<StackPanel Spacing="4">
|
||||
<Label Classes="Colorful" Theme="{DynamicResource TagLabel}">Light</Label>
|
||||
<Label Classes="Colorful Ghost" Theme="{DynamicResource TagLabel}">Ghost</Label>
|
||||
<Label Classes="Colorful Solid" Theme="{DynamicResource TagLabel}">Solid</Label>
|
||||
</StackPanel>
|
||||
<StackPanel Spacing="4">
|
||||
<Label Theme="{StaticResource TagLabel}">Label</Label>
|
||||
<Label Classes="Large" Theme="{StaticResource TagLabel}">Large Label</Label>
|
||||
<Label Classes="Circle" Theme="{StaticResource TagLabel}">Circle Label</Label>
|
||||
<Label Classes="Large Circle" Theme="{StaticResource TagLabel}">Large Circle Label</Label>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</HeaderedContentControl>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -1,6 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
Header="Default">
|
||||
<ScrollViewer>
|
||||
<StackPanel Spacing="20">
|
||||
<TextBlock Text="Theme: Default"/>
|
||||
<TextBlock Text="Theme: Default" />
|
||||
<ListBox ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
|
||||
<ListBox IsEnabled="False">
|
||||
<ListBoxItem IsSelected="True">Avalonia</ListBoxItem>
|
||||
@@ -31,7 +31,7 @@
|
||||
Theme="{DynamicResource GroupBox}"
|
||||
Header="RadioGroupListBox">
|
||||
<StackPanel Spacing="20">
|
||||
<TextBlock Text="Theme: RadioGroupListBox"/>
|
||||
<TextBlock Text="Theme: RadioGroupListBox" />
|
||||
<ListBox
|
||||
Theme="{DynamicResource RadioGroupListBox}"
|
||||
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
|
||||
@@ -40,7 +40,7 @@
|
||||
<ListBoxItem IsSelected="True">WPF</ListBoxItem>
|
||||
</ListBox>
|
||||
|
||||
<TextBlock Text="Theme: ButtonRadioGroupListBox"/>
|
||||
<TextBlock Text="Theme: ButtonRadioGroupListBox" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Border HorizontalAlignment="Left" Theme="{StaticResource RadioButtonGroupBorder}">
|
||||
<ListBox Theme="{DynamicResource ButtonRadioGroupListBox}">
|
||||
@@ -93,7 +93,7 @@
|
||||
</Border>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Text="Theme: CardRadioGroupListBox"/>
|
||||
<TextBlock Text="Theme: CardRadioGroupListBox" />
|
||||
<ListBox Theme="{DynamicResource CardRadioGroupListBox}"
|
||||
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
|
||||
<ListBox Theme="{DynamicResource CardRadioGroupListBox}" IsEnabled="False">
|
||||
@@ -101,7 +101,7 @@
|
||||
<ListBoxItem>WPF</ListBoxItem>
|
||||
</ListBox>
|
||||
|
||||
<TextBlock Text="Theme: PureCardRadioGroupListBox"/>
|
||||
<TextBlock Text="Theme: PureCardRadioGroupListBox" />
|
||||
<ListBox Theme="{DynamicResource PureCardRadioGroupListBox}"
|
||||
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
|
||||
<ListBox Theme="{DynamicResource PureCardRadioGroupListBox}" IsEnabled="False">
|
||||
@@ -117,25 +117,25 @@
|
||||
Header="CheckGroupListBox">
|
||||
<ScrollViewer>
|
||||
<StackPanel Spacing="20">
|
||||
<TextBlock Text="Theme: CheckGroupListBox"/>
|
||||
<TextBlock Text="Theme: CheckGroupListBox" />
|
||||
<ListBox
|
||||
SelectionMode="Multiple"
|
||||
SelectionMode="Multiple,Toggle"
|
||||
Theme="{DynamicResource CheckGroupListBox}"
|
||||
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
|
||||
<ListBox Theme="{DynamicResource CheckGroupListBox}"
|
||||
SelectionMode="Multiple"
|
||||
SelectionMode="Multiple,Toggle"
|
||||
IsEnabled="False">
|
||||
<ListBoxItem IsSelected="True">Avalonia</ListBoxItem>
|
||||
<ListBoxItem>WPF</ListBoxItem>
|
||||
</ListBox>
|
||||
|
||||
<TextBlock Text="Theme: CardCheckGroupListBox"/>
|
||||
<TextBlock Text="Theme: CardCheckGroupListBox" />
|
||||
<ListBox
|
||||
SelectionMode="Multiple"
|
||||
SelectionMode="Multiple,Toggle"
|
||||
Theme="{DynamicResource CardCheckGroupListBox}"
|
||||
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
|
||||
<ListBox Theme="{DynamicResource CardCheckGroupListBox}"
|
||||
SelectionMode="Multiple"
|
||||
SelectionMode="Multiple,Toggle"
|
||||
IsEnabled="False">
|
||||
<ListBoxItem>Avalonia</ListBoxItem>
|
||||
<ListBoxItem IsSelected="True">WPF</ListBoxItem>
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<Button Name="openFileDialog">Open File</Button>
|
||||
<Button Name="selectFolderDialog">Select Folder</Button>
|
||||
<Button Name="saveFileDialog">Save File</Button>
|
||||
<Button Name="OpenFileButton" Content="Open File" />
|
||||
<Button Name="SelectFolderButton" Content="Select Folder" />
|
||||
<Button Name="SaveFileButton" Content="Save File" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||