Compare commits

...

549 Commits

Author SHA1 Message Date
rabbitism e263c917de misc: bump version. 2024-05-18 14:21:09 +08:00
Dong Bin 911a07d6a1 Merge pull request #358 from irihitech/adorner
Add AdornerLayer control
2024-05-17 22:01:07 +08:00
Zhang Dian f65ec4bb05 feat: add AdornerLayer control. 2024-05-17 21:14:22 +08:00
Dong Bin e6e7d6042c Merge pull request #356 from irihitech/issue/354
Use Binding instead of ReflectionBinding
2024-05-17 10:37:46 +08:00
rabbitism e44499db4e feat: replace all reflection bindings. 2024-05-17 10:37:03 +08:00
Dong Bin b45272daa4 Merge pull request #357 from irihitech/issue/352
undefined
2024-05-16 15:34:47 +08:00
Zhang Dian 2d61d93c93 feat: add LooklessTextBox Theme. 2024-05-16 15:22:14 +08:00
Zhang Dian a49111c0c2 fix: use :focus instead of :focus-visible. 2024-05-15 21:40:27 +08:00
Zhang Dian 9a738603d0 feat: add :focus-visible pseudoclass to ComboBox. 2024-05-15 18:44:43 +08:00
Zhang Dian 49c7799431 feat: use Binding instead of ReflectionBinding. 2024-05-15 15:42:13 +08:00
Dong Bin 634e792f61 Merge pull request #351 from irihitech/dict
Fix various issues with Theme related RresourceDictionary
2024-04-22 14:00:57 +08:00
Dong Bin 5212f255e6 Merge pull request #350 from irihitech/menu
Add MenuItem ToggleType support
2024-04-22 13:43:05 +08:00
Zhang Dian e20f0a4161 misc: format resources. 2024-04-22 01:32:59 +08:00
Zhang Dian 20b2cf3aaa fix: Dark BorderBrush. 2024-04-22 01:32:58 +08:00
Zhang Dian cf54ad51f9 fix: various issues.
* CalendarDatePicker Bordered class.
* ComboBox Pressed BorderBrush.
* ToggleSwitch default Background & BorderBrush.
* CheckBox & ListBox Background.
2024-04-22 01:32:58 +08:00
Zhang Dian 3dff0ccad5 feat: add MenuItem ToggleType support. 2024-04-21 17:27:53 +08:00
Dong Bin 5036a53b7c Merge pull request #346 from irihitech/date-shadow
Fix date picker presenter shadow in light mode.
2024-04-13 22:57:14 +08:00
rabbitism 8c1c48bcf5 fix: fix date picker presenter shadow in light mode. 2024-04-13 22:06:13 +08:00
Dong Bin 67752d43d3 Merge pull request #344 from irihitech/validation
Fix DataValidation MinHeight
2024-04-12 21:28:14 +08:00
Zhang Dian 5947fc70eb fix: fix DataValidation MinHeight. 2024-04-12 20:06:55 +08:00
Dong Bin 9e26d5f20b Merge pull request #338 from irihitech/support
Add community support info
2024-04-10 14:34:43 +08:00
rabbitism 3be9b72148 feat: improve wording, add CN documentation. 2024-04-10 14:33:44 +08:00
rabbitism 75ecc525a7 docs: add support info. 2024-04-10 14:27:05 +08:00
Zhang Dian 0c1922a08b Merge pull request #335 from JIIIIL/main
misspelled word invalidates the background(SplitView lightDismiss)
2024-04-01 00:26:47 +08:00
Dong Bin 92e0362eb6 Apply suggestions from code review
Co-authored-by: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
2024-03-31 23:13:24 +08:00
rabbitism 3716cc3bcc feat: make sure mask is invisible in inline mode. use dynamic brush. 2024-03-31 21:51:01 +08:00
JIIIIL e24e847f4b misspelled word invalidates the background(SplitView lightDismiss) 2024-03-31 20:33:17 +08:00
rabbitism ccc423c44e misc: Update version. 2024-03-29 19:04:26 +08:00
Dong Bin 28b89e2535 Merge pull request #333 from irihitech/issue/326
Add caret blink interval.
2024-03-29 17:11:54 +08:00
rabbitism 52bfeae099 feat: add caret blink interval. 2024-03-29 17:11:27 +08:00
Dong Bin 6215a6a622 Merge pull request #332 from irihitech/locale
Locale update sync for 11.1
2024-03-28 19:32:23 +08:00
Dong Bin c2c41f9275 Merge pull request #331 from irihitech/splitview
Redesign SplitViewDemo
2024-03-28 19:26:35 +08:00
Zhang Dian d7de64a4ef feat: ManagedFileChooser columns. 2024-03-28 15:52:47 +08:00
Zhang Dian 04ffd38e14 feat: add DatePicker & TimePicker support. 2024-03-28 15:39:09 +08:00
Zhang Dian 38958c1326 feat: redesign SplitViewDemo. 2024-03-28 05:17:59 +08:00
Dong Bin 9bb50a7190 Merge pull request #329 from irihitech/293-bs-dian
ComboBox, DatePicker and TimePicker BackgroundSizing
2024-03-28 01:10:05 +08:00
Dong Bin 2e59ed73aa Merge branch 'main' into 293-bs-dian 2024-03-28 01:02:56 +08:00
Dong Bin b3dc2425f8 Merge pull request #328 from Soar360/main
TextBox.TextArea
2024-03-27 22:16:49 +08:00
Zhang Dian 4e7681d4d4 feat: Small Classes and BackgroundSizing of DateTimePicker, ComboBox TextTrimming. 2024-03-27 17:14:31 +08:00
Soar360 48235b63a2 TextBox.TextArea 2024-03-25 17:27:38 +08:00
Zhang Dian 8de7a1ae8c fix: various issues of demos. 2024-03-24 21:57:44 +08:00
Zhang Dian 8142dd48cd feat: ComboBox BackgroundSizing. 2024-03-24 21:00:20 +08:00
Zhang Dian 76c9b57a4b Merge pull request #322 from irihitech/293-bs-bin
BackgroundSizing: Button
2024-03-22 20:39:17 +08:00
Zhang Dian 071a75a740 fix: demos of using Button. 2024-03-22 20:37:01 +08:00
rabbitism 4782dab745 fix: fix disable foreground. 2024-03-22 20:15:32 +08:00
rabbitism 90fbd2a7e5 fix: fix dropdown button solid foreground. 2024-03-22 20:09:05 +08:00
Zhang Dian 1f0d83ded4 feat: add more button demo. 2024-03-22 19:26:02 +08:00
rabbitism 6ff3ebc55b fix: multiple fix related to default button background and borderbrush. 2024-03-22 17:12:13 +08:00
Zhang Dian 3813091668 fix: fix SolidButton colors. 2024-03-22 15:26:02 +08:00
Dong Bin 47e5300a46 Merge pull request #323 from irihitech/pkginfo
Update package info
2024-03-21 21:33:06 +08:00
Zhang Dian 41662706ab feat: update package info. 2024-03-21 16:18:31 +08:00
Dong Bin 91aa717189 Merge pull request #316 from irihitech/rc/271-rd-file
Add rd file explanation for native aot.
2024-03-21 10:54:57 +08:00
Zhang Dian f6b936431a misc: add AOT publish documentation. 2024-03-20 23:24:17 +08:00
Dong Bin 8524e56166 Merge pull request #321 from irihitech/rc/293-backgroundsizing
Fix BackgroundSizing of TextBox, CalendarDatePicker, AutoCompleteBox, NumericUpDown
2024-03-20 21:14:21 +08:00
rabbitism 8328c69c46 feat: Repeat Button: target template element. 2024-03-20 21:08:58 +08:00
rabbitism 2470522209 feat: make button color targets template part. 2024-03-20 21:00:11 +08:00
Zhang Dian f1d87f7c4d feat: unify MinHeight based on TextBox. 2024-03-20 15:20:48 +08:00
Zhang Dian 07278047a4 fix: MinHeight TemplateBinding and names. 2024-03-20 14:11:28 +08:00
rabbitism 6df8ea2101 feat: implement background sizing, change alignments and min height according to the design. 2024-03-19 21:53:22 +08:00
rabbitism 3b3fbd1265 misc: Update package version. 2024-03-16 18:33:09 +08:00
Dong Bin 8b4a670be8 Merge pull request #315 from irihitech/rc/313-content-control-template
Remove default implementation of ContentControl and UserControl
2024-03-15 23:14:09 +08:00
rabbitism dad406e995 feat: remove usercontrol inheritance style. 2024-03-15 23:07:04 +08:00
Dong Bin 13e9364477 Merge pull request #317 from irihitech/rc/299-DataGridRow-background
Fix DataGridRow background opacity in light theme.
2024-03-15 20:55:00 +08:00
Dong Bin 3018f17e6d Merge pull request #318 from irihitech/rc/306-notification-position
Add TopCenter and BottomCenter position
2024-03-15 18:10:39 +08:00
Zhang Dian 627aa65e1f feat: add TopCenter and BottomCenter position. 2024-03-15 16:40:54 +08:00
Zhang Dian b83525092c fix: fix DataGridRow background opacity in light theme. 2024-03-15 16:19:25 +08:00
Zhang Dian dd3c4bdbae feat: remove default implementation of ContentControl and UserControl. 2024-03-15 15:35:39 +08:00
Zhang Dian 17fe50d40b Merge pull request #314 from irihitech/doc
Add Chinese readme.
2024-03-14 16:19:10 +08:00
rabbitism 27c4794c6c fix typo. 2024-03-14 16:06:09 +08:00
rabbitism a678a0f39d doc: add ursa to readme. 2024-03-14 16:03:51 +08:00
rabbitism 33c56f87f8 doc: add Chinese doc. 2024-03-14 15:59:27 +08:00
Dong Bin ffb1b9c0e8 Merge pull request #312 from irihitech/browser
Update the latest template of Browser project
2024-03-13 16:17:36 +08:00
Zhang Dian ef272815ea fix: update the latest template of Browser project. 2024-03-12 17:16:23 +08:00
Dong Bin d967583228 Merge pull request #311 from irihitech/rc/256-colorpicker
Reapply "ColorPicker new theme."
2024-03-12 17:03:52 +08:00
rabbitism ef36239161 feat: make text looks like text. 2024-03-12 17:03:07 +08:00
Zhang Dian bb3966c36c Reapply "ColorPicker new theme."
This reverts commit a521efd39a.
2024-03-12 16:47:35 +08:00
Dong Bin 4b7674d7e2 Merge pull request #310 from irihitech/action/config
Reset github action branches.
2024-03-12 16:21:36 +08:00
Zhang Dian 166490195f misc: reset branches. 2024-03-12 15:34:41 +08:00
Zhang Dian 3d267139fe Merge pull request #309 from irihitech/rc/11.1
Upgrade Avalonia dependency to 11.1.0-beta1
2024-03-12 15:00:28 +08:00
Zhang Dian ede0f9f3db misc: delete useless config. 2024-03-12 14:58:51 +08:00
rabbitism f140a331d7 feat: upgrade dependency to 11.1.0-beta1. 2024-03-12 12:07:07 +08:00
Zhang Dian bf1a2cac39 fix: AutoCompleteBox VerticalAlignment. 2024-03-11 23:31:43 +08:00
Zhang Dian 4d14c846b0 feat: redesign NumericUpDown. 2024-03-11 19:52:11 +08:00
Zhang Dian 46e57925b9 feat: redesign TextBox. 2024-03-11 19:30:22 +08:00
rabbitism ca8f8d6c15 fix: fix watermark in ime mode.
(cherry picked from commit 38cbc6da94)
2024-03-08 10:37:41 +08:00
Dong Bin 7acd741ff0 Merge pull request #308 from irihitech/text
Fix watermark before IME commit
2024-03-08 10:35:55 +08:00
rabbitism 38cbc6da94 fix: fix watermark in ime mode. 2024-03-07 21:19:05 +08:00
Zhang Dian c2d1d0c4eb fix: CalendarDatePicker BackgroundSizing. 2024-03-07 11:55:26 +08:00
Dong Bin 3fce633195 Merge pull request #304 from irihitech/dev/thom/hyperlinkBtn
adding hyperlink button into semi
2024-03-06 19:39:20 +08:00
rabbitism 30a7466fc9 fix: fix color in dark mode. 2024-03-06 19:36:12 +08:00
qile.wang 7fa99ed910 fix 2024-03-06 19:25:59 +08:00
qile.wang 801fea8269 fix template 2024-03-06 19:21:48 +08:00
Zhang Dian 341fa7900a feat: update github page. 2024-03-02 22:25:04 +08:00
Zhang Dian fb0b4a08ac feat: change all PathGeometry to StreamGeometry.
(cherry picked from commit 5f72ed4a49)
2024-03-01 22:10:38 +08:00
Dong Bin a0797721a0 Merge pull request #305 from irihitech/291-geometry
Change all PathGeometry to StreamGeometry.
2024-03-01 22:08:06 +08:00
qile.wang 8dee3ec364 change to StreamGeometry 2024-03-01 21:00:17 +08:00
qile.wang 0ddcb39302 fix var names and comp 2024-03-01 20:53:55 +08:00
Zhang Dian 5f72ed4a49 feat: change all PathGeometry to StreamGeometry. 2024-03-01 13:24:50 +08:00
Zhang Dian 71e276d478 feat: redesign CalendarDatePicker. 2024-02-29 19:59:14 +08:00
Dong Bin 833ccadb58 Merge pull request #303 from irihitech/rc/297-refresh-container
Implement RefreshContainer
2024-02-29 12:52:03 +08:00
Zhang Dian d33f38ea70 misc: delete useless PathGeometry. 2024-02-29 12:16:53 +08:00
qile.wang 386a3d297c roughly comp 2024-02-28 15:51:30 +08:00
qile.wang d19cc9d7b9 push changes 2024-02-28 15:21:48 +08:00
Zhang Dian 30081a1717 fix: icon shaking. 2024-02-28 14:47:56 +08:00
Zhang Dian 0d68df3711 misc: rename resources. 2024-02-24 18:11:28 +08:00
Zhang Dian 157d22a8f9 feat: implement RefreshContainer. 2024-02-24 16:49:31 +08:00
Dong Bin 4efc6bf4ec Merge pull request #302 from irihitech/rc/298-inner-content
Add InnerContent to AutoCompleteBox and NumericUpDown
2024-02-23 20:08:55 +08:00
Dong Bin a920dbc873 Merge pull request #301 from irihitech/296-index
Implement Locale Switch
2024-02-23 19:40:24 +08:00
rabbitism cafd47f334 feat: add backward compatibility. 2024-02-23 19:39:39 +08:00
Zhang Dian 3a83c67c6c feat: add InnerContent to AutoCompleteBox and NumericUpDown. 2024-02-23 17:56:27 +08:00
Zhang Dian a5657a38cd feat: TextBox default ContextMenu. 2024-02-23 16:15:21 +08:00
Zhang Dian 82f284b5fa feat: implement locale switch. 2024-02-21 16:32:48 +08:00
rabbitism 6459a8be1b misc: fix DataGrid version. 2024-01-27 16:56:16 +08:00
rabbitism 06240d4aa8 feat: update demo version. 2024-01-27 16:46:13 +08:00
Dong Bin 5c2a42b69e Merge pull request #288 from irihitech/sync
feat: sync with Avalonia #13644
2024-01-27 16:42:05 +08:00
rabbitism 3c9a2f53ab feat: sync with Avalonia #13644 2024-01-27 16:22:05 +08:00
Dong Bin b565707db9 Merge pull request #287 from irihitech/colorpicker
feat: sync Avalonia #13567
2024-01-27 16:15:46 +08:00
Dong Bin 380d28253a Merge pull request #286 from irihitech/datagrid
feat: sync with upstream
2024-01-27 16:15:14 +08:00
rabbitism 3410b0df10 feat: sync Avalonia #13567 2024-01-27 16:13:46 +08:00
rabbitism a2d6469620 feat: sync with upstream 2024-01-27 16:00:56 +08:00
rabbitism c0c89cbfd7 feat: update doc 2024-01-27 15:58:24 +08:00
Zhang Dian f3e72b6a6d Merge pull request #285 from irihitech/ActiveIcon
feat: add active class to path icon.
2024-01-27 14:28:26 +08:00
rabbitism a9b9737065 misc: rename file. 2024-01-27 03:14:43 +08:00
rabbitism 1a2628eff0 feat: add active class to path icon. 2024-01-27 03:08:20 +08:00
Zhang Dian 53b468db4a Merge pull request #279 from irihitech/slider
Change slider disable color
2024-01-26 21:39:32 +08:00
Dong Bin 73000d30aa Merge pull request #284 from irihitech/revert-261-256-colorpicker
Revert "ColorPicker new theme."
2024-01-26 19:53:55 +08:00
Zhang Dian a521efd39a Revert "ColorPicker new theme." 2024-01-26 19:52:45 +08:00
Dong Bin 3531376eb2 Merge pull request #283 from irihitech/carousel
Implemented some Carousel features
2024-01-26 19:50:09 +08:00
rabbitism 2ec97c023f feat: simplify template 2024-01-26 19:48:46 +08:00
Zhang Dian 2b65a39c7a Merge pull request #261 from irihitech/256-colorpicker
ColorPicker new theme.
2024-01-26 19:35:42 +08:00
Zhang Dian ca4632ef3a Merge branch 'main' into 256-colorpicker 2024-01-26 19:35:35 +08:00
Zhang Dian bc5e65ab6c Merge pull request #260 from irihitech/close
Add Clear button to several controls, and related remakes
2024-01-26 19:25:52 +08:00
Zhang Dian 74140e9db1 Merge pull request #281 from irihitech/tab
feat: add scroll tab control.
2024-01-26 19:23:49 +08:00
Zhang Dian 0bf7168cba feat: Columnar. 2024-01-26 19:08:52 +08:00
Dong Bin 69002c3ff0 Merge branch 'main' into close 2024-01-26 18:23:16 +08:00
Zhang Dian d9c39cdd05 feat: classes Line, Left, Center, Right. 2024-01-26 17:54:40 +08:00
rabbitism 1989736d45 feat: update dependency. 2024-01-25 23:22:47 +08:00
rabbitism ecbe87bf3c feat: add scroll tab control. 2024-01-25 23:19:16 +08:00
Dong Bin c9fd4c9605 Merge pull request #280 from irihitech/275-scroll
Move scrollbar local template value to style setter.
2024-01-19 23:18:18 +08:00
rabbitism 97b316c5f7 fix: change slider disable color 2024-01-19 23:07:02 +08:00
rabbitism 589ec8784b feat: move scrollbar local template value to style setter. 2023-11-21 11:36:30 +08:00
Zhang Dian 547d733f84 Merge pull request #274 from irihitech/273-datagrid
Fix datagrid disable visual.
2023-11-08 15:16:53 +08:00
rabbitism 8ff8057f07 fix: add button, upgrade version individually. 2023-11-08 15:07:08 +08:00
Dong Bin 8059614a2e Merge pull request #272 from irihitech/drm
Running on Raspberry Pi with Drm
2023-11-08 14:35:21 +08:00
rabbitism 98785417b2 fix: fix datagrid disable visual. 2023-11-08 14:25:55 +08:00
Zhang Dian 750f295c0f feat: update usage doc. 2023-11-04 01:16:36 +08:00
Zhang Dian cbea8156ad feat: StartLinuxDrm in Raspberry Pi. 2023-11-04 01:07:43 +08:00
Zhang Dian 1ad9fc2714 fix: the graphics card path in Raspberry Pi. 2023-11-04 01:03:08 +08:00
Zhang Dian a247eadd54 Merge pull request #268 from JIIIIL/main
格式化 DRM 使用方法文档
2023-10-24 15:49:56 +08:00
JIIIIL 6c80c65f62 DRM使用方法进行一些格式化 2023-10-24 14:38:36 +08:00
JIIIIL 6c0623a9e1 DRM使用方法进行一些格式化 2023-10-24 14:36:55 +08:00
JIIIIL 7646a296dc DRM使用方法进行一些格式化 2023-10-24 14:35:33 +08:00
Dong Bin b1c65da22b Merge pull request #265 from irihitech/sweep
Remove redundant property type qualifier
2023-10-11 09:50:05 +08:00
Zhang Dian 1fa66bd469 misc: remove redundant property type qualifier. 2023-10-10 00:35:53 +08:00
Dong Bin 8ca57dc45b Merge pull request #262 from irihitech/sweep
Remove Useless Resources
2023-10-09 22:06:51 +08:00
Zhang Dian f6624aca02 misc: maybe add size variants later. 2023-10-09 18:12:07 +08:00
Dong Bin 1757b4c872 Merge pull request #263 from irihitech/order
Order of Colors
2023-10-09 17:38:13 +08:00
Dong Bin 98e8411fb6 Merge pull request #264 from irihitech/headered
Add HeaderedContentControl default theme
2023-10-09 17:37:46 +08:00
Zhang Dian 72f8d51eb1 feat: add default NotificationCard icon. 2023-10-09 14:56:40 +08:00
Zhang Dian 6d09d9f5ca feat: HeaderedContentControl default style. 2023-10-09 14:34:39 +08:00
Zhang Dian ce2e104286 feat: remove useless resources. 2023-10-09 01:38:03 +08:00
Zhang Dian 49b823f094 feat: remove useless resources. 2023-10-09 00:28:17 +08:00
rabbitism ba2ce1decb feat: add ColorPicker new theme. 2023-10-04 16:12:45 +08:00
rabbitism eb9a5b960b feat: fix calendar related two way template binding. 2023-10-04 15:50:13 +08:00
rabbitism d7a7153069 feat: rename glyph name, update TextBox to use universal icon button theme. 2023-10-04 15:41:52 +08:00
rabbitism 90f982d673 feat: add clear button to CalendarDatePicker. rename many resources. 2023-10-04 15:25:37 +08:00
rabbitism 385e1e2cd5 feat: add clear button to TimePicker 2023-10-04 14:56:04 +08:00
rabbitism d638b0603d feat: uppdate to latest nightly. add clear button to ComboBox and DatePicker 2023-10-04 14:51:05 +08:00
Zhang Dian a451b6b8b6 misc: success, warning, danger order. 2023-09-06 13:47:35 +08:00
Dong Bin e563f860ad Merge pull request #250 from irihitech/upgrade
Upgrade to 11.0.1.
2023-08-30 13:38:44 +08:00
Zhang Dian b8df9c2b96 misc: upgrade to 11.0.1. 2023-08-30 11:35:01 +08:00
Dong Bin 255e21d5ae Merge pull request #249 from irihitech/enhance
Several Enhancements
2023-08-30 00:34:51 +08:00
Zhang Dian d54e4ab2b7 misc:
extract App.axaml;
Android demo display label.
2023-08-30 00:14:40 +08:00
Zhang Dian d01f39e20d misc: label order. 2023-08-29 23:46:57 +08:00
Dong Bin de578d3b99 Merge pull request #246 from irihitech/listbox
Add ListBox Themes
2023-08-17 11:26:37 +08:00
Zhang Dian bb392af76f feat: remove PureCardCheckGroupListBox because of duplication. 2023-08-16 23:28:16 +08:00
Zhang Dian a2927266b4 feat: description. 2023-08-16 21:04:30 +08:00
Zhang Dian 29dce1de51 feat: transform style resources. 2023-08-16 20:51:06 +08:00
Zhang Dian 6a4065f3b7 feat: CheckGroup. 2023-08-16 18:02:27 +08:00
Zhang Dian 430a7e56ca feat: ListBox demo. 2023-08-14 18:49:33 +08:00
Zhang Dian a1e17b0e19 feat: description. 2023-08-14 17:46:05 +08:00
Zhang Dian 8a51f98532 feat: separate resource dictionary. 2023-08-14 17:22:01 +08:00
Zhang Dian eef4e5b62a feat: ButtonRadioGroupListBox, CardRadioGroupListBox, PureCardRadioGroupListBox. 2023-08-14 16:50:50 +08:00
Zhang Dian a6fe50e6bc feat: transform style resources. 2023-08-14 11:17:07 +08:00
Zhang Dian e1588120f2 feat: RadioGroupListBox theme. 2023-08-14 11:00:03 +08:00
Zhang Dian 437e9ea42b Merge pull request #242 from irihitech/tree
Add TreeDataGrid default themes
2023-07-27 10:15:51 +08:00
rabbitism 1c98ce4682 fix: fix identation, fix error theme in demo. 2023-07-27 00:30:32 +08:00
rabbitism 17fa10333a fix: fix number nullability. 2023-07-26 23:52:29 +08:00
rabbitism 3d174bf65f feat: add hierarchical demo. 2023-07-26 16:42:17 +08:00
rabbitism 591c728d69 feat: fix dark color. add theme switch in demo. add checkbox demo. 2023-07-26 03:04:10 +08:00
rabbitism 4b2f390fa3 feat: update 2023-07-26 02:50:01 +08:00
rabbitism 38aa8e6e5b feat: WIP. 2023-07-26 01:23:05 +08:00
rabbitism b665c0c7e3 feat: initialize tree data grid projects. 2023-07-25 23:19:27 +08:00
Zhang Dian 8c42a87e49 Merge pull request #240 from irihitech/data
Replace some demo data.
2023-07-25 15:30:29 +08:00
rabbitism ead6e07b24 feat: update overview page and checkbox/radiobutton samples. 2023-07-25 13:37:40 +08:00
rabbitism 52f2b6503f feat: update overview page. 2023-07-25 13:06:55 +08:00
rabbitism 98fc651c45 feat: update some demo data. 2023-07-25 11:05:16 +08:00
rabbitism 5e94fd7bfa feat: change DataGrid demo data. 2023-07-25 10:46:50 +08:00
Dong Bin 4cf29aeefd Merge pull request #239 from irihitech/deploy
Add github pages
2023-07-25 10:29:07 +08:00
Zhang Dian 9877014512 feat: github pages. 2023-07-24 18:02:22 +08:00
Dong Bin 694a9b4c3f Merge pull request #233 from irihitech/wasm
support WASM
2023-07-21 01:01:04 +08:00
Dong Bin 07074eb5e5 Merge pull request #235 from irihitech/shared
Extract non-theme resources to shared directory
2023-07-21 00:54:14 +08:00
Zhang Dian eaff3ebad0 fix: restore the missing resources. 2023-07-19 11:50:30 +08:00
Zhang Dian 95c7b9a807 feat: extract non-theme resources of ColorPicker and DataGrid. 2023-07-19 11:16:10 +08:00
Zhang Dian 54bdd69b2a fix: restore BoxShadows. 2023-07-19 03:29:23 +08:00
Zhang Dian cb9bf96b73 feat: rename theme index file. 2023-07-19 02:51:19 +08:00
Zhang Dian 3273fb1e91 feat: extract non-theme resources to shared directory. 2023-07-19 02:40:17 +08:00
Zhang Dian a8b141b402 Merge branch 'main' into wasm 2023-07-17 22:56:59 +08:00
Zhang Dian 2132a4322f Merge pull request #232 from JIIIIL/main
TreeView添加多重嵌套绑定示例
2023-07-17 21:29:53 +08:00
ImLuJian c59e47409b Treeview示例用Grid布局 2023-07-17 20:21:38 +08:00
ImLuJian 816af5a7b1 TreeView添加多重嵌套绑定示例 2023-07-15 11:20:42 +08:00
Dong Bin e3bf028b7f Merge pull request #231 from irihitech/label
improve Label Demo
2023-07-12 14:02:17 +08:00
Zhang Dian ad3aac5978 feat: add color block into ScrollViewerDemo. 2023-07-11 17:40:57 +08:00
Zhang Dian b19a576dc9 fix: label color order. 2023-07-11 17:38:31 +08:00
Dong Bin 00130d6cf7 Merge pull request #229 from irihitech/header
fix: delete default height and width, fix RowDefinitions.
2023-07-10 17:44:44 +08:00
Zhang Dian 86b437b3b0 fix: delete default height and width, fix RowDefinitions. 2023-07-10 17:37:19 +08:00
Zhang Dian e640089aab Merge pull request #228 from irihitech/226-typography
feat: improve TextBlock demo.
2023-07-10 17:33:46 +08:00
Zhang Dian 7a483d6de3 fix: delete binding. 2023-07-10 17:33:17 +08:00
rabbitism c713888062 fix: fix textblock alignment. 2023-07-10 17:03:29 +08:00
rabbitism b9a16e89d6 feat: improve TextBlock demo. 2023-07-10 00:22:02 +08:00
Dong Bin 2dc6e31d5a Merge pull request #227 from JIIIIL/main
添加DRM启动方式,在VM虚拟机上测试了一下Ubuntu18.04 Server,可以启动
2023-07-09 23:12:46 +08:00
rabbitism db7f199003 fix: fix version reference. 2023-07-09 23:06:08 +08:00
rabbitism 201610b9ab feat: update references. 2023-07-09 23:03:11 +08:00
ImLuJian 112d1e3dd4 还原desktop项目的文件 2023-07-09 09:52:28 +08:00
ImLuJian 5df492b20e Merge branch 'main' of https://github.com/JIIIIL/Semi.Avalonia 2023-07-09 09:27:21 +08:00
ImLuJian 1b7c30c557 添加DRM启动demo和使用方法 2023-07-09 09:24:41 +08:00
ImLuJian 40d179d4b4 添加DRM启动方式,在VM虚拟机上测试了一下Ubuntu18.04 Server,可以启动 2023-07-08 17:57:44 +08:00
Zhang Dian 367aa0a386 Merge pull request #225 from irihitech/android
feat: fix android demo start activity issue.
2023-07-08 02:44:29 +08:00
rabbitism 37daceca61 feat: fix android start activity issue. 2023-07-08 00:06:11 +08:00
Dong Bin 2f04a72c9f Merge pull request #224 from irihitech/opacity
fix: fix the wrong opacity values.
2023-07-07 18:29:44 +08:00
Zhang Dian 8f5b9f6c47 fix: fix the wrong opacity values. 2023-07-07 17:21:56 +08:00
rabbitism ab8dacec4b feat: update documentation. 2023-07-05 19:01:12 +08:00
Dong Bin 5d6d4de152 Merge pull request #217 from irihitech/11.0
feat: upgrade to v11.
2023-07-05 18:22:56 +08:00
rabbitism 0c21bb264f feat: upgrade to v11. 2023-07-05 18:14:18 +08:00
Zhang Dian 8ae2d10f2e Merge pull request #213 from irihitech/rc2.1
Upgrade to RC 2.1
2023-07-04 00:28:01 +08:00
Zhang Dian 19d48f4a1f Merge pull request #215 from irihitech/scroll
Update ScrollBar visual Style
2023-07-04 00:24:56 +08:00
Zhang Dian 81565cac97 feat: reduce the size of icon on :pressed state. 2023-07-04 00:24:00 +08:00
Zhang Dian b320c88e9e feat: add thumb :pointerover color. 2023-07-03 22:50:01 +08:00
Zhang Dian e76c480f34 Merge pull request #214 from irihitech/progress
Progress
2023-07-03 21:28:08 +08:00
rabbitism 11452fd21f fix: fixes #208 2023-07-03 17:29:41 +08:00
rabbitism 14c2ff6c02 feat: update ScrollBar visual styles. 2023-07-03 17:13:01 +08:00
Zhang Dian 7a701a9c04 feat: add Primary, Secondary, Tertiary color. 2023-07-03 16:28:29 +08:00
Zhang Dian 7e1376f57e fix: fix default ProgressBar background color. 2023-07-03 16:28:00 +08:00
rabbitism ae237f38fb fix: fix text visibility. 2023-07-03 11:59:42 +08:00
rabbitism 93071d3715 feat: add color styles. 2023-07-03 11:50:40 +08:00
rabbitism 27e344950a feat: add progress ring. 2023-07-03 11:49:11 +08:00
rabbitism 8bdfe2b7de fix: remove invalid fontsize resource. 2023-07-01 21:21:54 +08:00
rabbitism e631f3fa2d fix: fix #210 2023-07-01 19:55:40 +08:00
rabbitism 793c2b273f feat: upgrade to rc2.1 2023-07-01 19:51:33 +08:00
Dong Bin c79f696278 Merge pull request #205 from irihitech/CheckBox
CheckBox Border & SimpleCheckBox theme
2023-06-07 22:11:17 +08:00
rabbitism 5df262bc6d misc: remove radio button demo. 2023-06-07 22:10:04 +08:00
rabbitism 7a6ce6f07e misc: remove unnecessary demo. 2023-06-07 22:07:55 +08:00
Dong Bin 7335d51e7a Merge pull request #207 from irihitech/206-sg-error
Remove redundant proj file reference for Loongson-UOS compilation.
2023-06-07 21:52:21 +08:00
rabbitism f949793e10 feat: remove redundant proj file reference. 2023-06-07 21:50:21 +08:00
Zhang Dian 43b0f5b044 feat: add SimpleCheckBox theme. 2023-06-06 16:43:45 +08:00
Zhang Dian 5021ac683b feat: add demo. 2023-06-06 16:33:27 +08:00
Zhang Dian 7a040120b5 feat: adjust CheckBox Border style. 2023-06-05 22:47:00 +08:00
Zhang Dian 232e6e4b41 feat: upgrade to support wasm. 2023-06-04 23:44:23 +08:00
Zhang Dian 6d3514308a Merge pull request #202 from irihitech/199-fix-combobox-selected-item-background-in-dark-mode
Fix: fix combobox selected background.
2023-06-04 23:25:49 +08:00
rabbitism f7bcfb872d fix: fix combobox selected background. 2023-06-04 00:21:10 +08:00
Dong Bin 7c1fd71e43 Merge pull request #196 from irihitech/typo
fix: fix control typo.
2023-06-01 22:08:48 +08:00
Zhang Dian 8c8e13701b fix: fix control typo. 2023-06-01 17:30:22 +08:00
Zhang Dian ff2ff9c462 Merge pull request #195 from irihitech/preview
Upgrade to Avalonia RC1
2023-06-01 11:12:51 +08:00
Zhang Dian 20307f0c1b fix: add missing success button. 2023-06-01 10:41:21 +08:00
rabbitism 21a07b703d misc: update a demo color. 2023-06-01 10:25:18 +08:00
rabbitism e6a3274db9 docs: update docs. 2023-06-01 10:09:41 +08:00
rabbitism f72ec20576 misc: upgrade to 1.1 2023-06-01 09:49:51 +08:00
rabbitism 071976dd05 misc: upgrade to rc1 2023-06-01 09:46:06 +08:00
rabbitism 4842270a96 fix: fix scrollviewer binding according to https://github.com/AvaloniaUI/Avalonia/pull/11456 2023-05-30 12:09:24 +08:00
rabbitism 49c95dcb5e feat: upgrade to latest nightly. 2023-05-30 11:10:24 +08:00
Dong Bin 6c16d43980 Merge pull request #193 from irihitech/taglabel
fix: fix wrong colors.
2023-05-30 10:28:21 +08:00
Zhang Dian 3289295278 fix: fix wrong colors. 2023-05-28 23:30:45 +08:00
Zhang Dian 30d9dcb1e8 Merge pull request #191 from irihitech/190-text-color
fix: fix button and label text color in dark mode.
2023-05-26 20:47:08 +08:00
Zhang Dian c2b5b01f34 fix: togglebutton text color in dark mode. 2023-05-26 20:43:18 +08:00
rabbitism e999aeac23 fix: fix button and label text color in dark mode. 2023-05-26 20:31:57 +08:00
Dong Bin da025e97c5 Merge pull request #188 from irihitech/hoxfix
fix: fix missing template.
2023-05-26 20:19:33 +08:00
rabbitism 9d17cd0087 misc: add binding demo. 2023-05-26 20:18:43 +08:00
Zhang Dian 5d8297a392 fix: fix missing template. 2023-05-26 15:58:37 +08:00
Dong Bin 90a1b90b9a Merge pull request #186 from irihitech/34-HeaderedContentControl
Add a theme named GroupBox for HeaderedContentControl.
2023-05-11 00:11:50 +08:00
Zhang Dian 5475ad8bcf feat: rename theme key. 2023-05-11 00:07:18 +08:00
Zhang Dian f29e60712b feat: specify CornerRadius. 2023-05-10 23:59:47 +08:00
Zhang Dian cefa6bb4df feat: Add a theme for HeaderedContentControl as GroupBox. 2023-05-10 23:50:01 +08:00
Zhang Dian 503af76f0c Merge pull request #184 from irihitech/preview8
Preview 8
2023-05-09 22:53:12 +08:00
rabbitism a4b9d8724e docs: update readme and package release note. 2023-05-09 22:39:38 +08:00
rabbitism b5a9c8f53e fix: add carousel indicator back. 2023-05-09 22:24:51 +08:00
rabbitism b3737bfee6 fix: fix color picker display issue. fix various binding error (although they still compile) 2023-05-09 22:01:43 +08:00
rabbitism f68985eb92 feat: update version, fix progress bar binding. 2023-05-09 21:24:51 +08:00
Dong Bin e556c8ed3f Merge pull request #182 from irihitech/168-margin
fix: MenuFlyoutPresenter margin.
2023-05-09 21:19:05 +08:00
rabbitism 7e0d85f25f fix: align context menu and menu flyout. 2023-05-09 21:17:41 +08:00
rabbitism 983e7461c1 fix: fix border shadow display. 2023-05-09 21:12:24 +08:00
Dong Bin 66e1bf1439 Merge pull request #183 from irihitech/159-lightflyout
feat: add LightFlyout theme.
2023-05-09 20:54:54 +08:00
rabbitism 5d47829b6c feat: remove border and shadow. 2023-05-09 20:53:57 +08:00
Dong Bin df103bc972 Merge pull request #181 from irihitech/91-successbutton
feat: add Success Button style.
2023-05-09 20:44:51 +08:00
Zhang Dian a36a088983 feat: add LightFlyout theme. 2023-05-09 19:13:56 +08:00
Zhang Dian 28ecabdbbc fix: MenuFlyoutPresenter margin. 2023-05-09 17:56:22 +08:00
Zhang Dian e40bc531e4 feat: add Success Button style. 2023-05-09 17:42:08 +08:00
Dong Bin 37746e38f7 Merge pull request #180 from irihitech/178-datavalidationerror
Add DataValidationError to Input Control
2023-05-08 23:26:08 +08:00
rabbitism 97b5eb7a04 feat: add tooltip error theme. 2023-05-08 22:53:51 +08:00
rabbitism 6eb405abe2 feat: add textbox internal style, fix various internal textbox styles. 2023-05-08 22:15:17 +08:00
Zhang Dian 4ba6ea324d fix: fix DatePicker&TimePicker MinHeight property. 2023-05-08 17:57:43 +08:00
Zhang Dian e8ef024d59 feat: DatePicker&TimePicker validations. 2023-05-08 10:19:58 +08:00
Zhang Dian cece722496 feat: add validation errors to CalendarDatePicker. 2023-05-07 00:11:52 +08:00
rabbitism ae0994aa93 feat: add hacks for internal textbox error display. 2023-05-06 23:17:55 +08:00
Zhang Dian d75a4c549e feat: add validation errors to NumericUpDown. 2023-05-06 23:17:53 +08:00
Zhang Dian 45f3470d76 feat: add validation errors to ComboBox. 2023-05-06 17:30:26 +08:00
rabbitism bac20dbdbf feat: simplify slider template, add error. 2023-05-05 10:52:08 +08:00
Zhang Dian 7f89b6104c Merge pull request #177 from irihitech/176-managedfilechooser
Fix ManagedFileChooser crash issue
2023-05-05 09:54:25 +08:00
rabbitism 5f7e1510f1 feat: move validation errors demo to individual page. 2023-05-05 02:31:25 +08:00
rabbitism 127bd1446a feat: add validation errors to textbox. 2023-05-05 02:21:33 +08:00
rabbitism aee8042af8 feat: add resources. 2023-05-05 01:44:38 +08:00
rabbitism 64a9f9e25a feat: change to new converter to avoid resource dictionary key issue. 2023-05-05 01:07:00 +08:00
Dong Bin bbedbdccd3 Merge pull request #175 from irihitech/scroll
ScrollViewer Update
2023-04-27 10:50:54 +08:00
rabbitism 4758fc6547 feat: fix scrollviewer theme, add new theme, add demo. 2023-04-27 10:25:39 +08:00
Dong Bin 17676823ff Merge pull request #169 from irihitech/nightly
Update to Avalonia preview 7
2023-04-25 12:05:31 +08:00
rabbitism bd0d0f261a docs: update docs. 2023-04-25 12:03:35 +08:00
rabbitism 8cb67d94e2 feat: migrate to preview7 2023-04-25 11:04:37 +08:00
rabbitism 29f7af5bd0 feat: move to props file. 2023-04-23 01:41:42 +08:00
rabbitism 39b17f52d1 feat: update to latest nightly. 2023-04-23 01:10:23 +08:00
Dong Bin 95df47eeba Merge pull request #167 from irihitech/165-splitbutton-theme
SplitButton Styles
2023-04-04 23:01:57 +08:00
Zhang Dian 2c41fe862b feat: add SolidSplitButton and BorderlessSplitButton themes. 2023-04-04 15:59:42 +08:00
Zhang Dian 593d0d3fa2 feat: add size classes. 2023-04-04 15:58:47 +08:00
Dong Bin a425bceddb Merge pull request #166 from irihitech/CICD
GitHub Actions
2023-04-04 13:56:42 +08:00
Zhang Dian 80c6380ce9 feat: CI package. 2023-04-04 02:19:13 +08:00
Zhang Dian 0ae04b69f5 fix: fix index typo. 2023-03-30 23:04:16 +08:00
rabbitism d952f901f2 doc: update docs for version preview6.1 2023-03-28 23:55:11 +08:00
Dong Bin 566cec65be Merge pull request #161 from irihitech/160-togglebutton-foreground
Togglebutton disabled Foreground
2023-03-28 23:30:02 +08:00
Zhang Dian 0af182680f Merge pull request #162 from irihitech/150-radiobutton
RadioButton and CheckBox alignment issue
2023-03-28 23:27:35 +08:00
rabbitism efe00ebcf4 fix: fix checkbox card default vertical alignment. 2023-03-28 23:14:27 +08:00
rabbitism 2662059c6d fix: fix template and foreground. 2023-03-28 23:04:44 +08:00
rabbitism 04dbe2d9ce fix: fix checkbox vertical alignment issue. 2023-03-28 22:06:47 +08:00
rabbitism 4db7bbf522 fix: fix radiobutton vertical alignment. 2023-03-28 22:00:32 +08:00
Zhang Dian 97a0f21186 mix: move disabled Foreground resources. 2023-03-28 22:00:15 +08:00
Zhang Dian 698866ab43 feat: ToggleButton Foreground should the same as BorderBrush. 2023-03-28 21:27:14 +08:00
Zhang Dian 6cafdd6e1c Merge pull request #158 from irihitech/numeric
Additional Fix of Numeric Height fix
2023-03-27 23:54:50 +08:00
Dong Bin fd49eef668 Merge pull request #157 from irihitech/144-radiobutton-styles
Synchronize Styles for RadioButton and CheckBox
2023-03-27 23:45:03 +08:00
rabbitism 2cf623ddf9 fix: update colors. 2023-03-27 23:42:02 +08:00
rabbitism 7a89d503d7 fix: add more fix. 2023-03-27 23:35:33 +08:00
rabbitism 31ba4c9fbe fix: fix card disabled style. 2023-03-27 23:32:24 +08:00
rabbitism f30e027a19 fix: fix card disabled foreground 2023-03-27 23:26:44 +08:00
rabbitism ffd1c7d89a fix: fix height issue. 2023-03-27 23:03:27 +08:00
Zhang Dian 2bb175bb16 feat: checked ButtonRadioButton disable style. 2023-03-27 19:55:54 +08:00
Zhang Dian 3124c5e2cc feat: disabled ButtonRadioButton style. 2023-03-27 19:43:11 +08:00
Zhang Dian e79044b040 feat: ButtonRadioButton demo. 2023-03-27 19:20:17 +08:00
Zhang Dian f63abf6901 mix: format Card pseudoclass styles. 2023-03-27 18:54:35 +08:00
Zhang Dian fa9250540b mix: format pseudoclass styles. 2023-03-27 18:44:27 +08:00
Zhang Dian 08c06199ae feat: card RadioButton colors. 2023-03-27 18:25:07 +08:00
Zhang Dian a4713ca21b feat: original RadioButton disabled style. 2023-03-27 17:26:31 +08:00
Zhang Dian cc2ab6ee9a feat: relayout RadioButtonDemo. 2023-03-27 16:08:58 +08:00
Zhang Dian 0cee18f507 feat: relayout CheckBoxDemo. 2023-03-27 16:00:27 +08:00
Zhang Dian a015bbe3e0 fix: split buttons. 2023-03-27 15:35:43 +08:00
Zhang Dian afb0fbcea6 feat: add CheckBox and RadioButton overview. 2023-03-27 15:31:26 +08:00
Zhang Dian 5f7e84bf08 Merge pull request #154 from irihitech/0326
0326 release fixes.
2023-03-27 14:53:42 +08:00
Zhang Dian 2ad76cd737 fix: fix PointOver spell. 2023-03-27 14:49:37 +08:00
Zhang Dian 60a3fb6019 Merge pull request #156 from irihitech/color
Color Palette and ColorPicker update
2023-03-27 14:33:06 +08:00
Zhang Dian 6d338fa31c Merge pull request #155 from irihitech/153-timepicker
Fix TimePicker PeriodPanel crush issue.
2023-03-27 14:03:33 +08:00
rabbitism f026431ca9 feat: update readme. 2023-03-27 11:38:35 +08:00
rabbitism e6531d89eb feat: add color resource copy. 2023-03-27 11:25:47 +08:00
rabbitism fd33972dda feat: grouped as 2d array. 2023-03-26 22:13:31 +08:00
Zhang Dian 0e76c09b8e feat: split colors. 2023-03-26 22:04:23 +08:00
Zhang Dian d1739cc88f feat: copy colors. 2023-03-26 21:46:14 +08:00
Zhang Dian 6f4c0dd5cd feat: color order. 2023-03-26 21:37:32 +08:00
rabbitism 1a512e589d feat: Add Dark/Light color palette. 2023-03-26 20:57:03 +08:00
rabbitism 43305be6bf feat: update dark palette reference. 2023-03-26 20:32:55 +08:00
rabbitism 15ce60bcdb feat: change functional brushes to use color resource. 2023-03-26 20:23:22 +08:00
rabbitism 3639239dfe feat: add color resources, change brush definition to color reference. 2023-03-26 20:04:04 +08:00
rabbitism 9f43baa039 fix: improve nullable annotation. 2023-03-26 19:38:12 +08:00
rabbitism c34d240874 feat: update date/time panel item height to avoid crush. 2023-03-26 18:33:54 +08:00
rabbitism a3571192a9 fix: fix numeric height issue. 2023-03-26 18:27:04 +08:00
rabbitism c1a9a49cd7 feat: fix PointerOver spell. 2023-03-26 18:22:38 +08:00
rabbitism 016160dee8 feat: improve TreeViewItem padding. 2023-03-26 18:15:59 +08:00
rabbitism 6885575c85 misc: add license expression in project props. 2023-03-26 14:19:17 +08:00
rabbitism 2ce3dd7445 fix: fix calendar datepicker border corner issue. 2023-03-26 14:16:27 +08:00
rabbitism 28e70736b2 fix: change IBeam to Ibeam 2023-03-26 14:07:32 +08:00
Dong Bin e193bfc697 Merge pull request #148 from irihitech/146-togglebutton-styles
DropDownButton typo
2023-03-25 23:43:46 +08:00
Zhang Dian 41e57b5034 fix: use DropDownButton instead of DropdownButton. 2023-03-25 21:34:55 +08:00
Zhang Dian 117fce4a61 feat: DropDownButton and hand Cursor. 2023-03-25 21:30:01 +08:00
Dong Bin c852219f39 Merge pull request #147 from irihitech/146-togglebutton-styles
ToggleButton Styles
2023-03-25 20:52:24 +08:00
Zhang Dian f9ae36b7e1 feat: add Hand Cursor. 2023-03-25 19:50:36 +08:00
Zhang Dian 48ea283c65 fix: disabled Styles. 2023-03-25 17:51:10 +08:00
Zhang Dian 318f9fb510 fix: pressed ToggleButton BorderBrush Styles. 2023-03-25 17:50:43 +08:00
Zhang Dian 153109c0ca fix: increase disabled Style priority. 2023-03-25 12:14:50 +08:00
Zhang Dian 3afa528cac fix: add missing Primary Classes. 2023-03-25 11:44:57 +08:00
Zhang Dian 799875e38b fix: use Danger Classes instead of Error. 2023-03-25 11:33:22 +08:00
Dong Bin 49e234bf30 Merge pull request #145 from irihitech/enhancement
Protect Eyesight
2023-03-24 09:26:51 +08:00
Zhang Dian 1ddf35b25b fix: specify Foreground. 2023-03-24 01:06:14 +08:00
Zhang Dian c90f541228 fix: use CardBorder theme instead of yellow Background. 2023-03-24 01:05:26 +08:00
Zhang Dian ed1b417332 Merge pull request #141 from irihitech/140-menu-open
Various fixes after preview 6
2023-03-22 15:50:11 +08:00
rabbitism c28ff754f5 fix: fix expand icon color. 2023-03-22 15:34:02 +08:00
rabbitism 2aea7b3e84 fix: fix various placement issue. 2023-03-22 14:54:48 +08:00
Zhang Dian c7fc804ec1 Merge pull request #137 from irihitech/preview6
Upgrade to Preview6
2023-03-22 14:14:50 +08:00
rabbitism cd533c65bc fix: fix toggle switch font size. 2023-03-22 13:25:07 +08:00
rabbitism b0cba0e5a9 misc: update release info. 2023-03-22 12:58:23 +08:00
rabbitism 5a9596a2be fix: a temporary fix of grid splitter preview. 2023-03-22 12:24:49 +08:00
rabbitism 33db3bf0d4 fix: fix carousel collection conversion. 2023-03-22 12:02:02 +08:00
rabbitism 3473c754a2 fix: fix toggle switch foreground issue. 2023-03-22 11:50:38 +08:00
rabbitism 34f0e53627 fix: fix date/time picker color. 2023-03-22 11:49:28 +08:00
rabbitism 4f28569781 fix: fix menu button foreground issue. 2023-03-22 11:43:31 +08:00
rabbitism 874c4ab260 fix: fix combobox default colors. 2023-03-22 11:01:41 +08:00
rabbitism 3fd209f180 fix: fix dropdownbutton glyph color. 2023-03-22 10:54:01 +08:00
rabbitism 7c93f635e3 fix: fix calendar date picker watermark colors. 2023-03-22 10:48:25 +08:00
rabbitism 0e3170eba2 feat: upgrade to preview6 2023-03-22 09:40:08 +08:00
Dong Bin 6376d11a25 Merge pull request #135 from irihitech/android
Android Start Mode
2023-03-21 19:30:26 +08:00
rabbitism e48e72ec37 feat: remove theme 2023-03-21 19:25:31 +08:00
rabbitism 9f61d67141 feat: remove fluent theme. 2023-03-21 19:21:22 +08:00
rabbitism eca7d32ba9 feat: Add EmbeddableControlRoot 2023-03-21 19:19:51 +08:00
rabbitism 2461c4a5c1 fix: temporarily add fluent back. 2023-03-20 23:52:08 +08:00
rabbitism 0657c99f31 misc: try to fix android app. 2023-03-20 23:14:50 +08:00
Zhang Dian ba2089aed9 feat: Android start mode. 2023-03-20 19:57:51 +08:00
rabbitism 1505eacb78 misc: update docs. 2023-03-19 22:50:22 +08:00
rabbitism 869d4cf5e9 misc: update package version. 2023-03-19 22:39:28 +08:00
Zhang Dian a3eb8ec90e Merge pull request #129 from irihitech/121-add-checkbox-as-card
Add Checkbox new theme
2023-03-18 00:16:34 +08:00
rabbitism d5d3e085f7 fix: fix various color issue. fix checkbox naming. 2023-03-18 00:00:57 +08:00
rabbitism 261e17abcd misc: update demo. 2023-03-17 23:32:28 +08:00
rabbitism 309dc7ed23 feat: add pure card theme. 2023-03-17 23:20:39 +08:00
rabbitism f0d0ed918a feat: add checkbox border style 2023-03-17 23:12:24 +08:00
rabbitism 4b7920909c feat: Add Credits in README 2023-03-17 20:38:28 +08:00
Zhang Dian feb67c312e Merge pull request #127 from irihitech/123-calendardatepicker
Fix calendar date picker horizontal alignment issue
2023-03-16 22:18:08 +08:00
rabbitism 0d0ee168a1 fix: fix horizontal alignment. 2023-03-16 22:11:43 +08:00
Zhang Dian bcfed4d251 Merge pull request #126 from irihitech/122-update-minheight-in-calendar
Update Minheight in Calendar
2023-03-16 22:11:24 +08:00
rabbitism 5dc7bbe8ee misc: remove unrelated comments. 2023-03-16 21:27:14 +08:00
rabbitism e101609534 feat: update calendar min height 2023-03-16 21:26:22 +08:00
Dong Bin 4a8f24767b Merge pull request #125 from irihitech/110-update-captionbuttons-style
Fix caption buttons margin
2023-03-16 20:51:36 +08:00
rabbitism 354be7e207 fix: update cursor. 2023-03-16 20:50:51 +08:00
rabbitism fc036395cc fix: fix caption buttons margin. 2023-03-16 20:45:49 +08:00
Zhang Dian ffc5b120b8 Merge pull request #118 from irihitech/0312fix
fix: Fix Textblock/SelectableTextBlock/Label disable style and textdecoration combination.
2023-03-09 16:45:06 +08:00
rabbitism dd45da715a fix: address issue #116 and #117 2023-03-09 16:00:59 +08:00
rabbitism 224a759874 misc: bump version. 2023-03-05 20:46:25 +08:00
Dong Bin ad697b1091 Merge pull request #115 from irihitech/114-fix-nullable
fix: fix converter annotation.
2023-03-05 20:30:38 +08:00
rabbitism 95efcf063e fix: fix converter annotation. 2023-03-05 20:20:24 +08:00
Zhang Dian cbcedd6bdd Merge pull request #112 from irihitech/111-slider-tick-still-takes-place-when-invisible
Fix Slider default size
2023-03-02 10:54:51 +08:00
Zhang Dian 1b50bc5437 fix: delete RowDefinitions. 2023-03-02 10:52:41 +08:00
rabbitism efa0ff28e7 fix: simplify column definitions. 2023-03-02 00:11:27 +08:00
rabbitism 37737866ec fix: fix invalid vertical width binding. 2023-03-02 00:10:13 +08:00
rabbitism ddc886e52e fix: fix slider default height. 2023-03-02 00:08:34 +08:00
Dong Bin b92e2d18f7 Merge pull request #108 from irihitech/fix
fix: add ComboBox items.
2023-02-27 23:03:49 +08:00
Zhang Dian e1aa133155 fix: exchange MinHeight value. 2023-02-27 23:01:21 +08:00
Zhang Dian ea5f717da6 feat: unify Input box. 2023-02-27 22:42:43 +08:00
Zhang Dian e51b497f2a feat: clarify disabled input 2023-02-27 22:42:43 +08:00
Zhang Dian ec4bf729b4 fix: add ComboBox items. 2023-02-27 15:41:48 +08:00
rabbitism e675699f9c feat: use toggleswitch in demo. 2023-02-24 00:46:25 +08:00
Dong Bin 5b352b6f81 Merge pull request #103 from irihitech/empty
fix: make content invisible when content is null.
2023-02-24 00:19:29 +08:00
rabbitism ef9455c6da fix: make content invisible when content is null. 2023-02-24 00:16:58 +08:00
Dong Bin 4fc1dc5949 Merge pull request #102 from irihitech/toggle
ToggleSwitch Themes
2023-02-23 22:01:55 +08:00
Zhang Dian 6af2d9008d feat: add :pointerover and :pressed style 2023-02-23 21:28:33 +08:00
Zhang Dian c8e58e3dbf fix: rename theme. 2023-02-23 20:52:02 +08:00
Zhang Dian fa19b9e89a feat: add CustomToggleSwitch and SimpleToggleSwitch 2023-02-23 13:26:18 +08:00
Zhang Dian 20f421f6fc feat: add SimpleToggleSwitch theme. 2023-02-22 17:37:39 +08:00
rabbitism 4e48f28e1c docs: Update doc and screenshots. 2023-02-19 18:25:44 +08:00
rabbitism f4d6f7f025 misc: move csproj common properties to props file. 2023-02-19 18:08:02 +08:00
Zhang Dian bc55f2e321 Merge pull request #100 from irihitech/fix
Fix issues
2023-02-18 23:41:34 +08:00
rabbitism c2a309abc8 fix: fix button spinner in dark mode. 2023-02-18 23:22:15 +08:00
rabbitism 21e8f09934 fix: remove content presenter text style binding in FlyoutPresenter. 2023-02-18 23:06:17 +08:00
Dong Bin 303b7dbf49 Merge pull request #98 from irihitech/aot
Add NativeAOT support to Semi.Avalonia and Demo.
2023-02-18 22:08:28 +08:00
rabbitism 7b94727b59 feat: update colorpicker and datagrid to compiled bindings. 2023-02-18 21:54:35 +08:00
rabbitism 8a68f7793d fix: Add RD xml. 2023-02-18 21:33:19 +08:00
rabbitism 8911e52963 feat: add compiled bindings to resources. 2023-02-18 21:02:58 +08:00
Zhang Dian 032f62da42 Merge pull request #92 from irihitech/90-input-remake
Input Remake
2023-02-17 14:26:47 +08:00
rabbitism 24248f7d04 fix: temporary fix a demo issue. 2023-02-17 14:23:01 +08:00
rabbitism 6e5512e429 feat: Add Size to date and time picker. 2023-02-17 00:31:31 +08:00
rabbitism df217f3c82 fix: fix date time picker dark mode. 2023-02-17 00:20:22 +08:00
rabbitism 7b16b5a36a misc: improve menu demo. 2023-02-17 00:14:41 +08:00
rabbitism 4e5a6c327d feat: DateTime picker theme. 2023-02-16 23:58:55 +08:00
rabbitism 068f1e36cc feat: update ComboBox demo. 2023-02-16 02:01:17 +08:00
rabbitism 07debbb6f4 feat: Add bordered style for calendar datepicker. 2023-02-15 17:38:31 +08:00
rabbitism 46efeebf76 feat: Add dimension to dark mode, add demo of dimension. 2023-02-15 17:19:45 +08:00
rabbitism 73e2ebc316 feat: add CalendarDatePicker theme. 2023-02-15 17:18:05 +08:00
rabbitism 1bfe7a6744 fix: move dimensions to resource. 2023-02-15 16:28:08 +08:00
rabbitism ada894e456 feat: update AutoCompleteBox theme. 2023-02-15 16:25:38 +08:00
rabbitism 7762eff214 feat: AutoCompleteBox new theme. 2023-02-15 16:17:49 +08:00
rabbitism 3ecebc0387 fix: Update TextBox theme. 2023-02-15 15:48:14 +08:00
Dong Bin 3fe0effc9b Merge pull request #89 from irihitech/#88_margin
fix: fix margin values
2023-02-14 17:48:15 +08:00
Zhang Dian ff4f691fbf fix: fix margin values 2023-02-14 17:41:21 +08:00
rabbitism aab33b15f3 docs: Update docs. 2023-02-13 12:12:03 +08:00
rabbitism 7140b3298d misc: update release notes. 2023-02-13 12:00:13 +08:00
rabbitism 104dab6afc misc: Bump version. 2023-02-13 11:57:46 +08:00
Zhang Dian 10d0836b0d Merge pull request #86 from irihitech/color
Add Palette demo, and fix some significant color issue.
2023-02-13 11:39:55 +08:00
rabbitism 8dac0b193e fix: fix visual. 2023-02-13 11:15:01 +08:00
rabbitism a3dfa43694 fix: fix some color inconsistency issue. 2023-02-13 11:10:23 +08:00
rabbitism 958a682f60 feat: Add Column width. 2023-02-13 03:41:49 +08:00
rabbitism 03e9056c82 fix: fix toggle style. 2023-02-13 03:29:56 +08:00
rabbitism f3bb040dc9 feat: add more resources. 2023-02-13 02:55:29 +08:00
rabbitism b06e7c6443 feat: add color group control. 2023-02-13 02:17:38 +08:00
rabbitism 235865c925 feat: Add functional colors in resource. 2023-02-13 00:55:14 +08:00
rabbitism bf87bfeb90 feat: add color preview control. 2023-02-13 00:14:56 +08:00
rabbitism 888d115ca8 feat: Add ColorItemControl and color detail preview. 2023-02-12 00:56:45 +08:00
rabbitism 7fd45c7342 feat: load resources from dictionary. 2023-02-11 23:04:07 +08:00
rabbitism 9499bab92f feat: setup colors. 2023-02-11 15:50:39 +08:00
Zhang Dian 922afa904b Merge pull request #80 from irihitech/fix
Fix: Fix various issues
2023-02-11 00:29:51 +08:00
rabbitism 99a9730001 fix: fix color model tag alignment. 2023-02-11 00:15:24 +08:00
rabbitism e6a3e187a6 fix: fix colorpicker layout, remove datagrid animation. 2023-02-10 23:58:12 +08:00
rabbitism 7cababb140 fix Checkbox null content behavior, and icon stretch in menu. 2023-02-10 12:05:54 +08:00
rabbitism 0797e2e5df fix: fix file chooser selection. 2023-02-10 11:16:05 +08:00
rabbitism 42c526f927 fix: temporarily fix combobox demo display issue. 2023-02-10 11:02:40 +08:00
rabbitism f8188a43bc fix: fix split button separator. 2023-02-10 01:17:30 +08:00
rabbitism 0d306bdf51 fix: fix theme toggle. 2023-02-10 00:49:07 +08:00
rabbitism 43db0c0293 feat: add header for demo. 2023-02-10 00:34:48 +08:00
rabbitism ee4a9c0e9a fix: add default theme textelement handling. 2023-02-09 23:19:12 +08:00
rabbitism 7fb3460e02 fix: more fix on file chooser. 2023-02-09 22:55:33 +08:00
rabbitism bef55df65b fix: simplify checkbox layout. 2023-02-09 22:44:28 +08:00
rabbitism 0698046904 fix: fix file chooser layout alignment. 2023-02-09 22:37:22 +08:00
rabbitism b591c96968 Fix AutoCompleteBox default Border. Fix TextBox ClearButton layout. 2023-02-09 22:28:58 +08:00
rabbitism c9cc49a67c fix: fix checkbox vertical alignment. 2023-02-09 22:26:12 +08:00
rabbitism e37f97042e feat: use vertical navigation tab control. 2023-02-09 22:21:36 +08:00
Zhang Dian 321912a32e Merge pull request #77 from irihitech/colorpicker
Add ColorPicker
2023-02-09 21:34:23 +08:00
rabbitism e9f488f004 fix: move styles closer to element. 2023-02-09 21:30:16 +08:00
rabbitism 060a7c3bf7 fix: fix nuemricupdown inner content in flyout. 2023-02-09 20:16:43 +08:00
rabbitism a55818b850 feat: Add Dark Mode 2023-02-09 19:03:57 +08:00
rabbitism 52e57b14fd feat: Add color picker themes. 2023-02-09 18:43:02 +08:00
rabbitism ec33914f86 feat: Initialize ColorPicker project. 2023-02-08 13:12:31 +08:00
Zhang Dian 94c3391066 Merge pull request #75 from irihitech/datagrid
feat: Add DataGrid Theme.
2023-02-08 13:01:51 +08:00
rabbitism 21a4ad56ea feat: Update according to feedback. 2023-02-08 11:43:30 +08:00
rabbitism ed8a36450e fix: fix diagnostic versioning. 2023-02-08 02:03:53 +08:00
rabbitism ffb2b356cc feat: add DataGrid resources. 2023-02-08 02:00:06 +08:00
Dong Bin 566b42cb1d Merge pull request #74 from irihitech/#71_disabled_button
fix: fix disabled button text color
2023-02-07 11:11:19 +08:00
Zhang Dian 1438b0abdd fix: fix disabled button text color 2023-02-07 11:05:29 +08:00
Dong Bin a8daa16ca4 Merge pull request #73 from irihitech/#72_white_label
fix: fix white label background in dark mode
2023-02-07 00:47:55 +08:00
rabbitism 516e5703f7 feat: Add demo page. 2023-02-07 00:42:53 +08:00
Zhang Dian e2909ecf38 fix: fix white label background in dark mode 2023-02-07 00:40:18 +08:00
rabbitism 9a4fc56e72 fix: fix debug versioning. 2023-02-06 00:55:02 +08:00
rabbitism 03ad4a69a4 feat: WIP copy over fluent theme. 2023-02-05 23:26:45 +08:00
rabbitism bf833dd553 feat: Initialize DataGrid 2023-02-05 23:07:45 +08:00
Dong Bin dc21ce6b5d Merge pull request #70 from irihitech/Carousel
feat: Add FullCarousel theme.
2023-02-05 22:44:11 +08:00
rabbitism 08f8ccd215 feat: Add FullCarousel theme. 2023-02-05 22:30:01 +08:00
Dong Bin 2b0c26660e Merge pull request #69 from irihitech/theme
Theme
2023-02-04 14:15:49 +08:00
rabbitism 5ba21de6bb feat: add ThemeVariant demo. 2023-02-04 14:15:19 +08:00
rabbitism 8e10cd774a feat: Add new index for theme. fix some minor issue. 2023-02-04 14:00:20 +08:00
Dong Bin 16a9d3b0b2 Merge pull request #68 from irihitech/preview5
feat: add RefreshContainer and ThemeVariantScope.
2023-02-04 11:53:42 +08:00
rabbitism caae00b7c0 feat: add RefreshContainer and ThemeVariantScope. 2023-02-04 11:49:22 +08:00
rabbitism 3ee089fb32 doc: update documentation 2023-02-03 23:43:22 +08:00
rabbitism befd62fbb4 misc: update package info. 2023-02-03 23:04:49 +08:00
rabbitism f86ad05a01 misc: fix a build warning. 2023-02-03 23:04:03 +08:00
Dong Bin 2d11584282 Merge pull request #66 from irihitech/dark
Add Dark mode
2023-02-03 23:00:44 +08:00
Dong Bin 8987fa23d6 Merge branch 'main' into dark 2023-02-03 22:59:38 +08:00
Dong Bin b243d3270f Merge pull request #65 from irihitech/avalonia-preview5
Migrate to Avalonia preview5
2023-02-03 22:58:15 +08:00
rabbitism fdd90f20b6 feat: upgrade(downgrade) to preview 5. 2023-02-03 22:46:48 +08:00
rabbitism 48d36d1418 fix: fix backgrounds. 2023-02-03 12:46:34 +08:00
rabbitism 931e09701a feat: update BoxShadows. 2023-02-03 11:58:44 +08:00
rabbitism ae3376c0b2 feat: Update dark mode backgrounds, and change several control templates. 2023-02-03 11:51:56 +08:00
Zhang Dian 547e95e7b6 Label 2023-02-03 09:49:34 +08:00
Zhang Dian 38fd422b90 Window Background 2023-02-02 18:13:11 +08:00
Zhang Dian db5dd11bee Except Label 2023-02-02 18:06:13 +08:00
Zhang Dian a7a677db3a Button Color 2023-02-02 17:00:18 +08:00
Zhang Dian 76f82bebb8 Dark Mode 2023-02-02 16:02:28 +08:00
rabbitism c6cd17007a misc: update version for packaging. 2023-02-01 21:52:05 +08:00
rabbitism fa6f7a3ae8 fix: fix web demo setup. 2023-02-01 21:49:43 +08:00
rabbitism 7536b8b2a3 fix: simplify storage extraction. 2023-02-01 21:40:46 +08:00
rabbitism a56a0ee18b fix: fix notification. 2023-02-01 21:33:12 +08:00
rabbitism 1554e7bac9 misc: update to preview 5 nightly build 2023-02-01 21:17:19 +08:00
rabbitism 3e12731393 feat: start dark mode dev. 2023-01-31 22:27:22 +08:00
371 changed files with 18466 additions and 4313 deletions
+58
View File
@@ -0,0 +1,58 @@
name: Pack
on:
push:
branches: [ "action/pack" ]
pull_request:
branches: [ "action/pack" ]
jobs:
nuget_desktop:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Nuget Semi.Avalonia
run: dotnet pack ./src/Semi.Avalonia -o ./nugets
- name: Nuget Semi.Avalonia.ColorPicker
run: dotnet pack ./src/Semi.Avalonia.ColorPicker -o ./nugets
- name: Nuget Semi.Avalonia.DataGrid
run: dotnet pack ./src/Semi.Avalonia.DataGrid -o ./nugets
- name: Nuget 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 a Build Artifact
uses: actions/upload-artifact@v4.3.1
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 net7.0-android --no-restore
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4.3.1
with:
name: android
path: ./**/publish/*Signed.apk
+53
View File
@@ -0,0 +1,53 @@
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/net7.0/browser-wasm/AppBundle
on:
push:
branches: [ "action/deploy" ]
pull_request:
branches: [ "action/deploy" ]
jobs:
deploy-to-github-pages:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup .NET 7
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.405
- name: Install wasm-tools
run: dotnet workload install wasm-tools wasm-tools-net7
- name: Install DotNetCompress
run: dotnet tool install --global DotNetCompress --version 3.0.0 --no-cache
- name: Publish .NET Project
run: dotnet publish $PROJECT_PATH -c Release -o release --nologo
- name: Change base-tag in index.html
run: sed -i 's/<base href="\/" \/>/<base href="\/Semi.Avalonia\/" \/>/g' $OUTPUT_PATH/index.html
- name: copy index.html to 404.html
run: cp $OUTPUT_PATH/index.html $OUTPUT_PATH/404.html
- name: Compress Output using Brotli
run: DotNetCompress -d $OUTPUT_PATH -p "*.dll" "*.js" "*.wasm" --format br --threads 4
- name: Compress Output using GZip
run: DotNetCompress -d $OUTPUT_PATH -p "*.dll" "*.js" "*.wasm" --format gz --threads 4
- name: Add .nojekyll file
run: touch $OUTPUT_PATH/.nojekyll
- name: Commit wwwroot to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: ${{ env.OUTPUT_PATH }}
+6
View File
@@ -0,0 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="SC-Single" type="DotNetFolderPublish" factoryName="Publish to folder">
<riderPublish configuration="Release" include_native_libs_for_self_extract="true" platform="Any CPU" produce_single_file="true" runtime="win-x64" self_contained="true" target_folder="$PROJECT_DIR$/demo/Semi.Avalonia.Demo.Desktop/bin/Release/net7.0/win-x64/publish" target_framework="net7.0" uuid_high="3088527218258560748" uuid_low="-8649338673481336678" />
<method v="2" />
</configuration>
</component>
+104 -7
View File
@@ -1,14 +1,111 @@
# Semi.Avalonia # Semi Avalonia
[![Semi Avalonia](https://img.shields.io/nuget/v/Semi.Avalonia.svg?color=red&style=flat-square)](https://www.nuget.org/packages/Semi.Avalonia/)
[![Semi Avalonia](https://img.shields.io/nuget/dt/Semi.Avalonia.svg?style=flat-square)](https://www.nuget.org/packages/Semi.Avalonia/)
[中文](./README_CN.md)
Avalonia Theme inspired by Semi Design Avalonia Theme inspired by Semi Design
> Semi.Avalonia is still in very early stage. Please don't use in production. If you are looking for more customized controls, Please try [Ursa](https://github.com/irihitech/Ursa.Avalonia)
>
> Dark theme is not designed at all. Please don't use that.
![Cover](./docs/cover.png) ![Light](./docs/demo.jpg)
## Requirement ## How to Use
Avalonia V11 ### Installation
```bash
dotnet add package Semi.Avalonia --version 11.0.7
```
Include Semi Design Styles in application:
```xaml
<Application.Styles>
<StyleInclude Source="avares://Semi.Avalonia/Themes/Index.axaml" />
</Application.Styles>
```
That's all.
ColorPicker, DataGrid and TreeDataGrid are distributed in separated packages. Please install if you need.
```bash
dotnet add package Semi.Avalonia.ColorPicker --version 11.0.7
dotnet add package Semi.Avalonia.DataGrid --version 11.0.7
dotnet add package Semi.Avalonia.TreeDataGrid --version 11.0.7
```
```xaml
<Application.Styles>
<StyleInclude Source="avares://Semi.Avalonia.ColorPicker/Index.axaml" />
<StyleInclude Source="avares://Semi.Avalonia.DataGrid/Index.axaml" />
<StyleInclude Source="avares://Semi.Avalonia.TreeDataGrid/Index.axaml" />
</Application.Styles>
```
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>
```
## Demo
You can always download demo executable to play around with Semi Avalonia Themes.
<https://github.com/irihitech/Semi.Avalonia/releases>
## Support
We offer limited free community support for Semi Avalonia and Ursa. If you have any question or suggestion, feel free to raise issues and discussions via GitHub, and you are welcomed to join our group via FeiShu(Lark)
![FeiShu](./docs/community-support.png)
## Version compatibility
| Semi Design Version | Avalonia Version |
|:--------------------|:-----------------|
| 11.0.7 | >=11.0.7 |
| 11.0.1 | <=11.0.6 |
## TODO
* FocusAdorner
## Credits
[Semi Design](https://semi.design/)
[Avalonia](https://github.com/AvaloniaUI/Avalonia)
[FluentAvalonia](https://github.com/amwx/FluentAvalonia)
[Material Design Icons](https://pictogrammers.com/library/mdi/)
[CommunityToolKit](https://github.com/CommunityToolkit/dotnet)
+113
View File
@@ -0,0 +1,113 @@
# Semi Avalonia
[![Semi Avalonia](https://img.shields.io/nuget/v/Semi.Avalonia.svg?color=red&style=flat-square)](https://www.nuget.org/packages/Semi.Avalonia/)
[![Semi Avalonia](https://img.shields.io/nuget/dt/Semi.Avalonia.svg?style=flat-square)](https://www.nuget.org/packages/Semi.Avalonia/)
[English](./README.md)
Avalonia UI 控件主题,灵感来自 Semi Design
如果您希望使用更多的拓展控件,欢迎尝试 [Ursa](https://github.com/irihitech/Ursa.Avalonia)
![Light](./docs/demo.jpg)
## 如何使用
### 安装
```bash
dotnet add package Semi.Avalonia --version 11.0.7
```
在样式中引用 Semi 主题:
```xaml
<Application.Styles>
<StyleInclude Source="avares://Semi.Avalonia/Themes/Index.axaml" />
</Application.Styles>
```
这样就可以了。
ColorPicker DataGrid 和 TreeDataGrid 的样式单独分发,如果需要请安装并引用。
```bash
dotnet add package Semi.Avalonia.ColorPicker --version 11.0.7
dotnet add package Semi.Avalonia.DataGrid --version 11.0.7
dotnet add package Semi.Avalonia.TreeDataGrid --version 11.0.7
```
```xaml
<Application.Styles>
<StyleInclude Source="avares://Semi.Avalonia.ColorPicker/Index.axaml" />
<StyleInclude Source="avares://Semi.Avalonia.DataGrid/Index.axaml" />
<StyleInclude Source="avares://Semi.Avalonia.TreeDataGrid/Index.axaml" />
</Application.Styles>
```
如果需要进行 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>
```
## 示例
您可以从 Semi Avalonia 的 release 页下载并试用 Semi Avalonia 的展示应用。
<https://github.com/irihitech/Semi.Avalonia/releases>
## 社区支持
我们提供有限度的免费社区支持,如果您有任何问题或建议,除了在GitHub上提交issue或发起讨论,也欢迎加入我们的飞书交流群:
![FeiShu](./docs/community-support.png)
## 版本兼容性
| Semi Design Version | Avalonia Version |
|:--------------------|:-----------------|
| 11.0.7 | >=11.0.7 |
| 11.0.1 | <=11.0.6 |
## 代办事项
* FocusAdorner
## 致谢
[Semi Design](https://semi.design/)
[Avalonia](https://github.com/AvaloniaUI/Avalonia)
[FluentAvalonia](https://github.com/amwx/FluentAvalonia)
[Material Design Icons](https://pictogrammers.com/library/mdi/)
[CommunityToolKit](https://github.com/CommunityToolkit/dotnet)
+41
View File
@@ -9,6 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
demo\Directory.Build.props = demo\Directory.Build.props demo\Directory.Build.props = demo\Directory.Build.props
demo\global.json = demo\global.json demo\global.json = demo\global.json
src\Package.props = src\Package.props
EndProjectSection EndProjectSection
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Demo", "Demo", "{43091528-9509-43CB-A003-9C5C11E96DD6}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Demo", "Demo", "{43091528-9509-43CB-A003-9C5C11E96DD6}"
@@ -19,6 +20,18 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semi.Avalonia.Demo.Web", "d
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semi.Avalonia.Demo", "demo\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj", "{D789AEDB-EBDF-4450-8E8E-B4A03FB257B0}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semi.Avalonia.Demo", "demo\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj", "{D789AEDB-EBDF-4450-8E8E-B4A03FB257B0}"
EndProject 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 Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@@ -41,6 +54,31 @@ Global
{D789AEDB-EBDF-4450-8E8E-B4A03FB257B0}.Debug|Any CPU.Build.0 = 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.ActiveCfg = Release|Any CPU
{D789AEDB-EBDF-4450-8E8E-B4A03FB257B0}.Release|Any CPU.Build.0 = 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 EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@@ -49,6 +87,9 @@ Global
{2ADCA724-2B6D-46EC-87F7-604D7918B89A} = {43091528-9509-43CB-A003-9C5C11E96DD6} {2ADCA724-2B6D-46EC-87F7-604D7918B89A} = {43091528-9509-43CB-A003-9C5C11E96DD6}
{69A2C77D-6DB7-4AE4-B179-D1F5CF5E2DF0} = {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} {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 EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7CA41ED3-2CED-40CC-AA21-28C3B42B1E86} SolutionGuid = {7CA41ED3-2CED-40CC-AA21-28C3B42B1E86}
+1 -1
View File
@@ -1,6 +1,6 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<AvaloniaVersion>11.0.0-preview4</AvaloniaVersion> <AvaloniaVersion>11.1.0-beta2</AvaloniaVersion>
</PropertyGroup> </PropertyGroup>
</Project> </Project>
@@ -0,0 +1,16 @@
using Android.App;
using Android.Content.PM;
using Avalonia.Android;
namespace Semi.Avalonia.Demo.Android;
[Activity(
Label = "Semi.Avalonia",
Theme = "@style/MyTheme.NoActionBar",
Icon = "@drawable/Icon",
MainLauncher = true,
LaunchMode = LaunchMode.SingleTop,
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)]
public class MainActivity : AvaloniaMainActivity<App>
{
}
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto">
<uses-permission android:name="android.permission.INTERNET" />
<application android:label="Semi.Avalonia" android:icon="@drawable/Icon" />
</manifest>
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<color android:color="@color/splash_background"/>
</item>
<item android:drawable="@drawable/Icon"
android:width="120dp"
android:height="120dp"
android:gravity="center" />
</layer-list>
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="splash_background">#FFFFFF</color>
</resources>
@@ -0,0 +1,17 @@
<?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: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>
@@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0-android</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<ApplicationId>com.irihitech.Semi.Avalonia</ApplicationId>
<ApplicationVersion>1</ApplicationVersion>
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<AndroidPackageFormat>apk</AndroidPackageFormat>
<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)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj" />
</ItemGroup>
</Project>
@@ -1,9 +0,0 @@
<Application
x:Class="Semi.Avalonia.Demo.Desktop.App"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Semi.Avalonia.Demo.Desktop">
<Application.Styles>
<StyleInclude Source="avares://Semi.Avalonia/Themes/LightTheme.axaml" />
</Application.Styles>
</Application>
+7 -3
View File
@@ -1,6 +1,9 @@
using System; using Avalonia;
using Avalonia; using Avalonia.Dialogs;
using Avalonia.Media; using Avalonia.Media;
using System;
using System.Linq;
using System.Threading;
namespace Semi.Avalonia.Demo.Desktop; namespace Semi.Avalonia.Demo.Desktop;
@@ -26,7 +29,8 @@ class Program
// Avalonia configuration, don't remove; also used by visual designer. // Avalonia configuration, don't remove; also used by visual designer.
public static AppBuilder BuildAvaloniaApp() public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>() => AppBuilder.Configure<App>()
.UseManagedSystemDialogs()
.UsePlatformDetect() .UsePlatformDetect()
.With(new Win32PlatformOptions(){ UseCompositor = false}) .With(new Win32PlatformOptions())
.LogToTrace(); .LogToTrace();
} }
@@ -4,12 +4,21 @@
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport> <BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<!-- Uncomment below to enable Native AOT compilation-->
<!--
<PublishAot>true</PublishAot>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
-->
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest> <ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<RdXmlFile Include="rd.xml" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" /> <PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
+16
View File
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<Directives>
<!--
This file is part of RdXmlLibrary project.
Visit https://github.com/kant2002/rdxmllibrary for latest version.
If you have modifications specific to this Nuget package,
please contribute back.
-->
<Application>
<Assembly Name="Avalonia.Markup.Xaml" Dynamic="Required All"/>
<Assembly Name="Semi.Avalonia" Dynamic="Required All"/>
<Assembly Name="Semi.Avalonia.DataGrid" Dynamic="Required All"/>
<Assembly Name="Semi.Avalonia.ColorPicker" Dynamic="Required All"/>
<Assembly Name="Semi.Avalonia.Demo" Dynamic="Required All"/>
</Application>
</Directives>
+53
View File
@@ -0,0 +1,53 @@
using System;
using System.Globalization;
using System.Linq;
using System.Threading;
using Avalonia;
namespace Semi.Avalonia.Demo.Drm;
class Program
{
// Initialization code. Don't use any Avalonia, third-party APIs or any
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
// yet and stuff might break.
[STAThread]
public static int Main(string[] args)
{
var builder = BuildAvaloniaApp();
double GetScaling()
{
var idx = Array.IndexOf(args, "--scaling");
if (idx != 0 && args.Length > idx + 1 &&
double.TryParse(args[idx + 1], NumberStyles.Any, CultureInfo.InvariantCulture, out var scaling))
return scaling;
return 1;
}
if (args.Contains("--drm"))
{
SilenceConsole();
return builder.StartLinuxDrm(args: args, card: "/dev/dri/card1", scaling: GetScaling());
}
return builder.StartWithClassicDesktopLifetime(args);
}
// Avalonia configuration, don't remove; also used by visual designer.
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.LogToTrace();
private static void SilenceConsole()
{
new Thread(() =>
{
Console.CursorVisible = false;
while (true)
Console.ReadKey(true);
})
{ IsBackground = true }.Start();
}
}
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<ApplicationManifest>app.manifest</ApplicationManifest>
</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>
<ItemGroup>
<ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj" />
</ItemGroup>
</Project>
+18
View File
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<!-- This manifest is used on Windows only.
Don't remove it as it might cause problems with window transparency and embeded controls.
For more details visit https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests -->
<assemblyIdentity version="1.0.0.0" name="Semi.Avalonia.Demo.Drm.Desktop"/>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of the Windows versions that this application has been tested on
and is designed to work with. Uncomment the appropriate elements
and Windows will automatically select the most compatible environment. -->
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
</assembly>
@@ -0,0 +1,77 @@
# 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`,可能是显卡挂载到别的文件夹下了,待解决。
-10
View File
@@ -1,10 +0,0 @@
<Application
x:Class="Semi.Avalonia.Demo.Web.App"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Semi.Avalonia.Demo.Web">
<Application.Styles>
<FluentTheme Mode="Light" />
<StyleInclude Source="avares://Semi.Avalonia/Themes/LightTheme.axaml" />
</Application.Styles>
</Application>
+7 -16
View File
@@ -1,25 +1,16 @@
using System.Runtime.Versioning; using System.Runtime.Versioning;
using System.Threading.Tasks;
using Avalonia; using Avalonia;
using Avalonia.Media; using Avalonia.Browser;
using Avalonia.Web;
using Semi.Avalonia.Demo.Web;
[assembly: SupportedOSPlatform("browser")] [assembly: SupportedOSPlatform("browser")]
internal partial class Program namespace Semi.Avalonia.Demo.Web;
internal sealed partial class Program
{ {
private static void Main(string[] args) => BuildAvaloniaApp() private static Task Main(string[] args) => BuildAvaloniaApp()
.With(new FontManagerOptions .StartBrowserAppAsync("out");
{
FontFallbacks = new[]
{
new FontFallback
{
FontFamily = new FontFamily("avares://Semi.Avalonia.Demo.Web/Assets/SourceHanSansCN-Regular.otf#Source Han Sans CN")
}
}
})
.SetupBrowserApp("out");
public static AppBuilder BuildAvaloniaApp() public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>(); => AppBuilder.Configure<App>();
@@ -1,29 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
<WasmMainJSPath>AppBundle\main.js</WasmMainJSPath>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net8.0-browser</TargetFramework>
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
<WasmMainJSPath>wwwroot\main.js</WasmMainJSPath>
<WasmRuntimeAssetsLocation>./_framework</WasmRuntimeAssetsLocation>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<WasmExtraFilesToDeploy Include="AppBundle\**" /> <WasmExtraFilesToDeploy Include="wwwroot\**"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Remove="Assets\SourceHanSansCN-Regular.otf" /> <PackageReference Include="Avalonia.Browser" Version="$(AvaloniaVersion)" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<AvaloniaResource Include="Assets\SourceHanSansCN-Regular.otf" /> <ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.0-preview4" />
<PackageReference Include="Avalonia.Web" Version="$(AvaloniaVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -1,4 +1,11 @@
/* HTML styles for the splash screen */ :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 { .highlight {
color: white; color: white;

Before

Width:  |  Height:  |  Size: 172 KiB

After

Width:  |  Height:  |  Size: 172 KiB

@@ -7,10 +7,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="/" /> <base href="/" />
<link rel="modulepreload" href="./main.js" /> <link rel="modulepreload" href="./main.js" />
<link rel="modulepreload" href="./dotnet.js" /> <link rel="modulepreload" href="./_framework/dotnet.js" />
<link rel="modulepreload" href="./avalonia.js" /> <link rel="modulepreload" href="./_framework/avalonia.js" />
<link rel="stylesheet" href="./app.css" /> <link rel="stylesheet" href="./app.css" />
<link rel="preconnect" href="https://fonts.googleapis.com">
</head> </head>
<body style="margin: 0px; overflow: hidden"> <body style="margin: 0px; overflow: hidden">
@@ -1,5 +1,4 @@
import { dotnet } from './dotnet.js' import { dotnet } from './_framework/dotnet.js'
import { registerAvaloniaModule } from './avalonia.js';
const is_browser = typeof window != "undefined"; const is_browser = typeof window != "undefined";
if (!is_browser) throw new Error(`Expected to be running in a browser`); if (!is_browser) throw new Error(`Expected to be running in a browser`);
@@ -9,8 +8,6 @@ const dotnetRuntime = await dotnet
.withApplicationArgumentsFromQuery() .withApplicationArgumentsFromQuery()
.create(); .create();
await registerAvaloniaModule(dotnetRuntime);
const config = dotnetRuntime.getConfig(); const config = dotnetRuntime.getConfig();
await dotnetRuntime.runMainAndExit(config.mainAssemblyName, [window.location.search]); await dotnetRuntime.runMain(config.mainAssemblyName, [window.location.search]);
+14
View File
@@ -0,0 +1,14 @@
<Application
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">
<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" />
</Application.Styles>
</Application>
@@ -3,7 +3,7 @@ using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml; using Avalonia.Markup.Xaml;
using Semi.Avalonia.Demo.Views; using Semi.Avalonia.Demo.Views;
namespace Semi.Avalonia.Demo.Web; namespace Semi.Avalonia.Demo;
public partial class App : Application public partial class App : Application
{ {
@@ -14,10 +14,16 @@ public partial class App : Application
public override void OnFrameworkInitializationCompleted() public override void OnFrameworkInitializationCompleted()
{ {
if (ApplicationLifetime is ISingleViewApplicationLifetime singleViewPlatform) switch (ApplicationLifetime)
{ {
singleViewPlatform.MainView = new MainView(); case IClassicDesktopStyleApplicationLifetime desktop:
desktop.MainWindow = new MainWindow();
break;
case ISingleViewApplicationLifetime singleView:
singleView.MainView = new MainView();
break;
} }
base.OnFrameworkInitializationCompleted(); base.OnFrameworkInitializationCompleted();
} }
} }
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

@@ -0,0 +1,132 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Semi.Avalonia.Demo.Controls"
xmlns:viewModels="clr-namespace:Semi.Avalonia.Demo.ViewModels"
x:CompileBindings="True"
x:DataType="viewModels:ColorItemViewModel">
<StreamGeometry x:Key="CopyIcon">M5 7C3.89543 7 3 7.89543 3 9V19C3 20.1046 3.89543 21 5 21H15C16.1046 21 17 20.1046 17 19V9C17 7.89543 16.1046 7 15 7H5Z,M7 4C7 2.89543 7.89543 2 9 2H20C21.1046 2 22 2.89543 22 4V15C22 16.1046 21.1046 17 20 17H19V8C19 6 18 5 16 5H7V4Z</StreamGeometry>
<ControlTheme x:Key="{x:Type controls:ColorDetailControl}" TargetType="controls:ColorDetailControl">
<!-- Add Resources Here -->
<Setter Property="controls:ColorDetailControl.Template">
<ControlTemplate TargetType="controls:ColorDetailControl">
<StackPanel>
<TextBlock
Margin="0,0,0,8"
Classes="H5"
Text="{TemplateBinding ResourceName}"
Theme="{DynamicResource TitleTextBlock}" />
<Border
Height="100"
HorizontalAlignment="Stretch"
Background="{TemplateBinding Background}"
CornerRadius="6" />
<Grid ColumnDefinitions="*, Auto" RowDefinitions="*, *, *, *, *, *, *">
<!-- Row 0-1-2 ResourceKey -->
<TextBlock
Grid.Column="0"
Grid.ColumnSpan="2"
Margin="4,8,0,0"
VerticalAlignment="Center"
Classes="Tertiary"
Text="ResourceKey" />
<SelectableTextBlock
Grid.Row="1"
Grid.Column="0"
VerticalAlignment="Center"
Text="{TemplateBinding ResourceKey}" />
<Button
Grid.Row="1"
Grid.Column="1"
Classes="Tertiary"
Command="{Binding $parent[controls:ColorDetailControl].Copy}"
CommandParameter="{x:Static controls:ColorDetailControl.KEY_ResourceKey}"
Theme="{DynamicResource BorderlessButton}">
<PathIcon
Width="12"
Height="12"
Data="{StaticResource CopyIcon}"
Foreground="{Binding $parent[Button].Foreground}" />
</Button>
<SelectableTextBlock
Grid.Row="2"
Grid.Column="0"
VerticalAlignment="Center"
IsVisible="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ColorResourceKey, Converter={x:Static ObjectConverters.IsNotNull}}"
Text="{TemplateBinding ColorResourceKey}" />
<Button
Grid.Row="2"
Grid.Column="1"
Classes="Tertiary"
Command="{Binding $parent[controls:ColorDetailControl].Copy}"
CommandParameter="{x:Static controls:ColorDetailControl.KEY_ColorResourceKey}"
IsVisible="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ColorResourceKey, Converter={x:Static ObjectConverters.IsNotNull}}"
Theme="{DynamicResource BorderlessButton}">
<PathIcon
Width="12"
Height="12"
Data="{StaticResource CopyIcon}"
Foreground="{Binding $parent[Button].Foreground}" />
</Button>
<!-- Row 3-4 HEX -->
<TextBlock
Grid.Row="3"
Grid.Column="0"
Grid.ColumnSpan="2"
Margin="4,8,0,0"
VerticalAlignment="Center"
Classes="Tertiary"
Text="ARGB" />
<SelectableTextBlock
Grid.Row="4"
Grid.Column="0"
VerticalAlignment="Center"
Text="{TemplateBinding Hex}" />
<Button
Grid.Row="4"
Grid.Column="1"
Classes="Tertiary"
Command="{Binding $parent[controls:ColorDetailControl].Copy}"
CommandParameter="{x:Static controls:ColorDetailControl.KEY_Hex}"
Theme="{DynamicResource BorderlessButton}">
<PathIcon
Width="12"
Height="12"
Data="{StaticResource CopyIcon}"
Foreground="{Binding $parent[Button].Foreground}" />
</Button>
<!-- Row 5-6 Opacity -->
<TextBlock
Grid.Row="5"
Grid.Column="0"
Grid.ColumnSpan="2"
Margin="4,8,0,0"
VerticalAlignment="Center"
Classes="Tertiary"
Text="Opacity" />
<SelectableTextBlock
Grid.Row="6"
Grid.Column="0"
VerticalAlignment="Center"
Text="{TemplateBinding OpacityNumber}" />
<Button
Grid.Row="6"
Grid.Column="1"
Classes="Tertiary"
Command="{Binding $parent[controls:ColorDetailControl].Copy}"
CommandParameter="{x:Static controls:ColorDetailControl.KEY_Opacity}"
Theme="{DynamicResource BorderlessButton}">
<PathIcon
Width="12"
Height="12"
Data="{StaticResource CopyIcon}"
Foreground="{Binding $parent[Button].Foreground}" />
</Button>
</Grid>
</StackPanel>
</ControlTemplate>
</Setter>
</ControlTheme>
</ResourceDictionary>
@@ -0,0 +1,107 @@
using System.Globalization;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Primitives;
using Avalonia.Input.Platform;
using Avalonia.Media;
using Avalonia.Media.Immutable;
namespace Semi.Avalonia.Demo.Controls;
public class ColorDetailControl: TemplatedControl
{
public const string KEY_ResourceKey = "ResourceKey";
public const string KEY_Hex = "Hex";
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 string? ResourceKey
{
get => GetValue(ResourceKeyProperty);
set => SetValue(ResourceKeyProperty, value);
}
public static readonly StyledProperty<string?> ResourceNameProperty = AvaloniaProperty.Register<ColorDetailControl, string?>(
nameof(ResourceName));
public string? ResourceName
{
get => GetValue(ResourceNameProperty);
set => SetValue(ResourceNameProperty, value);
}
public static readonly StyledProperty<string?> ColorResourceKeyProperty = AvaloniaProperty.Register<ColorDetailControl, string?>(
nameof(ColorResourceKey));
public string? ColorResourceKey
{
get => GetValue(ColorResourceKeyProperty);
set => SetValue(ColorResourceKeyProperty, value);
}
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? _opacityNumber;
public string? OpacityNumber
{
get => _opacityNumber;
private set => SetAndRaise(OpacityNumberProperty, ref _opacityNumber, value);
}
static ColorDetailControl()
{
BackgroundProperty.Changed.AddClassHandler<ColorDetailControl>((o, e) => o.OnBackgroundChanged(e));
}
private void OnBackgroundChanged(AvaloniaPropertyChangedEventArgs args)
{
var color = args.GetNewValue<IBrush>();
if (color is ISolidColorBrush b)
{
Hex = b.Color.ToString().ToUpperInvariant();
OpacityNumber = b.Opacity.ToString(CultureInfo.InvariantCulture);
}
}
public async void Copy(object o)
{
string? text = null;
if (o is string s)
{
switch (s)
{
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;
}
}
var toplevel = TopLevel.GetTopLevel(this);
if (toplevel?.Clipboard is { } c)
{
await c.SetTextAsync(text??string.Empty);
}
}
}
@@ -0,0 +1,48 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Semi.Avalonia.Demo.Controls"
xmlns:viewModels="clr-namespace:Semi.Avalonia.Demo.ViewModels"
x:CompileBindings="True"
x:DataType="viewModels:ColorItemViewModel">
<Design.PreviewWith>
<controls:ColorItemControl />
</Design.PreviewWith>
<ControlTheme x:Key="{x:Type controls:ColorItemControl}" TargetType="controls:ColorItemControl">
<Setter Property="controls:ColorItemControl.Width" Value="120" />
<Setter Property="controls:ColorItemControl.Height" Value="60" />
<Setter Property="controls:ColorItemControl.Cursor" Value="Hand" />
<Setter Property="controls:ColorItemControl.Template">
<ControlTemplate TargetType="controls:ColorItemControl">
<!-- -->
<Border
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
Background="{TemplateBinding Background}"
CornerRadius="{TemplateBinding CornerRadius}">
<Panel>
<TextBlock
Padding="8"
FontSize="12"
FontWeight="600"
Foreground="{TemplateBinding Foreground}"
Text="{TemplateBinding ColorName}" />
<TextBlock
Name="PART_HexTextBlock"
Padding="8"
VerticalAlignment="Bottom"
FontSize="10"
Foreground="{TemplateBinding Foreground}"
IsVisible="False"
Opacity="0.8"
Text="{TemplateBinding Hex}" />
</Panel>
</Border>
</ControlTemplate>
</Setter>
<Style Selector="^:pointerover /template/ TextBlock#PART_HexTextBlock">
<Setter Property="TextBlock.IsVisible" Value="True" />
</Style>
</ControlTheme>
</ResourceDictionary>
@@ -0,0 +1,39 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Primitives;
using Avalonia.Input;
using CommunityToolkit.Mvvm.Messaging;
using Semi.Avalonia.Demo.ViewModels;
namespace Semi.Avalonia.Demo.Controls;
public class ColorItemControl : TemplatedControl
{
public static readonly StyledProperty<string?> ColorNameProperty = AvaloniaProperty.Register<ColorItemControl, string?>(
nameof(ColorName));
public string? ColorName
{
get => GetValue(ColorNameProperty);
set => SetValue(ColorNameProperty, value);
}
public static readonly StyledProperty<string?> HexProperty = AvaloniaProperty.Register<ColorItemControl, string?>(
nameof(Hex));
public string? Hex
{
get => GetValue(HexProperty);
set => SetValue(HexProperty, value);
}
protected override void OnPointerPressed(PointerPressedEventArgs e)
{
base.OnPointerPressed(e);
if (this.DataContext is ColorItemViewModel v)
{
WeakReferenceMessenger.Default.Send(v);
}
}
}
@@ -0,0 +1,134 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Semi.Avalonia.Demo.Controls"
xmlns:viewModels="clr-namespace:Semi.Avalonia.Demo.ViewModels"
x:CompileBindings="True"
x:DataType="viewModels:FunctionalColorGroupViewModel">
<!-- Add Resources Here -->
<ControlTheme x:Key="{x:Type controls:FunctionalColorGroupControl}" TargetType="controls:FunctionalColorGroupControl">
<!-- Add Resources Here -->
<Setter Property="controls:FunctionalColorGroupControl.Template">
<ControlTemplate x:DataType="viewModels:FunctionalColorGroupViewModel" TargetType="controls:FunctionalColorGroupControl">
<Grid RowDefinitions="Auto, *">
<TextBlock
Grid.Row="0"
Margin="0,16,0,0"
Classes="H3"
Text="{TemplateBinding Title}"
Theme="{DynamicResource TitleTextBlock}" />
<TabControl Grid.Row="1">
<TabItem Header="Light">
<DataGrid IsReadOnly="True" ItemsSource="{TemplateBinding LightColors}">
<DataGrid.Columns>
<DataGridTemplateColumn Width="70" Header="Color">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="viewModels:ColorItemViewModel">
<controls:ColorItemControl
Width="40"
Height="20"
Background="{Binding Brush}"
CornerRadius="3" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="*" Header="ResourceKey">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="viewModels:ColorItemViewModel">
<SelectableTextBlock
Margin="12,0,12,0"
VerticalAlignment="Center"
Text="{Binding ResourceKey}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn
Width="*"
x:DataType="viewModels:ColorItemViewModel"
Binding="{Binding ColorDisplayName}"
CanUserSort="False"
Header="Name" />
<DataGridTemplateColumn Width="100" Header="Hex">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="viewModels:ColorItemViewModel">
<SelectableTextBlock
Margin="12,0,12,0"
VerticalAlignment="Center"
Text="{Binding Hex}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="80" Header="Opacity">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="viewModels:ColorItemViewModel">
<SelectableTextBlock
Margin="12,0,12,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Text="{Binding Brush.Opacity}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</TabItem>
<TabItem Header="Dark">
<DataGrid IsReadOnly="True" ItemsSource="{TemplateBinding DarkColors}">
<DataGrid.Columns>
<DataGridTemplateColumn Width="70" Header="Color">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="viewModels:ColorItemViewModel">
<controls:ColorItemControl
Width="40"
Height="20"
Background="{Binding Brush}"
CornerRadius="3" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="*" Header="ResourceKey">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="viewModels:ColorItemViewModel">
<SelectableTextBlock
Margin="12,0,12,0"
VerticalAlignment="Center"
Text="{Binding ResourceKey}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn
Width="*"
x:DataType="viewModels:ColorItemViewModel"
Binding="{Binding ColorDisplayName}"
CanUserSort="False"
Header="Name" />
<DataGridTemplateColumn Width="100" Header="Hex">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="viewModels:ColorItemViewModel">
<SelectableTextBlock
Margin="12,0,12,0"
VerticalAlignment="Center"
Text="{Binding Hex}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="80" Header="Opacity">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="viewModels:ColorItemViewModel">
<SelectableTextBlock
Margin="12,0,12,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Text="{Binding Brush.Opacity}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</TabItem>
</TabControl>
</Grid>
</ControlTemplate>
</Setter>
</ControlTheme>
</ResourceDictionary>
@@ -0,0 +1,36 @@
using System.Collections;
using Avalonia;
using Avalonia.Controls.Primitives;
namespace Semi.Avalonia.Demo.Controls;
public class FunctionalColorGroupControl: TemplatedControl
{
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);
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);
private IEnumerable? _darkColors;
public IEnumerable? DarkColors
{
get => _darkColors;
set => SetAndRaise(DarkColorsProperty, ref _darkColors, value);
}
}
@@ -7,35 +7,82 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
x:CompileBindings="False"
x:DataType="local:AutoCompleteBoxDemoViewModel"
mc:Ignorable="d"> mc:Ignorable="d">
<Design.DataContext> <Design.DataContext>
<local:AutoCompleteBoxDemoViewModel /> <local:AutoCompleteBoxDemoViewModel />
</Design.DataContext> </Design.DataContext>
<StackPanel <StackPanel HorizontalAlignment="Left" Spacing="20">
Margin="20"
HorizontalAlignment="Left"
Spacing="20">
<StackPanel.Styles> <StackPanel.Styles>
<Style Selector="AutoCompleteBox"> <Style Selector="AutoCompleteBox">
<Setter Property="Width" Value="300" /> <Setter Property="Width" Value="300" />
<Setter Property="ItemsSource">
<Binding Path="States" />
</Setter>
<Setter Property="ItemTemplate">
<DataTemplate DataType="local:StateData">
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</Setter>
</Style> </Style>
</StackPanel.Styles> </StackPanel.Styles>
<AutoCompleteBox Items="{Binding States}" ValueMemberBinding="{Binding Name, x:DataType=local:StateData}">
<AutoCompleteBox.ItemTemplate>
<DataTemplate DataType="local:StateData">
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</AutoCompleteBox.ItemTemplate>
</AutoCompleteBox>
<AutoCompleteBox <AutoCompleteBox
Items="{Binding States}" Watermark="Please select a State"
Theme="{StaticResource BorderlessAutoCompleteBox}" ValueMemberBinding="{Binding Name}" />
ValueMemberBinding="{Binding Name, x:DataType=local:StateData}"> <AutoCompleteBox
<AutoCompleteBox.ItemTemplate> Classes="Large"
<DataTemplate DataType="local:StateData"> ValueMemberBinding="{ReflectionBinding Name}" />
<TextBlock Text="{Binding Name}" /> <AutoCompleteBox
</DataTemplate> Classes="Small"
</AutoCompleteBox.ItemTemplate> ValueMemberBinding="{ReflectionBinding Name}" />
</AutoCompleteBox> <AutoCompleteBox
Classes="Bordered"
ValueMemberBinding="{ReflectionBinding Name}" />
<AutoCompleteBox
IsEnabled="False"
Watermark="Disabled"
ValueMemberBinding="{ReflectionBinding Name}" />
<AutoCompleteBox
InnerLeftContent="https://"
InnerRightContent=".com"
ValueMemberBinding="{ReflectionBinding Name}" />
<StackPanel Orientation="Horizontal">
<AutoCompleteBox
Width="100"
Classes="Large"
Watermark="Large"
ValueMemberBinding="{ReflectionBinding Name}" />
<AutoCompleteBox
Width="100"
Watermark="Default"
ValueMemberBinding="{ReflectionBinding Name}" />
<AutoCompleteBox
Width="100"
Classes="Small"
Watermark="Small"
ValueMemberBinding="{ReflectionBinding Name}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<AutoCompleteBox
Width="100"
IsEnabled="False"
Watermark="Disabled"
ValueMemberBinding="{ReflectionBinding Name}" />
<AutoCompleteBox
Width="100"
Classes="Bordered"
Watermark="Bordered"
ValueMemberBinding="{ReflectionBinding Name}" />
<AutoCompleteBox
Width="100"
Classes="Bordered"
IsEnabled="False"
ValueMemberBinding="{ReflectionBinding Name}" />
</StackPanel>
</StackPanel> </StackPanel>
</UserControl> </UserControl>
@@ -1,9 +1,13 @@
<UserControl <UserControl
x:Class="Semi.Avalonia.Demo.Pages.BorderDemo" xmlns="https://github.com/avaloniaui" x:Class="Semi.Avalonia.Demo.Pages.BorderDemo"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns="https://github.com/avaloniaui"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="450" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
d:DesignWidth="800" mc:Ignorable="d"> xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
<StackPanel Margin="20" Spacing="20"> xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<StackPanel Spacing="20">
<Border Theme="{StaticResource CardBorder}"> <Border Theme="{StaticResource CardBorder}">
<TextBlock>Card</TextBlock> <TextBlock>Card</TextBlock>
</Border> </Border>
+142 -106
View File
@@ -4,112 +4,148 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">
<StackPanel <ScrollViewer>
Margin="20" <StackPanel HorizontalAlignment="Left" Spacing="20">
HorizontalAlignment="Left" <StackPanel.Styles>
Spacing="20"> <Style Selector="SplitButton">
<TextBlock>Light (Default)</TextBlock> <Setter Property="Flyout">
<StackPanel Orientation="Horizontal" Spacing="20"> <MenuFlyout Placement="BottomEdgeAlignedRight">
<Button Classes="Primary">Primary</Button> <MenuItem Header="Submit All" />
<Button Classes="Secondary">Secondary</Button> <MenuItem Header="Submit Updated" />
<Button Classes="Tertiary">Tertiary</Button> </MenuFlyout>
<Button Classes="Warning">Warning</Button> </Setter>
<Button Classes="Danger">Danger</Button> </Style>
<Button Classes="Primary" IsEnabled="False">Danger</Button> <Style Selector="DropDownButton">
<Setter Property="Flyout">
<MenuFlyout Placement="BottomEdgeAlignedRight">
<MenuItem Header="Submit All" />
<MenuItem Header="Submit Updated" />
</MenuFlyout>
</Setter>
</Style>
<Style Selector="ToggleSplitButton">
<Setter Property="Flyout">
<MenuFlyout Placement="BottomEdgeAlignedRight">
<MenuItem Header="Submit All" />
<MenuItem Header="Submit Updated" />
</MenuFlyout>
</Setter>
</Style>
</StackPanel.Styles>
<TextBlock>Light (Default)</TextBlock>
<StackPanel Orientation="Horizontal" Spacing="20">
<Button Classes="Primary">Primary</Button>
<Button Classes="Secondary">Secondary</Button>
<Button Classes="Tertiary">Tertiary</Button>
<Button Classes="Success">Success</Button>
<Button Classes="Warning">Warning</Button>
<Button Classes="Danger">Danger</Button>
<Button Classes="Danger" IsEnabled="False">Disabled</Button>
</StackPanel>
<StackPanel Orientation="Horizontal" Spacing="20">
<Button Classes="Primary Small">Small</Button>
<Button Classes="Primary">Default</Button>
<Button Classes="Primary Large">Large</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>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>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="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="Borderless" Theme="{DynamicResource BorderlessDropDownButton}" Classes="Success" IsEnabled="False"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Spacing="8">
<DropDownButton Classes="Small" Content="Small" />
<DropDownButton Content="Default" />
<DropDownButton Classes="Large" Content="Large" />
</StackPanel>
<TextBlock>SplitButton</TextBlock>
<StackPanel Orientation="Horizontal" Spacing="8">
<SplitButton Content="Primary" />
<SplitButton Classes="Secondary" Content="Secondary" />
<SplitButton Classes="Tertiary" Content="Tertiary" />
<SplitButton Classes="Success" Content="Success" />
<SplitButton Classes="Warning" Content="Warning" />
<SplitButton Classes="Danger" Content="Danger" />
<SplitButton Classes="Danger" Content="Disabled" IsEnabled="False" />
</StackPanel>
<StackPanel Orientation="Horizontal" Spacing="8">
<SplitButton Content="Default" Classes="Success" />
<SplitButton Theme="{DynamicResource SolidSplitButton}" Content="Solid" Classes="Success" />
<SplitButton Theme="{DynamicResource BorderlessSplitButton}" Content="Borderless" Classes="Success" />
<SplitButton Content="Default" Classes="Success" IsEnabled="False" />
<SplitButton Theme="{DynamicResource SolidSplitButton}" Content="Solid" Classes="Success" IsEnabled="False" />
<SplitButton Theme="{DynamicResource BorderlessSplitButton}" Content="Borderless" Classes="Success" IsEnabled="False" />
</StackPanel>
<StackPanel Orientation="Horizontal" Spacing="8">
<SplitButton Classes="Small" Content="Small" />
<SplitButton Content="Default" />
<SplitButton Classes="Large" Content="Large" />
</StackPanel>
<TextBlock>ToggleSplitButton</TextBlock>
<StackPanel Orientation="Horizontal" Spacing="8">
<ToggleSplitButton Content="Primary" />
<ToggleSplitButton Classes="Secondary" Content="Secondary" />
<ToggleSplitButton Classes="Tertiary" Content="Tertiary" />
<ToggleSplitButton Classes="Success" Content="Success" />
<ToggleSplitButton Classes="Warning" Content="Warning" />
<ToggleSplitButton Classes="Danger" Content="Danger" />
<ToggleSplitButton Classes="Danger" Content="Disabled" IsEnabled="False" />
</StackPanel>
<StackPanel Orientation="Horizontal" Spacing="8">
<ToggleSplitButton Classes="Small" Content="Small" />
<ToggleSplitButton Content="Default" />
<ToggleSplitButton Classes="Large" Content="Large" />
</StackPanel>
</StackPanel> </StackPanel>
<TextBlock>Solid</TextBlock> </ScrollViewer>
<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="Warning" Theme="{DynamicResource SolidButton}">Warning</Button>
<Button Classes="Danger" Theme="{DynamicResource SolidButton}">Danger</Button>
<Button
Classes="Primary"
IsEnabled="False"
Theme="{DynamicResource SolidButton}">
Danger
</Button>
</StackPanel>
<TextBlock>Borderless</TextBlock>
<StackPanel Orientation="Horizontal" Spacing="20">
<Button Classes="Primary" Theme="{DynamicResource BorderlessButton}">Primary</Button>
<Button Classes="Secondary" Theme="{DynamicResource BorderlessButton}">Secondary</Button>
<Button Classes="Tertiary" Theme="{DynamicResource BorderlessButton}">Tertiary</Button>
<Button Classes="Warning" Theme="{DynamicResource BorderlessButton}">Warning</Button>
<Button Classes="Danger" Theme="{DynamicResource BorderlessButton}">Danger</Button>
<Button
Classes="Primary"
IsEnabled="False"
Theme="{DynamicResource BorderlessButton}">
Danger
</Button>
</StackPanel>
<TextBlock>DropdownButton</TextBlock>
<StackPanel Orientation="Horizontal">
<DropDownButton Content="Submit">
<DropDownButton.Flyout>
<MenuFlyout Placement="BottomEdgeAlignedRight">
<MenuItem Header="Submit All" />
<MenuItem Header="Submit Updated" />
</MenuFlyout>
</DropDownButton.Flyout>
</DropDownButton>
<DropDownButton Content="Submit" Theme="{DynamicResource SolidDropdownButton}">
<DropDownButton.Flyout>
<MenuFlyout Placement="BottomEdgeAlignedRight">
<MenuItem Header="Submit All" />
<MenuItem Header="Submit Updated" />
</MenuFlyout>
</DropDownButton.Flyout>
</DropDownButton>
<DropDownButton Content="Submit" Theme="{DynamicResource BorderlessDropdownButton}">
<DropDownButton.Flyout>
<MenuFlyout Placement="BottomEdgeAlignedRight">
<MenuItem Header="Submit All" />
<MenuItem Header="Submit Updated" />
</MenuFlyout>
</DropDownButton.Flyout>
</DropDownButton>
</StackPanel>
<StackPanel Orientation="Horizontal">
<SplitButton Content="Submit">
<SplitButton.Flyout>
<MenuFlyout Placement="BottomEdgeAlignedRight">
<MenuItem Header="Submit All" />
<MenuItem Header="Submit Updated" />
</MenuFlyout>
</SplitButton.Flyout>
</SplitButton>
<SplitButton Classes="Secondary" Content="Submit" />
<SplitButton Classes="Tertiary" Content="Submit" />
<SplitButton Classes="Warning" Content="Submit" />
<SplitButton Classes="Danger" Content="Submit" />
<SplitButton
Classes="Danger"
Content="Submit"
IsEnabled="False" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<ToggleSplitButton Content="Submit">
<ToggleSplitButton.Flyout>
<MenuFlyout Placement="BottomEdgeAlignedRight">
<MenuItem Header="Submit All" />
<MenuItem Header="Submit Updated" />
</MenuFlyout>
</ToggleSplitButton.Flyout>
</ToggleSplitButton>
<ToggleSplitButton Classes="Secondary" Content="Submit" />
<ToggleSplitButton Classes="Tertiary" Content="Submit" />
<ToggleSplitButton Classes="Warning" Content="Submit" />
<ToggleSplitButton Classes="Danger" Content="Submit" />
<ToggleSplitButton
Classes="Danger"
Content="Submit"
IsEnabled="False" />
</StackPanel>
</StackPanel>
</UserControl> </UserControl>
@@ -7,10 +7,7 @@
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">
<StackPanel <StackPanel HorizontalAlignment="Left" Spacing="20">
Margin="20"
HorizontalAlignment="Left"
Spacing="20">
<ButtonSpinner <ButtonSpinner
Height="30" Height="30"
AllowSpin="{Binding #allowSpinCheck.IsChecked}" AllowSpin="{Binding #allowSpinCheck.IsChecked}"
@@ -20,8 +17,7 @@
<TextBlock <TextBlock
HorizontalAlignment="Center" HorizontalAlignment="Center"
VerticalAlignment="Center" VerticalAlignment="Center"
Background="Gray" Text="A.S.I.A" />
Text="Everest" />
</ButtonSpinner> </ButtonSpinner>
<ButtonSpinner <ButtonSpinner
Height="30" Height="30"
@@ -33,8 +29,7 @@
<TextBlock <TextBlock
HorizontalAlignment="Center" HorizontalAlignment="Center"
VerticalAlignment="Center" VerticalAlignment="Center"
Background="Gray" Text="A.S.I.A" />
Text="Everest" />
</ButtonSpinner> </ButtonSpinner>
</StackPanel> </StackPanel>
</UserControl> </UserControl>
@@ -36,15 +36,20 @@ public partial class ButtonSpinnerDemo : UserControl
private readonly string[] _mountains = new[] private readonly string[] _mountains = new[]
{ {
"Everest", "A.S.I.A",
"K2 (Mount Godwin Austen)", "饕餮人间",
"Kangchenjunga", "七步咙咚呛",
"Lhotse", "大惊小怪",
"Makalu", "The ONE",
"Cho Oyu", "以梦为马 (壮志骄阳版)",
"Dhaulagiri", "emo了",
"Manaslu", "一眼万年",
"Nanga Parbat", "冲刺吧",
"Annapurna" "爱的赏味期限",
"COSMIC ANTHEM / 手紙",
"世界晚安",
"明年也要好好长大",
"320万年前",
"W.O.R.L.D.",
}; };
} }
@@ -7,8 +7,23 @@
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">
<StackPanel Margin="20" Spacing="20"> <StackPanel HorizontalAlignment="Left" Spacing="20">
<CalendarDatePicker /> <StackPanel Orientation="Horizontal">
<CalendarDatePicker Classes="Large" />
<CalendarDatePicker />
<CalendarDatePicker Classes="Small" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<CalendarDatePicker IsEnabled="False" />
<CalendarDatePicker Classes="Bordered" />
<CalendarDatePicker Classes="Bordered" IsEnabled="False" />
</StackPanel>
<CalendarDatePicker Width="500" />
<CalendarDatePicker Classes="ClearButton" Width="200" />
<CalendarDatePicker <CalendarDatePicker
Name="DatePicker2" Name="DatePicker2"
Margin="0,0,0,8" Margin="0,0,0,8"
@@ -19,7 +34,5 @@
CustomDateFormatString="ddd, MMM d" CustomDateFormatString="ddd, MMM d"
SelectedDateFormat="Custom" /> SelectedDateFormat="Custom" />
<CalendarDatePicker Margin="0,0,0,8" Watermark="Watermark" /> <CalendarDatePicker Margin="0,0,0,8" Watermark="Watermark" />
<CalendarDatePicker IsEnabled="False" />
</StackPanel> </StackPanel>
</UserControl> </UserControl>
@@ -10,9 +10,4 @@ public partial class CalendarDatePickerDemo : UserControl
{ {
InitializeComponent(); InitializeComponent();
} }
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
} }
@@ -7,7 +7,7 @@
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">
<StackPanel Margin="20" Spacing="20"> <StackPanel HorizontalAlignment="Left" Spacing="20">
<Calendar /> <Calendar />
<Calendar SelectionMode="SingleRange" /> <Calendar SelectionMode="SingleRange" />
</StackPanel> </StackPanel>
@@ -7,31 +7,67 @@
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">
<UserControl.Styles>
<Style Selector="Border">
<Setter Property="Height" Value="200" />
</Style>
<Style Selector="TextBlock">
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Foreground" Value="#1C1F23" />
</Style>
</UserControl.Styles>
<StackPanel Spacing="20"> <StackPanel Spacing="20">
<TextBlock Classes="Strong" Text="This is still WIP" /> <Carousel Theme="{DynamicResource FullCarousel}">
<Grid <Carousel.PageTransition>
HorizontalAlignment="Stretch" <PageSlide Orientation="Horizontal" Duration="0.25" />
VerticalAlignment="Top" </Carousel.PageTransition>
ColumnDefinitions="Auto, *, Auto"> <Border Background="#EAF5FF">
<RepeatButton
Name="Previous"
Grid.Column="0"
Content="Previous" />
<Carousel Name="carousel" Grid.Column="1">
<Carousel.PageTransition>
<PageSlide Orientation="Horizontal" Duration="0.25" />
</Carousel.PageTransition>
<TextBlock Text="Text 1" /> <TextBlock Text="Text 1" />
</Border>
<Border Background="#F9F9F9">
<TextBlock Text="Text 2" /> <TextBlock Text="Text 2" />
</Border>
<Border Background="#FFF8EA">
<TextBlock Text="Text 3" /> <TextBlock Text="Text 3" />
</Border>
<Border Background="#FEF2ED">
<TextBlock Text="Text 4" /> <TextBlock Text="Text 4" />
</Carousel> </Border>
<RepeatButton </Carousel>
Name="Next" <Carousel Classes="Line" Theme="{DynamicResource FullCarousel}">
Grid.Column="2" <Carousel.PageTransition>
Content="Next" /> <PageSlide Orientation="Horizontal" Duration="0.25" />
</Grid> </Carousel.PageTransition>
<Border Background="#EAF5FF">
<TextBlock Text="{Binding #carousel.SelectedIndex}" /> <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>
<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>
@@ -10,17 +10,5 @@ public partial class CarouselDemo : UserControl
public CarouselDemo() public CarouselDemo()
{ {
InitializeComponent(); InitializeComponent();
Previous.Click += OnPreviousClick;
Next.Click += OnNextClick;
}
private void OnPreviousClick(object sender, RoutedEventArgs args)
{
carousel.Previous();
}
private void OnNextClick(object sender, RoutedEventArgs args)
{
carousel.Next();
} }
} }
+116 -14
View File
@@ -7,18 +7,120 @@
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">
<StackPanel Margin="48" HorizontalAlignment="Left"> <ScrollViewer HorizontalScrollBarVisibility="Auto">
<CheckBox>Unchecked</CheckBox> <StackPanel HorizontalAlignment="Left" Spacing="20">
<CheckBox IsEnabled="False">Unchecked</CheckBox> <TextBlock Text="CheckBox" />
<CheckBox IsChecked="True">Checked</CheckBox> <StackPanel Orientation="Horizontal">
<CheckBox IsChecked="True" IsEnabled="False">Checked</CheckBox> <CheckBox>Unchecked</CheckBox>
<CheckBox IsChecked="{x:Null}" IsThreeState="True">Indeterminate</CheckBox> <CheckBox IsChecked="True">Checked</CheckBox>
<CheckBox <CheckBox IsChecked="{x:Null}" IsThreeState="True">Indeterminate</CheckBox>
IsChecked="{x:Null}" </StackPanel>
IsEnabled="False" <StackPanel Orientation="Horizontal">
IsThreeState="True"> <CheckBox IsEnabled="False">Unchecked</CheckBox>
Indeterminate <CheckBox IsChecked="True" IsEnabled="False">Checked</CheckBox>
</CheckBox> <CheckBox
<CheckBox Width="120">Checkbox should wrap its text</CheckBox> IsChecked="{x:Null}"
</StackPanel> IsEnabled="False"
IsThreeState="True">
Indeterminate
</CheckBox>
</StackPanel>
<CheckBox Width="120" HorizontalAlignment="Left">Checkbox should wrap its text</CheckBox>
<TextBlock Text="SimpleCheckBox" />
<StackPanel Orientation="Horizontal">
<CheckBox Theme="{StaticResource SimpleCheckBox}" />
<CheckBox IsChecked="True" Theme="{StaticResource SimpleCheckBox}" />
<CheckBox
IsChecked="{x:Null}"
IsThreeState="True"
Theme="{StaticResource SimpleCheckBox}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<CheckBox IsEnabled="False" Theme="{StaticResource SimpleCheckBox}" />
<CheckBox
IsChecked="True"
IsEnabled="False"
Theme="{StaticResource SimpleCheckBox}" />
<CheckBox
IsChecked="{x:Null}"
IsEnabled="False"
IsThreeState="True"
Theme="{StaticResource SimpleCheckBox}" />
</StackPanel>
<TextBlock Text="CardCheckBox" />
<StackPanel Orientation="Horizontal">
<StackPanel.Styles>
<Style Selector="CheckBox">
<Setter Property="Width" Value="150" />
<Setter Property="Margin" Value="8" />
</Style>
</StackPanel.Styles>
<CheckBox
Content="Windows"
IsChecked="True"
Theme="{DynamicResource CardCheckBox}" />
<CheckBox
Content="macOS"
IsChecked="True"
IsEnabled="False"
Theme="{DynamicResource CardCheckBox}" />
<CheckBox
Content="Linux"
IsChecked="True"
Theme="{DynamicResource CardCheckBox}" />
<CheckBox
Content="iOS"
IsChecked="{x:Null}"
IsThreeState="True"
Theme="{DynamicResource CardCheckBox}" />
<CheckBox
Content="Android"
IsChecked="{x:Null}"
IsThreeState="True"
Theme="{DynamicResource CardCheckBox}" />
<CheckBox
Content="Wasm"
IsChecked="False"
IsThreeState="True"
Theme="{DynamicResource CardCheckBox}" />
</StackPanel>
<TextBlock Text="PureCardCheckBox" />
<StackPanel Orientation="Horizontal">
<StackPanel.Styles>
<Style Selector="CheckBox">
<Setter Property="Width" Value="150" />
<Setter Property="Margin" Value="8" />
</Style>
</StackPanel.Styles>
<CheckBox
Content="Windows"
IsChecked="True"
Theme="{DynamicResource PureCardCheckBox}" />
<CheckBox
Content="macOS"
IsChecked="True"
IsEnabled="False"
Theme="{DynamicResource PureCardCheckBox}" />
<CheckBox
Content="Linux"
IsChecked="True"
Theme="{DynamicResource PureCardCheckBox}" />
<CheckBox
Content="iOS"
IsChecked="{x:Null}"
IsThreeState="True"
Theme="{DynamicResource PureCardCheckBox}" />
<CheckBox
Content="Android"
IsChecked="{x:Null}"
IsThreeState="True"
Theme="{DynamicResource PureCardCheckBox}" />
<CheckBox
Content="Wasm"
IsChecked="False"
IsThreeState="True"
Theme="{DynamicResource PureCardCheckBox}" />
</StackPanel>
</StackPanel>
</ScrollViewer>
</UserControl> </UserControl>
@@ -0,0 +1,40 @@
<UserControl
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:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<StackPanel Spacing="20">
<StackPanel
VerticalAlignment="Top"
Orientation="Horizontal"
Spacing="20">
<ColorView ColorSpectrumShape="Ring" />
<ColorView ColorSpectrumShape="Box" />
<ColorView Palette="{DynamicResource SemiColorPalette}" />
</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>
@@ -0,0 +1,13 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages;
public partial class ColorPickerDemo : UserControl
{
public ColorPickerDemo()
{
InitializeComponent();
}
}
@@ -4,24 +4,40 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450" xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
d:DesignHeight="800"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">
<StackPanel Margin="20" Spacing="20"> <Design.DataContext>
<ComboBox Width="150"> <pages:ComboBoxDemoViewModel />
<TextBlock>AAA</TextBlock> </Design.DataContext>
<TextBlock>BBB</TextBlock> <StackPanel Spacing="20">
<TextBlock>CCC</TextBlock> <StackPanel.Styles>
</ComboBox> <Style Selector="ComboBox">
<ComboBox Width="150" PlaceholderText="Please Select"> <Setter Property="Width" Value="300" />
<TextBlock>AAA</TextBlock> <Setter Property="ItemsSource" Value="{Binding Items}" />
<TextBlock>BBB</TextBlock> </Style>
<TextBlock>CCC</TextBlock> </StackPanel.Styles>
</ComboBox>
<ComboBox Width="150" IsEnabled="False"> <ComboBox />
<TextBlock>AAA</TextBlock> <ComboBox Classes="ClearButton" />
<TextBlock>BBB</TextBlock> <ComboBox PlaceholderText="Please Select" />
<TextBlock>CCC</TextBlock> <ComboBox IsEnabled="False" />
</ComboBox> <ComboBox Classes="Large" IsEnabled="False" />
<ComboBox Classes="Small" />
<ComboBox Classes="Bordered" />
<ComboBox Classes="Bordered" IsEnabled="False" />
<StackPanel Orientation="Horizontal">
<ComboBox Width="100" Classes="Large" PlaceholderText="Large" />
<ComboBox Width="100" PlaceholderText="Default" />
<ComboBox Width="100" Classes="Small" PlaceholderText="Small" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<ComboBox Width="100" IsEnabled="False" PlaceholderText="Disabled" />
<ComboBox Width="100" Classes="Bordered" PlaceholderText="Bordered" />
<ComboBox Width="100" Classes="Bordered" IsEnabled="False" />
</StackPanel>
</StackPanel> </StackPanel>
</UserControl> </UserControl>
@@ -1,6 +1,6 @@
using Avalonia; using System.Collections.ObjectModel;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml; using CommunityToolkit.Mvvm.ComponentModel;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;
@@ -9,10 +9,11 @@ public partial class ComboBoxDemo : UserControl
public ComboBoxDemo() public ComboBoxDemo()
{ {
InitializeComponent(); InitializeComponent();
} this.DataContext = new ComboBoxDemoViewModel();
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
} }
} }
public class ComboBoxDemoViewModel : ObservableObject
{
public ObservableCollection<string> Items { get; set; } = ["Ding", "Otter", "Husky", "Mr.17", "Cass"];
}
@@ -0,0 +1,175 @@
<UserControl
x:Class="Semi.Avalonia.Demo.Pages.DataGridDemo"
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>
</DataGrid>
</Grid>
</TabItem>
<TabItem Header="Grouping">
<DataGrid
Margin="8"
CanUserReorderColumns="True"
CanUserResizeColumns="True"
CanUserSortColumns="True"
HeadersVisibility="All"
IsReadOnly="True"
ItemsSource="{Binding GridData2}">
<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
x:DataType="vm:Song"
Header="Duration"
SortMemberPath="Duration">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate x:DataType="vm:Song">
<TextBlock
Margin="8,0,0,0"
VerticalAlignment="Center"
Text="{Binding Duration}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</TabItem>
<TabItem x:Name="EditableTab" Header="Editable">
<Grid Margin="8" RowDefinitions="Auto,*,Auto">
<StackPanel
Grid.Row="0"
Orientation="Horizontal"
Spacing="4">
<TextBlock VerticalAlignment="Center" Text="FontSize:" />
<Slider
x:Name="FontSizeSlider"
Width="100"
VerticalAlignment="Center"
Maximum="30"
Minimum="5"
Value="14" />
<CheckBox
x:Name="IsThreeStateCheckBox"
Content="IsThreeState"
IsChecked="False" />
</StackPanel>
<DataGrid
Grid.Row="1"
Margin="8"
ItemsSource="{Binding GridData3}">
<DataGrid.Columns>
<DataGridCheckBoxColumn
Width="2*"
Binding="{Binding IsSelected}"
Header="Select"
IsThreeState="{Binding #IsThreeStateCheckBox.IsChecked, Mode=OneWay}" />
<DataGridTextColumn
Width="6*"
x:DataType="vm:SongViewModel"
Binding="{Binding Title}"
FontSize="{Binding #FontSizeSlider.Value, Mode=OneWay}"
Header="Title" />
<DataGridTextColumn
Width="6*"
x:DataType="vm:SongViewModel"
Binding="{Binding Artist}"
Header="Artist" />
<DataGridTextColumn
Width="6*"
x:DataType="vm:SongViewModel"
Binding="{Binding Album}"
Header="Album" />
<DataGridTemplateColumn Width="2*" Header="Comments">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="{Binding CountOfComment}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<NumericUpDown
HorizontalAlignment="Stretch"
FormatString="N0"
Minimum="0"
Value="{Binding CountOfComment}" />
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
<Button
Grid.Row="2"
Margin="12,0,12,12"
HorizontalAlignment="Right"
Command="{Binding AddCommand}"
Content="Add" />
</Grid>
</TabItem>
</TabControl>
</UserControl>
@@ -0,0 +1,27 @@
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;
public partial class DataGridDemo : UserControl
{
public DataGridDemo()
{
InitializeComponent();
DataContext = new DataGridDemoViewModel();
}
}
@@ -0,0 +1,83 @@
<UserControl
x:Class="Semi.Avalonia.Demo.Pages.DataValidationErrorsDemo"
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:system="clr-namespace:System;assembly=netstandard"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<ScrollViewer>
<StackPanel HorizontalAlignment="Left" Spacing="20">
<AutoCompleteBox Width="300">
<DataValidationErrors.Error>
<system:Exception />
</DataValidationErrors.Error>
</AutoCompleteBox>
<AutoCompleteBox Width="300" Classes="Large">
<DataValidationErrors.Error>
<system:Exception />
</DataValidationErrors.Error>
</AutoCompleteBox>
<AutoCompleteBox Width="300" Classes="Small">
<DataValidationErrors.Error>
<system:Exception />
</DataValidationErrors.Error>
</AutoCompleteBox>
<CalendarDatePicker Width="300">
<DataValidationErrors.Error>
<system:Exception />
</DataValidationErrors.Error>
</CalendarDatePicker>
<ComboBox Width="300">
<ComboBoxItem>AAA</ComboBoxItem>
<ComboBoxItem>BBB</ComboBoxItem>
<DataValidationErrors.Error>
<system:Exception />
</DataValidationErrors.Error>
</ComboBox>
<DatePicker Width="300">
<DataValidationErrors.Error>
<system:Exception />
</DataValidationErrors.Error>
</DatePicker>
<NumericUpDown Width="300">
<DataValidationErrors.Error>
<system:Exception />
</DataValidationErrors.Error>
</NumericUpDown>
<Slider Width="300">
<DataValidationErrors.Error>
<system:Exception />
</DataValidationErrors.Error>
</Slider>
<TimePicker Width="300">
<DataValidationErrors.Error>
<system:Exception />
</DataValidationErrors.Error>
</TimePicker>
<TextBox
Width="300"
InnerLeftContent="http://"
InnerRightContent=".com">
<DataValidationErrors.Error>
<system:Exception />
</DataValidationErrors.Error>
</TextBox>
<TextBox
Width="300"
InnerLeftContent="http://"
InnerRightContent=".com">
<TextBox.Styles>
<Style Selector="TextBox /template/ DataValidationErrors">
<Setter Property="Theme" Value="{DynamicResource TooltipDataValidationErrors}" />
</Style>
</TextBox.Styles>
<DataValidationErrors.Error>
<system:Exception />
</DataValidationErrors.Error>
</TextBox>
</StackPanel>
</ScrollViewer>
</UserControl>
@@ -0,0 +1,18 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages;
public partial class DataValidationErrorsDemo : UserControl
{
public DataValidationErrorsDemo()
{
InitializeComponent();
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
}
@@ -7,9 +7,23 @@
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">
<StackPanel Margin="20" Spacing="20"> <StackPanel Spacing="20">
<DatePicker /> <DatePicker />
<DatePicker Classes="ClearButton" />
<DatePicker DayFormat="d (ddd)" YearVisible="False" /> <DatePicker DayFormat="d (ddd)" YearVisible="False" />
<DatePicker IsEnabled="False" /> <DatePicker IsEnabled="False" />
<DatePicker Classes="Large" />
<DatePicker Classes="Small" />
<StackPanel Orientation="Horizontal">
<DatePicker Classes="Large" />
<DatePicker />
<DatePicker Classes="Small" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<DatePicker IsEnabled="False" />
<DatePicker Classes="Bordered" />
<DatePicker Classes="Bordered" IsEnabled="False" />
</StackPanel>
</StackPanel> </StackPanel>
</UserControl> </UserControl>
@@ -1,6 +1,7 @@
using Avalonia; using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml; using Avalonia.Markup.Xaml;
using Avalonia.Media;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;
@@ -15,4 +16,9 @@ public partial class DatePickerDemo : UserControl
{ {
AvaloniaXamlLoader.Load(this); AvaloniaXamlLoader.Load(this);
} }
public override void Render(DrawingContext context)
{
base.Render(context);
}
} }
@@ -1,9 +1,13 @@
<UserControl <UserControl
x:Class="Semi.Avalonia.Demo.Pages.ExpanderDemo" xmlns="https://github.com/avaloniaui" x:Class="Semi.Avalonia.Demo.Pages.ExpanderDemo"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns="https://github.com/avaloniaui"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="450" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
d:DesignWidth="800" mc:Ignorable="d"> xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
<StackPanel Margin="20" Spacing="20"> xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<StackPanel Spacing="20">
<StackPanel> <StackPanel>
<Expander Header="Expander 1"> <Expander Header="Expander 1">
<TextBlock Text="Hello Avalonia!" /> <TextBlock Text="Hello Avalonia!" />
@@ -15,15 +19,18 @@
<Button Content="Hello Avalonia World!" /> <Button Content="Hello Avalonia World!" />
</Expander> </Expander>
</StackPanel> </StackPanel>
<Grid ColumnDefinitions="* *"> <Grid ColumnDefinitions="*, *">
<Expander <Expander
Height="200" ExpandDirection="Right" Height="200"
ExpandDirection="Right"
Header="Right"> Header="Right">
<TextBlock>Right Content</TextBlock> <TextBlock>Right Content</TextBlock>
</Expander> </Expander>
<Expander <Expander
Grid.Column="1" Height="200" Grid.Column="1"
HorizontalAlignment="Right" ExpandDirection="Left" Height="200"
HorizontalAlignment="Right"
ExpandDirection="Left"
Header="Left"> Header="Left">
<TextBlock>Left Content</TextBlock> <TextBlock>Left Content</TextBlock>
</Expander> </Expander>
+41 -2
View File
@@ -10,13 +10,14 @@
<UserControl.Styles> <UserControl.Styles>
<Style Selector="Button"> <Style Selector="Button">
<Setter Property="Margin" Value="8" /> <Setter Property="Margin" Value="8" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
</Style> </Style>
</UserControl.Styles> </UserControl.Styles>
<Grid <Grid
HorizontalAlignment="Center" HorizontalAlignment="Center"
VerticalAlignment="Center" VerticalAlignment="Center"
ColumnDefinitions="* * * * *" ColumnDefinitions="*, *, *, *, *"
RowDefinitions="* * * * *"> RowDefinitions="*, *, *, *, *, *">
<Button <Button
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
@@ -113,6 +114,44 @@
<Flyout Content="BottomEdgeAlignedRight" Placement="BottomEdgeAlignedRight" /> <Flyout Content="BottomEdgeAlignedRight" Placement="BottomEdgeAlignedRight" />
</Button.Flyout> </Button.Flyout>
</Button> </Button>
<Button
Grid.Row="2"
Grid.Column="2"
Content="Center">
<Button.Flyout>
<Flyout Content="Center" Placement="Center" />
</Button.Flyout>
</Button>
<Button
Grid.Row="5"
Grid.Column="2" Content="LightFlyout">
<Button.Flyout>
<Flyout FlyoutPresenterTheme="{StaticResource LightFlyout}" Placement="Top">
<StackPanel>
<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>
</Flyout>
</Button.Flyout>
</Button>
</Grid> </Grid>
</UserControl> </UserControl>
@@ -0,0 +1,39 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Semi.Avalonia.Demo.Pages.HeaderedContentControlDemo">
<ScrollViewer>
<StackPanel HorizontalAlignment="Left" Spacing="20">
<TextBlock>Default Theme</TextBlock>
<WrapPanel ItemWidth="400">
<HeaderedContentControl
Header="This is the text header!"
BorderBrush="Gray"
BorderThickness="1"
CornerRadius="4">
<TextBlock Text="Some content" />
</HeaderedContentControl>
<HeaderedContentControl Header="This is the image header!">
<Image Source="/Assets/WORLD.png" />
</HeaderedContentControl>
<HeaderedContentControl>
<HeaderedContentControl.Header>
<Image Source="/Assets/WORLD.png" />
</HeaderedContentControl.Header>
<TextBlock Text="This is the content. But the header can also be non textual" />
</HeaderedContentControl>
</WrapPanel>
<TextBlock>GroupBox Theme</TextBlock>
<HeaderedContentControl
HorizontalAlignment="Left"
Theme="{DynamicResource GroupBox}"
Header="Semi Design"
Width="400"
Height="200">
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统。设计系统包含设计语言以及一整套可复用的前端组件,帮助设计师与开发者更容易地打造高质量的、用户体验一致的、符合设计规范的 Web 应用。</TextBlock>
</HeaderedContentControl>
</StackPanel>
</ScrollViewer>
</UserControl>
@@ -0,0 +1,11 @@
using Avalonia.Controls;
namespace Semi.Avalonia.Demo.Pages;
public partial class HeaderedContentControlDemo : UserControl
{
public HeaderedContentControlDemo()
{
InitializeComponent();
}
}
@@ -0,0 +1,43 @@
<UserControl
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d"
x:Class="Semi.Avalonia.Demo.Pages.HyperlinkButtonDemo"
xmlns="https://github.com/avaloniaui"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel HorizontalAlignment="Left" Spacing="20">
<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>
</StackPanel>
</StackPanel>
</UserControl>
@@ -0,0 +1,14 @@
using System;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages;
public partial class HyperlinkButtonDemo : UserControl
{
public HyperlinkButtonDemo()
{
InitializeComponent();
}
}
+224 -76
View File
@@ -1,78 +1,226 @@
<UserControl <UserControl
x:Class="Semi.Avalonia.Demo.Pages.LabelDemo" xmlns="https://github.com/avaloniaui" x:Class="Semi.Avalonia.Demo.Pages.LabelDemo"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns="https://github.com/avaloniaui"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="450" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
d:DesignWidth="800" mc:Ignorable="d"> xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
<StackPanel xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Width="500" Margin="20" d:DesignHeight="450"
HorizontalAlignment="Left" Spacing="20"> d:DesignWidth="800"
<StackPanel.Styles> mc:Ignorable="d">
<Style Selector="Label"> <ScrollViewer>
<Setter Property="Margin" Value="4" /> <StackPanel HorizontalAlignment="Left" Spacing="20">
</Style> <StackPanel.Styles>
</StackPanel.Styles> <Style Selector="Label">
<WrapPanel> <Setter Property="Margin" Value="4" />
<Label Theme="{StaticResource TagLabel}">Label</Label> </Style>
<Label Classes="Large" Theme="{StaticResource TagLabel}">Large Label</Label> </StackPanel.Styles>
<Label Classes="Circle" Theme="{StaticResource TagLabel}">Circle Label</Label> <ScrollViewer HorizontalScrollBarVisibility="Auto">
<Label Classes="Large Circle" Theme="{StaticResource TagLabel}">Large Circle Label</Label> <StackPanel Orientation="Horizontal">
</WrapPanel> <StackPanel.Styles>
<WrapPanel> <Style Selector="Label, TextBlock">
<Label Classes="Amber" Theme="{StaticResource TagLabel}">Amber</Label> <Setter Property="VerticalAlignment" Value="Center" />
<Label Classes="Blue" Theme="{StaticResource TagLabel}">Blue</Label> <Setter Property="Margin" Value="4" />
<Label Classes="Cyan" Theme="{StaticResource TagLabel}">Cyan</Label> </Style>
<Label Classes="Green" Theme="{StaticResource TagLabel}">Green</Label> </StackPanel.Styles>
<Label Classes="Grey" Theme="{StaticResource TagLabel}">Grey</Label> <HeaderedContentControl
<Label Classes="Indigo" Theme="{StaticResource TagLabel}">Indigo</Label> Width="400"
<Label Classes="LightBlue" Theme="{StaticResource TagLabel}">LightBlue</Label> Height="400"
<Label Classes="LightGreen" Theme="{StaticResource TagLabel}">LightGreen</Label> Margin="16"
<Label Classes="Lime" Theme="{StaticResource TagLabel}">Lime</Label> VerticalAlignment="Top"
<Label Classes="Orange" Theme="{StaticResource TagLabel}">Orange</Label> Header="Default Theme"
<Label Classes="Pink" Theme="{StaticResource TagLabel}">Pink</Label> Theme="{DynamicResource GroupBox}">
<Label Classes="Purple" Theme="{StaticResource TagLabel}">Purple</Label> <Grid
<Label Classes="Red" Theme="{StaticResource TagLabel}">Red</Label> VerticalAlignment="Top"
<Label Classes="Teal" Theme="{StaticResource TagLabel}">Teal</Label> ColumnDefinitions="Auto, *"
<Label Classes="Violet" Theme="{StaticResource TagLabel}">Violet</Label> RowDefinitions="*,*,*,*,*,*,*,*,*,*,*,*">
<Label Classes="Yellow" Theme="{StaticResource TagLabel}">Yellow</Label> <TextBlock Grid.Row="1" Grid.Column="0">Classes</TextBlock>
<Label Classes="White" Theme="{StaticResource TagLabel}">White</Label> <TextBlock Grid.Row="2" Grid.Column="0">-</TextBlock>
</WrapPanel> <TextBlock Grid.Row="3" Grid.Column="0">Secondary</TextBlock>
<WrapPanel> <TextBlock Grid.Row="4" Grid.Column="0">Tertiary</TextBlock>
<Label Classes="Ghost Amber" Theme="{StaticResource TagLabel}">Amber</Label> <TextBlock Grid.Row="5" Grid.Column="0">Quaternary</TextBlock>
<Label Classes="Ghost Blue" Theme="{StaticResource TagLabel}">Blue</Label> <TextBlock Grid.Row="6" Grid.Column="0">Success</TextBlock>
<Label Classes="Ghost Cyan" Theme="{StaticResource TagLabel}">Cyan</Label> <TextBlock Grid.Row="7" Grid.Column="0">Warning</TextBlock>
<Label Classes="Ghost Green" Theme="{StaticResource TagLabel}">Green</Label> <TextBlock Grid.Row="8" Grid.Column="0">Danger</TextBlock>
<Label Classes="Ghost Grey" Theme="{StaticResource TagLabel}">Grey</Label> <TextBlock Grid.Row="9" Grid.Column="0">Mark</TextBlock>
<Label Classes="Ghost Indigo" Theme="{StaticResource TagLabel}">Indigo</Label> <TextBlock Grid.Row="10" Grid.Column="0">Code</TextBlock>
<Label Classes="Ghost LightBlue" Theme="{StaticResource TagLabel}">LightBlue</Label> <Label Grid.Row="2" Grid.Column="1">Text</Label>
<Label Classes="Ghost LightGreen" Theme="{StaticResource TagLabel}">LightGreen</Label> <Label
<Label Classes="Ghost Lime" Theme="{StaticResource TagLabel}">Lime</Label> Grid.Row="3"
<Label Classes="Ghost Orange" Theme="{StaticResource TagLabel}">Orange</Label> Grid.Column="1"
<Label Classes="Ghost Pink" Theme="{StaticResource TagLabel}">Pink</Label> Classes="Secondary">
<Label Classes="Ghost Purple" Theme="{StaticResource TagLabel}">Purple</Label> Secondary
<Label Classes="Ghost Red" Theme="{StaticResource TagLabel}">Red</Label> </Label>
<Label Classes="Ghost Teal" Theme="{StaticResource TagLabel}">Teal</Label> <Label
<Label Classes="Ghost Violet" Theme="{StaticResource TagLabel}">Violet</Label> Grid.Row="4"
<Label Classes="Ghost Yellow" Theme="{StaticResource TagLabel}">Yellow</Label> Grid.Column="1"
<Label Classes="Ghost White" Theme="{StaticResource TagLabel}">White</Label> Classes="Tertiary">
</WrapPanel> Tertiary
<WrapPanel> </Label>
<Label Classes="Solid Amber" Theme="{StaticResource TagLabel}">Amber</Label> <Label
<Label Classes="Solid Blue" Theme="{StaticResource TagLabel}">Blue</Label> Grid.Row="5"
<Label Classes="Solid Cyan" Theme="{StaticResource TagLabel}">Cyan</Label> Grid.Column="1"
<Label Classes="Solid Green" Theme="{StaticResource TagLabel}">Green</Label> Classes="Quaternary">
<Label Classes="Solid Grey" Theme="{StaticResource TagLabel}">Grey</Label> Quaternary
<Label Classes="Solid Indigo" Theme="{StaticResource TagLabel}">Indigo</Label> </Label>
<Label Classes="Solid LightBlue" Theme="{StaticResource TagLabel}">LightBlue</Label> <Label
<Label Classes="Solid LightGreen" Theme="{StaticResource TagLabel}">LightGreen</Label> Grid.Row="6"
<Label Classes="Solid Lime" Theme="{StaticResource TagLabel}">Lime</Label> Grid.Column="1"
<Label Classes="Solid Orange" Theme="{StaticResource TagLabel}">Orange</Label> Classes="Success">
<Label Classes="Solid Pink" Theme="{StaticResource TagLabel}">Pink</Label> Success
<Label Classes="Solid Purple" Theme="{StaticResource TagLabel}">Purple</Label> </Label>
<Label Classes="Solid Red" Theme="{StaticResource TagLabel}">Red</Label> <Label
<Label Classes="Solid Teal" Theme="{StaticResource TagLabel}">Teal</Label> Grid.Row="7"
<Label Classes="Solid Violet" Theme="{StaticResource TagLabel}">Violet</Label> Grid.Column="1"
<Label Classes="Solid Yellow" Theme="{StaticResource TagLabel}">Yellow</Label> Classes="Warning">
<Label Classes="Solid White" Theme="{StaticResource TagLabel}">White</Label> Warning
</WrapPanel> </Label>
</StackPanel> <Label
Grid.Row="8"
Grid.Column="1"
Classes="Danger">
Danger
</Label>
<Label
Grid.Row="9"
Grid.Column="1"
Classes="Mark">
Default Mark
</Label>
<Label
Grid.Row="10"
Grid.Column="1"
Classes="Code">
Code
</Label>
</Grid>
</HeaderedContentControl>
<HeaderedContentControl
Width="400"
Height="400"
Margin="16"
VerticalAlignment="Top"
Header="Theme: TitleLabel"
Theme="{DynamicResource GroupBox}">
<Grid
VerticalAlignment="Top"
ColumnDefinitions="Auto, *"
RowDefinitions="*,*,*,*,*,*,*,*">
<TextBlock Grid.Row="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>
<Label
Grid.Row="2"
Grid.Column="1"
Classes="H1"
Theme="{StaticResource TitleLabel}">
Header 1
</Label>
<Label
Grid.Row="3"
Grid.Column="1"
Classes="H2"
Theme="{StaticResource TitleLabel}">
Header 2
</Label>
<Label
Grid.Row="4"
Grid.Column="1"
Classes="H3"
Theme="{StaticResource TitleLabel}">
Header 3
</Label>
<Label
Grid.Row="5"
Grid.Column="1"
Classes="H4"
Theme="{StaticResource TitleLabel}">
Header 4
</Label>
<Label
Grid.Row="6"
Grid.Column="1"
Classes="H5"
Theme="{StaticResource TitleLabel}">
Header 5
</Label>
<Label
Grid.Row="7"
Grid.Column="1"
Classes="H6"
Theme="{StaticResource TitleLabel}">
Header 6
</Label>
</Grid>
</HeaderedContentControl>
</StackPanel>
</ScrollViewer>
<WrapPanel>
<Label Theme="{StaticResource TagLabel}">Label</Label>
<Label Classes="Large" Theme="{StaticResource TagLabel}">Large Label</Label>
<Label Classes="Circle" Theme="{StaticResource TagLabel}">Circle Label</Label>
<Label Classes="Large Circle" Theme="{StaticResource TagLabel}">Large Circle Label</Label>
</WrapPanel>
<WrapPanel>
<Label Classes="Red" Theme="{StaticResource TagLabel}">Red</Label>
<Label Classes="Pink" Theme="{StaticResource TagLabel}">Pink</Label>
<Label Classes="Purple" Theme="{StaticResource TagLabel}">Purple</Label>
<Label Classes="Violet" Theme="{StaticResource TagLabel}">Violet</Label>
<Label Classes="Indigo" Theme="{StaticResource TagLabel}">Indigo</Label>
<Label Classes="Blue" Theme="{StaticResource TagLabel}">Blue</Label>
<Label Classes="LightBlue" Theme="{StaticResource TagLabel}">LightBlue</Label>
<Label Classes="Cyan" Theme="{StaticResource TagLabel}">Cyan</Label>
<Label Classes="Teal" Theme="{StaticResource TagLabel}">Teal</Label>
<Label Classes="Green" Theme="{StaticResource TagLabel}">Green</Label>
<Label Classes="LightGreen" Theme="{StaticResource TagLabel}">LightGreen</Label>
<Label Classes="Lime" Theme="{StaticResource TagLabel}">Lime</Label>
<Label Classes="Yellow" Theme="{StaticResource TagLabel}">Yellow</Label>
<Label Classes="Amber" Theme="{StaticResource TagLabel}">Amber</Label>
<Label Classes="Orange" Theme="{StaticResource TagLabel}">Orange</Label>
<Label Classes="Grey" Theme="{StaticResource TagLabel}">Grey</Label>
<Label Classes="White" Theme="{StaticResource TagLabel}">White</Label>
</WrapPanel>
<WrapPanel>
<Label Classes="Ghost Red" Theme="{StaticResource TagLabel}">Red</Label>
<Label Classes="Ghost Pink" Theme="{StaticResource TagLabel}">Pink</Label>
<Label Classes="Ghost Purple" Theme="{StaticResource TagLabel}">Purple</Label>
<Label Classes="Ghost Violet" Theme="{StaticResource TagLabel}">Violet</Label>
<Label Classes="Ghost Indigo" Theme="{StaticResource TagLabel}">Indigo</Label>
<Label Classes="Ghost Blue" Theme="{StaticResource TagLabel}">Blue</Label>
<Label Classes="Ghost LightBlue" Theme="{StaticResource TagLabel}">LightBlue</Label>
<Label Classes="Ghost Cyan" Theme="{StaticResource TagLabel}">Cyan</Label>
<Label Classes="Ghost Teal" Theme="{StaticResource TagLabel}">Teal</Label>
<Label Classes="Ghost Green" Theme="{StaticResource TagLabel}">Green</Label>
<Label Classes="Ghost LightGreen" Theme="{StaticResource TagLabel}">LightGreen</Label>
<Label Classes="Ghost Lime" Theme="{StaticResource TagLabel}">Lime</Label>
<Label Classes="Ghost Yellow" Theme="{StaticResource TagLabel}">Yellow</Label>
<Label Classes="Ghost Amber" Theme="{StaticResource TagLabel}">Amber</Label>
<Label Classes="Ghost Orange" Theme="{StaticResource TagLabel}">Orange</Label>
<Label Classes="Ghost Grey" Theme="{StaticResource TagLabel}">Grey</Label>
<Label Classes="Ghost White" Theme="{StaticResource TagLabel}">White</Label>
</WrapPanel>
<WrapPanel>
<Label Classes="Solid Red" Theme="{StaticResource TagLabel}">Red</Label>
<Label Classes="Solid Pink" Theme="{StaticResource TagLabel}">Pink</Label>
<Label Classes="Solid Purple" Theme="{StaticResource TagLabel}">Purple</Label>
<Label Classes="Solid Violet" Theme="{StaticResource TagLabel}">Violet</Label>
<Label Classes="Solid Indigo" Theme="{StaticResource TagLabel}">Indigo</Label>
<Label Classes="Solid Blue" Theme="{StaticResource TagLabel}">Blue</Label>
<Label Classes="Solid LightBlue" Theme="{StaticResource TagLabel}">LightBlue</Label>
<Label Classes="Solid Cyan" Theme="{StaticResource TagLabel}">Cyan</Label>
<Label Classes="Solid Teal" Theme="{StaticResource TagLabel}">Teal</Label>
<Label Classes="Solid Green" Theme="{StaticResource TagLabel}">Green</Label>
<Label Classes="Solid LightGreen" Theme="{StaticResource TagLabel}">LightGreen</Label>
<Label Classes="Solid Lime" Theme="{StaticResource TagLabel}">Lime</Label>
<Label Classes="Solid Yellow" Theme="{StaticResource TagLabel}">Yellow</Label>
<Label Classes="Solid Amber" Theme="{StaticResource TagLabel}">Amber</Label>
<Label Classes="Solid Orange" Theme="{StaticResource TagLabel}">Orange</Label>
<Label Classes="Solid Grey" Theme="{StaticResource TagLabel}">Grey</Label>
<Label Classes="Solid White" Theme="{StaticResource TagLabel}">White</Label>
</WrapPanel>
</StackPanel>
</ScrollViewer>
</UserControl> </UserControl>
+139 -16
View File
@@ -4,22 +4,145 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450" xmlns:local="clr-namespace:Semi.Avalonia.Demo.Pages"
d:DesignHeight="900"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">
<ListBox Margin="20"> <ScrollViewer>
<ListBoxItem>Item 1</ListBoxItem> <Grid ColumnDefinitions="*,*,*">
<ListBoxItem>Item 2</ListBoxItem> <HeaderedContentControl
<ListBoxItem IsEnabled="False">Item 3</ListBoxItem> Grid.Column="0"
<ListBoxItem>Item 4</ListBoxItem> Theme="{StaticResource GroupBox}"
<ListBoxItem>Item 5</ListBoxItem> Header="Default">
<ListBoxItem>Item 6</ListBoxItem> <ScrollViewer>
<ListBoxItem>Item 7</ListBoxItem> <StackPanel Spacing="20">
<ListBoxItem IsEnabled="False">Item 8</ListBoxItem> <TextBlock Text="Theme: Default"/>
<ListBoxItem>Item 9</ListBoxItem> <ListBox ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
<ListBoxItem>Item 10</ListBoxItem> <ListBox IsEnabled="False">
<ListBoxItem>Item 11</ListBoxItem> <ListBoxItem IsSelected="True">Avalonia</ListBoxItem>
<ListBoxItem>Item 12</ListBoxItem> <ListBoxItem>WPF</ListBoxItem>
<ListBoxItem>Item 13</ListBoxItem> </ListBox>
</ListBox> </StackPanel>
</ScrollViewer>
</HeaderedContentControl>
<HeaderedContentControl
Grid.Column="1"
Theme="{DynamicResource GroupBox}"
Header="RadioGroupListBox">
<StackPanel Spacing="20">
<TextBlock Text="Theme: RadioGroupListBox"/>
<ListBox
Theme="{DynamicResource RadioGroupListBox}"
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
<ListBox Theme="{DynamicResource RadioGroupListBox}" IsEnabled="False">
<ListBoxItem>Avalonia</ListBoxItem>
<ListBoxItem IsSelected="True">WPF</ListBoxItem>
</ListBox>
<TextBlock Text="Theme: ButtonRadioGroupListBox"/>
<StackPanel Orientation="Horizontal">
<Border HorizontalAlignment="Left" Theme="{StaticResource RadioButtonGroupBorder}">
<ListBox Theme="{DynamicResource ButtonRadioGroupListBox}">
<ListBoxItem Classes="Small" IsSelected="True">Small 1</ListBoxItem>
<ListBoxItem Classes="Small">Small 2</ListBoxItem>
</ListBox>
</Border>
<Border
Margin="8,0"
HorizontalAlignment="Left"
Theme="{StaticResource RadioButtonGroupBorder}">
<ListBox Theme="{DynamicResource ButtonRadioGroupListBox}" IsEnabled="False">
<ListBoxItem Classes="Small" IsSelected="True">Small 1</ListBoxItem>
<ListBoxItem Classes="Small">Small 2</ListBoxItem>
</ListBox>
</Border>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Border HorizontalAlignment="Left" Theme="{StaticResource RadioButtonGroupBorder}">
<ListBox Theme="{DynamicResource ButtonRadioGroupListBox}">
<ListBoxItem IsSelected="True">Default 1</ListBoxItem>
<ListBoxItem>Default 2</ListBoxItem>
</ListBox>
</Border>
<Border
Margin="8,0"
HorizontalAlignment="Left"
Theme="{StaticResource RadioButtonGroupBorder}">
<ListBox Theme="{DynamicResource ButtonRadioGroupListBox}" IsEnabled="False">
<ListBoxItem IsSelected="True">Default 1</ListBoxItem>
<ListBoxItem>Default 2</ListBoxItem>
</ListBox>
</Border>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Border HorizontalAlignment="Left" Theme="{StaticResource RadioButtonGroupBorder}">
<ListBox Theme="{DynamicResource ButtonRadioGroupListBox}">
<ListBoxItem Classes="Large" IsSelected="True">Small 1</ListBoxItem>
<ListBoxItem Classes="Large">Small 2</ListBoxItem>
</ListBox>
</Border>
<Border
Margin="8,0"
HorizontalAlignment="Left"
Theme="{StaticResource RadioButtonGroupBorder}">
<ListBox Theme="{DynamicResource ButtonRadioGroupListBox}" IsEnabled="False">
<ListBoxItem Classes="Large" IsSelected="True">Small 1</ListBoxItem>
<ListBoxItem Classes="Large">Small 2</ListBoxItem>
</ListBox>
</Border>
</StackPanel>
<TextBlock Text="Theme: CardRadioGroupListBox"/>
<ListBox Theme="{DynamicResource CardRadioGroupListBox}"
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
<ListBox Theme="{DynamicResource CardRadioGroupListBox}" IsEnabled="False">
<ListBoxItem IsSelected="True">Avalonia</ListBoxItem>
<ListBoxItem>WPF</ListBoxItem>
</ListBox>
<TextBlock Text="Theme: PureCardRadioGroupListBox"/>
<ListBox Theme="{DynamicResource PureCardRadioGroupListBox}"
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
<ListBox Theme="{DynamicResource PureCardRadioGroupListBox}" IsEnabled="False">
<ListBoxItem>Avalonia</ListBoxItem>
<ListBoxItem IsSelected="True">WPF</ListBoxItem>
</ListBox>
</StackPanel>
</HeaderedContentControl>
<HeaderedContentControl
Grid.Column="2"
Theme="{DynamicResource GroupBox}"
Header="CheckGroupListBox">
<ScrollViewer>
<StackPanel Spacing="20">
<TextBlock Text="Theme: CheckGroupListBox"/>
<ListBox
SelectionMode="Multiple"
Theme="{DynamicResource CheckGroupListBox}"
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
<ListBox Theme="{DynamicResource CheckGroupListBox}"
SelectionMode="Multiple"
IsEnabled="False">
<ListBoxItem IsSelected="True">Avalonia</ListBoxItem>
<ListBoxItem>WPF</ListBoxItem>
</ListBox>
<TextBlock Text="Theme: CardCheckGroupListBox"/>
<ListBox
SelectionMode="Multiple"
Theme="{DynamicResource CardCheckGroupListBox}"
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
<ListBox Theme="{DynamicResource CardCheckGroupListBox}"
SelectionMode="Multiple"
IsEnabled="False">
<ListBoxItem>Avalonia</ListBoxItem>
<ListBoxItem IsSelected="True">WPF</ListBoxItem>
</ListBox>
</StackPanel>
</ScrollViewer>
</HeaderedContentControl>
</Grid>
</ScrollViewer>
</UserControl> </UserControl>
@@ -1,6 +1,6 @@
using Avalonia; using System.Collections;
using System.Collections.Generic;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;
@@ -10,4 +10,6 @@ public partial class ListBoxDemo : UserControl
{ {
InitializeComponent(); InitializeComponent();
} }
public IEnumerable Items { get; set; } = new List<string> { "Ding", "Otter", "Husky", "Mr.17", "Cass", };
} }
@@ -3,12 +3,16 @@
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dialogs="clr-namespace:Avalonia.Dialogs;assembly=Avalonia.Dialogs"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">
<StackPanel HorizontalAlignment="Left" Spacing="10"> <StackPanel HorizontalAlignment="Left" Spacing="10">
<StackPanel.Styles>
<Style Selector="Button">
<Setter Property="HorizontalAlignment" Value="Stretch" />
</Style>
</StackPanel.Styles>
<Button Name="openFileDialog">Open File</Button> <Button Name="openFileDialog">Open File</Button>
<Button Name="selectFolderDialog">Select Folder</Button> <Button Name="selectFolderDialog">Select Folder</Button>
<Button Name="saveFileDialog">Save File</Button> <Button Name="saveFileDialog">Save File</Button>
@@ -21,7 +21,8 @@ public partial class ManagedFileChooserDemo : UserControl
private async void OpenFileDialog(object sender, RoutedEventArgs args) private async void OpenFileDialog(object sender, RoutedEventArgs args)
{ {
IStorageProvider sp = GetStorageProvider(); IStorageProvider? sp = GetStorageProvider();
if (sp is null) return;
var result = await sp.OpenFilePickerAsync(new FilePickerOpenOptions() var result = await sp.OpenFilePickerAsync(new FilePickerOpenOptions()
{ {
Title = "Open File", Title = "Open File",
@@ -31,7 +32,8 @@ public partial class ManagedFileChooserDemo : UserControl
} }
private async void SelectFolderDialog(object sender, RoutedEventArgs args) private async void SelectFolderDialog(object sender, RoutedEventArgs args)
{ {
IStorageProvider sp = GetStorageProvider(); IStorageProvider? sp = GetStorageProvider();
if (sp is null) return;
var result = await sp.OpenFolderPickerAsync(new FolderPickerOpenOptions() var result = await sp.OpenFolderPickerAsync(new FolderPickerOpenOptions()
{ {
Title = "Select Folder", Title = "Select Folder",
@@ -40,27 +42,20 @@ public partial class ManagedFileChooserDemo : UserControl
} }
private async void SaveFileDialog(object sender, RoutedEventArgs args) private async void SaveFileDialog(object sender, RoutedEventArgs args)
{ {
IStorageProvider sp = GetStorageProvider(); IStorageProvider? sp = GetStorageProvider();
if (sp is null) return;
var result = await sp.SaveFilePickerAsync(new FilePickerSaveOptions() var result = await sp.SaveFilePickerAsync(new FilePickerSaveOptions()
{ {
Title = "Open File", Title = "Open File",
}); });
} }
private IStorageProvider GetStorageProvider() private IStorageProvider? GetStorageProvider()
{ {
return new ManagedStorageProvider<Window>(GetWindow(), null); var topLevel = TopLevel.GetTopLevel(this);
return topLevel?.StorageProvider;
} }
private static string FullPathOrName(IStorageItem? item)
{
if (item is null) return "(null)";
return item.TryGetUri(out var uri) ? uri.ToString() : item.Name;
}
Window GetWindow() => this.VisualRoot as Window ?? throw new NullReferenceException("Invalid Owner");
TopLevel GetTopLevel() => this.VisualRoot as TopLevel ?? throw new NullReferenceException("Invalid Owner");
List<FilePickerFileType>? GetFileTypes() List<FilePickerFileType>? GetFileTypes()
{ {
return new List<FilePickerFileType> return new List<FilePickerFileType>
+28 -8
View File
@@ -7,7 +7,7 @@
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">
<StackPanel Margin="20" Spacing="20"> <StackPanel Spacing="20">
<Menu> <Menu>
<MenuItem Header="_First"> <MenuItem Header="_First">
<MenuItem Header="Standard _Menu Item" InputGesture="Ctrl+A" /> <MenuItem Header="Standard _Menu Item" InputGesture="Ctrl+A" />
@@ -25,14 +25,30 @@
<MenuItem Header="Submenu Level 2" /> <MenuItem Header="Submenu Level 2" />
</MenuItem> </MenuItem>
</MenuItem> </MenuItem>
<MenuItem Header="Menu Item with _Checkbox"> <MenuItem Header="Menu Item with _Icon">
<MenuItem.Icon> <MenuItem.Icon>
<TextBlock>😊</TextBlock> <TextBlock>😊</TextBlock>
</MenuItem.Icon> </MenuItem.Icon>
</MenuItem> </MenuItem>
<MenuItem Header="Menu Item with _Checkbox" ToggleType="CheckBox" />
</MenuItem> </MenuItem>
<MenuItem Header="_Second"> <MenuItem Header="_Second">
<MenuItem Header="Second _Menu Item" /> <MenuItem Header="Second _Menu Item" />
<MenuItem IsChecked="True" Header="Second Menu toggle item" ToggleType="CheckBox" />
<Separator />
<MenuItem GroupName="A" Header="Radio 1 - group" ToggleType="Radio" />
<MenuItem IsChecked="True" GroupName="A" Header="Radio 2 - group" ToggleType="Radio" />
<MenuItem GroupName="A" Header="Radio 3 - group" ToggleType="Radio">
<MenuItem Header="Radio 4 - group" ToggleType="Radio" GroupName="A" />
<MenuItem Header="Radio 5 - group" ToggleType="Radio" GroupName="A" />
</MenuItem>
<Separator />
<MenuItem Header="Radio 1" ToggleType="Radio" />
<MenuItem IsChecked="True" Header="Radio 2" ToggleType="Radio" />
<MenuItem Header="Radio 3" ToggleType="Radio">
<MenuItem Header="Radio 4" ToggleType="Radio" />
<MenuItem Header="Radio 5" ToggleType="Radio" />
</MenuItem>
</MenuItem> </MenuItem>
<MenuItem Header="Parent"> <MenuItem Header="Parent">
<MenuItem Header="Child 1" /> <MenuItem Header="Child 1" />
@@ -73,7 +89,7 @@
<MenuItem Header="Child 19" /> <MenuItem Header="Child 19" />
</MenuItem> </MenuItem>
</Menu> </Menu>
<Border> <Border Theme="{DynamicResource CardBorder}">
<Border.ContextMenu> <Border.ContextMenu>
<ContextMenu> <ContextMenu>
<MenuItem Header="Standard _Menu Item" InputGesture="Ctrl+A" /> <MenuItem Header="Standard _Menu Item" InputGesture="Ctrl+A" />
@@ -86,20 +102,22 @@
<MenuItem Header="Submenu _1" /> <MenuItem Header="Submenu _1" />
<MenuItem Header="Submenu _2" /> <MenuItem Header="Submenu _2" />
</MenuItem> </MenuItem>
<MenuItem Header="Menu Item with _Checkbox"> <MenuItem Header="Menu Item with _Icon">
<MenuItem.Icon> <MenuItem.Icon>
<CheckBox <CheckBox
Padding="0"
BorderThickness="0" BorderThickness="0"
IsChecked="True" IsChecked="True"
IsHitTestVisible="False" /> IsHitTestVisible="False" />
</MenuItem.Icon> </MenuItem.Icon>
</MenuItem> </MenuItem>
<MenuItem Header="Menu Item with _Checkbox" ToggleType="CheckBox" />
<MenuItem Header="Menu Item that won't close on click" StaysOpenOnClick="True" /> <MenuItem Header="Menu Item that won't close on click" StaysOpenOnClick="True" />
</ContextMenu> </ContextMenu>
</Border.ContextMenu> </Border.ContextMenu>
<TextBlock Text="Context Menu" /> <TextBlock Text="Right Click to show Context Menu" />
</Border> </Border>
<Border> <Border Theme="{DynamicResource CardBorder}">
<Border.ContextFlyout> <Border.ContextFlyout>
<MenuFlyout> <MenuFlyout>
<MenuItem Header="Standard _Menu Item" InputGesture="Ctrl+A" /> <MenuItem Header="Standard _Menu Item" InputGesture="Ctrl+A" />
@@ -112,17 +130,19 @@
<MenuItem Header="Submenu _1" /> <MenuItem Header="Submenu _1" />
<MenuItem Header="Submenu _2" /> <MenuItem Header="Submenu _2" />
</MenuItem> </MenuItem>
<MenuItem Header="Menu Item with _Checkbox"> <MenuItem Header="Menu Item with _Icon">
<MenuItem.Icon> <MenuItem.Icon>
<CheckBox <CheckBox
Padding="0"
BorderThickness="0" BorderThickness="0"
IsChecked="True" IsChecked="True"
IsHitTestVisible="False" /> IsHitTestVisible="False" />
</MenuItem.Icon> </MenuItem.Icon>
</MenuItem> </MenuItem>
<MenuItem Header="Menu Item with _Checkbox" ToggleType="CheckBox" />
</MenuFlyout> </MenuFlyout>
</Border.ContextFlyout> </Border.ContextFlyout>
<TextBlock Text="Context Flyout" /> <TextBlock Text="Right Click to show Context Flyout" />
</Border> </Border>
</StackPanel> </StackPanel>
</UserControl> </UserControl>
@@ -7,13 +7,18 @@
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">
<StackPanel <StackPanel HorizontalAlignment="Left" Spacing="20">
Margin="300,20,20,20" <StackPanel.Styles>
HorizontalAlignment="Left" <Style Selector="Button">
Spacing="20"> <Setter Property="Theme" Value="{DynamicResource SolidButton}" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
</Style>
</StackPanel.Styles>
<Button Click="InfoButton_OnClick" Content="Default" />
<Button Click="InfoButton_OnClick" Content="Information" /> <Button Click="InfoButton_OnClick" Content="Information" />
<Button Click="InfoButton_OnClick" Content="Success" /> <Button Click="InfoButton_OnClick" Content="Success" Classes="Success" />
<Button Click="InfoButton_OnClick" Content="Warning" /> <Button Click="InfoButton_OnClick" Content="Warning" Classes="Warning" />
<Button Click="InfoButton_OnClick" Content="Error" /> <Button Click="InfoButton_OnClick" Content="Error" Classes="Danger" />
</StackPanel> </StackPanel>
</UserControl> </UserControl>
@@ -2,17 +2,14 @@ using System;
using Avalonia; using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Controls.Notifications; using Avalonia.Controls.Notifications;
using Avalonia.Controls.Presenters;
using Avalonia.Interactivity; using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using Avalonia.VisualTree;
using Semi.Avalonia.Demo.Views;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;
public partial class NotificationDemo : UserControl public partial class NotificationDemo : UserControl
{ {
private MainWindow? _window; private WindowNotificationManager? _manager;
public NotificationDemo() public NotificationDemo()
{ {
InitializeComponent(); InitializeComponent();
@@ -21,14 +18,17 @@ public partial class NotificationDemo : UserControl
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e) protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
{ {
base.OnAttachedToVisualTree(e); base.OnAttachedToVisualTree(e);
_window = VisualRoot as MainWindow; var topLevel = TopLevel.GetTopLevel(this);
_manager = new WindowNotificationManager(topLevel) { MaxItems = 3 };
} }
private void InfoButton_OnClick(object? sender, RoutedEventArgs e) private void InfoButton_OnClick(object? sender, RoutedEventArgs e)
{ {
if (sender is Button b && b.Content is string s && Enum.TryParse<NotificationType>(s, out NotificationType t)) if (sender is Button b && b.Content is string s)
{ {
_window?.Notify(t); _manager?.Show(Enum.TryParse<NotificationType>(s, out NotificationType t)
? new Notification(t.ToString(), "This is message", t)
: new Notification(s, "This is message"));
} }
} }
} }
@@ -4,31 +4,53 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450" d:DesignHeight="800"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">
<StackPanel <StackPanel HorizontalAlignment="Left" Spacing="20">
Margin="20" <StackPanel.Styles>
HorizontalAlignment="Left" <Style Selector="NumericUpDown">
Spacing="20"> <Setter Property="Width" Value="300" />
<NumericUpDown <Setter Property="Maximum" Value="100" />
Width="200" <Setter Property="Minimum" Value="0" />
Maximum="100" </Style>
Minimum="0" /> </StackPanel.Styles>
<NumericUpDown
Width="200" <NumericUpDown />
Increment="10" <NumericUpDown Increment="10" />
Maximum="100" <NumericUpDown ButtonSpinnerLocation="Left" />
Minimum="0" /> <NumericUpDown ShowButtonSpinner="False" />
<NumericUpDown <NumericUpDown Classes="Large" />
Width="200" <NumericUpDown Classes="Small" />
ButtonSpinnerLocation="Left" <NumericUpDown InnerLeftContent="Price" InnerRightContent="$" />
Maximum="100"
Minimum="0" /> <StackPanel Orientation="Horizontal">
<NumericUpDown <NumericUpDown
Width="200" Width="100"
Maximum="100" Classes="Large"
Minimum="0" Watermark="Large"
ShowButtonSpinner="False" /> ButtonSpinnerLocation="Left" />
<NumericUpDown
Width="100"
Watermark="Default"
ShowButtonSpinner="False" />
<NumericUpDown
Width="100"
Watermark="Small"
Classes="Small" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<NumericUpDown Width="100" ButtonSpinnerLocation="Left" />
<NumericUpDown Width="100" ShowButtonSpinner="False" />
<NumericUpDown Width="100" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<NumericUpDown Width="100" ShowButtonSpinner="False" />
<NumericUpDown Width="100" IsEnabled="False" />
<NumericUpDown Width="100" ButtonSpinnerLocation="Left" />
</StackPanel>
</StackPanel> </StackPanel>
</UserControl> </UserControl>
+397 -143
View File
@@ -2,160 +2,414 @@
x:Class="Semi.Avalonia.Demo.Pages.Overview" x:Class="Semi.Avalonia.Demo.Pages.Overview"
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Avalonia.Markup.Xaml.Converters;assembly=Avalonia.Markup.Xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Semi.Avalonia.Demo.Pages"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="1000" d:DesignHeight="1000"
d:DesignWidth="800" d:DesignWidth="1920"
mc:Ignorable="d"> mc:Ignorable="d">
<UserControl.Resources>
<ResourceDictionary>
<converters:ColorToBrushConverter x:Key="ColorToBrushConverter" />
</ResourceDictionary>
</UserControl.Resources>
<UserControl.Styles>
<Style Selector="Border.CodeBlock">
<Setter Property="BorderBrush" Value="{DynamicResource SemiColorBorder}" />
<Setter Property="Padding" Value="16" />
<Setter Property="CornerRadius" Value="6" />
<Setter Property="Background" Value="{DynamicResource SemiColorFill0}" />
</Style>
</UserControl.Styles>
<ScrollViewer HorizontalScrollBarVisibility="Auto"> <ScrollViewer HorizontalScrollBarVisibility="Auto">
<StackPanel Margin="10" Spacing="5"> <StackPanel Margin="20">
<StackPanel
Margin="20"
HorizontalAlignment="Center"
Orientation="Horizontal">
<PathIcon
Width="32"
Height="32"
Data="M10.6201 17.5C6.06377 17.5 2.37012 13.8063 2.37012 9.25C2.37012 4.69365 6.06377 1 10.6201 1V17.5ZM13.3701 6.5C17.9265 6.5 21.6201 10.1936 21.6201 14.75C21.6201 19.3063 17.9265 23 13.3701 23V6.5Z" />
<PathIcon
Width="10"
Height="10"
Margin="20,0"
Data="M20.5 13.5C21.3284 13.5 22 12.8284 22 12C22 11.1716 21.3284 10.5 20.5 10.5L13.5 10.5L13.5 3.5C13.5 2.67157 12.8284 2 12 2C11.1716 2 10.5 2.67157 10.5 3.5L10.5 10.5L3.5 10.5C2.67157 10.5 2 11.1716 2 12C2 12.8284 2.67157 13.5 3.5 13.5L10.5 13.5V20.5C10.5 21.3284 11.1716 22 12 22C12.8284 22 13.5 21.3284 13.5 20.5V13.5L20.5 13.5Z" />
<Image Width="32" Height="32">
<Image.Source>
<DrawingImage>
<DrawingGroup>
<GeometryDrawing Brush="#8B44AC" Geometry="M74.8535 85.8231C75.0263 85.8231 75.1954 85.8231 75.3679 85.8231C80.7347 85.8231 85.1439 81.8027 85.7614 76.6019L85.8357 41.7604C85.2255 18.5931 66.2537 0 42.9393 0C19.2399 0 0.02771 19.2122 0.02771 42.9116C0.02771 66.3573 18.8309 85.418 42.18 85.8231H74.8535Z" />
<GeometryDrawing Brush="#F9F9FB" Geometry="M43.0585 14.6143C29.5513 14.6143 18.2555 24.082 15.4454 36.7432C18.1357 37.4975 20.1087 39.9679 20.1087 42.8992C20.1087 45.8305 18.1357 48.301 15.4454 49.0552C18.2555 61.7164 29.5513 71.1842 43.0585 71.1842C47.9754 71.1842 52.5993 69.9296 56.6276 67.723V70.9926H71.3435V44.0716C71.3569 43.7138 71.3435 43.2603 71.3435 42.8992C71.3435 27.2779 58.6799 14.6143 43.0585 14.6143ZM29.5096 42.8992C29.5096 35.4164 35.5757 29.3503 43.0585 29.3503C50.5414 29.3503 56.6074 35.4164 56.6074 42.8992C56.6074 50.3821 50.5414 56.4481 43.0585 56.4481C35.5757 56.4481 29.5096 50.3821 29.5096 42.8992Z" />
<GeometryDrawing Brush="#F9F9FB" Geometry="M18.105 42.8805C18.105 45.3803 16.0785 47.4068 13.5787 47.4068C11.0789 47.4068 9.05237 45.3803 9.05237 42.8805C9.05237 40.3807 11.0789 38.3542 13.5787 38.3542C16.0785 38.3542 18.105 40.3807 18.105 42.8805Z" />
</DrawingGroup>
</DrawingImage>
</Image.Source>
</Image>
</StackPanel>
<TextBlock <TextBlock
HorizontalAlignment="Center" HorizontalAlignment="Center"
Classes="H4" Classes="H1"
Text="Welcome to Semi Avalonia" Text="Semi Avalonia"
Theme="{StaticResource TitleTextBlock}" /> Theme="{DynamicResource TitleTextBlock}" />
<TextBlock
<StackPanel Orientation="Horizontal" Spacing="20"> MaxWidth="600"
<Button Classes="Primary" Theme="{DynamicResource SolidButton}">Primary</Button> Margin="0,20,0,0"
<Button Classes="Secondary" Theme="{DynamicResource SolidButton}">Secondary</Button> HorizontalAlignment="Center"
<Button Classes="Tertiary" Theme="{DynamicResource SolidButton}">Tertiary</Button> Classes="Secondary"
<Button Classes="Warning" Theme="{DynamicResource SolidButton}">Warning</Button> Text="AvaloniaUI Theme inspired by Semi Design. An easy-to-customize modern design system that helps designers and developers create high-quality products."
<Button Classes="Danger" Theme="{DynamicResource SolidButton}">Danger</Button> TextWrapping="Wrap" />
<Button <StackPanel
Classes="Primary" Margin="0,10,0,0"
IsEnabled="False" HorizontalAlignment="Center"
Theme="{DynamicResource SolidButton}"> Orientation="Horizontal">
Danger <TextBlock
</Button> Margin="12,0"
FontWeight="600"
Text="Modern" />
<TextBlock
Margin="12,0"
FontWeight="600"
Foreground="{Binding #color.Color, Converter={StaticResource ColorToBrushConverter}, Mode=TwoWay}"
Text="Flexible" />
<TextBlock
Margin="12,0"
FontWeight="600"
Text="Simple" />
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal" Spacing="20"> <StackPanel HorizontalAlignment="Center">
<Label Theme="{StaticResource TagLabel}">Label</Label> <StackPanel>
<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 Orientation="Horizontal" Spacing="20">
<Label Classes="Blue" Theme="{StaticResource TagLabel}">Indigo</Label>
<Label Classes="Ghost Blue" Theme="{StaticResource TagLabel}">Indigo</Label>
<Label Classes="Solid Blue" Theme="{StaticResource TagLabel}">Indigo</Label>
</StackPanel>
<StackPanel Orientation="Horizontal">
<StackPanel
Margin="0,0,16,0"
VerticalAlignment="Center"
Orientation="Horizontal">
<RadioButton Margin="0,0,8,0">Option 1</RadioButton>
<RadioButton>Option 2</RadioButton>
</StackPanel>
<Border VerticalAlignment="Center" Theme="{StaticResource RadioButtonGroupBorder}">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<RadioButton IsChecked="True" Theme="{StaticResource ButtonRadioButton}">选项 1</RadioButton> <StackPanel Margin="16,0">
<RadioButton Theme="{StaticResource ButtonRadioButton}">选项 2</RadioButton> <Button
</StackPanel> Margin="0,8"
</Border> Classes="Primary"
<RadioButton Margin="4" Theme="{StaticResource CardRadioButton}"> Content="Primary"
<StackPanel> HorizontalAlignment="Stretch"
<TextBlock FontWeight="Bold">Option 1</TextBlock> Theme="{DynamicResource SolidButton}" />
<TextBlock Classes="Tertiary">Description 1</TextBlock> <Button
</StackPanel> Margin="0,8"
</RadioButton> Classes="Secondary"
<RadioButton Content="Secondary"
Margin="4" HorizontalAlignment="Stretch"
IsChecked="True" Theme="{DynamicResource SolidButton}" />
Theme="{StaticResource CardRadioButton}"> <Button
<StackPanel> Margin="0,8"
<TextBlock FontWeight="Bold">Option 2</TextBlock> Classes="Tertiary"
<TextBlock Classes="Tertiary">Description 2</TextBlock> Content="Tertiary"
</StackPanel> HorizontalAlignment="Stretch"
</RadioButton> Theme="{DynamicResource SolidButton}" />
</StackPanel> <Button
<StackPanel Orientation="Horizontal" /> Margin="0,8"
<StackPanel Orientation="Horizontal"> Classes="Success"
<CheckBox Margin="0,0,8,0">Avalonia</CheckBox> Content="Success"
<CheckBox Margin="0,0,8,0" IsChecked="True">WPF</CheckBox> HorizontalAlignment="Stretch"
<CheckBox IsChecked="{x:Null}" IsThreeState="True">UWP</CheckBox> Theme="{DynamicResource SolidButton}" />
</StackPanel> <Button
<StackPanel Orientation="Horizontal"> Margin="0,8"
<ToggleSwitch Classes="Warning"
Content="Content" Content="Warning"
OffContent="No" HorizontalAlignment="Stretch"
OnContent="Yes" /> Theme="{DynamicResource SolidButton}" />
<ProgressBar <Button
Classes="Right" Margin="0,8"
ShowProgressText="True" Classes="Danger"
Value="20" /> Content="Danger"
<Slider HorizontalAlignment="Stretch"
Width="200" Theme="{DynamicResource SolidButton}" />
Margin="30,0" </StackPanel>
Orientation="Horizontal" <Calendar Margin="16,0" />
Value="30" /> <StackPanel Margin="16,0">
</StackPanel> <TextBox
<TabControl> Width="300"
<TabItem Header="Tab 1"> Margin="0,12"
<TextBlock Margin="8">Tab Content 1</TextBlock> InnerLeftContent="https://"
</TabItem> InnerRightContent=".com" />
<TabItem Header="Tab 2"> <DatePicker Width="300" Margin="0,12" />
<TextBlock Margin="8">Tab Content 2</TextBlock> <CalendarDatePicker Width="300" Margin="0,12" />
</TabItem> <NumericUpDown Width="300" Margin="0,12" />
<TabItem Header="Tab 3"> <ComboBox Width="300" Margin="0,12">
<TextBlock Margin="8">Tab Content 3</TextBlock> <ComboBoxItem>Avalonia</ComboBoxItem>
</TabItem> <ComboBoxItem>Semi Design</ComboBoxItem>
</TabControl> <ComboBoxItem>IRIHI Technology</ComboBoxItem>
<StackPanel Orientation="Horizontal" Spacing="20"> </ComboBox>
<ComboBox Width="200" PlaceholderText="Please Select" /> </StackPanel>
<DatePicker /> <StackPanel>
<TimePicker /> <UniformGrid HorizontalAlignment="Center" Columns="3">
<CalendarDatePicker /> <UniformGrid.Styles>
</StackPanel> <Style Selector="CheckBox">
<Grid ColumnDefinitions="* * *"> <Setter Property="Margin" Value="4" />
<Border Theme="{StaticResource CardBorder}"> </Style>
<TextBlock>Card</TextBlock> </UniformGrid.Styles>
</Border> <CheckBox Content="Windows" IsChecked="True" />
<Border <CheckBox Content="macOS" IsChecked="True" />
Grid.Column="1" <CheckBox Content="Linux" IsChecked="True" />
Classes="Hover" <CheckBox
Theme="{StaticResource CardBorder}"> Content="iOS"
<TextBlock>Shadow on hover</TextBlock> IsChecked="{x:Null}"
</Border> IsThreeState="True" />
<Border <CheckBox
Grid.Column="2" Content="Android"
Classes="Shadow" IsChecked="{x:Null}"
Theme="{StaticResource CardBorder}"> IsThreeState="True" />
<TextBlock>Shadow</TextBlock> <CheckBox
</Border> Content="Wasm"
</Grid> IsChecked="{x:Null}"
<StackPanel Orientation="Horizontal" Spacing="20"> IsThreeState="True" />
<TextBox </UniformGrid>
Width="200" <UniformGrid HorizontalAlignment="Center" Columns="3">
InnerLeftContent="http://" <UniformGrid.Styles>
InnerRightContent=".com" /> <Style Selector="CheckBox">
<TextBox <Setter Property="Margin" Value="4" />
Width="200" </Style>
Classes="revealPasswordButton" </UniformGrid.Styles>
PasswordChar="*" <CheckBox
Text="Avalonia" /> Content="Windows"
IsChecked="True"
Theme="{DynamicResource CardCheckBox}" />
<CheckBox
Content="macOS"
IsChecked="True"
Theme="{DynamicResource CardCheckBox}" />
<CheckBox
Content="Linux"
IsChecked="True"
Theme="{DynamicResource CardCheckBox}" />
<CheckBox
Content="iOS"
IsChecked="{x:Null}"
IsThreeState="True"
Theme="{DynamicResource CardCheckBox}" />
<CheckBox
Content="Android"
IsChecked="{x:Null}"
IsThreeState="True"
Theme="{DynamicResource CardCheckBox}" />
<CheckBox
Content="Wasm"
IsChecked="{x:Null}"
IsThreeState="True"
Theme="{DynamicResource CardCheckBox}" />
</UniformGrid>
</StackPanel>
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal">
<StackPanel Margin="16,0">
<Button
Margin="0,8"
HorizontalAlignment="Stretch"
Classes="Primary"
Content="Primary" />
<Button
Margin="0,8"
HorizontalAlignment="Stretch"
Classes="Secondary"
Content="Secondary" />
<Button
Margin="0,8"
HorizontalAlignment="Stretch"
Classes="Tertiary"
Content="Tertiary" />
<Button
Margin="0,8"
HorizontalAlignment="Stretch"
Classes="Success"
Content="Success" />
<Button
Margin="0,8"
HorizontalAlignment="Stretch"
Classes="Warning"
Content="Warning" />
<Button
Margin="0,8"
HorizontalAlignment="Stretch"
Classes="Danger"
Content="Danger" />
</StackPanel>
<ColorView
Name="color"
VerticalAlignment="Top"
Palette="{DynamicResource SemiColorPalette}"
SelectedIndex="2"
Color="#8B44AC" />
<StackPanel Width="300" Margin="8">
<StackPanel Orientation="Horizontal">
<Slider
Name="slider"
Width="200"
Margin="16"
Maximum="100"
Minimum="0" />
<ToggleSwitch Name="three" IsChecked="True" />
</StackPanel>
<UniformGrid Columns="2">
<ProgressBar
Width="100"
MinWidth="100"
Margin="0,16"
IsIndeterminate="{Binding #three.IsChecked}"
ShowProgressText="True"
Value="{Binding #slider.Value}" />
<ProgressBar
Width="100"
Height="100"
IsIndeterminate="{Binding #three.IsChecked}"
ShowProgressText="True"
Theme="{DynamicResource ProgressRing}"
Value="{Binding #slider.Value}" />
</UniformGrid>
<TabStrip Margin="0,8">
<TabStripItem Content="Tab 1" />
<TabStripItem Content="Tab 2" />
<TabStripItem Content="Tab 3" />
</TabStrip>
<Menu Margin="0,8">
<MenuItem Header="Menu 1">
<MenuItem Header="SubMenu 1" />
<MenuItem Header="SubMenu 2" />
<MenuItem Header="SubMenu 3" />
</MenuItem>
<MenuItem Header="Menu 2">
<MenuItem Header="SubMenu 1" />
<MenuItem Header="SubMenu 2" />
<MenuItem Header="SubMenu 3" />
<MenuItem Header="SubMenu 4">
<MenuItem Header="SubMenu 1" />
<MenuItem Header="SubMenu 2" />
<MenuItem Header="SubMenu 3" />
</MenuItem>
</MenuItem>
<MenuItem Header="Menu 3" />
</Menu>
<StackPanel Orientation="Horizontal" Spacing="20"> </StackPanel>
<TreeView> <StackPanel Margin="8">
<TreeViewItem Header="Level 1" IsExpanded="True">
<TreeViewItem Header="Level 2" /> <UniformGrid HorizontalAlignment="Center" Columns="3">
<TreeViewItem Header="Level 2" /> <UniformGrid.Styles>
<TreeViewItem Header="Level 2" IsExpanded="True"> <Style Selector="RadioButton">
<TreeViewItem Header="Level 3" /> <Setter Property="Margin" Value="4" />
<TreeViewItem Header="Level 3" /> <Setter Property="HorizontalAlignment" Value="Center" />
</TreeViewItem> </Style>
</TreeViewItem> </UniformGrid.Styles>
</TreeView> <RadioButton Content="Avalonia" IsChecked="True" />
<ListBox SelectedIndex="3"> <RadioButton Content="WPF" />
<TextBlock>List Item 1</TextBlock> <RadioButton Content="Xamarin" />
<TextBlock>List Item 2</TextBlock> </UniformGrid>
<TextBlock>List Item 3</TextBlock> <UniformGrid HorizontalAlignment="Center" Columns="3">
<TextBlock>List Item 4</TextBlock> <UniformGrid.Styles>
<TextBlock>List Item 5</TextBlock> <Style Selector="RadioButton">
</ListBox> <Setter Property="Margin" Value="4" />
<Calendar /> <Setter Property="HorizontalAlignment" Value="Center" />
</Style>
</UniformGrid.Styles>
<RadioButton
Content="Avalonia"
IsChecked="True"
Theme="{DynamicResource CardRadioButton}" />
<RadioButton Content="WPF" Theme="{DynamicResource CardRadioButton}" />
<RadioButton Content="Xamarin" Theme="{DynamicResource CardRadioButton}" />
</UniformGrid>
<WrapPanel Width="300">
<WrapPanel.Styles>
<Style Selector="Label">
<Setter Property="Margin" Value="4" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
</Style>
</WrapPanel.Styles>
<Label Classes="Red" Theme="{StaticResource TagLabel}">Red</Label>
<Label Classes="Pink" Theme="{StaticResource TagLabel}">Pink</Label>
<Label Classes="Purple" Theme="{StaticResource TagLabel}">Purple</Label>
<Label Classes="Violet" Theme="{StaticResource TagLabel}">Violet</Label>
<Label Classes="Indigo" Theme="{StaticResource TagLabel}">Indigo</Label>
<Label Classes="Blue" Theme="{StaticResource TagLabel}">Blue</Label>
<Label Classes="LightBlue" Theme="{StaticResource TagLabel}">LightBlue</Label>
<Label Classes="Cyan" Theme="{StaticResource TagLabel}">Cyan</Label>
<Label Classes="Teal" Theme="{StaticResource TagLabel}">Teal</Label>
<Label Classes="Green" Theme="{StaticResource TagLabel}">Green</Label>
<Label Classes="LightGreen" Theme="{StaticResource TagLabel}">LightGreen</Label>
<Label Classes="Lime" Theme="{StaticResource TagLabel}">Lime</Label>
<Label Classes="Yellow" Theme="{StaticResource TagLabel}">Yellow</Label>
<Label Classes="Amber" Theme="{StaticResource TagLabel}">Amber</Label>
<Label Classes="Orange" Theme="{StaticResource TagLabel}">Orange</Label>
<Label Classes="Grey" Theme="{StaticResource TagLabel}">Grey</Label>
<Label Classes="White" Theme="{StaticResource TagLabel}">White</Label>
<Label Classes="Large" Theme="{StaticResource TagLabel}">Large</Label>
<Label Classes="Circle" Theme="{StaticResource TagLabel}">Circle</Label>
</WrapPanel>
</StackPanel>
</StackPanel>
</StackPanel>
<TextBlock
Margin="0,32,0,16"
Classes="H5"
Text="Start to install"
Theme="{DynamicResource TitleTextBlock}" />
<TabControl Padding="8">
<TabItem Header="Main">
<StackPanel>
<TextBlock Text="Install via nuget: " />
<Border Margin="0,16" Classes="CodeBlock">
<SelectableTextBlock FontFamily="Consolas" Text="{Binding $parent[local:Overview].MainInstall}" />
</Border>
<TextBlock Text="Reference styles: " />
<Border Margin="0,16" Classes="CodeBlock">
<SelectableTextBlock
FontFamily="Consolas"
Text="{Binding $parent[local:Overview].MainStyle}"
TextWrapping="Wrap" />
</Border>
</StackPanel>
</TabItem>
<TabItem Header="ColorPicker">
<StackPanel>
<TextBlock Text="Install via nuget: " />
<Border Margin="0,16" Classes="CodeBlock">
<SelectableTextBlock FontFamily="Consolas" Text="{Binding $parent[local:Overview].ColorPickerInstall}" />
</Border>
<TextBlock Text="Reference styles: " />
<Border Margin="0,16" Classes="CodeBlock">
<SelectableTextBlock
FontFamily="Consolas"
Text="{Binding $parent[local:Overview].ColorPickerStyle}"
TextWrapping="Wrap" />
</Border>
</StackPanel>
</TabItem>
<TabItem Header="DataGrid">
<StackPanel>
<TextBlock Text="Install via nuget: " />
<Border Margin="0,16" Classes="CodeBlock">
<SelectableTextBlock FontFamily="Consolas" Text="{Binding $parent[local:Overview].DataGridInstall}" />
</Border>
<TextBlock Text="Reference styles: " />
<Border Margin="0,16" Classes="CodeBlock">
<SelectableTextBlock
FontFamily="Consolas"
Text="{Binding $parent[local:Overview].DataGridStyle}"
TextWrapping="Wrap" />
</Border>
</StackPanel>
</TabItem>
<TabItem Header="TreeDataGrid">
<StackPanel>
<TextBlock Text="Install via nuget: " />
<Border Margin="0,16" Classes="CodeBlock">
<SelectableTextBlock FontFamily="Consolas" Text="{Binding $parent[local:Overview].TreeDataGridInstall}" />
</Border>
<TextBlock Text="Reference styles: " />
<Border Margin="0,16" Classes="CodeBlock">
<SelectableTextBlock
FontFamily="Consolas"
Text="{Binding $parent[local:Overview].TreeDataGridStyle}"
TextWrapping="Wrap" />
</Border>
</StackPanel>
</TabItem>
</TabControl>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
</ScrollViewer> </ScrollViewer>
@@ -1,6 +1,8 @@
using Avalonia; using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml; using Avalonia.Markup.Xaml;
using Avalonia.Styling;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;
@@ -10,4 +12,36 @@ public partial class Overview : UserControl
{ {
InitializeComponent(); InitializeComponent();
} }
public string MainInstall { get; set; } = "dotnet add package Semi.Avalonia --version 11.0.7";
public string MainStyle { get; set; } = """
<Application.Styles>
<StyleInclude Source="avares://Semi.Avalonia/Themes/Index.axaml" />
</Application.Styles>
""";
public string ColorPickerInstall { get; set; } = "dotnet add package Semi.Avalonia.ColorPicker --version 11.0.7";
public string ColorPickerStyle { get; set; } = """
<Application.Styles>
<StyleInclude Source="avares://Semi.Avalonia.ColorPicker/Index.axaml" />
</Application.Styles>
""";
public string DataGridInstall { get; set; } = "dotnet add package Semi.Avalonia.DataGrid --version 11.0.7";
public string DataGridStyle { get; set; } = """
<Application.Styles>
<StyleInclude Source="avares://Semi.Avalonia.DataGrid/Index.axaml" />
</Application.Styles>
""";
public string TreeDataGridInstall { get; set; } = "dotnet add package Semi.Avalonia.TreeDataGrid --version 11.0.7";
public string TreeDataGridStyle { get; set; } = """
<Application.Styles>
<StyleInclude Source="avares://Semi.Avalonia.TreeDataGrid/Index.axaml" />
</Application.Styles>
""";
} }
@@ -0,0 +1,130 @@
<UserControl
x:Class="Semi.Avalonia.Demo.Pages.PaletteDemo"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Semi.Avalonia.Demo.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewModels="clr-namespace:Semi.Avalonia.Demo.ViewModels"
d:DesignHeight="450"
d:DesignWidth="800"
x:CompileBindings="True"
x:DataType="viewModels:PaletteDemoViewModel"
mc:Ignorable="d">
<Design.DataContext>
<viewModels:PaletteDemoViewModel />
</Design.DataContext>
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="../Themes/ToggleButton.axaml" />
<ResourceInclude Source="../Controls/ColorItemControl.axaml" />
<ResourceInclude Source="../Controls/ColorDetailControl.axaml" />
<ResourceInclude Source="../Controls/FunctionalColorGroupControl.axaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<SplitView
Name="splitView"
CompactPaneLength="50"
DisplayMode="CompactInline"
IsPaneOpen="{Binding #toggle.IsChecked, Mode=TwoWay}"
OpenPaneLength="300"
PanePlacement="Right">
<SplitView.Pane>
<StackPanel>
<ToggleButton
Name="toggle"
HorizontalAlignment="Right"
IsChecked="True"
Theme="{DynamicResource SplitViewToggleButton}" />
<Border IsVisible="{Binding #splitView.IsPaneOpen}" Theme="{DynamicResource CardBorder}">
<Panel>
<TextBlock
IsVisible="{Binding SelectedColor, Converter={x:Static ObjectConverters.IsNull}}"
Text="Click on Color to Check Details"
TextWrapping="Wrap" />
<controls:ColorDetailControl
Background="{Binding SelectedColor.Brush}"
ColorResourceKey="{Binding SelectedColor.ColorResourceKey}"
IsVisible="{Binding SelectedColor, Converter={x:Static ObjectConverters.IsNotNull}}"
ResourceKey="{Binding SelectedColor.ResourceKey}"
ResourceName="{Binding SelectedColor.ColorDisplayName}" />
</Panel>
</Border>
</StackPanel>
</SplitView.Pane>
<SplitView.Content>
<ScrollViewer>
<StackPanel Margin="8,0">
<TextBlock
Classes="H3"
Text="Basic Colors"
Theme="{DynamicResource TitleTextBlock}" />
<TabControl>
<TabItem Header="Light">
<ItemsControl Margin="16" ItemsSource="{Binding LightLists}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="viewModels:ColorListViewModel">
<ItemsControl Margin="4,0" ItemsSource="{Binding Color}">
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="viewModels:ColorItemViewModel">
<controls:ColorItemControl
Background="{Binding Brush}"
ColorName="{Binding ColorDisplayName}"
Foreground="{Binding TextBrush}"
Hex="{Binding Hex}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</TabItem>
<TabItem Header="Dark">
<ItemsControl Margin="16" ItemsSource="{Binding DarkLists}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="viewModels:ColorListViewModel">
<ItemsControl Margin="4,0" ItemsSource="{Binding Color}">
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="viewModels:ColorItemViewModel">
<controls:ColorItemControl
Background="{Binding Brush}"
ColorName="{Binding ColorDisplayName}"
Foreground="{Binding TextBrush}"
Hex="{Binding Hex}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</TabItem>
</TabControl>
<ItemsControl ItemsSource="{Binding FunctionalColors}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<!-- -->
<controls:FunctionalColorGroupControl
Title="{Binding Title}"
DarkColors="{Binding DarkColors}"
LightColors="{Binding LightColors}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</ScrollViewer>
</SplitView.Content>
</SplitView>
</UserControl>
@@ -0,0 +1,29 @@
using System.Threading.Tasks;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Primitives;
using Avalonia.Markup.Xaml;
using Avalonia.Threading;
using Semi.Avalonia.Demo.ViewModels;
namespace Semi.Avalonia.Demo.Pages;
public partial class PaletteDemo : UserControl
{
public PaletteDemo()
{
InitializeComponent();
}
protected override async void OnApplyTemplate(TemplateAppliedEventArgs e)
{
base.OnApplyTemplate(e);
PaletteDemoViewModel? vm = new PaletteDemoViewModel();
await Dispatcher.UIThread.InvokeAsync(() =>
{
vm.InitializeResources();
});
DataContext = vm;
}
}
@@ -0,0 +1,22 @@
<UserControl
x:Class="Semi.Avalonia.Demo.Pages.PathIconDemo"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<StackPanel HorizontalAlignment="Left" >
<TextBlock Text="Size"></TextBlock>
<Slider Name="width" Minimum="0" Maximum="100" Value="20" Width="300"></Slider>
<ToggleSwitch Name="active" Content="Active"></ToggleSwitch>
<PathIcon
Classes.Active="{Binding ElementName=active, Path=IsChecked}"
BorderBrush="{DynamicResource SemiRed6}"
Width="{Binding #width.Value}"
Height="{Binding #width.Value}"
Data="M12 3L2 12H5V20H19V12H22L12 3M13 18H11V16H13V18M13 14H11V8H13V14Z"
Foreground="{DynamicResource SemiBlue6}" />
</StackPanel>
</UserControl>
@@ -0,0 +1,13 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages;
public partial class PathIconDemo : UserControl
{
public PathIconDemo()
{
InitializeComponent();
}
}
@@ -7,117 +7,159 @@
d:DesignHeight="800" d:DesignHeight="800"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">
<StackPanel <ScrollViewer>
Margin="20" <StackPanel HorizontalAlignment="Left" Spacing="20">
HorizontalAlignment="Left" <StackPanel
Spacing="20"> HorizontalAlignment="Left"
<ProgressBar Orientation="Horizontal"
Width="200" Spacing="20">
Maximum="100" <ProgressBar
Minimum="0" Width="100"
ShowProgressText="True" Height="100"
Value="20" /> Maximum="{Binding #slider.Maximum}"
<ProgressBar Minimum="{Binding #slider.Minimum}"
Width="200" Theme="{DynamicResource ProgressRing}"
IsIndeterminate="True" Value="{Binding #slider.Value}"
Maximum="100" ShowProgressText="True"/>
Minimum="0" <ProgressBar
ShowProgressText="True" Width="100"
Value="20" /> Height="100"
<ProgressBar IsIndeterminate="True"
Width="200" Maximum="{Binding #slider.Maximum}"
Classes="Left" Minimum="{Binding #slider.Minimum}"
IsIndeterminate="True" Theme="{DynamicResource ProgressRing}"
Maximum="100" ShowProgressText="True"/>
Minimum="0" </StackPanel>
ShowProgressText="True" <Slider
Value="20" /> Name="slider"
<ProgressBar Width="300"
Width="200" IsSnapToTickEnabled="True"
Classes="Left" Maximum="100"
Maximum="100" Minimum="0"
Minimum="0" TickFrequency="10" />
ShowProgressText="True" <ProgressBar
Value="20" /> Width="200"
<ProgressBar Maximum="100"
Width="200" Minimum="0"
Classes="Right" ShowProgressText="True"
Maximum="100" Value="{Binding #slider.Value}" />
Minimum="0" <ProgressBar
ShowProgressText="True" Width="200"
Value="20" /> IsIndeterminate="True"
<StackPanel
HorizontalAlignment="Left"
Orientation="Horizontal"
Spacing="20">
<ProgressBar
Classes="Left"
Maximum="100" Maximum="100"
Minimum="0" Minimum="0"
Orientation="Vertical"
ShowProgressText="True" ShowProgressText="True"
Value="20" /> Value="20" />
<ProgressBar <ProgressBar
Width="200"
Classes="Left"
IsIndeterminate="True"
Maximum="100"
Minimum="0"
ShowProgressText="True"
Value="20" />
<ProgressBar
Width="200"
Classes="Left"
Maximum="100"
Minimum="0"
ShowProgressText="True"
Value="20" />
<ProgressBar
Width="200"
Classes="Right" Classes="Right"
Maximum="100" Maximum="100"
Minimum="0" Minimum="0"
Orientation="Vertical"
ShowProgressText="True" ShowProgressText="True"
Value="20" /> Value="20" />
<StackPanel
HorizontalAlignment="Left"
Orientation="Horizontal"
Spacing="20">
<ProgressBar
Classes="Left"
Maximum="100"
Minimum="0"
Orientation="Vertical"
ShowProgressText="True"
Value="20" />
<ProgressBar
Classes="Right"
Maximum="100"
Minimum="0"
Orientation="Vertical"
ShowProgressText="True"
Value="20" />
<ProgressBar
Maximum="100"
Minimum="0"
Orientation="Vertical"
ShowProgressText="True"
Value="20" />
<ProgressBar
Classes="Left"
Maximum="100"
Minimum="0"
Orientation="Vertical"
ShowProgressText="False"
Value="20" />
<ProgressBar
IsIndeterminate="True"
Maximum="100"
Minimum="0"
Orientation="Vertical"
ShowProgressText="True"
Value="20" />
<ProgressBar
IsIndeterminate="True"
Maximum="100"
Minimum="0"
Orientation="Vertical"
ShowProgressText="False"
Value="20" />
</StackPanel>
<ProgressBar <ProgressBar
Width="200"
Classes="Primary"
Maximum="100" Maximum="100"
Minimum="0" Minimum="0"
Orientation="Vertical"
ShowProgressText="True" ShowProgressText="True"
Value="20" /> Value="60" />
<ProgressBar <ProgressBar
Classes="Left" Width="200"
Classes="Secondary"
Maximum="100" Maximum="100"
Minimum="0" Minimum="0"
Orientation="Vertical"
ShowProgressText="False"
Value="20" />
<ProgressBar
IsIndeterminate="True"
Maximum="100"
Minimum="0"
Orientation="Vertical"
ShowProgressText="True" ShowProgressText="True"
Value="20" /> Value="60" />
<ProgressBar <ProgressBar
IsIndeterminate="True" Width="200"
Classes="Tertiary"
Maximum="100" Maximum="100"
Minimum="0" Minimum="0"
Orientation="Vertical" ShowProgressText="True"
ShowProgressText="False" Value="60" />
Value="20" /> <ProgressBar
Width="200"
Classes="Success"
Maximum="100"
Minimum="0"
ShowProgressText="True"
Value="60" />
<ProgressBar
Width="200"
Classes="Warning"
Maximum="100"
Minimum="0"
ShowProgressText="True"
Value="60" />
<ProgressBar
Width="200"
Classes="Error"
Maximum="100"
Minimum="0"
ShowProgressText="True"
Value="60" />
</StackPanel> </StackPanel>
<ProgressBar </ScrollViewer>
Width="200"
Classes="Success"
Maximum="100"
Minimum="0"
ShowProgressText="True"
Value="60" />
<ProgressBar
Width="200"
Classes="Warning"
Maximum="100"
Minimum="0"
ShowProgressText="True"
Value="60" />
<ProgressBar
Width="200"
Classes="Error"
Maximum="100"
Minimum="0"
ShowProgressText="True"
Value="60" />
<ProgressBar
Width="200"
Maximum="100"
Minimum="0"
ShowProgressText="True"
Value="60" />
</StackPanel>
</UserControl> </UserControl>
@@ -1,76 +1,161 @@
<UserControl <UserControl
x:Class="Semi.Avalonia.Demo.Pages.RadioButtonDemo" xmlns="https://github.com/avaloniaui" x:Class="Semi.Avalonia.Demo.Pages.RadioButtonDemo"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns="https://github.com/avaloniaui"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
<StackPanel xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
Margin="20" HorizontalAlignment="Left" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Spacing="20"> mc:Ignorable="d">
<TextBlock Text="Radio Buttons" /> <ScrollViewer>
<StackPanel> <StackPanel HorizontalAlignment="Left" Spacing="20">
<RadioButton>111</RadioButton> <TextBlock Text="Radio Buttons" />
<RadioButton>222</RadioButton>
<RadioButton>333</RadioButton>
</StackPanel>
<TextBlock Text="Radio Button as Button" />
<Border HorizontalAlignment="Left" Theme="{StaticResource RadioButtonGroupBorder}">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<RadioButton Classes="Small" Theme="{DynamicResource ButtonRadioButton}">小1</RadioButton> <RadioButton>Unchecked</RadioButton>
<RadioButton Classes="Small" Theme="{DynamicResource ButtonRadioButton}">小2</RadioButton> <RadioButton IsChecked="True">Checked</RadioButton>
</StackPanel> </StackPanel>
</Border>
<Border HorizontalAlignment="Left" Theme="{StaticResource RadioButtonGroupBorder}">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<RadioButton Theme="{DynamicResource ButtonRadioButton}">默认1</RadioButton> <RadioButton IsEnabled="False">Unchecked</RadioButton>
<RadioButton Theme="{DynamicResource ButtonRadioButton}">默认2</RadioButton> <RadioButton IsChecked="True" IsEnabled="False">Checked</RadioButton>
</StackPanel> </StackPanel>
</Border> <TextBlock Text="Radio Button as Button" />
<Border HorizontalAlignment="Left" Theme="{StaticResource RadioButtonGroupBorder}">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<RadioButton Classes="Large" Theme="{DynamicResource ButtonRadioButton}">大1</RadioButton> <Border HorizontalAlignment="Left" Theme="{StaticResource RadioButtonGroupBorder}">
<RadioButton Classes="Large" Theme="{DynamicResource ButtonRadioButton}">大2</RadioButton> <StackPanel Orientation="Horizontal">
<RadioButton Classes="Small" Theme="{DynamicResource ButtonRadioButton}">小1</RadioButton>
<RadioButton
Classes="Small"
IsChecked="True"
Theme="{DynamicResource ButtonRadioButton}">
小2
</RadioButton>
</StackPanel>
</Border>
<Border
Margin="8,0"
HorizontalAlignment="Left"
Theme="{StaticResource RadioButtonGroupBorder}">
<StackPanel Orientation="Horizontal">
<RadioButton
Classes="Small"
IsEnabled="False"
Theme="{DynamicResource ButtonRadioButton}">
小1
</RadioButton>
<RadioButton
Classes="Small"
IsChecked="True"
IsEnabled="False"
Theme="{DynamicResource ButtonRadioButton}">
小2
</RadioButton>
</StackPanel>
</Border>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Border HorizontalAlignment="Left" Theme="{StaticResource RadioButtonGroupBorder}">
<StackPanel Orientation="Horizontal">
<RadioButton Theme="{DynamicResource ButtonRadioButton}">默认1</RadioButton>
<RadioButton IsChecked="True" Theme="{DynamicResource ButtonRadioButton}">默认2</RadioButton>
</StackPanel>
</Border>
<Border
Margin="8,0"
HorizontalAlignment="Left"
Theme="{StaticResource RadioButtonGroupBorder}">
<StackPanel Orientation="Horizontal">
<RadioButton IsEnabled="False" Theme="{DynamicResource ButtonRadioButton}">默认1</RadioButton>
<RadioButton
IsChecked="True"
IsEnabled="False"
Theme="{DynamicResource ButtonRadioButton}">
默认2
</RadioButton>
</StackPanel>
</Border>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Border HorizontalAlignment="Left" Theme="{StaticResource RadioButtonGroupBorder}">
<StackPanel Orientation="Horizontal">
<RadioButton Classes="Large" Theme="{DynamicResource ButtonRadioButton}">大1</RadioButton>
<RadioButton
Classes="Large"
IsChecked="True"
Theme="{DynamicResource ButtonRadioButton}">
大2
</RadioButton>
</StackPanel>
</Border>
<Border
Margin="8,0"
HorizontalAlignment="Left"
Theme="{StaticResource RadioButtonGroupBorder}">
<StackPanel Orientation="Horizontal">
<RadioButton
Classes="Large"
IsEnabled="False"
Theme="{DynamicResource ButtonRadioButton}">
大1
</RadioButton>
<RadioButton
Classes="Large"
IsChecked="True"
IsEnabled="False"
Theme="{DynamicResource ButtonRadioButton}">
大2
</RadioButton>
</StackPanel>
</Border>
</StackPanel>
<TextBlock Text="Radio Button as Card" />
<StackPanel Orientation="Horizontal">
<RadioButton
Width="300"
Content="Avalonia"
IsChecked="True"
Theme="{DynamicResource CardRadioButton}" />
<RadioButton
Width="300"
Content="WPF"
IsChecked="True"
Theme="{DynamicResource CardRadioButton}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<RadioButton
Width="300"
Content="Avalonia"
IsEnabled="False"
Theme="{DynamicResource CardRadioButton}" />
<RadioButton
Width="300"
Content="WPF"
IsChecked="True"
IsEnabled="False"
Theme="{DynamicResource CardRadioButton}" />
</StackPanel>
<TextBlock Text="Radio Button as Pure Card" />
<StackPanel Orientation="Horizontal">
<RadioButton
Width="300"
Content="Avalonia"
IsChecked="True"
Theme="{DynamicResource PureCardRadioButton}" />
<RadioButton
Width="300"
Content="WPF"
Theme="{DynamicResource PureCardRadioButton}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<RadioButton
Width="300"
Content="Avalonia"
IsChecked="True"
IsEnabled="False"
Theme="{DynamicResource PureCardRadioButton}" />
<RadioButton
Width="300"
Content="WPF"
IsEnabled="False"
Theme="{DynamicResource PureCardRadioButton}" />
</StackPanel> </StackPanel>
</Border>
<TextBlock Text="Radio Button as Card" />
<StackPanel Orientation="Horizontal">
<RadioButton Width="300" Theme="{DynamicResource CardRadioButton}">
<StackPanel>
<TextBlock FontWeight="Bold">单选框标题</TextBlock>
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统</TextBlock>
</StackPanel>
</RadioButton>
<RadioButton Width="300" Theme="{DynamicResource CardRadioButton}">
<StackPanel>
<TextBlock FontWeight="Bold">单选框标题</TextBlock>
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统</TextBlock>
</StackPanel>
</RadioButton>
<RadioButton Width="300" Theme="{DynamicResource CardRadioButton}">
<StackPanel>
<TextBlock FontWeight="Bold">单选框标题</TextBlock>
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统</TextBlock>
</StackPanel>
</RadioButton>
</StackPanel> </StackPanel>
<TextBlock Text="Radio Button as Pure Card" /> </ScrollViewer>
<StackPanel Orientation="Horizontal">
<RadioButton Width="300" Theme="{DynamicResource PureCardRadioButton}">
<StackPanel>
<TextBlock FontWeight="Bold">单选框标题</TextBlock>
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统</TextBlock>
</StackPanel>
</RadioButton>
<RadioButton Width="300" Theme="{DynamicResource PureCardRadioButton}">
<StackPanel>
<TextBlock FontWeight="Bold">单选框标题</TextBlock>
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统</TextBlock>
</StackPanel>
</RadioButton>
<RadioButton Width="300" Theme="{DynamicResource PureCardRadioButton}">
<StackPanel>
<TextBlock FontWeight="Bold">单选框标题</TextBlock>
<TextBlock TextWrapping="Wrap">Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统</TextBlock>
</StackPanel>
</RadioButton>
</StackPanel>
</StackPanel>
</UserControl> </UserControl>
@@ -0,0 +1,27 @@
<UserControl
x:Class="Semi.Avalonia.Demo.Pages.RefreshContainerDemo"
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:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
d:DesignHeight="450"
d:DesignWidth="800"
x:DataType="pages:RefreshContainerDemoViewModel"
x:CompileBindings="True"
mc:Ignorable="d">
<DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Top">
<Label DockPanel.Dock="Top">A control that supports pull to refresh</Label>
<RefreshContainer Name="Refresh"
DockPanel.Dock="Bottom"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
PullDirection="TopToBottom"
RefreshRequested="RefreshContainerPage_RefreshRequested"
Margin="5">
<ListBox HorizontalAlignment="Stretch"
VerticalAlignment="Top"
ItemsSource="{Binding Items}" />
</RefreshContainer>
</DockPanel>
</UserControl>
@@ -0,0 +1,46 @@
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using Avalonia.Controls;
using CommunityToolkit.Mvvm.ComponentModel;
namespace Semi.Avalonia.Demo.Pages;
public partial class RefreshContainerDemo : UserControl
{
private RefreshContainerDemoViewModel _viewModel;
public RefreshContainerDemo()
{
InitializeComponent();
_viewModel = new RefreshContainerDemoViewModel();
DataContext = _viewModel;
}
private async void RefreshContainerPage_RefreshRequested(object? sender, RefreshRequestedEventArgs e)
{
var deferral = e.GetDeferral();
await _viewModel.AddToTop();
deferral.Complete();
}
}
public class RefreshContainerDemoViewModel : ObservableObject
{
public ObservableCollection<string> Items { get; }
public RefreshContainerDemoViewModel()
{
Items = new ObservableCollection<string>(Enumerable.Range(1, 200).Select(i => $"Item {i}"));
}
public async Task AddToTop()
{
await Task.Delay(1000);
Items.Insert(0, $"Item {200 - Items.Count}");
}
}
@@ -1,37 +1,57 @@
<UserControl xmlns="https://github.com/avaloniaui" <UserControl
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="Semi.Avalonia.Demo.Pages.RepeatButtonDemo"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns="https://github.com/avaloniaui"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
mc:Ignorable="d" d:DesignWidth="800" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
d:DesignHeight="450" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
x:Class="Semi.Avalonia.Demo.Pages.RepeatButtonDemo"> d:DesignHeight="450"
<StackPanel Margin="20" HorizontalAlignment="Left" Spacing="20"> d:DesignWidth="800"
mc:Ignorable="d">
<StackPanel HorizontalAlignment="Left" Spacing="20">
<TextBlock>Light (Default)</TextBlock> <TextBlock>Light (Default)</TextBlock>
<StackPanel Orientation="Horizontal" Spacing="20"> <StackPanel Orientation="Horizontal" Spacing="20">
<RepeatButton Classes="Primary">Primary</RepeatButton> <RepeatButton Classes="Primary">Primary</RepeatButton>
<RepeatButton Classes="Secondary">Secondary</RepeatButton> <RepeatButton Classes="Secondary">Secondary</RepeatButton>
<RepeatButton Classes="Tertiary">Tertiary</RepeatButton> <RepeatButton Classes="Tertiary">Tertiary</RepeatButton>
<RepeatButton Classes="Success">Success</RepeatButton>
<RepeatButton Classes="Warning">Warning</RepeatButton> <RepeatButton Classes="Warning">Warning</RepeatButton>
<RepeatButton Classes="Danger">Danger</RepeatButton> <RepeatButton Classes="Danger">Danger</RepeatButton>
<RepeatButton Classes="Primary" IsEnabled="False">Danger</RepeatButton> <RepeatButton Classes="Danger" IsEnabled="False">Disabled</RepeatButton>
</StackPanel> </StackPanel>
<TextBlock>Solid</TextBlock> <TextBlock>Solid</TextBlock>
<StackPanel Orientation="Horizontal" Spacing="20"> <StackPanel Orientation="Horizontal" Spacing="20">
<RepeatButton Classes="Primary" Theme="{DynamicResource SolidRepeatButton}">Primary</RepeatButton> <RepeatButton Classes="Primary" Theme="{DynamicResource SolidRepeatButton}">Primary</RepeatButton>
<RepeatButton Classes="Secondary" Theme="{DynamicResource SolidRepeatButton}">Secondary</RepeatButton> <RepeatButton Classes="Secondary" Theme="{DynamicResource SolidRepeatButton}">Secondary</RepeatButton>
<RepeatButton Classes="Tertiary" Theme="{DynamicResource SolidRepeatButton}">Tertiary</RepeatButton> <RepeatButton Classes="Tertiary" Theme="{DynamicResource SolidRepeatButton}">Tertiary</RepeatButton>
<RepeatButton Classes="Success" Theme="{DynamicResource SolidRepeatButton}">Success</RepeatButton>
<RepeatButton Classes="Warning" Theme="{DynamicResource SolidRepeatButton}">Warning</RepeatButton> <RepeatButton Classes="Warning" Theme="{DynamicResource SolidRepeatButton}">Warning</RepeatButton>
<RepeatButton Classes="Danger" Theme="{DynamicResource SolidRepeatButton}">Danger</RepeatButton> <RepeatButton Classes="Danger" Theme="{DynamicResource SolidRepeatButton}">Danger</RepeatButton>
<RepeatButton Classes="Primary" IsEnabled="False" Theme="{DynamicResource SolidRepeatButton}">Danger</RepeatButton> <RepeatButton
Classes="Danger"
IsEnabled="False"
Theme="{DynamicResource SolidRepeatButton}">
Disabled
</RepeatButton>
</StackPanel> </StackPanel>
<TextBlock>Borderless</TextBlock> <TextBlock>Borderless</TextBlock>
<StackPanel Orientation="Horizontal" Spacing="20"> <StackPanel Orientation="Horizontal" Spacing="20">
<RepeatButton Classes="Primary" Theme="{DynamicResource BorderlessRepeatButton}">Primary</RepeatButton> <RepeatButton Classes="Primary" Theme="{DynamicResource BorderlessRepeatButton}">Primary</RepeatButton>
<RepeatButton Classes="Secondary" Theme="{DynamicResource BorderlessRepeatButton}">Secondary</RepeatButton> <RepeatButton Classes="Secondary" Theme="{DynamicResource BorderlessRepeatButton}">Secondary</RepeatButton>
<RepeatButton Classes="Tertiary" Theme="{DynamicResource BorderlessRepeatButton}">Tertiary</RepeatButton> <RepeatButton Classes="Tertiary" Theme="{DynamicResource BorderlessRepeatButton}">Tertiary</RepeatButton>
<RepeatButton Classes="Success" Theme="{DynamicResource BorderlessRepeatButton}">Success</RepeatButton>
<RepeatButton Classes="Warning" Theme="{DynamicResource BorderlessRepeatButton}">Warning</RepeatButton> <RepeatButton Classes="Warning" Theme="{DynamicResource BorderlessRepeatButton}">Warning</RepeatButton>
<RepeatButton Classes="Danger" Theme="{DynamicResource BorderlessRepeatButton}">Danger</RepeatButton> <RepeatButton Classes="Danger" Theme="{DynamicResource BorderlessRepeatButton}">Danger</RepeatButton>
<RepeatButton Classes="Primary" IsEnabled="False" Theme="{DynamicResource BorderlessRepeatButton}">Danger</RepeatButton> <RepeatButton
Classes="Danger"
IsEnabled="False"
Theme="{DynamicResource BorderlessRepeatButton}">
Disabled
</RepeatButton>
</StackPanel>
<StackPanel Orientation="Horizontal" Spacing="8">
<RepeatButton Classes="Small">Small</RepeatButton>
<RepeatButton>Default</RepeatButton>
<RepeatButton Classes="Large">Large</RepeatButton>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
</UserControl> </UserControl>
@@ -0,0 +1,75 @@
<UserControl
x:Class="Semi.Avalonia.Demo.Pages.ScrollViewerDemo"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<ScrollViewer>
<StackPanel HorizontalAlignment="Left" Spacing="20">
<ScrollViewer
Width="200"
Height="200"
Margin="10"
HorizontalScrollBarVisibility="Auto">
<Grid RowDefinitions="Auto,Auto"
ColumnDefinitions="Auto,Auto"
Width="300" Height="300">
<Rectangle
Grid.Row="0" Grid.Column="0"
Width="150"
Height="150"
Fill="{DynamicResource SemiYellow2}" />
<Rectangle
Grid.Row="0" Grid.Column="1"
Width="150"
Height="150"
Fill="{DynamicResource SemiBlue2}" />
<Rectangle
Grid.Row="1" Grid.Column="0"
Width="150"
Height="150"
Fill="{DynamicResource SemiPink2}" />
<Rectangle
Grid.Row="1" Grid.Column="1"
Width="150"
Height="150"
Fill="{DynamicResource SemiGreen2}" />
</Grid>
</ScrollViewer>
<ScrollViewer
Width="200"
Height="200"
Margin="10"
HorizontalScrollBarVisibility="Auto"
Theme="{DynamicResource StaticScrollViewer}">
<Grid RowDefinitions="Auto,Auto"
ColumnDefinitions="Auto,Auto"
Width="300" Height="300">
<Rectangle
Grid.Row="0" Grid.Column="0"
Width="150"
Height="150"
Fill="{DynamicResource SemiYellow2}" />
<Rectangle
Grid.Row="0" Grid.Column="1"
Width="150"
Height="150"
Fill="{DynamicResource SemiBlue2}" />
<Rectangle
Grid.Row="1" Grid.Column="0"
Width="150"
Height="150"
Fill="{DynamicResource SemiPink2}" />
<Rectangle
Grid.Row="1" Grid.Column="1"
Width="150"
Height="150"
Fill="{DynamicResource SemiGreen2}" />
</Grid>
</ScrollViewer>
</StackPanel>
</ScrollViewer>
</UserControl>
@@ -0,0 +1,18 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages;
public partial class ScrollViewerDemo : UserControl
{
public ScrollViewerDemo()
{
InitializeComponent();
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
}
@@ -0,0 +1,163 @@
<UserControl
x:Class="Semi.Avalonia.Demo.Pages.SelectableTextBlockDemo"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<StackPanel Orientation="Horizontal">
<StackPanel.Styles>
<Style Selector="SelectableTextBlock">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Margin" Value="4" />
</Style>
</StackPanel.Styles>
<HeaderedContentControl
Width="400"
Height="400"
Margin="16"
VerticalAlignment="Top"
Header="Default Theme"
Theme="{DynamicResource GroupBox}">
<Grid
VerticalAlignment="Top"
ColumnDefinitions="Auto, *"
RowDefinitions="*,*,*,*,*,*,*,*,*,*,*,*">
<SelectableTextBlock Grid.Row="1" Grid.Column="0">Classes</SelectableTextBlock>
<SelectableTextBlock Grid.Row="2" Grid.Column="0">-</SelectableTextBlock>
<SelectableTextBlock Grid.Row="3" Grid.Column="0">Secondary</SelectableTextBlock>
<SelectableTextBlock Grid.Row="4" Grid.Column="0">Tertiary</SelectableTextBlock>
<SelectableTextBlock Grid.Row="5" Grid.Column="0">Quaternary</SelectableTextBlock>
<SelectableTextBlock Grid.Row="6" Grid.Column="0">Success</SelectableTextBlock>
<SelectableTextBlock Grid.Row="7" Grid.Column="0">Warning</SelectableTextBlock>
<SelectableTextBlock Grid.Row="8" Grid.Column="0">Danger</SelectableTextBlock>
<SelectableTextBlock Grid.Row="9" Grid.Column="0">Mark</SelectableTextBlock>
<SelectableTextBlock Grid.Row="10" Grid.Column="0">Underline</SelectableTextBlock>
<SelectableTextBlock Grid.Row="11" Grid.Column="0">Delete</SelectableTextBlock>
<SelectableTextBlock Grid.Row="2" Grid.Column="1">Text</SelectableTextBlock>
<SelectableTextBlock
Grid.Row="3"
Grid.Column="1"
Classes="Secondary">
Secondary
</SelectableTextBlock>
<SelectableTextBlock
Grid.Row="4"
Grid.Column="1"
Classes="Tertiary">
Tertiary
</SelectableTextBlock>
<SelectableTextBlock
Grid.Row="5"
Grid.Column="1"
Classes="Quaternary">
Quaternary
</SelectableTextBlock>
<SelectableTextBlock
Grid.Row="6"
Grid.Column="1"
Classes="Success">
Success
</SelectableTextBlock>
<SelectableTextBlock
Grid.Row="7"
Grid.Column="1"
Classes="Warning">
Warning
</SelectableTextBlock>
<SelectableTextBlock
Grid.Row="8"
Grid.Column="1"
Classes="Danger">
Danger
</SelectableTextBlock>
<SelectableTextBlock
Grid.Row="9"
Grid.Column="1"
Classes="Mark">
Default Mark
</SelectableTextBlock>
<SelectableTextBlock
Grid.Row="10"
Grid.Column="1"
Classes="Underline">
Underline
</SelectableTextBlock>
<SelectableTextBlock
Grid.Row="11"
Grid.Column="1"
Classes="Delete">
Delete
</SelectableTextBlock>
</Grid>
</HeaderedContentControl>
<HeaderedContentControl
Width="400"
Height="400"
Margin="16"
VerticalAlignment="Top"
Header="Theme: TitleSelectableTextBlock"
Theme="{DynamicResource GroupBox}">
<Grid
VerticalAlignment="Top"
Background="{Binding}"
ColumnDefinitions="Auto, *"
RowDefinitions="*,*,*,*,*,*,*,*">
<SelectableTextBlock Grid.Row="1" Grid.Column="0">Classes</SelectableTextBlock>
<SelectableTextBlock Grid.Row="2" Grid.Column="0">H1</SelectableTextBlock>
<SelectableTextBlock Grid.Row="3" Grid.Column="0">H2</SelectableTextBlock>
<SelectableTextBlock Grid.Row="4" Grid.Column="0">H3</SelectableTextBlock>
<SelectableTextBlock Grid.Row="5" Grid.Column="0">H4</SelectableTextBlock>
<SelectableTextBlock Grid.Row="6" Grid.Column="0">H5</SelectableTextBlock>
<SelectableTextBlock Grid.Row="7" Grid.Column="0">H6</SelectableTextBlock>
<SelectableTextBlock
Grid.Row="2"
Grid.Column="1"
Classes="H1"
Theme="{StaticResource TitleSelectableTextBlock}">
Header 1
</SelectableTextBlock>
<SelectableTextBlock
Grid.Row="3"
Grid.Column="1"
Classes="H2"
Theme="{StaticResource TitleSelectableTextBlock}">
Header 2
</SelectableTextBlock>
<SelectableTextBlock
Grid.Row="4"
Grid.Column="1"
Classes="H3"
Theme="{StaticResource TitleSelectableTextBlock}">
Header 3
</SelectableTextBlock>
<SelectableTextBlock
Grid.Row="5"
Grid.Column="1"
Classes="H4"
Theme="{StaticResource TitleSelectableTextBlock}">
Header 4
</SelectableTextBlock>
<SelectableTextBlock
Grid.Row="6"
Grid.Column="1"
Classes="H5"
Theme="{StaticResource TitleSelectableTextBlock}">
Header 5
</SelectableTextBlock>
<SelectableTextBlock
Grid.Row="7"
Grid.Column="1"
Classes="H6"
Theme="{StaticResource TitleSelectableTextBlock}">
Header 6
</SelectableTextBlock>
</Grid>
</HeaderedContentControl>
</StackPanel>
</ScrollViewer>
</UserControl>
@@ -0,0 +1,18 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages;
public partial class SelectableTextBlockDemo : UserControl
{
public SelectableTextBlockDemo()
{
InitializeComponent();
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
}
+26 -4
View File
@@ -7,10 +7,7 @@
d:DesignHeight="800" d:DesignHeight="800"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">
<StackPanel <StackPanel HorizontalAlignment="Left" Spacing="20">
Margin="20"
HorizontalAlignment="Left"
Spacing="20">
<Slider <Slider
Width="300" Width="300"
Maximum="100" Maximum="100"
@@ -65,6 +62,15 @@
TickFrequency="10" TickFrequency="10"
TickPlacement="TopLeft" TickPlacement="TopLeft"
Value="0" /> Value="0" />
<Slider
Height="300"
IsSnapToTickEnabled="True"
Maximum="100"
Minimum="0"
Orientation="Vertical"
TickFrequency="10"
TickPlacement="Outside"
Value="0" />
<Slider <Slider
Height="300" Height="300"
Classes="ToolTip" Classes="ToolTip"
@@ -74,6 +80,22 @@
TickFrequency="10" TickFrequency="10"
TickPlacement="TopLeft" TickPlacement="TopLeft"
Value="0" /> Value="0" />
<Slider
Height="300"
IsDirectionReversed="True"
Maximum="100"
Minimum="0"
Orientation="Vertical"
TickFrequency="10"
Value="0" />
<Slider
Height="300"
IsEnabled="False"
Maximum="100"
Minimum="0"
Orientation="Vertical"
TickFrequency="10"
Value="30" />
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
</UserControl> </UserControl>
+163 -118
View File
@@ -4,145 +4,190 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450" xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
d:DesignHeight="1000"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">
<Design.DataContext>
<pages:SplitViewDemoViewModel />
</Design.DataContext>
<UserControl.Resources>
<ResourceDictionary>
<StreamGeometry x:Key="NavigationMenuExpandIconGlyph">M5 2H19C20.6569 2 22 3.34315 22 5V19C22 20.6569 20.6569 22 19 22H5C3.34315 22 2 20.6569 2 19V5C2 3.34315 3.34315 2 5 2ZM6 4C5.44772 4 5 4.44772 5 5V19C5 19.5523 5.44772 20 6 20H9C9.55229 20 10 19.5523 10 19V5C10 4.44772 9.55229 4 9 4H6Z</StreamGeometry>
</ResourceDictionary>
</UserControl.Resources>
<Border> <Border>
<Grid ColumnDefinitions="*,400"> <Grid ColumnDefinitions="*,400">
<StackPanel <Border Grid.Column="1" VerticalAlignment="Top" Margin="10 0 0 0">
Grid.Column="1" <Grid RowDefinitions="*, *, *, *, *, *" ColumnDefinitions="Auto, *">
Margin="5" <Label
Orientation="Vertical" Grid.Row="0" Grid.Column="0"
Spacing="4"> VerticalAlignment="Center"
<ToggleButton Content="IsPaneOpen" />
Name="PaneOpenButton" <ToggleSwitch
Content="IsPaneOpen" Grid.Row="0" Grid.Column="1"
IsChecked="{Binding IsPaneOpen, ElementName=SplitView}" /> Name="PaneOpenButton"
IsChecked="{Binding #SplitView.IsPaneOpen}" />
<ToggleButton <Label
Name="UseLightDismissOverlayModeButton" Grid.Row="1" Grid.Column="0"
Content="UseLightDismissOverlayMode" VerticalAlignment="Center"
IsChecked="{Binding UseLightDismissOverlayMode, ElementName=SplitView}" /> Content="UseLightDismissOverlayMode" />
<ToggleSwitch
Grid.Row="1" Grid.Column="1"
Name="UseLightDismissOverlayModeButton"
IsChecked="{Binding #SplitView.UseLightDismissOverlayMode}" />
<ToggleSwitch <Label
Content="Placement" Grid.Row="2" Grid.Column="0"
IsChecked="{Binding !IsLeft}" VerticalAlignment="Center"
OffContent="Left" Content="Placement" />
OnContent="Right" /> <ToggleSwitch
Grid.Row="2" Grid.Column="1"
OffContent="Left"
OnContent="Right"
IsChecked="{Binding #SplitView.PanePlacement}" />
<TextBlock Text="DisplayMode" /> <Label
<ComboBox Grid.Row="3" Grid.Column="0"
Name="DisplayModeSelector" VerticalAlignment="Center"
Width="170" Content="DisplayMode" />
Margin="10" <ComboBox
SelectedIndex="{Binding DisplayMode}"> Grid.Row="3" Grid.Column="1"
<ComboBoxItem>Inline</ComboBoxItem> Name="DisplayModeSelector"
<ComboBoxItem>CompactInline</ComboBoxItem> HorizontalAlignment="Stretch"
<ComboBoxItem>Overlay</ComboBoxItem> ItemsSource="{Binding DisplayModes}"
<ComboBoxItem>CompactOverlay</ComboBoxItem> SelectedIndex="{Binding #SplitView.DisplayMode}" />
</ComboBox>
<TextBlock Text="PaneBackground" /> <Label
<ComboBox Grid.Row="4" Grid.Column="0"
Name="PaneBackgroundSelector" VerticalAlignment="Center"
Width="170" Content="{Binding #CompactPaneLengthSlider.Value, StringFormat='{}CompactPaneLength: {0}'}" />
Margin="10" <Slider
SelectedIndex="0"> Grid.Row="4" Grid.Column="1"
<ComboBoxItem Tag="White">White</ComboBoxItem> Name="CompactPaneLengthSlider"
<ComboBoxItem Tag="Red">Red</ComboBoxItem> Maximum="128"
<ComboBoxItem Tag="Blue">Blue</ComboBoxItem> Minimum="0"
<ComboBoxItem Tag="Green">Green</ComboBoxItem> TickFrequency="1"
</ComboBox> IsSnapToTickEnabled="True"
Value="{Binding #SplitView.CompactPaneLength}" />
<TextBlock Text="{Binding Value, ElementName=OpenPaneLengthSlider, StringFormat='{}OpenPaneLength: {0}'}" /> <Label
<Slider Grid.Row="5" Grid.Column="0"
Name="OpenPaneLengthSlider" VerticalAlignment="Center"
Width="150" Content="{Binding #OpenPaneLengthSlider.Value,StringFormat='{}OpenPaneLength: {0}'}" />
Maximum="500" <Slider
Minimum="128" Grid.Row="5" Grid.Column="1"
Value="256" /> Name="OpenPaneLengthSlider"
Maximum="500"
<TextBlock Text="{Binding Value, ElementName=CompactPaneLengthSlider, StringFormat='{}CompactPaneLength: {0}'}" /> Minimum="128"
<Slider TickFrequency="1"
Name="CompactPaneLengthSlider" IsSnapToTickEnabled="True"
Width="150" Value="{Binding #SplitView.OpenPaneLength}" />
Maximum="128" </Grid>
Minimum="24" </Border>
Value="48" /> <Border
</StackPanel> Grid.Column="0"
<Border BorderBrush="{DynamicResource SystemControlHighlightBaseLowBrush}" BorderThickness="1"> BorderBrush="{DynamicResource SemiGrey1}"
<!-- {Binding SelectedItem.Tag, ElementName=PaneBackgroundSelector} --> BorderThickness="1">
<SplitView <SplitView
Name="SplitView" Name="SplitView"
CompactPaneLength="{Binding Value, ElementName=CompactPaneLengthSlider}"
DisplayMode="CompactOverlay" DisplayMode="CompactOverlay"
OpenPaneLength="{Binding Value, ElementName=OpenPaneLengthSlider}" CompactPaneLength="48"
PaneBackground="{Binding SelectedItem.Tag, ElementName=PaneBackgroundSelector}" OpenPaneLength="256">
PanePlacement="{Binding PanePlacement}"> <SplitView.Background>
<LinearGradientBrush StartPoint="0%,0%" EndPoint="0%,100%">
<GradientStop Color="#6b4c1b" Offset="0" />
<GradientStop Color="#291e10" Offset="1" />
</LinearGradientBrush>
</SplitView.Background>
<SplitView.Pane> <SplitView.Pane>
<Grid RowDefinitions="Auto,Auto,*,Auto"> <Grid RowDefinitions="Auto,*,Auto">
<TextBlock <TextBlock
Grid.Row="0"
Name="PaneHeader" Name="PaneHeader"
Margin="5,12,0,0" Margin="8,12"
FontWeight="Bold" FontWeight="Bold"
Text="PANE CONTENT" /> Text="Playlist" />
<ComboBox Grid.Row="1" Width="150"> <ListBox
<ComboBoxItem Content="Item1" /> Grid.Row="1"
<ComboBoxItem Content="Item2" /> ItemsSource="{Binding Songs}" />
<ComboBoxItem Content="Item3" /> <ToggleSwitch
</ComboBox>
<ListBoxItem
Grid.Row="2" Grid.Row="2"
Margin="0,10" Theme="{DynamicResource ButtonToggleSwitch}"
VerticalAlignment="Top"> IsChecked="{Binding #SplitView.IsPaneOpen}">
<StackPanel Orientation="Horizontal"> <ToggleSwitch.OnContent>
<!-- Path glyph from materialdesignicons.com --> <PathIcon
<Border Width="48"> Width="16"
<Viewbox Height="16"
Width="24" Data="{StaticResource NavigationMenuExpandIconGlyph}" />
Height="24" </ToggleSwitch.OnContent>
HorizontalAlignment="Left"> <ToggleSwitch.OffContent>
<Canvas Width="24" Height="24"> <PathIcon
<Path Data="M16 17V19H2V17S2 13 9 13 16 17 16 17M12.5 7.5A3.5 3.5 0 1 0 9 11A3.5 3.5 0 0 0 12.5 7.5M15.94 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13M15 4A3.39 3.39 0 0 0 13.07 4.59A5 5 0 0 1 13.07 10.41A3.39 3.39 0 0 0 15 11A3.5 3.5 0 0 0 15 4Z" Fill="{DynamicResource SystemControlForegroundBaseHighBrush}" /> Width="16"
</Canvas> Height="16"
</Viewbox> Data="{StaticResource NavigationMenuExpandIconGlyph}" />
</Border> </ToggleSwitch.OffContent>
<TextBlock VerticalAlignment="Center" Text="People" /> </ToggleSwitch>
</StackPanel>
</ListBoxItem>
<TextBlock
Grid.Row="3"
Margin="60,12"
Text="Item at bottom" />
</Grid> </Grid>
</SplitView.Pane> </SplitView.Pane>
<Grid> <Panel>
<Grid.Styles> <Panel.Styles>
<Style Selector="TextBlock"> <Style Selector="Image#AlbumCover">
<Setter Property="FontSize" Value="14" /> <Style.Animations>
<Setter Property="FontWeight" Value="700" /> <Animation IterationCount="Infinite" Duration="0:0:40">
<KeyFrame Cue="0%">
<Setter Property="RotateTransform.Angle" Value="0" />
</KeyFrame>
<KeyFrame Cue="100%">
<Setter Property="RotateTransform.Angle" Value="360" />
</KeyFrame>
</Animation>
</Style.Animations>
</Style> </Style>
</Grid.Styles> </Panel.Styles>
<TextBlock <Image
HorizontalAlignment="Center" Source="/Assets/WORLD.png"
VerticalAlignment="Center" Name="AlbumCover"
Text="SplitViewContent" /> Width="200"
<TextBlock Text="SplitViewContent" TextAlignment="Left" /> Height="200" />
<TextBlock <Arc
HorizontalAlignment="Right" Width="290"
Text="SplitViewContent" Height="290"
TextAlignment="Left" /> StartAngle="0"
<TextBlock SweepAngle="360"
VerticalAlignment="Bottom" StrokeJoin="Round"
Text="SplitViewContent" StrokeLineCap="Round"
TextAlignment="Left" /> StrokeThickness="45">
<TextBlock <Arc.Stroke>
HorizontalAlignment="Right" <LinearGradientBrush StartPoint="0%,0%" EndPoint="100%,0%">
VerticalAlignment="Bottom" <GradientStop Color="#010101" Offset="0" />
Text="SplitViewContent" <GradientStop Color="#363636" Offset="0.5" />
TextAlignment="Left" /> <GradientStop Color="#010101" Offset="1" />
</Grid> </LinearGradientBrush>
</Arc.Stroke>
</Arc>
<Arc
Width="294"
Height="294"
StartAngle="0"
SweepAngle="360"
StrokeJoin="Round"
StrokeLineCap="Round"
StrokeThickness="4"
Stroke="Black" />
<Arc
Width="310"
Height="310"
StartAngle="0"
SweepAngle="360"
StrokeJoin="Round"
StrokeLineCap="Round"
StrokeThickness="10"
Stroke="#C6CACD"
Opacity="0.1" />
</Panel>
</SplitView> </SplitView>
</Border> </Border>
@@ -1,6 +1,7 @@
using Avalonia; using System.Collections.ObjectModel;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml; using Avalonia.Markup.Xaml;
using CommunityToolkit.Mvvm.ComponentModel;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;
@@ -9,6 +10,7 @@ public partial class SplitViewDemo : UserControl
public SplitViewDemo() public SplitViewDemo()
{ {
InitializeComponent(); InitializeComponent();
this.DataContext = new SplitViewDemoViewModel();
} }
private void InitializeComponent() private void InitializeComponent()
@@ -16,3 +18,27 @@ public partial class SplitViewDemo : UserControl
AvaloniaXamlLoader.Load(this); AvaloniaXamlLoader.Load(this);
} }
} }
public class SplitViewDemoViewModel : ObservableObject
{
public ObservableCollection<string> Songs { get; set; } =
[
"320万年前",
"隐德来希",
"孔明",
"锦鲤卟噜噜",
"指鹿为马",
"热带季风Remix",
"加州梦境",
"渐近自由",
"世界所有的烂漫",
];
public ObservableCollection<SplitViewDisplayMode> DisplayModes { get; set; } =
[
SplitViewDisplayMode.Inline,
SplitViewDisplayMode.CompactInline,
SplitViewDisplayMode.Overlay,
SplitViewDisplayMode.CompactOverlay,
];
}
@@ -4,63 +4,92 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels;assembly=Semi.Avalonia.Demo"
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
x:CompileBindings="True"
x:DataType="vm:TabControlDemoViewModel"
mc:Ignorable="d"> mc:Ignorable="d">
<StackPanel> <ScrollViewer>
<Border Theme="{StaticResource CardBorder}"> <StackPanel Spacing="20">
<TabControl TabStripPlacement="Top"> <Border Theme="{StaticResource CardBorder}">
<TabItem Content="Hello 1" Header="Tab 1" /> <TabControl TabStripPlacement="Top">
<TabItem Content="Hello 2" Header="Tab 2" /> <TabItem Content="Hello 1" Header="Tab 1" />
<TabItem Content="Hello 3" Header="Tab 3" /> <TabItem Content="Hello 2" Header="Tab 2" />
<TabItem Content="中文内容" Header="中文中文" /> <TabItem Content="Hello 3" Header="Tab 3" />
<TabItem <TabItem Content="中文内容" Header="中文中文" />
Content="Hello 4" <TabItem
Header="Tab 4" Content="Hello 4"
IsEnabled="False" /> Header="Tab 4"
</TabControl> IsEnabled="False" />
</Border> </TabControl>
<Border Theme="{StaticResource CardBorder}"> </Border>
<TabControl TabStripPlacement="Left"> <Border Theme="{StaticResource CardBorder}">
<TabItem Content="Hello 1" Header="Tab 1" /> <TabControl TabStripPlacement="Left">
<TabItem Content="Hello 2" Header="Tab 2" /> <TabItem Content="Hello 1" Header="Tab 1" />
<TabItem Content="Hello 3" Header="Tab 3" /> <TabItem Content="Hello 2" Header="Tab 2" />
<TabItem Content="中文内容" Header="中文中文" /> <TabItem Content="Hello 3" Header="Tab 3" />
<TabItem <TabItem Content="中文内容" Header="中文中文" />
Content="Hello 4" <TabItem
Header="Tab 4" Content="Hello 4"
IsEnabled="False" /> Header="Tab 4"
</TabControl> IsEnabled="False" />
</Border> </TabControl>
<Border Theme="{StaticResource CardBorder}"> </Border>
<TabControl TabStripPlacement="Right"> <Border Theme="{StaticResource CardBorder}">
<TabItem Content="Hello 1" Header="Tab 1" /> <TabControl TabStripPlacement="Right">
<TabItem Content="Hello 2" Header="Tab 2" /> <TabItem Content="Hello 1" Header="Tab 1" />
<TabItem Content="Hello 3" Header="Tab 3" /> <TabItem Content="Hello 2" Header="Tab 2" />
<TabItem Content="中文内容" Header="中文中文" /> <TabItem Content="Hello 3" Header="Tab 3" />
<TabItem <TabItem Content="中文内容" Header="中文中文" />
Content="Hello 4" <TabItem
Header="Tab 4" Content="Hello 4"
IsEnabled="False" /> Header="Tab 4"
</TabControl> IsEnabled="False" />
</Border> </TabControl>
<Border Theme="{StaticResource CardBorder}"> </Border>
<TabControl TabStripPlacement="Bottom"> <Border Theme="{StaticResource CardBorder}">
<TabItem Content="Hello 1" Header="Tab 1" /> <TabControl TabStripPlacement="Bottom">
<TabItem Content="Hello 2" Header="Tab 2" /> <TabItem Content="Hello 1" Header="Tab 1" />
<TabItem Content="Hello 3" Header="Tab 3" /> <TabItem Content="Hello 2" Header="Tab 2" />
<TabItem Content="中文内容" Header="中文中文" /> <TabItem Content="Hello 3" Header="Tab 3" />
<TabItem <TabItem Content="中文内容" Header="中文中文" />
Content="Hello 4" <TabItem
Header="Tab 4" Content="Hello 4"
IsEnabled="False" /> Header="Tab 4"
</TabControl> IsEnabled="False" />
</Border> </TabControl>
<Border Theme="{StaticResource CardBorder}"> </Border>
<TabStrip> <Border Theme="{StaticResource CardBorder}">
<TabStripItem>Tab 1</TabStripItem> <TabStrip>
<TabStripItem>Tab 2</TabStripItem> <TabStripItem>Tab 1</TabStripItem>
</TabStrip> <TabStripItem>Tab 2</TabStripItem>
</Border> </TabStrip>
</StackPanel> </Border>
<Border Height="300" Theme="{DynamicResource CardBorder}">
<TabControl
ItemsSource="{Binding Items}"
TabStripPlacement="Top"
Theme="{DynamicResource ScrollTabControl}" />
</Border>
<Border Height="300" Theme="{DynamicResource CardBorder}">
<TabControl
ItemsSource="{Binding Items}"
TabStripPlacement="Left"
Theme="{DynamicResource ScrollTabControl}" />
</Border>
<Border Height="300" Theme="{DynamicResource CardBorder}">
<TabControl
ItemsSource="{Binding Items}"
TabStripPlacement="Bottom"
Theme="{DynamicResource ScrollTabControl}" />
</Border>
<Border Height="300" Theme="{DynamicResource CardBorder}">
<TabControl
ItemsSource="{Binding Items}"
TabStripPlacement="Right"
Theme="{DynamicResource ScrollTabControl}" />
</Border>
</StackPanel>
</ScrollViewer>
</UserControl> </UserControl>
@@ -1,6 +1,7 @@
using Avalonia; using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml; using Avalonia.Markup.Xaml;
using Semi.Avalonia.Demo.ViewModels;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;
@@ -9,5 +10,6 @@ public partial class TabControlDemo : UserControl
public TabControlDemo() public TabControlDemo()
{ {
InitializeComponent(); InitializeComponent();
this.DataContext = new TabControlDemoViewModel();
} }
} }
+158 -71
View File
@@ -1,76 +1,163 @@
<UserControl <UserControl
x:Class="Semi.Avalonia.Demo.Pages.TextBlockDemo" xmlns="https://github.com/avaloniaui" x:Class="Semi.Avalonia.Demo.Pages.TextBlockDemo"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns="https://github.com/avaloniaui"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="600" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
d:DesignWidth="800" mc:Ignorable="d"> xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
<StackPanel Orientation="Horizontal"> xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
<StackPanel d:DesignHeight="600"
Margin="20" HorizontalAlignment="Left" d:DesignWidth="800"
Spacing="5"> mc:Ignorable="d">
<TextBlock>Styles for TextBlock</TextBlock> <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<TextBlock Classes="H1" Theme="{StaticResource TitleTextBlock}">Header 1</TextBlock> <StackPanel Orientation="Horizontal">
<TextBlock Classes="H2" Theme="{StaticResource TitleTextBlock}">Header 1</TextBlock> <StackPanel.Styles>
<TextBlock Classes="H3" Theme="{StaticResource TitleTextBlock}">Header 1</TextBlock> <Style Selector="TextBlock">
<TextBlock Classes="H4" Theme="{StaticResource TitleTextBlock}">Header 1</TextBlock> <Setter Property="VerticalAlignment" Value="Center" />
<TextBlock Classes="H5" Theme="{StaticResource TitleTextBlock}">Header 1</TextBlock> <Setter Property="Margin" Value="4" />
<TextBlock Classes="H6" Theme="{StaticResource TitleTextBlock}">Header 1</TextBlock> </Style>
</StackPanel.Styles>
<HeaderedContentControl
Width="400"
Height="400"
Margin="16"
VerticalAlignment="Top"
Header="Default Theme"
Theme="{DynamicResource GroupBox}">
<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">Underline</TextBlock>
<TextBlock Grid.Row="11" Grid.Column="0">Delete</TextBlock>
<TextBlock>Text</TextBlock> <TextBlock Grid.Row="2" Grid.Column="1">Text</TextBlock>
<TextBlock Classes="Secondary">Secondary</TextBlock> <TextBlock
<TextBlock Classes="Tertiary">Tertiary</TextBlock> Grid.Row="3"
<TextBlock Classes="Quaternary">Quaternary</TextBlock> Grid.Column="1"
<TextBlock Classes="Warning">Warning</TextBlock> Classes="Secondary">
<TextBlock Classes="Danger">Danger</TextBlock> Secondary
<TextBlock Classes="Success">Success</TextBlock> </TextBlock>
<TextBlock IsEnabled="False">Disabled</TextBlock> <TextBlock
<TextBlock Classes="Mark">Default Mark</TextBlock> Grid.Row="4"
<TextBlock Classes="Underline">Underline</TextBlock> Grid.Column="1"
<TextBlock Classes="Delete">Delete</TextBlock> Classes="Tertiary">
</StackPanel> Tertiary
<StackPanel </TextBlock>
Margin="20" HorizontalAlignment="Left" <TextBlock
Spacing="5"> Grid.Row="5"
<TextBlock>Styles for SelectableTextBlock</TextBlock> Grid.Column="1"
<SelectableTextBlock Classes="H1" Theme="{StaticResource TitleSelectableTextBlock}">Header 1</SelectableTextBlock> Classes="Quaternary">
<SelectableTextBlock Classes="H2" Theme="{StaticResource TitleSelectableTextBlock}">Header 1</SelectableTextBlock> Quaternary
<SelectableTextBlock Classes="H3" Theme="{StaticResource TitleSelectableTextBlock}">Header 1</SelectableTextBlock> </TextBlock>
<SelectableTextBlock Classes="H4" Theme="{StaticResource TitleSelectableTextBlock}">Header 1</SelectableTextBlock> <TextBlock
<SelectableTextBlock Classes="H5" Theme="{StaticResource TitleSelectableTextBlock}">Header 1</SelectableTextBlock> Grid.Row="6"
<SelectableTextBlock Classes="H6" Theme="{StaticResource TitleSelectableTextBlock}">Header 1</SelectableTextBlock> Grid.Column="1"
Classes="Success">
Success
</TextBlock>
<TextBlock
Grid.Row="7"
Grid.Column="1"
Classes="Warning">
Warning
</TextBlock>
<TextBlock
Grid.Row="8"
Grid.Column="1"
Classes="Danger">
Danger
</TextBlock>
<TextBlock
Grid.Row="9"
Grid.Column="1"
Classes="Mark">
Default Mark
</TextBlock>
<TextBlock
Grid.Row="10"
Grid.Column="1"
Classes="Underline">
Underline
</TextBlock>
<TextBlock
Grid.Row="11"
Grid.Column="1"
Classes="Delete">
Delete
</TextBlock>
</Grid>
</HeaderedContentControl>
<HeaderedContentControl
Width="400"
Height="400"
Margin="16"
VerticalAlignment="Top"
Header="Theme: TitleTextBlock"
Theme="{DynamicResource GroupBox}">
<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>
<TextBlock
Grid.Row="2"
Grid.Column="1"
Classes="H1"
Theme="{StaticResource TitleTextBlock}">
Header 1
</TextBlock>
<TextBlock
Grid.Row="3"
Grid.Column="1"
Classes="H2"
Theme="{StaticResource TitleTextBlock}">
Header 2
</TextBlock>
<TextBlock
Grid.Row="4"
Grid.Column="1"
Classes="H3"
Theme="{StaticResource TitleTextBlock}">
Header 3
</TextBlock>
<TextBlock
Grid.Row="5"
Grid.Column="1"
Classes="H4"
Theme="{StaticResource TitleTextBlock}">
Header 4
</TextBlock>
<TextBlock
Grid.Row="6"
Grid.Column="1"
Classes="H5"
Theme="{StaticResource TitleTextBlock}">
Header 5
</TextBlock>
<TextBlock
Grid.Row="7"
Grid.Column="1"
Classes="H6"
Theme="{StaticResource TitleTextBlock}">
Header 6
</TextBlock>
</Grid>
<SelectableTextBlock>Text</SelectableTextBlock> </HeaderedContentControl>
<SelectableTextBlock Classes="Secondary">Secondary</SelectableTextBlock>
<SelectableTextBlock Classes="Tertiary">Tertiary</SelectableTextBlock>
<SelectableTextBlock Classes="Quaternary">Quaternary</SelectableTextBlock>
<SelectableTextBlock Classes="Warning">Warning</SelectableTextBlock>
<SelectableTextBlock Classes="Danger">Danger</SelectableTextBlock>
<SelectableTextBlock Classes="Success">Success</SelectableTextBlock>
<SelectableTextBlock IsEnabled="False">Disabled</SelectableTextBlock>
<SelectableTextBlock Classes="Mark">Default Mark</SelectableTextBlock>
<SelectableTextBlock Classes="Underline">Underline</SelectableTextBlock>
<SelectableTextBlock Classes="Delete">Delete</SelectableTextBlock>
</StackPanel> </StackPanel>
<StackPanel </ScrollViewer>
Margin="20" HorizontalAlignment="Left"
Spacing="5">
<TextBlock>Styles for Label</TextBlock>
<Label Classes="H1" Theme="{StaticResource TitleLabel}">Header 1</Label>
<Label Classes="H2" Theme="{StaticResource TitleLabel}">Header 1</Label>
<Label Classes="H3" Theme="{StaticResource TitleLabel}">Header 1</Label>
<Label Classes="H4" Theme="{StaticResource TitleLabel}">Header 1</Label>
<Label Classes="H5" Theme="{StaticResource TitleLabel}">Header 1</Label>
<Label Classes="H6" Theme="{StaticResource TitleLabel}">Header 1</Label>
<Label>Text</Label>
<Label Classes="Secondary">Secondary</Label>
<Label Classes="Tertiary">Tertiary</Label>
<Label Classes="Quaternary">Quaternary</Label>
<Label Classes="Warning">Warning</Label>
<Label Classes="Danger">Danger</Label>
<Label Classes="Success">Success</Label>
<Label IsEnabled="False">Disabled</Label>
<Label Classes="Mark">Default Mark</Label>
<Label Classes="Code">Example Code</Label>
</StackPanel>
</StackPanel>
</UserControl> </UserControl>
@@ -1,26 +1,82 @@
<UserControl <UserControl
x:Class="Semi.Avalonia.Demo.Pages.TextBoxDemo" xmlns="https://github.com/avaloniaui" x:Class="Semi.Avalonia.Demo.Pages.TextBoxDemo"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns="https://github.com/avaloniaui"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="450" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
d:DesignWidth="800" mc:Ignorable="d"> xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:system="clr-namespace:System;assembly=netstandard"
d:DesignHeight="800"
d:DesignWidth="800"
mc:Ignorable="d">
<ScrollViewer> <ScrollViewer>
<StackPanel HorizontalAlignment="Left" Spacing="20"> <StackPanel HorizontalAlignment="Left" Spacing="20">
<TextBox Width="300" /> <TextBox Width="300" />
<TextBox Width="300" Classes="Large" />
<TextBox Width="300" Classes="Small" />
<TextBox Width="300" Watermark="Please use this" /> <TextBox Width="300" Watermark="Please use this" />
<TextBox Width="300" InnerLeftContent="http://" /> <TextBox Width="300" InnerLeftContent="http://" />
<TextBox Width="300" InnerRightContent=".com" /> <TextBox Width="300" InnerRightContent=".com" />
<TextBox <TextBox
Width="500" InnerLeftContent="http://" Width="500"
InnerLeftContent="http://"
InnerRightContent=".com" /> InnerRightContent=".com" />
<TextBox Width="300" Classes="clearButton" /> <TextBox Width="300" Classes="clearButton" />
<TextBox Width="300" PasswordChar="*" /> <TextBox Width="300" PasswordChar="*" />
<TextBox <TextBox
Width="300" Classes="revealPasswordButton" Width="300"
Classes="revealPasswordButton"
PasswordChar="*" /> PasswordChar="*" />
<TextBox <TextBox
Width="500" InnerLeftContent="http://" Width="500"
InnerLeftContent="http://"
InnerRightContent=".com" InnerRightContent=".com"
Theme="{StaticResource BorderlessTextBox}" /> IsEnabled="False" />
<TextBox
Width="500"
Classes="Bordered"
InnerLeftContent="http://"
InnerRightContent=".com" />
<TextBox
Width="500"
Classes="Bordered"
InnerLeftContent="http://"
InnerRightContent=".com"
IsEnabled="False" />
<StackPanel Orientation="Horizontal">
<TextBox
Width="150"
Classes="Large"
Watermark="Large" />
<TextBox
Width="150"
Watermark="Default" />
<TextBox
Width="150"
Classes="Small"
Watermark="Small" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBox
Width="150"
IsEnabled="False"
Watermark="Disabled" />
<TextBox
Width="150"
Classes="Bordered"
Watermark="Bordered" />
<TextBox
Width="150"
Classes="Bordered"
IsEnabled="False" />
</StackPanel>
<TextBox Width="300" Classes="TextArea" />
<TextBox
Width="300"
Theme="{StaticResource LooklessTextBox}"
Watermark="Lookless TextBox"
InnerLeftContent="http://"
InnerRightContent=".com" />
</StackPanel> </StackPanel>
</ScrollViewer> </ScrollViewer>
</UserControl> </UserControl>
@@ -0,0 +1,21 @@
<UserControl
x:Class="Semi.Avalonia.Demo.Pages.ThemeVariantDemo"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<Grid>
<ThemeVariantScope Name="scope">
<Border Theme="{StaticResource CardBorder}">
<StackPanel>
<DatePicker />
<CalendarDatePicker />
<ToggleSwitch Content="Switch Theme" IsCheckedChanged="Switch_OnIsCheckedChanged" />
</StackPanel>
</Border>
</ThemeVariantScope>
</Grid>
</UserControl>
@@ -0,0 +1,20 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using Avalonia.Styling;
namespace Semi.Avalonia.Demo.Pages;
public partial class ThemeVariantDemo : UserControl
{
public ThemeVariantDemo()
{
InitializeComponent();
}
private void Switch_OnIsCheckedChanged(object sender, RoutedEventArgs e)
{
scope.RequestedThemeVariant = scope.ActualThemeVariant == ThemeVariant.Dark ? ThemeVariant.Light : ThemeVariant.Dark;
}
}
@@ -7,10 +7,24 @@
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">
<StackPanel Margin="20" Spacing="20"> <StackPanel Spacing="20">
<TimePicker /> <TimePicker />
<TimePicker Classes="ClearButton" />
<TimePicker MinuteIncrement="15" /> <TimePicker MinuteIncrement="15" />
<TimePicker ClockIdentifier="24HourClock" /> <TimePicker ClockIdentifier="24HourClock" />
<TimePicker ClockIdentifier="12HourClock" IsEnabled="False" /> <TimePicker ClockIdentifier="12HourClock" IsEnabled="False" />
<TimePicker Classes="Large" />
<TimePicker Classes="Small" />
<StackPanel Orientation="Horizontal">
<TimePicker Classes="Large" ClockIdentifier="12HourClock"/>
<TimePicker ClockIdentifier="12HourClock"/>
<TimePicker Classes="Small" ClockIdentifier="12HourClock"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TimePicker IsEnabled="False" />
<TimePicker Classes="Bordered" />
<TimePicker Classes="Bordered" IsEnabled="False" />
</StackPanel>
</StackPanel> </StackPanel>
</UserControl> </UserControl>

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