Compare commits

..

103 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
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
fb0b4a08ac feat: change all PathGeometry to StreamGeometry.
(cherry picked from commit 5f72ed4a49)
2024-03-01 22:10:38 +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
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
Zhang Dian
3a83c67c6c feat: add InnerContent to AutoCompleteBox and NumericUpDown. 2024-02-23 17:56:27 +08:00
159 changed files with 2011 additions and 1460 deletions

View File

@@ -49,7 +49,7 @@ jobs:
run: dotnet restore
- name: Build
run: dotnet publish ./demo/Semi.Avalonia.Demo.Android -c Release -f net8.0-android --no-restore
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

View File

@@ -2,7 +2,7 @@ name: Deploy to GitHub Pages
env:
PROJECT_PATH: demo/Semi.Avalonia.Demo.Web/Semi.Avalonia.Demo.Web.csproj
OUTPUT_PATH: demo/Semi.Avalonia.Demo.Web/bin/Release/net8.0-browser/publish/wwwroot
OUTPUT_PATH: demo/Semi.Avalonia.Demo.Web/bin/Release/net7.0/browser-wasm/AppBundle
on:
push:
branches: [ "action/deploy" ]
@@ -16,16 +16,19 @@ jobs:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup .NET 8
- name: Setup .NET 7
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 7.0.405
- name: Install wasm-tools
run: dotnet workload 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 --nologo
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
@@ -33,6 +36,12 @@ jobs:
- 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

View File

@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="SC-Single" type="DotNetFolderPublish" factoryName="Publish to folder">
<riderPublish configuration="Release" include_native_libs_for_self_extract="true" platform="Any CPU" produce_single_file="true" runtime="win-x64" self_contained="true" target_folder="$PROJECT_DIR$/demo/Semi.Avalonia.Demo.Desktop/bin/Release/net8.0/win-x64/publish" target_framework="net8.0" uuid_high="3088527218258560748" uuid_low="-8649338673481336678" />
<riderPublish configuration="Release" include_native_libs_for_self_extract="true" platform="Any CPU" produce_single_file="true" runtime="win-x64" self_contained="true" target_folder="$PROJECT_DIR$/demo/Semi.Avalonia.Demo.Desktop/bin/Release/net7.0/win-x64/publish" target_framework="net7.0" uuid_high="3088527218258560748" uuid_low="-8649338673481336678" />
<method v="2" />
</configuration>
</component>

View File

@@ -1,16 +1,24 @@
# 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
# How to Use
If you are looking for more customized controls, Please try [Ursa](https://github.com/irihitech/Ursa.Avalonia)
![Light](./docs/demo.jpg)
## How to Use
### Installation
## Installation
```bash
dotnet add package Semi.Avalonia
dotnet add package Semi.Avalonia --version 11.0.7
```
Include Semi Design Styles in application:
```xaml
@@ -19,14 +27,16 @@ Include Semi Design Styles in application:
</Application.Styles>
```
That's all.
That's all.
ColorPicker, DataGrid and TreeDataGrid are distributed in separated packages. Please install if you need.
ColorPicker, DataGrid and TreeDataGrid are distributed in separated packages. Please install if you need.
```bash
dotnet add package Semi.Avalonia.ColorPicker
dotnet add package Semi.Avalonia.DataGrid
dotnet add package Semi.Avalonia.TreeDataGrid
dotnet add package Semi.Avalonia.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" />
@@ -35,19 +45,56 @@ dotnet add package Semi.Avalonia.TreeDataGrid
</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
<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.7 | >=11.0.7 |
| 11.0.1 | <=11.0.6 |
## TODO
* FocusAdorner
## Credits
@@ -62,10 +109,3 @@ https://github.com/irihitech/Semi.Avalonia/releases
[CommunityToolKit](https://github.com/CommunityToolkit/dotnet)
## Screenshot
Light Mode
![Light](./docs/Light.png)
Dark Mode
![Dark](./docs/Dark.png)

113
README_CN.md Normal file
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)

View File

@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Nullable>enable</Nullable>
<AvaloniaVersion>11.0.7</AvaloniaVersion>
<AvaloniaVersion>11.1.0-beta2</AvaloniaVersion>
</PropertyGroup>
</Project>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0-android</TargetFramework>
<TargetFramework>net7.0-android</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<ApplicationId>com.irihitech.Semi.Avalonia</ApplicationId>
<ApplicationVersion>1</ApplicationVersion>
@@ -15,11 +15,11 @@
<Import Project="../Directory.Build.props" />
<ItemGroup>
<PackageReference Include="Avalonia.Android" Version="$(AvaloniaVersion)" />
<PackageReference Include="Avalonia.Android" Version="$(AvaloniaVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj" />
<ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj" />
</ItemGroup>
</Project>

View File

@@ -1,3 +0,0 @@
<linker>
<assembly fullname="Semi.Avalonia.Demo" preserve="All"/>
</linker>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<!-- Uncomment below to enable Native AOT compilation-->
@@ -11,17 +11,12 @@
-->
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
<IsTrimmable>true</IsTrimmable>
<PublishTrimmed>true</PublishTrimmed>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<TrimmerRootDescriptor Include="Roots.xml" />
<RdXmlFile Include="rd.xml" />
</ItemGroup>
<ItemGroup>

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>

View File

@@ -1,16 +0,0 @@
using Avalonia;
using Avalonia.Media;
namespace Semi.Avalonia.Demo.Web;
public static class AvaloniaAppBuilderExtensions
{
private static string DefaultFontFamily => "avares://Semi.Avalonia.Demo.Web/Assets#Source Han Sans CN";
public static AppBuilder WithSourceHanSansCNFont(this AppBuilder builder) =>
builder.With(new FontManagerOptions
{
DefaultFamilyName = DefaultFontFamily,
FontFallbacks = new[] { new FontFallback { FontFamily = new FontFamily(DefaultFontFamily) } }
});
}

View File

@@ -10,7 +10,6 @@ namespace Semi.Avalonia.Demo.Web;
internal sealed partial class Program
{
private static Task Main(string[] args) => BuildAvaloniaApp()
.WithSourceHanSansCNFont()
.StartBrowserAppAsync("out");
public static AppBuilder BuildAvaloniaApp()

View File

@@ -1,18 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk.WebAssembly">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0-browser</TargetFramework>
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
<WasmMainJSPath>wwwroot\main.js</WasmMainJSPath>
<WasmRuntimeAssetsLocation>./_framework</WasmRuntimeAssetsLocation>
</PropertyGroup>
<ItemGroup>
<AvaloniaResource Include="Assets\**"/>
<WasmExtraFilesToDeploy Include="wwwroot\**"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia.Browser" Version="$(AvaloniaVersion)"/>
<PackageReference Include="Avalonia.Browser" Version="$(AvaloniaVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj"/>
<ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj" />
</ItemGroup>
</Project>

View File

@@ -45,7 +45,7 @@
<DataGridTextColumn
Width="*"
x:DataType="viewModels:ColorItemViewModel"
Binding="{ReflectionBinding ColorDisplayName}"
Binding="{Binding ColorDisplayName}"
CanUserSort="False"
Header="Name" />
<DataGridTemplateColumn Width="100" Header="Hex">
@@ -99,7 +99,7 @@
<DataGridTextColumn
Width="*"
x:DataType="viewModels:ColorItemViewModel"
Binding="{ReflectionBinding ColorDisplayName}"
Binding="{Binding ColorDisplayName}"
CanUserSort="False"
Header="Name" />
<DataGridTemplateColumn Width="100" Header="Hex">

View File

@@ -17,58 +17,72 @@
<StackPanel.Styles>
<Style Selector="AutoCompleteBox">
<Setter Property="Width" Value="300" />
<Setter Property="ItemsSource">
<Binding Path="States" />
</Setter>
<Setter Property="ItemTemplate">
<DataTemplate DataType="local:StateData">
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</Setter>
</Style>
</StackPanel.Styles>
<AutoCompleteBox
ItemsSource="{Binding States}"
ValueMemberBinding="{Binding Name}"
Watermark="Please select a State">
<AutoCompleteBox.ItemTemplate>
<DataTemplate DataType="local:StateData">
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</AutoCompleteBox.ItemTemplate>
</AutoCompleteBox>
Watermark="Please select a State"
ValueMemberBinding="{Binding Name}" />
<AutoCompleteBox
Classes="Large"
ItemsSource="{Binding States}"
ValueMemberBinding="{ReflectionBinding Name}">
<AutoCompleteBox.ItemTemplate>
<DataTemplate DataType="local:StateData">
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</AutoCompleteBox.ItemTemplate>
</AutoCompleteBox>
ValueMemberBinding="{ReflectionBinding Name}" />
<AutoCompleteBox
Classes="Small"
ItemsSource="{Binding States}"
ValueMemberBinding="{ReflectionBinding Name}">
<AutoCompleteBox.ItemTemplate>
<DataTemplate DataType="local:StateData">
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</AutoCompleteBox.ItemTemplate>
</AutoCompleteBox>
ValueMemberBinding="{ReflectionBinding Name}" />
<AutoCompleteBox
Classes="Bordered"
ItemsSource="{Binding States}"
ValueMemberBinding="{ReflectionBinding Name}">
<AutoCompleteBox.ItemTemplate>
<DataTemplate DataType="local:StateData">
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</AutoCompleteBox.ItemTemplate>
</AutoCompleteBox>
ValueMemberBinding="{ReflectionBinding Name}" />
<AutoCompleteBox
IsEnabled="False"
ItemsSource="{Binding States}"
ValueMemberBinding="{ReflectionBinding Name}"
Watermark="Disabled">
<AutoCompleteBox.ItemTemplate>
<DataTemplate DataType="local:StateData">
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</AutoCompleteBox.ItemTemplate>
</AutoCompleteBox>
Watermark="Disabled"
ValueMemberBinding="{ReflectionBinding Name}" />
<AutoCompleteBox
InnerLeftContent="https://"
InnerRightContent=".com"
ValueMemberBinding="{ReflectionBinding Name}" />
<StackPanel Orientation="Horizontal">
<AutoCompleteBox
Width="100"
Classes="Large"
Watermark="Large"
ValueMemberBinding="{ReflectionBinding Name}" />
<AutoCompleteBox
Width="100"
Watermark="Default"
ValueMemberBinding="{ReflectionBinding Name}" />
<AutoCompleteBox
Width="100"
Classes="Small"
Watermark="Small"
ValueMemberBinding="{ReflectionBinding Name}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<AutoCompleteBox
Width="100"
IsEnabled="False"
Watermark="Disabled"
ValueMemberBinding="{ReflectionBinding Name}" />
<AutoCompleteBox
Width="100"
Classes="Bordered"
Watermark="Bordered"
ValueMemberBinding="{ReflectionBinding Name}" />
<AutoCompleteBox
Width="100"
Classes="Bordered"
IsEnabled="False"
ValueMemberBinding="{ReflectionBinding Name}" />
</StackPanel>
</StackPanel>
</UserControl>
</UserControl>

View File

@@ -44,6 +44,11 @@
<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>
@@ -59,16 +64,6 @@
Disabled
</Button>
</StackPanel>
<TextBlock>Outline</TextBlock>
<StackPanel Orientation="Horizontal" Spacing="20">
<Button Classes="Primary" Theme="{DynamicResource OutlineButton}">Primary</Button>
<Button Classes="Secondary" Theme="{DynamicResource OutlineButton}">Secondary</Button>
<Button Classes="Tertiary" Theme="{DynamicResource OutlineButton}">Tertiary</Button>
<Button Classes="Success" Theme="{DynamicResource OutlineButton}">Success</Button>
<Button Classes="Warning" Theme="{DynamicResource OutlineButton}">Warning</Button>
<Button Classes="Danger" Theme="{DynamicResource OutlineButton}">Danger</Button>
<Button Classes="Danger" Theme="{DynamicResource OutlineButton}" IsEnabled="False">Disabled</Button>
</StackPanel>
<TextBlock>Borderless</TextBlock>
<StackPanel Orientation="Horizontal" Spacing="20">
<Button Classes="Primary" Theme="{DynamicResource BorderlessButton}">Primary</Button>
@@ -84,19 +79,6 @@
Disabled
</Button>
</StackPanel>
<TextBlock>Disabled</TextBlock>
<StackPanel Background="{DynamicResource SemiColorBackground1}" Orientation="Horizontal" Spacing="20">
<Button IsEnabled="False">Light</Button>
<Button IsEnabled="False" Theme="{DynamicResource SolidButton}">Solid</Button>
<Button IsEnabled="False" Theme="{DynamicResource OutlineButton}">Outline</Button>
<Button IsEnabled="False" Theme="{DynamicResource BorderlessButton}">Borderless</Button>
</StackPanel>
<TextBlock>Size Classes</TextBlock>
<StackPanel Orientation="Horizontal" Spacing="20">
<Button Classes="Primary Small">Small</Button>
<Button Classes="Primary">Default</Button>
<Button Classes="Primary Large">Large</Button>
</StackPanel>
<TextBlock>DropDownButton</TextBlock>
<StackPanel Orientation="Horizontal" Spacing="8">
@@ -114,11 +96,9 @@
<StackPanel Orientation="Horizontal" Spacing="8">
<DropDownButton Content="Default" Classes="Success"/>
<DropDownButton Content="Solid" Theme="{DynamicResource SolidDropDownButton}" Classes="Success"/>
<DropDownButton Content="Outline" Theme="{DynamicResource OutlineDropDownButton}" Classes="Success"/>
<DropDownButton Content="Borderless" Theme="{DynamicResource BorderlessDropDownButton}" Classes="Success"/>
<DropDownButton Content="Default" Classes="Success" IsEnabled="False"/>
<DropDownButton Content="Solid" Theme="{DynamicResource SolidDropDownButton}" Classes="Success" IsEnabled="False"/>
<DropDownButton Content="Outline" Theme="{DynamicResource OutlineDropDownButton}" Classes="Success" IsEnabled="False"/>
<DropDownButton Content="Borderless" Theme="{DynamicResource BorderlessDropDownButton}" Classes="Success" IsEnabled="False"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Spacing="8">
@@ -139,13 +119,11 @@
</StackPanel>
<StackPanel Orientation="Horizontal" Spacing="8">
<SplitButton Content="Default" Classes="Success" />
<SplitButton Content="Solid" Theme="{DynamicResource SolidSplitButton}" Classes="Success" />
<SplitButton Content="Outline" Theme="{DynamicResource OutlineSplitButton}" Classes="Success" />
<SplitButton Content="Borderless" Theme="{DynamicResource BorderlessSplitButton}" Classes="Success" />
<SplitButton Theme="{DynamicResource SolidSplitButton}" Content="Solid" Classes="Success" />
<SplitButton Theme="{DynamicResource BorderlessSplitButton}" Content="Borderless" Classes="Success" />
<SplitButton Content="Default" Classes="Success" IsEnabled="False" />
<SplitButton Content="Solid" Theme="{DynamicResource SolidSplitButton}" Classes="Success" IsEnabled="False" />
<SplitButton Content="Outline" Theme="{DynamicResource OutlineSplitButton}" Classes="Success" IsEnabled="False" />
<SplitButton Content="Borderless" Theme="{DynamicResource BorderlessSplitButton}" Classes="Success" IsEnabled="False" />
<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" />
@@ -163,12 +141,6 @@
<ToggleSplitButton Classes="Danger" Content="Danger" />
<ToggleSplitButton Classes="Danger" Content="Disabled" IsEnabled="False" />
</StackPanel>
<StackPanel Orientation="Horizontal" Spacing="8">
<ToggleSplitButton Content="Default" Classes="Success" />
<ToggleSplitButton Content="Checked" Classes="Success" IsChecked="True" />
<ToggleSplitButton Content="Default" Classes="Success" IsEnabled="False" />
<ToggleSplitButton Content="Checked" Classes="Success" IsChecked="True" IsEnabled="False" />
</StackPanel>
<StackPanel Orientation="Horizontal" Spacing="8">
<ToggleSplitButton Classes="Small" Content="Small" />
<ToggleSplitButton Content="Default" />

View File

@@ -8,11 +8,22 @@
d:DesignWidth="800"
mc:Ignorable="d">
<StackPanel HorizontalAlignment="Left" Spacing="20">
<CalendarDatePicker />
<CalendarDatePicker Classes="ClearButton" Width="200" />
<StackPanel Orientation="Horizontal">
<CalendarDatePicker Classes="Large" />
<CalendarDatePicker />
<CalendarDatePicker Classes="Small" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<CalendarDatePicker IsEnabled="False" />
<CalendarDatePicker Classes="Bordered" />
<CalendarDatePicker Classes="Bordered" IsEnabled="False" />
</StackPanel>
<CalendarDatePicker Width="500" />
<CalendarDatePicker Classes="Large" />
<CalendarDatePicker Classes="Small" />
<CalendarDatePicker Classes="ClearButton" Width="200" />
<CalendarDatePicker
Name="DatePicker2"
Margin="0,0,0,8"
@@ -23,9 +34,5 @@
CustomDateFormatString="ddd, MMM d"
SelectedDateFormat="Custom" />
<CalendarDatePicker Margin="0,0,0,8" Watermark="Watermark" />
<CalendarDatePicker IsEnabled="False" />
<CalendarDatePicker Classes="Bordered" />
<CalendarDatePicker Classes="Bordered" IsEnabled="False" />
</StackPanel>
</UserControl>
</UserControl>

View File

@@ -29,6 +29,12 @@
<colorPicker:SemiColorLightPalette />
</ColorPicker.Palette>
</ColorPicker>
<ColorPicker ColorSpectrumShape="Box" Theme="{DynamicResource HexColorPicker}">
<ColorPicker.Palette>
<colorPicker:SemiColorLightPalette />
</ColorPicker.Palette>
</ColorPicker>
</StackPanel>
</StackPanel>
</UserControl>

View File

@@ -4,71 +4,40 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450"
xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
d:DesignHeight="800"
d:DesignWidth="800"
mc:Ignorable="d">
<Design.DataContext>
<pages:ComboBoxDemoViewModel />
</Design.DataContext>
<StackPanel Spacing="20">
<ComboBox Width="150">
<ComboBoxItem>Ding</ComboBoxItem>
<ComboBoxItem>Otter</ComboBoxItem>
<ComboBoxItem>Husky</ComboBoxItem>
<ComboBoxItem>Mr. 17</ComboBoxItem>
<ComboBoxItem>Cass</ComboBoxItem>
</ComboBox>
<ComboBox Width="150" Classes="ClearButton">
<ComboBoxItem>Ding</ComboBoxItem>
<ComboBoxItem>Otter</ComboBoxItem>
<ComboBoxItem>Husky</ComboBoxItem>
<ComboBoxItem>Mr. 17</ComboBoxItem>
<ComboBoxItem>Cass</ComboBoxItem>
</ComboBox>
<ComboBox Width="150" PlaceholderText="Please Select">
<ComboBoxItem>Ding</ComboBoxItem>
<ComboBoxItem>Otter</ComboBoxItem>
<ComboBoxItem>Husky</ComboBoxItem>
<ComboBoxItem>Mr. 17</ComboBoxItem>
<ComboBoxItem>Cass</ComboBoxItem>
</ComboBox>
<ComboBox Width="150" IsEnabled="False">
<ComboBoxItem>Ding</ComboBoxItem>
<ComboBoxItem>Otter</ComboBoxItem>
<ComboBoxItem>Husky</ComboBoxItem>
<ComboBoxItem>Mr. 17</ComboBoxItem>
<ComboBoxItem>Cass</ComboBoxItem>
</ComboBox>
<ComboBox
Width="150"
Classes="Large"
IsEnabled="False">
<ComboBoxItem>Ding</ComboBoxItem>
<ComboBoxItem>Otter</ComboBoxItem>
<ComboBoxItem>Husky</ComboBoxItem>
<ComboBoxItem>Mr. 17</ComboBoxItem>
<ComboBoxItem>Cass</ComboBoxItem>
</ComboBox>
<ComboBox Width="150" Classes="Small">
<ComboBoxItem>Ding</ComboBoxItem>
<ComboBoxItem>Otter</ComboBoxItem>
<ComboBoxItem>Husky</ComboBoxItem>
<ComboBoxItem>Mr. 17</ComboBoxItem>
<ComboBoxItem>Cass</ComboBoxItem>
</ComboBox>
<ComboBox Width="150" Classes="Bordered">
<ComboBoxItem>Ding</ComboBoxItem>
<ComboBoxItem>Otter</ComboBoxItem>
<ComboBoxItem>Husky</ComboBoxItem>
<ComboBoxItem>Mr. 17</ComboBoxItem>
<ComboBoxItem>Cass</ComboBoxItem>
</ComboBox>
<ComboBox
Width="150"
Classes="Bordered"
IsEnabled="False">
<ComboBoxItem>Ding</ComboBoxItem>
<ComboBoxItem>Otter</ComboBoxItem>
<ComboBoxItem>Husky</ComboBoxItem>
<ComboBoxItem>Mr. 17</ComboBoxItem>
<ComboBoxItem>Cass</ComboBoxItem>
</ComboBox>
<StackPanel.Styles>
<Style Selector="ComboBox">
<Setter Property="Width" Value="300" />
<Setter Property="ItemsSource" Value="{Binding Items}" />
</Style>
</StackPanel.Styles>
<ComboBox />
<ComboBox Classes="ClearButton" />
<ComboBox PlaceholderText="Please Select" />
<ComboBox IsEnabled="False" />
<ComboBox Classes="Large" IsEnabled="False" />
<ComboBox Classes="Small" />
<ComboBox Classes="Bordered" />
<ComboBox Classes="Bordered" IsEnabled="False" />
<StackPanel Orientation="Horizontal">
<ComboBox Width="100" Classes="Large" PlaceholderText="Large" />
<ComboBox Width="100" PlaceholderText="Default" />
<ComboBox Width="100" Classes="Small" PlaceholderText="Small" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<ComboBox Width="100" IsEnabled="False" PlaceholderText="Disabled" />
<ComboBox Width="100" Classes="Bordered" PlaceholderText="Bordered" />
<ComboBox Width="100" Classes="Bordered" IsEnabled="False" />
</StackPanel>
</StackPanel>
</UserControl>

View File

@@ -1,6 +1,6 @@
using Avalonia;
using System.Collections.ObjectModel;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using CommunityToolkit.Mvvm.ComponentModel;
namespace Semi.Avalonia.Demo.Pages;
@@ -9,5 +9,11 @@ public partial class ComboBoxDemo : UserControl
public ComboBoxDemo()
{
InitializeComponent();
this.DataContext = new ComboBoxDemoViewModel();
}
}
public class ComboBoxDemoViewModel : ObservableObject
{
public ObservableCollection<string> Items { get; set; } = ["Ding", "Otter", "Husky", "Mr.17", "Cass"];
}

View File

@@ -14,5 +14,16 @@
<DatePicker IsEnabled="False" />
<DatePicker Classes="Large" />
<DatePicker Classes="Small" />
<StackPanel Orientation="Horizontal">
<DatePicker Classes="Large" />
<DatePicker />
<DatePicker Classes="Small" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<DatePicker IsEnabled="False" />
<DatePicker Classes="Bordered" />
<DatePicker Classes="Bordered" IsEnabled="False" />
</StackPanel>
</StackPanel>
</UserControl>

View File

@@ -10,6 +10,7 @@
<UserControl.Styles>
<Style Selector="Button">
<Setter Property="Margin" Value="8" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
</Style>
</UserControl.Styles>
<Grid

View File

@@ -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>

View File

@@ -0,0 +1,14 @@
using System;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages;
public partial class HyperlinkButtonDemo : UserControl
{
public HyperlinkButtonDemo()
{
InitializeComponent();
}
}

View File

@@ -78,8 +78,8 @@
<StackPanel Orientation="Horizontal">
<Border HorizontalAlignment="Left" Theme="{StaticResource RadioButtonGroupBorder}">
<ListBox Theme="{DynamicResource ButtonRadioGroupListBox}">
<ListBoxItem Classes="Large" IsSelected="True">Large 1</ListBoxItem>
<ListBoxItem Classes="Large">Large 2</ListBoxItem>
<ListBoxItem Classes="Large" IsSelected="True">Small 1</ListBoxItem>
<ListBoxItem Classes="Large">Small 2</ListBoxItem>
</ListBox>
</Border>
<Border
@@ -87,8 +87,8 @@
HorizontalAlignment="Left"
Theme="{StaticResource RadioButtonGroupBorder}">
<ListBox Theme="{DynamicResource ButtonRadioGroupListBox}" IsEnabled="False">
<ListBoxItem Classes="Large" IsSelected="True">Large 1</ListBoxItem>
<ListBoxItem Classes="Large">Large 2</ListBoxItem>
<ListBoxItem Classes="Large" IsSelected="True">Small 1</ListBoxItem>
<ListBoxItem Classes="Large">Small 2</ListBoxItem>
</ListBox>
</Border>
</StackPanel>

View File

@@ -8,6 +8,11 @@
d:DesignWidth="800"
mc:Ignorable="d">
<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="selectFolderDialog">Select Folder</Button>
<Button Name="saveFileDialog">Save File</Button>

View File

@@ -25,14 +25,30 @@
<MenuItem Header="Submenu Level 2" />
</MenuItem>
</MenuItem>
<MenuItem Header="Menu Item with _Checkbox">
<MenuItem Header="Menu Item with _Icon">
<MenuItem.Icon>
<TextBlock>😊</TextBlock>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Menu Item with _Checkbox" ToggleType="CheckBox" />
</MenuItem>
<MenuItem Header="_Second">
<MenuItem Header="Second _Menu Item" />
<MenuItem IsChecked="True" Header="Second Menu toggle item" ToggleType="CheckBox" />
<Separator />
<MenuItem GroupName="A" Header="Radio 1 - group" ToggleType="Radio" />
<MenuItem IsChecked="True" GroupName="A" Header="Radio 2 - group" ToggleType="Radio" />
<MenuItem GroupName="A" Header="Radio 3 - group" ToggleType="Radio">
<MenuItem Header="Radio 4 - group" ToggleType="Radio" GroupName="A" />
<MenuItem Header="Radio 5 - group" ToggleType="Radio" GroupName="A" />
</MenuItem>
<Separator />
<MenuItem Header="Radio 1" ToggleType="Radio" />
<MenuItem IsChecked="True" Header="Radio 2" ToggleType="Radio" />
<MenuItem Header="Radio 3" ToggleType="Radio">
<MenuItem Header="Radio 4" ToggleType="Radio" />
<MenuItem Header="Radio 5" ToggleType="Radio" />
</MenuItem>
</MenuItem>
<MenuItem Header="Parent">
<MenuItem Header="Child 1" />
@@ -86,7 +102,7 @@
<MenuItem Header="Submenu _1" />
<MenuItem Header="Submenu _2" />
</MenuItem>
<MenuItem Header="Menu Item with _Checkbox">
<MenuItem Header="Menu Item with _Icon">
<MenuItem.Icon>
<CheckBox
Padding="0"
@@ -95,6 +111,7 @@
IsHitTestVisible="False" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Menu Item with _Checkbox" ToggleType="CheckBox" />
<MenuItem Header="Menu Item that won't close on click" StaysOpenOnClick="True" />
</ContextMenu>
</Border.ContextMenu>
@@ -113,7 +130,7 @@
<MenuItem Header="Submenu _1" />
<MenuItem Header="Submenu _2" />
</MenuItem>
<MenuItem Header="Menu Item with _Checkbox">
<MenuItem Header="Menu Item with _Icon">
<MenuItem.Icon>
<CheckBox
Padding="0"
@@ -122,6 +139,7 @@
IsHitTestVisible="False" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Menu Item with _Checkbox" ToggleType="CheckBox" />
</MenuFlyout>
</Border.ContextFlyout>
<TextBlock Text="Right Click to show Context Flyout" />

View File

@@ -8,10 +8,17 @@
d:DesignWidth="800"
mc:Ignorable="d">
<StackPanel HorizontalAlignment="Left" Spacing="20">
<StackPanel.Styles>
<Style Selector="Button">
<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="Success" />
<Button Click="InfoButton_OnClick" Content="Warning" />
<Button Click="InfoButton_OnClick" Content="Error" />
<Button Click="InfoButton_OnClick" Content="Success" Classes="Success" />
<Button Click="InfoButton_OnClick" Content="Warning" Classes="Warning" />
<Button Click="InfoButton_OnClick" Content="Error" Classes="Danger" />
</StackPanel>
</UserControl>
</UserControl>

View File

@@ -4,38 +4,53 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450"
d:DesignHeight="800"
d:DesignWidth="800"
mc:Ignorable="d">
<StackPanel HorizontalAlignment="Left" Spacing="20">
<NumericUpDown
Width="200"
Maximum="100"
Minimum="0" />
<NumericUpDown
Width="200"
Increment="10"
Maximum="100"
Minimum="0" />
<NumericUpDown
Width="200"
ButtonSpinnerLocation="Left"
Maximum="100"
Minimum="0" />
<NumericUpDown
Width="200"
Maximum="100"
Minimum="0"
ShowButtonSpinner="False" />
<NumericUpDown
Width="200"
Classes="Large"
Maximum="100"
Minimum="0" />
<NumericUpDown
Width="200"
Classes="Small"
Maximum="100"
Minimum="0" />
<StackPanel.Styles>
<Style Selector="NumericUpDown">
<Setter Property="Width" Value="300" />
<Setter Property="Maximum" Value="100" />
<Setter Property="Minimum" Value="0" />
</Style>
</StackPanel.Styles>
<NumericUpDown />
<NumericUpDown Increment="10" />
<NumericUpDown ButtonSpinnerLocation="Left" />
<NumericUpDown ShowButtonSpinner="False" />
<NumericUpDown Classes="Large" />
<NumericUpDown Classes="Small" />
<NumericUpDown InnerLeftContent="Price" InnerRightContent="$" />
<StackPanel Orientation="Horizontal">
<NumericUpDown
Width="100"
Classes="Large"
Watermark="Large"
ButtonSpinnerLocation="Left" />
<NumericUpDown
Width="100"
Watermark="Default"
ShowButtonSpinner="False" />
<NumericUpDown
Width="100"
Watermark="Small"
Classes="Small" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<NumericUpDown Width="100" ButtonSpinnerLocation="Left" />
<NumericUpDown Width="100" ShowButtonSpinner="False" />
<NumericUpDown Width="100" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<NumericUpDown Width="100" ShowButtonSpinner="False" />
<NumericUpDown Width="100" IsEnabled="False" />
<NumericUpDown Width="100" ButtonSpinnerLocation="Left" />
</StackPanel>
</StackPanel>
</UserControl>
</UserControl>

View File

@@ -87,31 +87,37 @@
Margin="0,8"
Classes="Primary"
Content="Primary"
HorizontalAlignment="Stretch"
Theme="{DynamicResource SolidButton}" />
<Button
Margin="0,8"
Classes="Secondary"
Content="Secondary"
HorizontalAlignment="Stretch"
Theme="{DynamicResource SolidButton}" />
<Button
Margin="0,8"
Classes="Tertiary"
Content="Tertiary"
HorizontalAlignment="Stretch"
Theme="{DynamicResource SolidButton}" />
<Button
Margin="0,8"
Classes="Success"
Content="Success"
HorizontalAlignment="Stretch"
Theme="{DynamicResource SolidButton}" />
<Button
Margin="0,8"
Classes="Warning"
Content="Warning"
HorizontalAlignment="Stretch"
Theme="{DynamicResource SolidButton}" />
<Button
Margin="0,8"
Classes="Danger"
Content="Danger"
HorizontalAlignment="Stretch"
Theme="{DynamicResource SolidButton}" />
</StackPanel>
<Calendar Margin="16,0" />
@@ -194,26 +200,32 @@
<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>

View File

@@ -155,7 +155,7 @@
Value="60" />
<ProgressBar
Width="200"
Classes="Danger"
Classes="Error"
Maximum="100"
Minimum="0"
ShowProgressText="True"

View File

@@ -4,12 +4,24 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
d:DesignHeight="450"
d:DesignWidth="800"
x:DataType="pages:RefreshContainerDemoViewModel"
x:CompileBindings="True"
mc:Ignorable="d">
<StackPanel HorizontalAlignment="Left" Spacing="20">
<RefreshContainer Name="container">
<TextBlock Text="Content" />
<DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Top">
<Label DockPanel.Dock="Top">A control that supports pull to refresh</Label>
<RefreshContainer Name="Refresh"
DockPanel.Dock="Bottom"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
PullDirection="TopToBottom"
RefreshRequested="RefreshContainerPage_RefreshRequested"
Margin="5">
<ListBox HorizontalAlignment="Stretch"
VerticalAlignment="Top"
ItemsSource="{Binding Items}" />
</RefreshContainer>
</StackPanel>
</DockPanel>
</UserControl>

View File

@@ -1,14 +1,46 @@
using Avalonia;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using CommunityToolkit.Mvvm.ComponentModel;
namespace Semi.Avalonia.Demo.Pages;
public partial class RefreshContainerDemo : UserControl
{
private RefreshContainerDemoViewModel _viewModel;
public RefreshContainerDemo()
{
InitializeComponent();
_viewModel = new RefreshContainerDemoViewModel();
DataContext = _viewModel;
}
private async void RefreshContainerPage_RefreshRequested(object? sender, RefreshRequestedEventArgs e)
{
var deferral = e.GetDeferral();
await _viewModel.AddToTop();
deferral.Complete();
}
}
public class RefreshContainerDemoViewModel : ObservableObject
{
public ObservableCollection<string> Items { get; }
public RefreshContainerDemoViewModel()
{
Items = new ObservableCollection<string>(Enumerable.Range(1, 200).Select(i => $"Item {i}"));
}
public async Task AddToTop()
{
await Task.Delay(1000);
Items.Insert(0, $"Item {200 - Items.Count}");
}
}

View File

@@ -33,21 +33,6 @@
Disabled
</RepeatButton>
</StackPanel>
<TextBlock>Outline</TextBlock>
<StackPanel Orientation="Horizontal" Spacing="20">
<RepeatButton Classes="Primary" Theme="{DynamicResource OutlineRepeatButton}">Primary</RepeatButton>
<RepeatButton Classes="Secondary" Theme="{DynamicResource OutlineRepeatButton}">Secondary</RepeatButton>
<RepeatButton Classes="Tertiary" Theme="{DynamicResource OutlineRepeatButton}">Tertiary</RepeatButton>
<RepeatButton Classes="Success" Theme="{DynamicResource OutlineRepeatButton}">Success</RepeatButton>
<RepeatButton Classes="Warning" Theme="{DynamicResource OutlineRepeatButton}">Warning</RepeatButton>
<RepeatButton Classes="Danger" Theme="{DynamicResource OutlineRepeatButton}">Danger</RepeatButton>
<RepeatButton
Classes="Danger"
IsEnabled="False"
Theme="{DynamicResource OutlineRepeatButton}">
Disabled
</RepeatButton>
</StackPanel>
<TextBlock>Borderless</TextBlock>
<StackPanel Orientation="Horizontal" Spacing="20">
<RepeatButton Classes="Primary" Theme="{DynamicResource BorderlessRepeatButton}">Primary</RepeatButton>
@@ -63,18 +48,10 @@
Disabled
</RepeatButton>
</StackPanel>
<TextBlock>Disabled</TextBlock>
<StackPanel Background="{DynamicResource SemiColorBackground1}" Orientation="Horizontal" Spacing="20">
<Button IsEnabled="False">Light</Button>
<Button IsEnabled="False" Theme="{DynamicResource SolidButton}">Solid</Button>
<Button IsEnabled="False" Theme="{DynamicResource OutlineButton}">Outline</Button>
<Button IsEnabled="False" Theme="{DynamicResource BorderlessButton}">Borderless</Button>
</StackPanel>
<TextBlock>Size Classes</TextBlock>
<StackPanel Orientation="Horizontal" Spacing="20">
<StackPanel Orientation="Horizontal" Spacing="8">
<RepeatButton Classes="Small">Small</RepeatButton>
<RepeatButton>Default</RepeatButton>
<RepeatButton Classes="Large">Large</RepeatButton>
</StackPanel>
</StackPanel>
</UserControl>
</UserControl>

View File

@@ -46,7 +46,7 @@
Grid.Row="2" Grid.Column="1"
OffContent="Left"
OnContent="Right"
IsChecked="{Binding #SplitView.PanePlacement, Mode=OneWayToSource}" />
IsChecked="{Binding #SplitView.PanePlacement}" />
<Label
Grid.Row="3" Grid.Column="0"

View File

@@ -5,7 +5,7 @@
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:DesignHeight="800"
d:DesignWidth="800"
mc:Ignorable="d">
<ScrollViewer>
@@ -42,7 +42,41 @@
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>
</ScrollViewer>
</UserControl>

View File

@@ -15,5 +15,16 @@
<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>
</UserControl>

View File

@@ -82,14 +82,7 @@
Disabled
</ToggleButton>
</StackPanel>
<TextBlock Text="Toggle Button Disabled State" />
<StackPanel Background="{DynamicResource SemiColorBackground1}" Orientation="Horizontal" Spacing="20">
<ToggleButton IsThreeState="True" IsEnabled="False">Default</ToggleButton>
<ToggleButton IsThreeState="True" IsEnabled="False" IsChecked="True">Checked</ToggleButton>
<ToggleButton IsThreeState="True" IsEnabled="False" IsChecked="{x:Null}">Indeterminate</ToggleButton>
</StackPanel>
<TextBlock Text="Toggle Button Size" />
<StackPanel Orientation="Horizontal" Spacing="20">
<StackPanel Orientation="Horizontal">
<ToggleButton Classes="Small" IsThreeState="True">Small</ToggleButton>
<ToggleButton IsThreeState="True">Default</ToggleButton>
<ToggleButton Classes="Large" IsThreeState="True">Large</ToggleButton>

View File

@@ -7,7 +7,7 @@
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<StackPanel Spacing="8" Margin="20">
<StackPanel Spacing="20">
<ToggleSwitch
Content="Content"
OffContent="OffContent"
@@ -24,19 +24,11 @@
IsEnabled="False"
OffContent="OffContent"
OnContent="OnContent" />
<StackPanel Orientation="Horizontal">
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Small" />
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Small" IsChecked="True"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" />
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" IsChecked="True" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Large" />
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Large" IsChecked="True"/>
</StackPanel>
<ToggleSwitch
Theme="{DynamicResource SimpleToggleSwitch}"
Content="Content"
OffContent="OffContent"
OnContent="OnContent" />
<ToggleSwitch Theme="{DynamicResource ButtonToggleSwitch}">
<ToggleSwitch.OnContent>
<PathIcon

View File

@@ -0,0 +1,5 @@
<linker>
<!-- Can be removed if CompiledBinding and no reflection are used -->
<assembly fullname="Semi.Avalonia.Demo" preserve="All" />
<assembly fullname="Avalonia.Themes.Fluent" preserve="All" />
</linker>

View File

@@ -4,9 +4,10 @@
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<AvaloniaResource Include="Assets\**" />
<TrimmerRootDescriptor Include="Roots.xml" />
</ItemGroup>
<ItemGroup>
@@ -18,8 +19,8 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Semi.Avalonia.ColorPicker\Semi.Avalonia.ColorPicker.csproj" />
<ProjectReference Include="..\..\src\Semi.Avalonia.DataGrid\Semi.Avalonia.DataGrid.csproj" />
<ProjectReference Include="..\..\src\Semi.Avalonia\Semi.Avalonia.csproj" />
<ProjectReference Include="..\..\src\Semi.Avalonia.ColorPicker\Semi.Avalonia.ColorPicker.csproj" />
<ProjectReference Include="..\..\src\Semi.Avalonia.DataGrid\Semi.Avalonia.DataGrid.csproj" />
<ProjectReference Include="..\..\src\Semi.Avalonia\Semi.Avalonia.csproj" />
</ItemGroup>
</Project>

View File

@@ -47,8 +47,8 @@ public class PaletteDemoViewModel: ObservableObject
public PaletteDemoViewModel()
{
_lightResourceDictionary = new Light.Palette();
_darkResourceDictionary = new Dark.Palette();
_lightResourceDictionary = AvaloniaXamlLoader.Load(new Uri("avares://Semi.Avalonia/Themes/Light/Palette.axaml")) as ResourceDictionary;
_darkResourceDictionary = AvaloniaXamlLoader.Load(new Uri("avares://Semi.Avalonia/Themes/Dark/Palette.axaml")) as ResourceDictionary;
WeakReferenceMessenger.Default.Register<PaletteDemoViewModel, ColorItemViewModel>(this, OnClickColorItem);
}
@@ -251,7 +251,7 @@ public static class ColorTokens
{
new ("SemiColorPrimary", "Primary"),
new ("SemiColorPrimaryPointerover", "Primary Pointerover"),
new ("SemiColorPrimaryActive", "Primary Active"),
new ("SemiColorPrimaryPressed", "Primary Pressed"),
new ("SemiColorPrimaryDisabled", "Primary Disabled"),
new ("SemiColorPrimaryLight", "Primary Light"),
new ("SemiColorPrimaryLightPointerover", "Primary Light Pointerover"),
@@ -262,7 +262,7 @@ public static class ColorTokens
{
new ("SemiColorSecondary", "Secondary"),
new ("SemiColorSecondaryPointerover", "Secondary Pointerover"),
new ("SemiColorSecondaryActive", "Secondary Active"),
new ("SemiColorSecondaryPressed", "Secondary Pressed"),
new ("SemiColorSecondaryDisabled", "Secondary Disabled"),
new ("SemiColorSecondaryLight", "Secondary Light"),
new ("SemiColorSecondaryLightPointerover", "Secondary Light Pointerover"),
@@ -273,7 +273,7 @@ public static class ColorTokens
{
new ("SemiColorTertiary", "Tertiary"),
new ("SemiColorTertiaryPointerover", "Tertiary Pointerover"),
new ("SemiColorTertiaryActive", "Tertiary Active"),
new ("SemiColorTertiaryPressed", "Tertiary Pressed"),
new ("SemiColorTertiaryLight", "Tertiary Light"),
new ("SemiColorTertiaryLightPointerover", "Tertiary Light Pointerover"),
new ("SemiColorTertiaryLightActive", "Tertiary Light Active"),
@@ -283,7 +283,7 @@ public static class ColorTokens
{
new ("SemiColorInformation", "Information"),
new ("SemiColorInformationPointerover", "Information Pointerover"),
new ("SemiColorInformationActive", "Information Active"),
new ("SemiColorInformationPressed", "Information Pressed"),
new ("SemiColorInformationDisabled", "Information Disabled"),
new ("SemiColorInformationLight", "Information Light"),
new ("SemiColorInformationLightPointerover", "Information Light Pointerover"),
@@ -294,7 +294,7 @@ public static class ColorTokens
{
new ("SemiColorSuccess", "Success"),
new ("SemiColorSuccessPointerover", "Success Pointerover"),
new ("SemiColorSuccessActive", "Success Active"),
new ("SemiColorSuccessPressed", "Success Pressed"),
new ("SemiColorSuccessDisabled", "Success Disabled"),
new ("SemiColorSuccessLight", "Success Light"),
new ("SemiColorSuccessLightPointerover", "Success Light Pointerover"),
@@ -305,7 +305,7 @@ public static class ColorTokens
{
new ("SemiColorWarning", "Warning"),
new ("SemiColorWarningPointerover", "Warning Pointerover"),
new ("SemiColorWarningActive", "Warning Active"),
new ("SemiColorWarningPressed", "Warning Pressed"),
new ("SemiColorWarningLight", "Warning Light"),
new ("SemiColorWarningLightPointerover", "Warning Light Pointerover"),
new ("SemiColorWarningLightActive", "Warning Light Active"),
@@ -315,7 +315,7 @@ public static class ColorTokens
{
new ("SemiColorDanger", "Danger"),
new ("SemiColorDangerPointerover", "Danger Pointerover"),
new ("SemiColorDangerActive", "Danger Active"),
new ("SemiColorDangerPressed", "Danger Pressed"),
new ("SemiColorDangerLight", "Danger Light"),
new ("SemiColorDangerLightPointerover", "Danger Light Pointerover"),
new ("SemiColorDangerLightActive", "Danger Light Active"),

View File

@@ -1,13 +1,13 @@
<UserControl
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d"
x:Class="Semi.Avalonia.Demo.Views.MainView"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pages="using:Semi.Avalonia.Demo.Pages"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
@@ -21,52 +21,52 @@
Margin="8"
Padding="12,4"
Theme="{DynamicResource CardBorder}">
<Grid VerticalAlignment="Center" ColumnDefinitions="*, Auto">
<Grid ColumnDefinitions="*, Auto" VerticalAlignment="Center">
<StackPanel Grid.Column="0" Orientation="Horizontal">
<TextBlock
VerticalAlignment="Center"
Classes="H6"
Text="Semi Avalonia"
Theme="{DynamicResource TitleTextBlock}" />
Theme="{DynamicResource TitleTextBlock}"
VerticalAlignment="Center" />
<TextBlock
Margin="8,0"
VerticalAlignment="Center"
Text="/" />
Text="/"
VerticalAlignment="Center" />
<TextBlock
Margin="8,0"
VerticalAlignment="Center"
Classes="Secondary"
Text="{Binding #tab.SelectedItem.Header}" />
Margin="8,0"
Text="{Binding #tab.SelectedItem.Header}"
VerticalAlignment="Center" />
</StackPanel>
<ToggleSwitch
Grid.Column="1"
Padding="4"
IsCheckedChanged="ToggleButton_OnIsCheckedChanged"
Padding="4"
Theme="{DynamicResource ButtonToggleSwitch}">
<ToggleSwitch.OnContent>
<PathIcon
Width="16"
Height="16"
Data="M12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23ZM17 15C17.476 15 17.9408 14.9525 18.3901 14.862C17.296 17.3011 14.8464 19 12 19C8.13401 19 5 15.866 5 12C5 8.60996 7.40983 5.78277 10.6099 5.13803C10.218 6.01173 10 6.98041 10 8C10 11.866 13.134 15 17 15Z"
Foreground="{DynamicResource ButtonDefaultTertiaryForeground}" />
Foreground="{DynamicResource ButtonDefaultTertiaryForeground}"
Height="16"
Width="16" />
</ToggleSwitch.OnContent>
<ToggleSwitch.OffContent>
<PathIcon
Width="16"
Height="16"
Data="M3.55 19.09L4.96 20.5L6.76 18.71L5.34 17.29M12 6C8.69 6 6 8.69 6 12S8.69 18 12 18 18 15.31 18 12C18 8.68 15.31 6 12 6M20 13H23V11H20M17.24 18.71L19.04 20.5L20.45 19.09L18.66 17.29M20.45 5L19.04 3.6L17.24 5.39L18.66 6.81M13 1H11V4H13M6.76 5.39L4.96 3.6L3.55 5L5.34 6.81L6.76 5.39M1 13H4V11H1M13 20H11V23H13"
Foreground="{DynamicResource ButtonDefaultTertiaryForeground}" />
Foreground="{DynamicResource ButtonDefaultTertiaryForeground}"
Height="16"
Width="16" />
</ToggleSwitch.OffContent>
</ToggleSwitch>
</Grid>
</Border>
<TabControl
Name="tab"
Grid.Row="1"
Margin="8"
Padding="20,0,0,0"
HorizontalAlignment="Stretch"
Margin="8"
Name="tab"
Padding="20,0,0,0"
TabStripPlacement="Left"
Theme="{DynamicResource NavigationTab}">
<TabItem Header="Overview">
@@ -126,6 +126,9 @@
<TabItem Header="HeaderedContentControl">
<pages:HeaderedContentControlDemo />
</TabItem>
<TabItem Header="HyperlinkButton">
<pages:HyperlinkButtonDemo />
</TabItem>
<TabItem Header="Label">
<pages:LabelDemo />
</TabItem>
@@ -145,7 +148,7 @@
<pages:NumericUpDownDemo />
</TabItem>
<TabItem Header="PathIcon">
<pages:PathIconDemo/>
<pages:PathIconDemo />
</TabItem>
<TabItem Header="ProgressBar">
<pages:ProgressBarDemo />

View File

@@ -1,5 +1,5 @@
{
"sdk": {
"version": "8.0"
"version": "7.0"
}
}

BIN
docs/community-support.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

BIN
docs/demo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

View File

@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.0",
"version": "7.0.0",
"rollForward": "latestMajor",
"allowPrerelease": true
}

View File

@@ -1,16 +1,16 @@
<Project>
<PropertyGroup>
<TargetFrameworks>net6.0;net8.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<Version>11.0.7.6</Version>
<Version>11.1.0-beta2</Version>
<Authors>IRIHI Technology Co., Ltd.</Authors>
<Description>Avalonia Theme inspired by Semi Design.</Description>
<RepositoryUrl>https://github.com/irihitech/Semi.Avalonia</RepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIcon>irihi.png</PackageIcon>
<PackageProjectUrl>https://github.com/irihitech/Semi.Avalonia</PackageProjectUrl>
<AvaloniaVersion>11.0.7</AvaloniaVersion>
<AvaloniaVersion>11.1.0-beta2</AvaloniaVersion>
</PropertyGroup>
<ItemGroup>

View File

@@ -17,10 +17,33 @@
<converters:ToBrushConverter x:Key="ToBrushConverter" />
<ControlTheme x:Key="{x:Type ColorPicker}" TargetType="ColorPicker">
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
<Setter Property="CornerRadius" Value="3" />
<Setter Property="Height" Value="32" />
<Setter Property="Width" Value="64" />
<Setter Property="MinWidth" Value="64" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="Content">
<Template>
<Panel>
<Border
Margin="1,1,0,1"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="{DynamicResource ColorControlCheckeredBackgroundBrush}"
CornerRadius="{TemplateBinding CornerRadius,
Converter={StaticResource LeftCornerRadiusFilterConverter}}" />
<Border
Margin="1,1,0,1"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="{TemplateBinding HsvColor,
Converter={StaticResource ToBrushConverter}}"
CornerRadius="{TemplateBinding CornerRadius,
Converter={StaticResource LeftCornerRadiusFilterConverter}}" />
</Panel>
</Template>
</Setter>
<Setter Property="Palette">
<controls:FluentColorPalette />
</Setter>
@@ -33,6 +56,8 @@
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
ClipToBounds="True"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
CornerRadius="{TemplateBinding CornerRadius}"
UseLayoutRounding="False">
<DropDownButton.Styles>
@@ -40,26 +65,6 @@
<Setter Property="Padding" Value="0" />
</Style>
</DropDownButton.Styles>
<DropDownButton.Content>
<!-- Preview color -->
<Panel>
<Border
Margin="1,1,0,1"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="{DynamicResource ColorControlCheckeredBackgroundBrush}"
CornerRadius="{TemplateBinding CornerRadius,
Converter={StaticResource LeftCornerRadiusFilterConverter}}" />
<Border
Margin="1,1,0,1"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="{TemplateBinding HsvColor,
Converter={StaticResource ToBrushConverter}}"
CornerRadius="{TemplateBinding CornerRadius,
Converter={StaticResource LeftCornerRadiusFilterConverter}}" />
</Panel>
</DropDownButton.Content>
<DropDownButton.Flyout>
<Flyout FlyoutPresenterClasses="nopadding" Placement="{DynamicResource ColorPickerFlyoutPlacement}">
@@ -167,7 +172,7 @@
Orientation="Vertical">
<primitives:ColorSlider.IsVisible>
<MultiBinding Converter="{x:Static BoolConverters.And}">
<ReflectionBinding Path="IsAlphaVisible" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="IsAlphaVisible" RelativeSource="{RelativeSource TemplatedParent}" />
</MultiBinding>
</primitives:ColorSlider.IsVisible>
</primitives:ColorSlider>
@@ -425,8 +430,8 @@
Value="{Binding Value, ElementName=AlphaComponentSlider}">
<NumericUpDown.IsVisible>
<MultiBinding Converter="{x:Static BoolConverters.And}">
<ReflectionBinding Path="IsAlphaVisible" RelativeSource="{RelativeSource TemplatedParent}" />
<ReflectionBinding Path="IsComponentTextInputVisible" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="IsAlphaVisible" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="IsComponentTextInputVisible" RelativeSource="{RelativeSource TemplatedParent}" />
</MultiBinding>
</NumericUpDown.IsVisible>
</NumericUpDown>
@@ -447,8 +452,8 @@
TickFrequency="1">
<primitives:ColorSlider.IsVisible>
<MultiBinding Converter="{x:Static BoolConverters.And}">
<ReflectionBinding Path="IsAlphaVisible" RelativeSource="{RelativeSource TemplatedParent}" />
<ReflectionBinding Path="IsComponentSliderVisible" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="IsAlphaVisible" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="IsComponentSliderVisible" RelativeSource="{RelativeSource TemplatedParent}" />
</MultiBinding>
</primitives:ColorSlider.IsVisible>
</primitives:ColorSlider>
@@ -471,4 +476,42 @@
</Setter>
</ControlTheme>
<ControlTheme
x:Key="HexColorPicker"
BasedOn="{StaticResource {x:Type ColorPicker}}"
TargetType="ColorPicker">
<Setter Property="Width" Value="200" />
<Setter Property="Content">
<Template>
<Grid ColumnDefinitions="Auto, *">
<Border
Grid.Column="0"
Width="{Binding $self.Bounds.Height}"
Margin="1,1,0,1"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="{DynamicResource ColorControlCheckeredBackgroundBrush}"
CornerRadius="{TemplateBinding CornerRadius}" />
<Border
Grid.Column="0"
Width="{Binding $self.Bounds.Height}"
Margin="1,1,0,1"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="{TemplateBinding HsvColor,
Converter={StaticResource ToBrushConverter}}"
CornerRadius="{TemplateBinding CornerRadius}" />
<TextBlock
Grid.Column="1"
Margin="8,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontWeight="Regular"
Foreground="{DynamicResource TextBlockDefaultForeground}"
Text="{Binding $parent[ColorPicker].Color}" />
</Grid>
</Template>
</Setter>
</ControlTheme>
</ResourceDictionary>

View File

@@ -260,7 +260,7 @@
Orientation="Vertical">
<primitives:ColorSlider.IsVisible>
<MultiBinding Converter="{x:Static BoolConverters.And}">
<ReflectionBinding Path="IsAlphaVisible" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="IsAlphaVisible" RelativeSource="{RelativeSource TemplatedParent}" />
</MultiBinding>
</primitives:ColorSlider.IsVisible>
</primitives:ColorSlider>
@@ -490,8 +490,8 @@
Value="{Binding Value, ElementName=AlphaComponentSlider}">
<NumericUpDown.IsVisible>
<MultiBinding Converter="{x:Static BoolConverters.And}">
<ReflectionBinding Path="IsAlphaVisible" RelativeSource="{RelativeSource TemplatedParent}" />
<ReflectionBinding Path="IsComponentTextInputVisible" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="IsAlphaVisible" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="IsComponentTextInputVisible" RelativeSource="{RelativeSource TemplatedParent}" />
</MultiBinding>
</NumericUpDown.IsVisible>
</NumericUpDown>
@@ -512,8 +512,8 @@
TickFrequency="1">
<primitives:ColorSlider.IsVisible>
<MultiBinding Converter="{x:Static BoolConverters.And}">
<ReflectionBinding Path="IsAlphaVisible" RelativeSource="{RelativeSource TemplatedParent}" />
<ReflectionBinding Path="IsComponentSliderVisible" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="IsAlphaVisible" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="IsComponentSliderVisible" RelativeSource="{RelativeSource TemplatedParent}" />
</MultiBinding>
</primitives:ColorSlider.IsVisible>
</primitives:ColorSlider>

View File

@@ -2,8 +2,8 @@
<Styles.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceInclude x:Key="Default" Source="avares://Semi.Avalonia.ColorPicker/Light.axaml" />
<ResourceInclude x:Key="Dark" Source="avares://Semi.Avalonia.ColorPicker/Dark.axaml" />
<MergeResourceInclude x:Key="Default" Source="avares://Semi.Avalonia.ColorPicker/Light.axaml" />
<MergeResourceInclude x:Key="Dark" Source="avares://Semi.Avalonia.ColorPicker/Dark.axaml" />
</ResourceDictionary.ThemeDictionaries>
<ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="avares://Semi.Avalonia.ColorPicker/Controls/ColorPicker.axaml" />

View File

@@ -7,10 +7,6 @@
<PackageReleaseNotes>Update to 11.0.7</PackageReleaseNotes>
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
<IsAotCompatible>true</IsAotCompatible>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)"/>
<PackageReference Include="Avalonia.Controls.ColorPicker" Version="$(AvaloniaVersion)"/>

View File

@@ -9,7 +9,6 @@
<SolidColorBrush x:Key="DataGridColumnHeaderForeground" Opacity="0.6" Color="#F9F9F9" />
<SolidColorBrush x:Key="DataGridColumnHeaderBackground" Color="Transparent" />
<SolidColorBrush x:Key="DataGridColumnHeaderPointeroverBackground" Opacity="0.16" Color="White" />
<SolidColorBrush x:Key="DataGridColumnHeaderPressedBackground" Opacity="0.20" Color="White" />

View File

@@ -292,7 +292,7 @@
Name="BackgroundBorder"
Grid.RowSpan="2"
Grid.ColumnSpan="2"
Margin="{DynamicResource DataGridRowMargin}"
Margin="2"
Background="{DynamicResource DataGridRowBackground}"
CornerRadius="3" />
<Rectangle

View File

@@ -2,8 +2,8 @@
<Styles.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceInclude x:Key="Default" Source="avares://Semi.Avalonia.DataGrid/Light.axaml" />
<ResourceInclude x:Key="Dark" Source="avares://Semi.Avalonia.DataGrid/Dark.axaml" />
<MergeResourceInclude x:Key="Default" Source="avares://Semi.Avalonia.DataGrid/Light.axaml" />
<MergeResourceInclude x:Key="Dark" Source="avares://Semi.Avalonia.DataGrid/Dark.axaml" />
</ResourceDictionary.ThemeDictionaries>
<ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="avares://Semi.Avalonia.DataGrid/DataGrid.axaml" />

View File

@@ -18,9 +18,8 @@
<SolidColorBrush x:Key="DataGridDetailsPresenterBackground" Color="Transparent" />
<SolidColorBrush x:Key="DataGridRowPointeroverBackground" Opacity="0.09" Color="#2E3238" />
<SolidColorBrush x:Key="DataGridRowSelectedBackground" Color="#EAF5FF" />
<SolidColorBrush x:Key="DataGridRowSelectedPointeroverBackground" Color="#CBE7FE" />
<SolidColorBrush x:Key="DataGridRowSelectedBackground" Opacity="0.2" Color="#EAF5FF" />
<SolidColorBrush x:Key="DataGridRowSelectedPointeroverBackground" Opacity="0.3" Color="#CBE7FE" />
<SolidColorBrush x:Key="DataGridRowGroupHeaderExpandIconForeground" Opacity="0.62" Color="#1C1F23" />
<SolidColorBrush x:Key="DataGridRowGroupHeaderBackground" Opacity="0.05" Color="#2E3238" />

View File

@@ -1,16 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../Package.props"/>
<PropertyGroup>
<Title>Semi.Avalonia.DataGrid</Title>
<PackageReleaseNotes>Update to 11.0.7</PackageReleaseNotes>
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
<IsAotCompatible>true</IsAotCompatible>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)"/>
<PackageReference Include="Avalonia.Controls.DataGrid" Version="$(AvaloniaVersion)"/>

View File

@@ -12,7 +12,6 @@
<StreamGeometry x:Key="DataGridColumnHeaderDescendingGlyph">M17.549 15.659L12.753 21.139C12.6591 21.2464 12.5434 21.3325 12.4135 21.3915C12.2836 21.4505 12.1427 21.481 12 21.481C11.8574 21.481 11.7164 21.4505 11.5865 21.3915C11.4566 21.3325 11.3409 21.2464 11.247 21.139L6.45101 15.659C5.88501 15.011 6.34501 14 7.20401 14H16.796C17.656 14 18.115 15.012 17.549 15.659Z</StreamGeometry>
<Thickness x:Key="DataGridRowHeaderMargin">8 0</Thickness>
<Thickness x:Key="DataGridRowMargin">2</Thickness>
<StreamGeometry x:Key="DataGridRowGroupHeaderExpandIconGlyph">M7.43934 19.7957C6.85355 19.2099 6.85355 18.2601 7.43934 17.6744L13.0962 12.0175L7.43934 6.36065C6.85355 5.77486 6.85355 4.82511 7.43934 4.23933C8.02513 3.65354 8.97487 3.65354 9.56066 4.23933L16.2782 10.9568C16.864 11.5426 16.864 12.4924 16.2782 13.0782L9.56066 19.7957C8.97487 20.3815 8.02513 20.3815 7.43934 19.7957Z</StreamGeometry>

View File

@@ -4,18 +4,14 @@
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<Version>11.0.10</Version>
<Version>11.0.1</Version>
<Authors>IRIHI Technology Co., Ltd.</Authors>
<Description>Avalonia Theme inspired by Semi Design.</Description>
<RepositoryUrl>https://github.com/irihitech/Semi.Avalonia</RepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIcon>irihi.png</PackageIcon>
<PackageProjectUrl>https://github.com/irihitech/Semi.Avalonia</PackageProjectUrl>
<AvaloniaVersion>11.0.10</AvaloniaVersion>
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
<IsAotCompatible>true</IsAotCompatible>
<AvaloniaVersion>11.0.0</AvaloniaVersion>
</PropertyGroup>
<ItemGroup>

View File

@@ -5,5 +5,4 @@
</StreamGeometry>
<StreamGeometry x:Key="TreeDataGridSortIconAscendingPath">M6.45096 8.34102L11.247 2.86102C11.3408 2.75361 11.4566 2.66753 11.5865 2.60854C11.7163 2.54956 11.8573 2.51904 12 2.51904C12.1426 2.51904 12.2836 2.54956 12.4135 2.60854C12.5433 2.66753 12.6591 2.75361 12.753 2.86102L17.549 8.34102C18.115 8.98802 17.655 10 16.796 10H7.20396C6.34396 10 5.88496 8.98802 6.45096 8.34102Z</StreamGeometry>
<StreamGeometry x:Key="TreeDataGridItemCollapsedChevronPathData">M9.65618 3.44015L18.6322 11.2454C19.0906 11.644 19.0906 12.356 18.6322 12.7546L9.65618 20.5598C9.00895 21.1226 8 20.6629 8 19.8052V4.19475C8 3.33705 9.00895 2.87734 9.65618 3.44015Z</StreamGeometry>
<Thickness x:Key="TreeDataGridRowMargin">2</Thickness>
</ResourceDictionary>

View File

@@ -149,7 +149,7 @@
<Panel>
<Border
Name="RowBorder"
Margin="{DynamicResource TreeDataGridRowMargin}"
Margin="2"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="{TemplateBinding Background}"
@@ -183,7 +183,8 @@
<CheckBox
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="Center"
IsChecked="{TemplateBinding Value, Mode=TwoWay}"
IsChecked="{TemplateBinding Value,
Mode=TwoWay}"
IsEnabled="{Binding !IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}"
IsThreeState="{TemplateBinding IsThreeState}"
Theme="{DynamicResource SimpleCheckBox}" />
@@ -238,7 +239,8 @@
DockPanel.Dock="Left">
<ToggleButton
Focusable="False"
IsChecked="{TemplateBinding IsExpanded, Mode=TwoWay}"
IsChecked="{TemplateBinding IsExpanded,
Mode=TwoWay}"
IsVisible="{TemplateBinding ShowExpander}"
Theme="{StaticResource TreeDataGridExpandCollapseChevron}" />
</Border>
@@ -285,7 +287,8 @@
<TextBox
Name="PART_Edit"
Classes="Small"
Text="{TemplateBinding Value, Mode=TwoWay}" />
Text="{TemplateBinding Value,
Mode=TwoWay}" />
</Border>
</ControlTemplate>
</Setter>

View File

@@ -9,6 +9,8 @@
</StackPanel>
</Design.PreviewWith>
<ControlTheme x:Key="{x:Type AutoCompleteBox}" TargetType="AutoCompleteBox">
<Setter Property="AutoCompleteBox.VerticalAlignment" Value="Center" />
<Setter Property="AutoCompleteBox.MinHeight" Value="{DynamicResource AutoCompleteBoxDefaultHeight}" />
<Setter Property="AutoCompleteBox.MaxDropDownHeight" Value="{DynamicResource AutoCompleteMaxDropdownHeight}" />
<Setter Property="Template">
<ControlTemplate TargetType="AutoCompleteBox">
@@ -16,9 +18,12 @@
<Panel>
<TextBox
Name="PART_TextBox"
VerticalAlignment="Center"
VerticalAlignment="Stretch"
MinHeight="{TemplateBinding MinHeight}"
DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}"
Theme="{DynamicResource NonErrorTextBox}"
InnerLeftContent="{TemplateBinding InnerLeftContent}"
InnerRightContent="{TemplateBinding InnerRightContent}"
Watermark="{TemplateBinding Watermark}" />
<Popup
Name="PART_Popup"
@@ -53,7 +58,8 @@
<Panel>
<TextBox
Name="PART_TextBox"
VerticalAlignment="Center"
VerticalAlignment="Stretch"
MinHeight="0"
Classes="Bordered"
DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}"
Watermark="{TemplateBinding Watermark}" />
@@ -83,15 +89,11 @@
</ControlTemplate>
</Setter>
</Style>
<Style Selector="^.Large /template/ TextBox">
<Style Selector="^.Large">
<Setter Property="MinHeight" Value="{DynamicResource AutoCompleteBoxLargeHeight}" />
</Style>
<Style Selector="^.Small /template/ TextBox">
<Style Selector="^.Small">
<Setter Property="MinHeight" Value="{DynamicResource AutoCompleteBoxSmallHeight}" />
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -2,34 +2,38 @@
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True">
<!-- Button Theme Key: Light, Solid, Outline, Borderless; Default is Light -->
<!-- Button Default Classes: Primary, Secondary, Tertiary, Success, Warning, Danger; Default is Primary -->
<!-- State: default, pointerover, pressed, disabled -->
<!-- Button Theme Key: Solid Light Border Borderless; Default is Light -->
<!-- Button Default Classes: Primary Secondary, Tertiary, Warning, Danger; Default is Primary -->
<!-- State default pointerover pressed disabled -->
<!-- Button Light -->
<ControlTheme x:Key="{x:Type Button}" TargetType="Button">
<Setter Property="Button.Background" Value="{DynamicResource ButtonDefaultBackground}" />
<Setter Property="Button.Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonDefaultBorderBrush}" />
<Setter Property="Button.CornerRadius" Value="{DynamicResource ButtonCornerRadius}" />
<Setter Property="Button.BorderThickness" Value="{DynamicResource ButtonBorderThickness}" />
<Setter Property="Button.Padding" Value="{DynamicResource ButtonDefaultPadding}" />
<Setter Property="Button.RenderTransform" Value="none" />
<Setter Property="Button.FontSize" Value="{DynamicResource ButtonDefaultFontSize}" />
<Setter Property="Button.FontWeight" Value="{DynamicResource ButtonDefaultFontWeight}" />
<Setter Property="Button.HorizontalContentAlignment" Value="Center" />
<Setter Property="Button.VerticalContentAlignment" Value="Center" />
<Setter Property="Button.MinHeight" Value="12" />
<Setter Property="Button.Cursor" Value="Hand" />
<Setter Property="Button.Template">
<Setter Property="Background" Value="{DynamicResource ButtonDefaultBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultBorderBrush}" />
<Setter Property="CornerRadius" Value="{DynamicResource ButtonCornerRadius}" />
<Setter Property="BorderThickness" Value="{DynamicResource ButtonBorderThickness}" />
<Setter Property="Padding" Value="{DynamicResource ButtonDefaultPadding}" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="RenderTransform" Value="none" />
<Setter Property="FontSize" Value="{DynamicResource ButtonDefaultFontSize}" />
<Setter Property="FontWeight" Value="{DynamicResource ButtonDefaultFontWeight}" />
<Setter Property="BackgroundSizing" Value="OuterBorderEdge" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="MinHeight" Value="{DynamicResource ButtonDefaultHeight}" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Template">
<ControlTemplate TargetType="Button">
<ContentPresenter
x:Name="PART_ContentPresenter"
Padding="{TemplateBinding Padding}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BackgroundSizing="{TemplateBinding BackgroundSizing}"
BorderThickness="{TemplateBinding BorderThickness}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
@@ -44,6 +48,11 @@
<Style Selector="^:pressed">
<Setter Property="RenderTransform" Value="scale(0.98)" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="BorderBrush" Value="{TemplateBinding BorderBrush}" />
<Setter Property="Background" Value="{TemplateBinding Background}" />
</Style>
<Style Selector="^.Primary">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
@@ -64,25 +73,28 @@
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDangerForeground}" />
</Style>
<Style Selector="^:pointerover">
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPointeroverBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPointeroverBackground}" />
</Style>
<Style Selector="^:pressed">
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPressedBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPressedBackground}" />
</Style>
<Style Selector="^:disabled">
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultDisabledBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultDisabledBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style>
<Style Selector="^.Large">
<Setter Property="MinHeight" Value="{DynamicResource ButtonLargeHeight}" />
<Setter Property="Padding" Value="{DynamicResource ButtonLargePadding}" />
</Style>
<Style Selector="^.Small">
<Setter Property="MinHeight" Value="{DynamicResource ButtonSmallHeight}" />
<Setter Property="Padding" Value="{DynamicResource ButtonSmallPadding}" />
</Style>
</ControlTheme>
@@ -91,131 +103,115 @@
x:Key="SolidButton"
BasedOn="{StaticResource {x:Type Button}}"
TargetType="Button">
<Setter Property="Button.Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Button.Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" />
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Button.Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Button.Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
<Setter Property="Button.BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" />
</Style>
<Style Selector="^:pointerover">
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPressedBorderBrush}" />
</Style>
<Style Selector="^.Primary">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" />
<Style Selector="^:pointerover">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPressedBorderBrush}" />
</Style>
</Style>
<Style Selector="^.Secondary">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryBorderBrush}" />
<Style Selector="^:pointerover">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryPressedBorderBrush}" />
</Style>
</Style>
<Style Selector="^.Tertiary">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryBorderBrush}" />
<Style Selector="^:pointerover">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryPressedBorderBrush}" />
</Style>
</Style>
<Style Selector="^.Success">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessBorderBrush}" />
<Style Selector="^:pointerover">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessPressedBorderBrush}" />
</Style>
</Style>
<Style Selector="^.Warning">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidWarningBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningBorderBrush}" />
<Style Selector="^:pointerover">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidWarningBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidWarningPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidWarningPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningPressedBorderBrush}" />
</Style>
</Style>
<Style Selector="^.Danger">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidDangerBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerBorderBrush}" />
<Style Selector="^:pointerover">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidDangerBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidDangerPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidDangerPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerPressedBorderBrush}" />
</Style>
</Style>
<Style Selector="^:disabled">
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultDisabledBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidDisabledBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style>
</ControlTheme>
<ControlTheme
x:Key="OutlineButton"
BasedOn="{StaticResource {x:Type Button}}"
TargetType="Button">
<Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource ButtonOutlinePointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource ButtonOutlinePressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
</Style>
<Style Selector="^.Success">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineSuccessBorderBrush}" />
</Style>
<Style Selector="^.Warning">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineWarningBorderBrush}" />
</Style>
<Style Selector="^.Danger">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineDangerBorderBrush}" />
</Style>
<Style Selector="^:disabled">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultDisabledBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style>
</ControlTheme>
@@ -224,9 +220,11 @@
x:Key="BorderlessButton"
BasedOn="{StaticResource {x:Type Button}}"
TargetType="Button">
<Setter Property="Button.Background" Value="Transparent" />
<Setter Property="Button.BorderBrush" Value="Transparent" />
<Style Selector="^:disabled">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
</Style>
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />

View File

@@ -41,6 +41,7 @@
<Setter Property="ButtonSpinner.BorderBrush" Value="{DynamicResource ButtonSpinnerRepeatButtonBorderBrush}" />
<Setter Property="ButtonSpinner.BorderThickness" Value="0" />
<Setter Property="ButtonSpinner.MinWidth" Value="300" />
<!-- Add Resource -->
<Setter Property="ButtonSpinner.Template">
<ControlTemplate TargetType="ButtonSpinner">
<Grid ColumnDefinitions="Auto, *, Auto">
@@ -48,7 +49,8 @@
Grid.Column="1"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
CornerRadius="{TemplateBinding CornerRadius}"
UseLayoutRounding="False">
<ContentPresenter
Name="PART_ContentPresenter"
Padding="{TemplateBinding Padding}"

View File

@@ -31,7 +31,6 @@
</ControlTheme>
<ControlTheme x:Key="{x:Type CalendarItem}" TargetType="CalendarItem">
<Setter Property="CalendarItem.MinWidth" Value="{DynamicResource CalendarMinWidth}" />
<Setter Property="CalendarItem.MinHeight" Value="{DynamicResource CalendarMinHeight}" />
<Setter Property="CalendarItem.DayTitleTemplate">
<Template>
@@ -54,7 +53,7 @@
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<Grid
MinWidth="{TemplateBinding MinWidth}"
MinWidth="{DynamicResource CalendarMinWidth}"
MinHeight="{TemplateBinding MinHeight}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"

View File

@@ -9,12 +9,14 @@
<Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerBorderBrush}" />
<Setter Property="BorderThickness" Value="{DynamicResource CalendarDatePickerBorderThickness}" />
<Setter Property="CornerRadius" Value="{DynamicResource CalendarDatePickerCornerRadius}" />
<Setter Property="BackgroundSizing" Value="OuterBorderEdge"/>
<Setter Property="IsTodayHighlighted" Value="True" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Padding" Value="8 0" />
<Setter Property="MinHeight" Value="{DynamicResource CalendarDatePickerDefaultHeight}" />
<Setter Property="Template">
<ControlTemplate TargetType="CalendarDatePicker">
<DataValidationErrors>
@@ -24,96 +26,96 @@
VerticalAlignment="Stretch">
<Border
x:Name="Background"
BackgroundSizing="{TemplateBinding BackgroundSizing}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<Grid
CornerRadius="{TemplateBinding CornerRadius}"/>
<Grid
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
ColumnDefinitions="*, Auto, Auto">
<TextBox
Name="PART_TextBox"
Grid.Column="0"
Grid.ColumnSpan="2"
MinHeight="{TemplateBinding MinHeight}"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
ColumnDefinitions="*, Auto, Auto">
<TextBox
Name="PART_TextBox"
Grid.Column="0"
Grid.ColumnSpan="2"
MinHeight="{DynamicResource CalendarDatePickerDefaultHeight}"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
VerticalAlignment="Stretch"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Background="Transparent"
BorderBrush="Transparent"
BorderThickness="0"
CornerRadius="{TemplateBinding CornerRadius}"
Foreground="{TemplateBinding Foreground}"
Theme="{DynamicResource NonErrorTextBox}"
UseFloatingWatermark="{TemplateBinding UseFloatingWatermark}"
Watermark="{TemplateBinding Watermark}">
<TextBox.Styles>
<Style Selector="TextBox#PART_TextBox:pointerover /template/ Border#PART_ContentPresenterBorder">
<!-- By default the TextBox has its own focused state, override this to disable it here -->
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
</Style>
<Style Selector="TextBox#PART_TextBox:focus /template/ Border#PART_ContentPresenterBorder">
<!-- By default the TextBox has its own focused state, override this to disable it here -->
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
</Style>
<Style Selector="TextBox#PART_TextBox:disabled">
<Style Selector="^ /template/ Border#PART_ContentPresenterBorder">
<!-- By default the TextBox has its own disabled state, override this to make the border background show through -->
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
</Style>
</Style>
</TextBox.Styles>
</TextBox>
<Button
Name="ClearButton"
Grid.Column="1"
Padding="0,0,8,0"
Content="{DynamicResource IconButtonClearData}"
Command="{Binding $parent[CalendarDatePicker].Clear}"
Focusable="False"
IsVisible="False"
Theme="{DynamicResource InnerIconButton}" />
<Button
Name="PART_Button"
Grid.Column="2"
Padding="0,0,8,0"
Content="{DynamicResource CalendarDatePickerIconGlyph}"
Focusable="False"
Theme="{DynamicResource InnerIconButton}" />
<Popup
Name="PART_Popup"
Grid.Column="0"
HorizontalOffset="-8"
IsLightDismissEnabled="True"
PlacementTarget="{TemplateBinding}"
VerticalOffset="-4">
<Border
Margin="8"
Background="Transparent"
BorderBrush="Transparent"
BorderThickness="0"
CornerRadius="{TemplateBinding CornerRadius}"
Foreground="{TemplateBinding Foreground}"
Theme="{DynamicResource NonErrorTextBox}"
UseFloatingWatermark="{TemplateBinding UseFloatingWatermark}"
Watermark="{TemplateBinding Watermark}">
<TextBox.Styles>
<Style Selector="TextBox#PART_TextBox:pointerover /template/ Border#PART_ContentPresenterBorder">
<!-- By default the TextBox has its own focused state, override this to disable it here -->
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
</Style>
<Style Selector="TextBox#PART_TextBox:focus /template/ Border#PART_ContentPresenterBorder">
<!-- By default the TextBox has its own focused state, override this to disable it here -->
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
</Style>
<Style Selector="TextBox#PART_TextBox:disabled">
<Style Selector="^ /template/ Border#PART_ContentPresenterBorder">
<!-- By default the TextBox has its own disabled state, override this to make the border background show through -->
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
</Style>
</Style>
</TextBox.Styles>
</TextBox>
<Button
Name="ClearButton"
Grid.Column="1"
Padding="0,0,8,0"
Content="{DynamicResource IconButtonClearData}"
Command="{Binding $parent[CalendarDatePicker].Clear}"
Focusable="False"
IsVisible="False"
Theme="{DynamicResource InnerIconButton}" />
<Button
Name="PART_Button"
Grid.Column="2"
Padding="0,0,8,0"
Content="{DynamicResource CalendarDatePickerIconGlyph}"
Focusable="False"
Theme="{DynamicResource InnerIconButton}" />
<Popup
Name="PART_Popup"
Grid.Column="0"
HorizontalOffset="-8"
IsLightDismissEnabled="True"
PlacementTarget="{TemplateBinding}"
VerticalOffset="-4">
<Border
Margin="8"
Background="Transparent"
BoxShadow="{DynamicResource CalendarDatePickerPopupBoxShadows}"
CornerRadius="{DynamicResource CalendarCornerRadius}">
<Calendar
Name="PART_Calendar"
BorderThickness="0"
CornerRadius="{Binding $parent[Border].CornerRadius}"
DisplayDate="{TemplateBinding DisplayDate}"
DisplayDateEnd="{TemplateBinding DisplayDateEnd}"
DisplayDateStart="{TemplateBinding DisplayDateStart}"
FirstDayOfWeek="{TemplateBinding FirstDayOfWeek}"
IsTodayHighlighted="{TemplateBinding IsTodayHighlighted}"
SelectedDate="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SelectedDate, Mode=TwoWay}">
</Calendar>
</Border>
</Popup>
</Grid>
</Border>
BoxShadow="{DynamicResource CalendarDatePickerPopupBoxShadows}"
CornerRadius="{DynamicResource CalendarCornerRadius}">
<Calendar
Name="PART_Calendar"
BorderThickness="0"
CornerRadius="{Binding $parent[Border].CornerRadius}"
DisplayDate="{TemplateBinding DisplayDate}"
DisplayDateEnd="{TemplateBinding DisplayDateEnd}"
DisplayDateStart="{TemplateBinding DisplayDateStart}"
FirstDayOfWeek="{TemplateBinding FirstDayOfWeek}"
IsTodayHighlighted="{TemplateBinding IsTodayHighlighted}"
SelectedDate="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SelectedDate, Mode=TwoWay}">
</Calendar>
</Border>
</Popup>
</Grid>
</Panel>
</DataValidationErrors>
@@ -128,14 +130,10 @@
</Style>
<Style Selector="^.Large">
<Style Selector="^ /template/ TextBox#PART_TextBox">
<Setter Property="MinHeight" Value="{DynamicResource CalendarDatePickerInnerLargeHeight}" />
</Style>
<Setter Property="MinHeight" Value="{DynamicResource CalendarDatePickerLargeHeight}" />
</Style>
<Style Selector="^.Small">
<Style Selector="^ /template/ TextBox#PART_TextBox">
<Setter Property="MinHeight" Value="{DynamicResource CalendarDatePickerInnerSmallHeight}" />
</Style>
<Setter Property="MinHeight" Value="{DynamicResource CalendarDatePickerSmallHeight}" />
</Style>
<Style Selector="^:pointerover">

View File

@@ -123,8 +123,8 @@
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckedDisabledBackground}" />
</Style>
<Style Selector="^ /template/ PathIcon#CheckGlyph">
<Setter Property="Foreground" Value="{DynamicResource CheckBoxGlyphDisabledFill}" />
<Style Selector="^ /template/ Path#CheckGlyph">
<Setter Property="Fill" Value="{DynamicResource CheckBoxGlyphDisabledFill}" />
</Style>
</Style>
</Style>
@@ -166,8 +166,8 @@
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckedDisabledBackground}" />
</Style>
<Style Selector="^ /template/ PathIcon#CheckGlyph">
<Setter Property="Foreground" Value="{DynamicResource CheckBoxGlyphDisabledFill}" />
<Style Selector="^ /template/ Path#CheckGlyph">
<Setter Property="Fill" Value="{DynamicResource CheckBoxGlyphDisabledFill}" />
</Style>
</Style>
</Style>
@@ -275,8 +275,8 @@
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckedDisabledBackground}" />
</Style>
<Style Selector="^ /template/ PathIcon#CheckGlyph">
<Setter Property="Foreground" Value="{DynamicResource CheckBoxGlyphDisabledFill}" />
<Style Selector="^ /template/ Path#CheckGlyph">
<Setter Property="Fill" Value="{DynamicResource CheckBoxGlyphDisabledFill}" />
</Style>
</Style>
</Style>
@@ -315,8 +315,8 @@
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckedDisabledBackground}" />
</Style>
<Style Selector="^ /template/ PathIcon#CheckGlyph">
<Setter Property="Foreground" Value="{DynamicResource CheckBoxGlyphDisabledFill}" />
<Style Selector="^ /template/ Path#CheckGlyph">
<Setter Property="Fill" Value="{DynamicResource CheckBoxGlyphDisabledFill}" />
</Style>
</Style>
</Style>
@@ -457,8 +457,8 @@
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckedDisabledBackground}" />
</Style>
<Style Selector="^ /template/ PathIcon#CheckGlyph">
<Setter Property="Foreground" Value="{DynamicResource CheckBoxGlyphDisabledFill}" />
<Style Selector="^ /template/ Path#CheckGlyph">
<Setter Property="Fill" Value="{DynamicResource CheckBoxGlyphDisabledFill}" />
</Style>
</Style>
</Style>
@@ -512,8 +512,8 @@
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckedDisabledBackground}" />
</Style>
<Style Selector="^ /template/ PathIcon#CheckGlyph">
<Setter Property="Foreground" Value="{DynamicResource CheckBoxGlyphDisabledFill}" />
<Style Selector="^ /template/ Path#CheckGlyph">
<Setter Property="Fill" Value="{DynamicResource CheckBoxGlyphDisabledFill}" />
</Style>
</Style>
</Style>

View File

@@ -32,6 +32,7 @@
<Setter Property="FocusAdorner" Value="{x:Null}" />
<Setter Property="MaxDropDownHeight" Value="504" />
<Setter Property="Background" Value="{DynamicResource ComboBoxSelectorBackground}" />
<Setter Property="BackgroundSizing" Value="OuterBorderEdge" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="CornerRadius" Value="{DynamicResource ComboBoxSelectorCornerRadius}" />
@@ -41,6 +42,7 @@
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="MinHeight" Value="{DynamicResource ComboBoxDefaultHeight}" />
<Setter Property="Template">
<ControlTemplate TargetType="ComboBox">
<DataValidationErrors>
@@ -49,12 +51,12 @@
x:Name="Background"
Grid.Column="0"
Grid.ColumnSpan="3"
MinWidth="{DynamicResource ComboBoxThemeMinWidth}"
MinHeight="{DynamicResource ComboBoxDefaultHeight}"
Background="{TemplateBinding Background}"
BackgroundSizing="{TemplateBinding BackgroundSizing}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}" />
CornerRadius="{TemplateBinding CornerRadius}"
MinHeight="{TemplateBinding MinHeight}" />
<TextBlock
x:Name="PlaceholderTextBlock"
Grid.Column="0"
@@ -148,10 +150,10 @@
</Style>
</Style>
<Style Selector="^.Large /template/ Border#Background">
<Style Selector="^.Large">
<Setter Property="MinHeight" Value="{DynamicResource ComboBoxLargeHeight}" />
</Style>
<Style Selector="^.Small /template/ Border#Background">
<Style Selector="^.Small">
<Setter Property="MinHeight" Value="{DynamicResource ComboBoxSmallHeight}" />
</Style>
@@ -159,9 +161,18 @@
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource ComboBoxSelectorPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxSelectorPointeroverBorderBrush}" />
<Style Selector="^ /template/ PathIcon#DropDownGlyph">
<Setter Property="Foreground" Value="{DynamicResource ComboBoxIconPointeroverForeground}" />
</Style>
</Style>
<Style Selector="^:pointerover /template/ PathIcon#DropDownGlyph">
<Setter Property="Foreground" Value="{DynamicResource ComboBoxIconPointeroverForeground}" />
<!-- Focus State -->
<Style Selector="^:focus">
<Setter Property="Background" Value="{DynamicResource ComboBoxSelectorFocusBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxSelectorFocusBorderBrush}" />
<Style Selector="^ /template/ PathIcon#DropDownGlyph">
<Setter Property="Foreground" Value="{DynamicResource ComboBoxIconFocusForeground}" />
</Style>
</Style>
<!-- Pressed State -->
@@ -222,6 +233,10 @@
<Setter Property="Background" Value="{DynamicResource ComboBoxSelectorBorderedPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxSelectorBorderedPressedBorderBrush}" />
</Style>
<Style Selector="^:focus /template/ Border#Background">
<Setter Property="Background" Value="{DynamicResource ComboBoxSelectorBorderedFocusBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxSelectorBorderedFocusBorderBrush}" />
</Style>
<Style Selector="^:disabled">
<Style Selector="^ /template/ Border#Background">
<Setter Property="Background" Value="{DynamicResource ComboBoxSelectorDisabledBackground}" />
@@ -284,6 +299,10 @@
<Setter Property="Background" Value="{DynamicResource ComboBoxItemPointeroverBackground}" />
</Style>
<Style Selector="^:focus /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ComboBoxItemFocusBackground}" />
</Style>
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ComboBoxItemDisabledBackground}" />
</Style>
@@ -303,5 +322,6 @@
<Setter Property="Background" Value="{DynamicResource ComboBoxItemSelectedPointeroverBackground}" />
</Style>
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -1,22 +0,0 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True">
<ControlTheme x:Key="{x:Type ContentControl}" TargetType="ContentControl">
<Setter Property="Template">
<ControlTemplate TargetType="ContentControl">
<ContentPresenter
Name="PART_ContentPresenter"
Padding="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
CornerRadius="{TemplateBinding CornerRadius}" />
</ControlTemplate>
</Setter>
</ControlTheme>
</ResourceDictionary>

View File

@@ -132,6 +132,7 @@
<Setter Property="CornerRadius" Value="{DynamicResource DateTimePickerButtonCornerRadius}" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="MinHeight" Value="{DynamicResource DateTimePickerButtonDefaultHeight}" />
<Setter Property="Template">
<ControlTemplate TargetType="DatePicker">
<DataValidationErrors>
@@ -145,7 +146,7 @@
Grid.ColumnSpan="2"
Width="298"
MinWidth="298"
MinHeight="{DynamicResource DateTimePickerButtonDefaultHeight}"
MinHeight="{TemplateBinding MinHeight}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="{TemplateBinding Background}"
@@ -165,43 +166,45 @@
ColumnDefinitions="78*,Auto,132*,Auto,78*">
<TextBlock
Name="PART_DayTextBlock"
Padding="12,4"
Padding="12,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontFamily="{TemplateBinding FontFamily}"
FontSize="{TemplateBinding FontSize}"
FontWeight="{TemplateBinding FontWeight}"
Text="day" />
Text="{DynamicResource STRING_DATEPICKER_DAY_TEXT}" />
<TextBlock
Name="PART_MonthTextBlock"
Padding="12,4"
Padding="12,0"
VerticalAlignment="Center"
FontFamily="{TemplateBinding FontFamily}"
FontSize="{TemplateBinding FontSize}"
FontWeight="{TemplateBinding FontWeight}"
Text="month"
Text="{DynamicResource STRING_DATEPICKER_MONTH_TEXT}"
TextAlignment="Left" />
<TextBlock
Name="PART_YearTextBlock"
Padding="12,4"
Padding="12,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontFamily="{TemplateBinding FontFamily}"
FontSize="{TemplateBinding FontSize}"
FontWeight="{TemplateBinding FontWeight}"
Text="year" />
Text="{DynamicResource STRING_DATEPICKER_YEAR_TEXT}" />
<Rectangle
x:Name="PART_FirstSpacer"
Grid.Column="1"
Width="1"
Margin="0,4"
Height="{TemplateBinding Height}"
MinHeight="{TemplateBinding MinHeight}"
HorizontalAlignment="Center"
Fill="{DynamicResource DateTimePickerSeparatorBackground}" />
<Rectangle
x:Name="PART_SecondSpacer"
Grid.Column="3"
Width="1"
Margin="0,4"
Height="{TemplateBinding Height}"
MinHeight="{TemplateBinding MinHeight}"
HorizontalAlignment="Center"
Fill="{DynamicResource DateTimePickerSeparatorBackground}" />
</Grid>
@@ -255,10 +258,10 @@
<Style Selector="^:hasnodate /template/ Button#PART_FlyoutButton TextBlock">
<Setter Property="Foreground" Value="{DynamicResource DateTimePickerEmptyForeground}" />
</Style>
<Style Selector="^.Large /template/ Button#PART_FlyoutButton">
<Style Selector="^.Large">
<Setter Property="MinHeight" Value="{DynamicResource DateTimePickerButtonLargeHeight}" />
</Style>
<Style Selector="^.Small /template/ Button#PART_FlyoutButton">
<Style Selector="^.Small">
<Setter Property="MinHeight" Value="{DynamicResource DateTimePickerButtonSmallHeight}" />
</Style>
</ControlTheme>

View File

@@ -6,7 +6,8 @@
<ControlTheme x:Key="DateTimePickerFlyoutButton" TargetType="Button">
<Setter Property="RenderTransform" Value="none" />
<Setter Property="Button.VerticalAlignment" Value="Stretch" />
<Setter Property="BackgroundSizing" Value="OuterBorderEdge" />
<Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="Template">
<ControlTemplate>
<ContentPresenter
@@ -14,6 +15,7 @@
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
Background="{TemplateBinding Background}"
BackgroundSizing="{TemplateBinding BackgroundSizing}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Content="{TemplateBinding Content}"

View File

@@ -4,25 +4,29 @@
x:CompileBindings="True">
<!-- Add Resources Here -->
<ControlTheme x:Key="{x:Type DropDownButton}" TargetType="DropDownButton">
<Setter Property="DropDownButton.Background" Value="{DynamicResource ButtonDefaultBackground}" />
<Setter Property="DropDownButton.Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
<Setter Property="DropDownButton.BorderBrush" Value="{DynamicResource ButtonDefaultBorderBrush}" />
<Setter Property="DropDownButton.CornerRadius" Value="{DynamicResource ButtonCornerRadius}" />
<Setter Property="DropDownButton.BorderThickness" Value="{DynamicResource ButtonBorderThickness}" />
<Setter Property="DropDownButton.Padding" Value="{DynamicResource ButtonDefaultPadding}" />
<Setter Property="DropDownButton.RenderTransform" Value="none" />
<Setter Property="DropDownButton.FontSize" Value="{DynamicResource ButtonDefaultFontSize}" />
<Setter Property="DropDownButton.FontWeight" Value="{DynamicResource ButtonDefaultFontWeight}" />
<Setter Property="DropDownButton.HorizontalContentAlignment" Value="Center" />
<Setter Property="DropDownButton.VerticalContentAlignment" Value="Center" />
<Setter Property="DropDownButton.MinHeight" Value="12" />
<Setter Property="DropDownButton.Cursor" Value="Hand" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultBorderBrush}" />
<Setter Property="CornerRadius" Value="{DynamicResource ButtonCornerRadius}" />
<Setter Property="BorderThickness" Value="{DynamicResource ButtonBorderThickness}" />
<Setter Property="Padding" Value="{DynamicResource ButtonDefaultPadding}" />
<Setter Property="RenderTransform" Value="none" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="{DynamicResource ButtonDefaultFontSize}" />
<Setter Property="FontWeight" Value="{DynamicResource ButtonDefaultFontWeight}" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="BackgroundSizing" Value="OuterBorderEdge" />
<Setter Property="MinHeight" Value="{DynamicResource ButtonDefaultHeight}" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Template">
<ControlTemplate TargetType="DropDownButton">
<Border
x:Name="RootBorder"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
BackgroundSizing="{TemplateBinding BackgroundSizing}"
BorderThickness="{TemplateBinding BorderThickness}"
ClipToBounds="True"
CornerRadius="{TemplateBinding CornerRadius}">
@@ -35,6 +39,7 @@
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Foreground="{TemplateBinding Foreground}"
RecognizesAccessKey="True" />
<PathIcon
x:Name="DropDownGlyph"
@@ -57,6 +62,21 @@
<Setter Property="RenderTransform" Value="scale(0.98)" />
</Style>
<Style Selector="^ /template/ Border#RootBorder">
<Setter Property="BorderBrush" Value="{TemplateBinding BorderBrush}" />
<Setter Property="Background" Value="{TemplateBinding Background}" />
</Style>
<Style Selector="^:pointerover /template/ Border#RootBorder">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPointeroverBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPointeroverBackground}" />
</Style>
<Style Selector="^:pressed /template/ Border#RootBorder">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPressedBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPressedBackground}" />
</Style>
<Style Selector="^.Primary">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
</Style>
@@ -76,195 +96,145 @@
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDangerForeground}" />
</Style>
<Style Selector="^:pointerover">
<Style Selector="^:pointerover /template/ Border#RootBorder">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPointeroverBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPointeroverBackground}" />
</Style>
<Style Selector="^:pressed">
<Style Selector="^:pressed /template/ Border#RootBorder">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPressedBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPressedBackground}" />
</Style>
<Style Selector="^:disabled">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultDisabledBorderBrush}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style>
<Style Selector="^:disabled /template/ Border#RootBorder">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultDisabledBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultDisabledBackground}" />
</Style>
<Style Selector="^.Large">
<Setter Property="Padding" Value="{DynamicResource ButtonLargePadding}" />
<Setter Property="MinHeight" Value="{DynamicResource ButtonLargeHeight}" />
</Style>
<Style Selector="^.Small">
<Setter Property="Padding" Value="{DynamicResource ButtonSmallPadding}" />
<Setter Property="MinHeight" Value="{DynamicResource ButtonSmallHeight}" />
</Style>
</ControlTheme>
<ControlTheme x:Key="SolidDropDownButton" TargetType="DropDownButton">
<Setter Property="DropDownButton.Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="DropDownButton.Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
<Setter Property="DropDownButton.BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" />
<Setter Property="DropDownButton.CornerRadius" Value="{DynamicResource ButtonCornerRadius}" />
<Setter Property="DropDownButton.BorderThickness" Value="{DynamicResource ButtonBorderThickness}" />
<Setter Property="DropDownButton.Padding" Value="{DynamicResource ButtonDefaultPadding}" />
<Setter Property="DropDownButton.RenderTransform" Value="none" />
<Setter Property="DropDownButton.FontSize" Value="{DynamicResource ButtonDefaultFontSize}" />
<Setter Property="DropDownButton.FontWeight" Value="{DynamicResource ButtonDefaultFontWeight}" />
<Setter Property="DropDownButton.HorizontalContentAlignment" Value="Center" />
<Setter Property="DropDownButton.VerticalContentAlignment" Value="Center" />
<Setter Property="DropDownButton.MinHeight" Value="12" />
<Setter Property="DropDownButton.Cursor" Value="Hand" />
<Setter Property="Template">
<ControlTemplate TargetType="DropDownButton">
<Border
x:Name="RootBorder"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
ClipToBounds="True"
CornerRadius="{TemplateBinding CornerRadius}">
<Grid x:Name="InnerGrid" ColumnDefinitions="*,Auto">
<ContentPresenter
x:Name="PART_ContentPresenter"
Grid.Column="0"
Padding="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
RecognizesAccessKey="True" />
<PathIcon
x:Name="DropDownGlyph"
Grid.Column="1"
Width="12"
Height="12"
Margin="0,0,8,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Data="{DynamicResource DropDownButtonIconGlyph}"
Foreground="{TemplateBinding Foreground}"
IsHitTestVisible="False"
UseLayoutRounding="False" />
</Grid>
</Border>
</ControlTemplate>
</Setter>
<Style Selector="^:pressed">
<Setter Property="RenderTransform" Value="scale(0.98)" />
</Style>
<Style Selector="^.Primary">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<ControlTheme
x:Key="SolidDropDownButton"
BasedOn="{StaticResource {x:Type DropDownButton}}"
TargetType="DropDownButton">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Style Selector="^ /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" />
<Style Selector="^:pointerover">
</Style>
<Style Selector="^:pointerover /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPressedBorderBrush}" />
</Style>
<Style Selector="^.Primary">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Style Selector="^ /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Style Selector="^:pressed /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPressedBorderBrush}" />
</Style>
</Style>
<Style Selector="^.Secondary">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryBorderBrush}" />
<Style Selector="^:pointerover">
<Style Selector="^ /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Style Selector="^:pressed /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryPressedBorderBrush}" />
</Style>
</Style>
<Style Selector="^.Tertiary">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryBorderBrush}" />
<Style Selector="^:pointerover">
<Style Selector="^ /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Style Selector="^:pressed /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryPressedBorderBrush}" />
</Style>
</Style>
<Style Selector="^.Success">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessBorderBrush}" />
<Style Selector="^:pointerover">
<Style Selector="^ /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Style Selector="^:pressed /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessPressedBorderBrush}" />
</Style>
</Style>
<Style Selector="^.Warning">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidWarningBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningBorderBrush}" />
<Style Selector="^:pointerover">
<Style Selector="^ /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidWarningBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidWarningPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Style Selector="^:pressed /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidWarningPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningPressedBorderBrush}" />
</Style>
</Style>
<Style Selector="^.Danger">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidDangerBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerBorderBrush}" />
<Style Selector="^:pointerover">
<Style Selector="^ /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidDangerBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidDangerPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Style Selector="^:pressed /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidDangerPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerPressedBorderBrush}" />
</Style>
</Style>
<Style Selector="^:disabled">
<Style Selector="^:disabled /template/ Border#RootBorder">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultDisabledBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidDisabledBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style>
</ControlTheme>
<ControlTheme
x:Key="OutlineDropDownButton"
BasedOn="{StaticResource {x:Type DropDownButton}}"
TargetType="DropDownButton">
<Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource ButtonOutlinePointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource ButtonOutlinePressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
</Style>
<Style Selector="^.Success">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineSuccessBorderBrush}" />
</Style>
<Style Selector="^.Warning">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineWarningBorderBrush}" />
</Style>
<Style Selector="^.Danger">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineDangerBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultDisabledBackground}" />
</Style>
<Style Selector="^:disabled">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style>
</ControlTheme>
@@ -273,12 +243,13 @@
x:Key="BorderlessDropDownButton"
BasedOn="{StaticResource {x:Type DropDownButton}}"
TargetType="DropDownButton">
<Setter Property="DropDownButton.Background" Value="Transparent" />
<Setter Property="DropDownButton.BorderBrush" Value="Transparent" />
<Style Selector="^:disabled">
<Style Selector="^ /template/ Border#RootBorder">
<Setter Property="DropDownButton.Background" Value="Transparent" />
<Setter Property="DropDownButton.BorderBrush" Value="Transparent" />
</Style>
<Style Selector="^:disabled /template/ Border#RootBorder">
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -0,0 +1,118 @@
<ResourceDictionary
x:CompileBindings="True"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ControlTheme TargetType="HyperlinkButton" x:Key="{x:Type HyperlinkButton}">
<Setter Property="Padding" Value="0,0,0,0" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="FontSize" Value="{DynamicResource HyperlinkButtonFontSize}" />
<Setter Property="MinHeight" Value="32" />
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonForeground}" />
<Setter Property="Background" Value="{DynamicResource HyperlinkButtonDefaultBackground}" />
<Setter Property="Template">
<ControlTemplate TargetType="HyperlinkButton">
<Grid ColumnDefinitions="Auto,*" x:Name="RootGrid">
<Grid
Grid.Column="0"
IsVisible="False"
Margin="0,0,8,0"
VerticalAlignment="Center"
x:Name="IconGrid">
<Border
Background="{DynamicResource HyperlinkButtonDefaultBackground}"
Height="{DynamicResource HyperlinkButtonIconHeight}"
Opacity="0"
UseLayoutRounding="False"
Width="{DynamicResource HyperlinkButtonIconWidth}"
x:Name="BackgroundRectangle" />
<PathIcon
Data="{DynamicResource HyperlinkButtonLinkGlyph}"
Foreground="{DynamicResource HyperlinkButtonForeground}"
Height="{DynamicResource HyperlinkButtonLinkGlyphHeight}"
Name="LinkGlyph"
VerticalAlignment="Center"
Width="{DynamicResource HyperlinkButtonLinkGlyphWidth}" />
</Grid>
<ContentPresenter
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Cursor="{TemplateBinding Cursor}"
Grid.Column="1"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Padding="0,0,0,0"
RecognizesAccessKey="True"
VerticalAlignment="Center"
x:Name="ContentPresenter" />
</Grid>
</ControlTemplate>
</Setter>
<Style Selector="^:pointerover">
<Style Selector="^ /template/ PathIcon#LinkGlyph">
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonOverForeground}" />
</Style>
<Style Selector="^ /template/ ContentPresenter#ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonOverForeground}" />
</Style>
</Style>
<!-- Unvisited Pressed State -->
<Style Selector="^:pressed">
<Setter Property="RenderTransform" Value="scale(0.98)" />
</Style>
<!-- Unvisited Disabled state -->
<Style Selector="^:disabled">
<Style Selector="^ /template/ PathIcon#LinkGlyph">
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonDisabledForeground}" />
</Style>
<Style Selector="^ /template/ ContentPresenter#ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonDisabledForeground}" />
</Style>
</Style>
<Style Selector="^:visited">
<Style Selector="^ /template/ PathIcon#LinkGlyph">
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonVisitedForeground}" />
</Style>
<Style Selector="^ /template/ ContentPresenter#ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonVisitedForeground}" />
</Style>
<!-- Visited Pointerover State -->
<Style Selector="^:pointerover">
<Style Selector="^ /template/ PathIcon#LinkGlyph">
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonOverForeground}" />
</Style>
<Style Selector="^ /template/ ContentPresenter#ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonOverForeground}" />
</Style>
</Style>
<!-- Visited Pressed State -->
<Style Selector="^:pressed">
<Setter Property="RenderTransform" Value="scale(0.98)" />
</Style>
<!-- Visited Disabled State -->
<Style Selector="^:disabled">
<Style Selector="^ /template/ PathIcon#LinkGlyph">
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonDisabledForeground}" />
</Style>
<Style Selector="^ /template/ ContentPresenter#ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonDisabledForeground}" />
</Style>
</Style>
</Style>
<Style Selector="^.WithIcon">
<Style Selector="^ /template/ Grid#IconGrid">
<Setter Property="IsVisible" Value="True" />
</Style>
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -27,10 +27,10 @@
RenderTransform="{x:Null}">
<RepeatButton.IsVisible>
<MultiBinding Converter="{x:Static converters:MenuScrollingVisibilityConverter.Instance}" ConverterParameter="0">
<ReflectionBinding Path="VerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}" />
<ReflectionBinding Path="Offset.Y" RelativeSource="{RelativeSource TemplatedParent}" />
<ReflectionBinding Path="Extent.Height" RelativeSource="{RelativeSource TemplatedParent}" />
<ReflectionBinding Path="Viewport.Height" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="VerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="Offset.Y" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="Extent.Height" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="Viewport.Height" RelativeSource="{RelativeSource TemplatedParent}" />
</MultiBinding>
</RepeatButton.IsVisible>
<PathIcon
@@ -50,10 +50,10 @@
RenderTransform="{x:Null}">
<RepeatButton.IsVisible>
<MultiBinding Converter="{x:Static converters:MenuScrollingVisibilityConverter.Instance}" ConverterParameter="100">
<ReflectionBinding Path="VerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}" />
<ReflectionBinding Path="Offset.Y" RelativeSource="{RelativeSource TemplatedParent}" />
<ReflectionBinding Path="Extent.Height" RelativeSource="{RelativeSource TemplatedParent}" />
<ReflectionBinding Path="Viewport.Height" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="VerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="Offset.Y" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="Extent.Height" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="Viewport.Height" RelativeSource="{RelativeSource TemplatedParent}" />
</MultiBinding>
</RepeatButton.IsVisible>
<PathIcon
@@ -120,14 +120,26 @@
CornerRadius="{TemplateBinding CornerRadius}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="ToggleIcon" />
<ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIcon" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIGT" />
<ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemChevron" />
</Grid.ColumnDefinitions>
<ContentControl
Name="PART_ToggleIconPresenter"
Grid.Column="0"
Width="16"
Height="16"
Margin="{DynamicResource MenuItemIconMargin}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
IsVisible="False" />
<Viewbox
Name="PART_IconPresenter"
Grid.Column="1"
Width="16"
Height="16"
Margin="{DynamicResource MenuItemIconMargin}"
@@ -143,15 +155,14 @@
<ContentPresenter
Name="PART_HeaderPresenter"
Grid.Column="1"
Grid.Column="2"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
RecognizesAccessKey="True" />
<TextBlock
x:Name="PART_InputGestureText"
Grid.Column="2"
Grid.Column="3"
Margin="{DynamicResource MenuItemInputGestureTextMargin}"
HorizontalAlignment="Right"
VerticalAlignment="Center"
@@ -160,7 +171,7 @@
Converter={StaticResource KeyGestureConverter}}" />
<PathIcon
Name="PART_ExpandIcon"
Grid.Column="3"
Grid.Column="4"
Width="8"
Height="8"
Margin="{DynamicResource MenuItemExpandIconMargin}"
@@ -245,6 +256,27 @@
</ControlTemplate>
</Setter>
</Style>
<Style Selector="^:checked:toggle /template/ ContentControl#PART_ToggleIconPresenter">
<Setter Property="IsVisible" Value="True" />
<Setter Property="Content">
<Template>
<PathIcon
Foreground="{Binding $parent[MenuItem].Foreground}"
Data="{StaticResource MenuCheckGlyph}" />
</Template>
</Setter>
</Style>
<Style Selector="^:checked:radio /template/ ContentControl#PART_ToggleIconPresenter">
<Setter Property="IsVisible" Value="True" />
<Setter Property="Content">
<Template>
<Ellipse Fill="{Binding $parent[MenuItem].Foreground}"
Margin="4" Width="8" Height="8" />
</Template>
</Setter>
</Style>
</ControlTheme>
<ControlTheme x:Key="TopLevelMenuItem" TargetType="MenuItem">
@@ -268,7 +300,6 @@
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
RecognizesAccessKey="True" />
<Popup
Name="PART_Popup"

View File

@@ -4,8 +4,10 @@
x:CompileBindings="True">
<!-- Add Resources Here -->
<ControlTheme x:Key="{x:Type NumericUpDown}" TargetType="NumericUpDown">
<Setter Property="NumericUpDown.VerticalAlignment" Value="Center" />
<Setter Property="NumericUpDown.VerticalContentAlignment" Value="Center" />
<Setter Property="NumericUpDown.CornerRadius" Value="{DynamicResource NumericUpDownCornerRadius}" />
<Setter Property="NumericUpDown.MinHeight" Value="{DynamicResource NumericUpDownDefaultHeight}" />
<Setter Property="NumericUpDown.Template">
<ControlTemplate TargetType="NumericUpDown">
<DataValidationErrors>
@@ -23,29 +25,32 @@
<TextBox
Name="PART_TextBox"
Height="{TemplateBinding Height}"
MinHeight="{DynamicResource NumericUpDownWrapperDefaultHeight}"
MinHeight="{TemplateBinding MinHeight}"
VerticalAlignment="Stretch"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
AcceptsReturn="False"
CornerRadius="{TemplateBinding CornerRadius}"
DataValidationErrors.Errors="{ReflectionBinding $parent[NumericUpDown].(DataValidationErrors.Errors)}"
DataValidationErrors.Errors="{Binding $parent[NumericUpDown].(DataValidationErrors.Errors)}"
FontSize="{TemplateBinding FontSize}"
Foreground="{TemplateBinding Foreground}"
IsReadOnly="{TemplateBinding IsReadOnly}"
Text="{TemplateBinding Text}"
TextWrapping="NoWrap"
Theme="{DynamicResource NonErrorTextBox}"
InnerLeftContent="{TemplateBinding InnerLeftContent}"
InnerRightContent="{TemplateBinding InnerRightContent}"
Watermark="{TemplateBinding Watermark}" />
</ButtonSpinner>
</DataValidationErrors>
</ControlTemplate>
</Setter>
<Style Selector="^.Large /template/ TextBox#PART_TextBox">
<Setter Property="MinHeight" Value="{DynamicResource NumericUpDownWrapperLargeHeight}" />
<Style Selector="^.Large">
<Setter Property="MinHeight" Value="{DynamicResource NumericUpDownLargeHeight}" />
</Style>
<Style Selector="^.Small /template/ TextBox#PART_TextBox">
<Setter Property="MinHeight" Value="{DynamicResource NumericUpDownWrapperSmallHeight}" />
<Style Selector="^.Small">
<Setter Property="MinHeight" Value="{DynamicResource NumericUpDownSmallHeight}" />
</Style>
<Style Selector="^:error">

View File

@@ -159,7 +159,7 @@
<TextBlock.Text>
<MultiBinding Converter="{StaticResource StringFormatConverter}">
<TemplateBinding Property="ProgressTextFormat" />
<ReflectionBinding Path="Value" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="Value" RelativeSource="{RelativeSource TemplatedParent}" />
<TemplateBinding Property="Percentage" />
<TemplateBinding Property="Minimum" />
<TemplateBinding Property="Maximum" />
@@ -185,10 +185,6 @@
<Style Selector="^.Warning">
<Setter Property="Foreground" Value="{DynamicResource ProgressBarWarningForeground}" />
</Style>
<Style Selector="^.Danger">
<Setter Property="Foreground" Value="{DynamicResource ProgressBarDangerForeground}" />
</Style>
<!-- Error style is obsolete, use Danger instead -->
<Style Selector="^.Error">
<Setter Property="Foreground" Value="{DynamicResource ProgressBarErrorForeground}" />
</Style>
@@ -415,10 +411,6 @@
<Style Selector="^.Warning">
<Setter Property="Foreground" Value="{DynamicResource ProgressBarWarningForeground}" />
</Style>
<Style Selector="^.Danger">
<Setter Property="Foreground" Value="{DynamicResource ProgressBarDangerForeground}" />
</Style>
<!-- Error style is obsolete, use Danger instead -->
<Style Selector="^.Error">
<Setter Property="Foreground" Value="{DynamicResource ProgressBarErrorForeground}" />
</Style>

View File

@@ -28,21 +28,27 @@
<Setter Property="IsTabStop" Value="False" />
<Setter Property="IsHitTestVisible" Value="False" />
<Setter Property="Height" Value="100" />
<Setter Property="Background" Value="{DynamicResource RefreshContainerIconBackground}" />
<Setter Property="Foreground" Value="{DynamicResource RefreshContainerIconForeground}" />
<Setter Property="Background" Value="{DynamicResource RefreshVisualizerIconBackground}" />
<Setter Property="Foreground" Value="{DynamicResource RefreshVisualizerIconForeground}" />
<Setter Property="Content">
<Template>
<Arc
Name="PART_Icon"
Width="{DynamicResource RefreshVisualizerIconSize}"
Height="{DynamicResource RefreshVisualizerIconSize}"
StartAngle="0"
Stroke="{DynamicResource RefreshVisualizerIconForeground}"
StrokeThickness="3"
StrokeLineCap="Round"
SweepAngle="270" />
</Template>
</Setter>
<Setter Property="Template">
<ControlTemplate>
<Grid
Name="PART_Root"
MinHeight="80"
Background="{TemplateBinding Background}">
<Grid.Styles>
<Style Selector="PathIcon#PART_Icon">
<Setter Property="Data" Value="{DynamicResource RefreshContainerIconGlyph}" />
</Style>
</Grid.Styles>
</Grid>
<Grid Name="PART_Root"
MinHeight="80"
Background="{TemplateBinding Background}" />
</ControlTemplate>
</Setter>
</ControlTheme>
</ResourceDictionary>
</ResourceDictionary>

View File

@@ -3,28 +3,32 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True">
<ControlTheme x:Key="{x:Type RepeatButton}" TargetType="RepeatButton">
<Setter Property="RepeatButton.Background" Value="{DynamicResource ButtonDefaultBackground}" />
<Setter Property="RepeatButton.Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
<Setter Property="RepeatButton.BorderBrush" Value="{DynamicResource ButtonDefaultBorderBrush}" />
<Setter Property="RepeatButton.CornerRadius" Value="{DynamicResource ButtonCornerRadius}" />
<Setter Property="RepeatButton.BorderThickness" Value="{DynamicResource ButtonBorderThickness}" />
<Setter Property="RepeatButton.Padding" Value="{DynamicResource ButtonDefaultPadding}" />
<Setter Property="RepeatButton.RenderTransform" Value="none" />
<Setter Property="RepeatButton.FontSize" Value="{DynamicResource ButtonDefaultFontSize}" />
<Setter Property="RepeatButton.FontWeight" Value="{DynamicResource ButtonDefaultFontWeight}" />
<Setter Property="RepeatButton.HorizontalContentAlignment" Value="Center" />
<Setter Property="RepeatButton.VerticalContentAlignment" Value="Center" />
<Setter Property="RepeatButton.MinHeight" Value="12" />
<Setter Property="RepeatButton.Cursor" Value="Hand" />
<Setter Property="RepeatButton.Template">
<Setter Property="Background" Value="{DynamicResource ButtonDefaultBackground}" />
<Setter Property="BackgroundSizing" Value="OuterBorderEdge" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultBorderBrush}" />
<Setter Property="CornerRadius" Value="{DynamicResource ButtonCornerRadius}" />
<Setter Property="BorderThickness" Value="{DynamicResource ButtonBorderThickness}" />
<Setter Property="Padding" Value="{DynamicResource ButtonDefaultPadding}" />
<Setter Property="RenderTransform" Value="none" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="{DynamicResource ButtonDefaultFontSize}" />
<Setter Property="FontWeight" Value="{DynamicResource ButtonDefaultFontWeight}" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="MinHeight" Value="{DynamicResource ButtonDefaultHeight}" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Template">
<ControlTemplate TargetType="RepeatButton">
<ContentPresenter
x:Name="PART_ContentPresenter"
Name="PART_ContentPresenter"
Padding="{TemplateBinding Padding}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BackgroundSizing="{TemplateBinding BackgroundSizing}"
BorderThickness="{TemplateBinding BorderThickness}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
@@ -39,6 +43,11 @@
<Style Selector="^:pressed">
<Setter Property="RenderTransform" Value="scale(0.98)" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="BorderBrush" Value="{TemplateBinding BorderBrush}" />
<Setter Property="Background" Value="{TemplateBinding Background}" />
</Style>
<Style Selector="^.Primary">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
@@ -59,26 +68,29 @@
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDangerForeground}" />
</Style>
<Style Selector="^:pointerover">
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPointeroverBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPointeroverBackground}" />
</Style>
<Style Selector="^:pressed">
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPressedBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPressedBackground}" />
</Style>
<Style Selector="^:disabled">
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultDisabledBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultDisabledBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style>
<Style Selector="^.Large">
<Setter Property="Padding" Value="{DynamicResource ButtonLargePadding}" />
<Setter Property="MinHeight" Value="{DynamicResource ButtonLargeHeight}" />
</Style>
<Style Selector="^.Small">
<Setter Property="Padding" Value="{DynamicResource ButtonSmallPadding}" />
<Setter Property="MinHeight" Value="{DynamicResource ButtonSmallHeight}" />
</Style>
</ControlTheme>
@@ -86,122 +98,105 @@
x:Key="SolidRepeatButton"
BasedOn="{StaticResource {x:Type RepeatButton}}"
TargetType="RepeatButton">
<Setter Property="RepeatButton.Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="RepeatButton.Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
<Setter Property="RepeatButton.BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" />
<Style Selector="^.Primary">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" />
<Style Selector="^:pointerover">
</Style>
<Style Selector="^.Primary">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPressedBorderBrush}" />
</Style>
</Style>
<Style Selector="^.Secondary">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryBorderBrush}" />
<Style Selector="^:pointerover">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryPressedBorderBrush}" />
</Style>
</Style>
<Style Selector="^.Tertiary">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryBorderBrush}" />
<Style Selector="^:pointerover">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryPressedBorderBrush}" />
</Style>
</Style>
<Style Selector="^.Success">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessBorderBrush}" />
<Style Selector="^:pointerover">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessPressedBorderBrush}" />
</Style>
</Style>
<Style Selector="^.Warning">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidWarningBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningBorderBrush}" />
<Style Selector="^:pointerover">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidWarningBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidWarningPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidWarningPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningPressedBorderBrush}" />
</Style>
</Style>
<Style Selector="^.Danger">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidDangerBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerBorderBrush}" />
<Style Selector="^:pointerover">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidDangerBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidDangerPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidDangerPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerPressedBorderBrush}" />
</Style>
</Style>
<Style Selector="^:disabled">
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultDisabledBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidDisabledBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style>
</ControlTheme>
<ControlTheme
x:Key="OutlineRepeatButton"
BasedOn="{StaticResource {x:Type RepeatButton}}"
TargetType="RepeatButton">
<Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource ButtonOutlinePointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource ButtonOutlinePressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
</Style>
<Style Selector="^.Success">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineSuccessBorderBrush}" />
</Style>
<Style Selector="^.Warning">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineWarningBorderBrush}" />
</Style>
<Style Selector="^.Danger">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineDangerBorderBrush}" />
</Style>
<Style Selector="^:disabled">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultDisabledBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style>
</ControlTheme>
@@ -210,9 +205,11 @@
x:Key="BorderlessRepeatButton"
BasedOn="{StaticResource {x:Type RepeatButton}}"
TargetType="RepeatButton">
<Setter Property="RepeatButton.Background" Value="Transparent" />
<Setter Property="RepeatButton.BorderBrush" Value="Transparent" />
<Style Selector="^:disabled">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="RepeatButton.Background" Value="Transparent" />
<Setter Property="RepeatButton.BorderBrush" Value="Transparent" />
</Style>
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />

View File

@@ -319,10 +319,10 @@
DockPanel.Dock="Top">
<RepeatButton.IsVisible>
<MultiBinding Converter="{x:Static converters:MenuScrollingVisibilityConverter.Instance}" ConverterParameter="0">
<ReflectionBinding Path="VerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}" />
<ReflectionBinding Path="Offset.Y" RelativeSource="{RelativeSource TemplatedParent}" />
<ReflectionBinding Path="Extent.Height" RelativeSource="{RelativeSource TemplatedParent}" />
<ReflectionBinding Path="Viewport.Height" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="VerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="Offset.Y" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="Extent.Height" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="Viewport.Height" RelativeSource="{RelativeSource TemplatedParent}" />
</MultiBinding>
</RepeatButton.IsVisible>
<Path Data="M 0 4 L 8 4 L 4 0 Z" />
@@ -334,10 +334,10 @@
DockPanel.Dock="Bottom">
<RepeatButton.IsVisible>
<MultiBinding Converter="{x:Static converters:MenuScrollingVisibilityConverter.Instance}" ConverterParameter="100">
<ReflectionBinding Path="VerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}" />
<ReflectionBinding Path="Offset.Y" RelativeSource="{RelativeSource TemplatedParent}" />
<ReflectionBinding Path="Extent.Height" RelativeSource="{RelativeSource TemplatedParent}" />
<ReflectionBinding Path="Viewport.Height" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="VerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="Offset.Y" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="Extent.Height" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="Viewport.Height" RelativeSource="{RelativeSource TemplatedParent}" />
</MultiBinding>
</RepeatButton.IsVisible>
<Path Data="M 0 0 L 4 4 L 8 0 Z" />

View File

@@ -2,79 +2,135 @@
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True">
<Design.PreviewWith>
<StackPanel Margin="20">
<SplitButton>Hello</SplitButton>
</StackPanel>
</Design.PreviewWith>
<ControlTheme x:Key="{x:Type SplitButton}" TargetType="SplitButton">
<Setter Property="SplitButton.Background" Value="{DynamicResource ButtonDefaultBackground}" />
<Setter Property="SplitButton.Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
<Setter Property="SplitButton.BorderBrush" Value="{DynamicResource ButtonDefaultBorderBrush}" />
<Setter Property="SplitButton.CornerRadius" Value="{DynamicResource ButtonCornerRadius}" />
<Setter Property="SplitButton.BorderThickness" Value="{DynamicResource ButtonBorderThickness}" />
<Setter Property="SplitButton.Padding" Value="{DynamicResource ButtonDefaultPadding}" />
<Setter Property="SplitButton.RenderTransform" Value="none" />
<Setter Property="SplitButton.FontSize" Value="{DynamicResource ButtonDefaultFontSize}" />
<Setter Property="SplitButton.FontWeight" Value="{DynamicResource ButtonDefaultFontWeight}" />
<Setter Property="SplitButton.HorizontalContentAlignment" Value="Center" />
<Setter Property="SplitButton.VerticalContentAlignment" Value="Center" />
<Setter Property="SplitButton.MinHeight" Value="12" />
<ControlTheme x:Key="SemiSplitButtonElement" TargetType="Button">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
<Setter Property="CornerRadius" Value="{DynamicResource ButtonCornerRadius}" />
<Setter Property="BorderThickness" Value="{DynamicResource ButtonBorderThickness}" />
<Setter Property="Padding" Value="{DynamicResource ButtonDefaultPadding}" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="RenderTransform" Value="none" />
<Setter Property="FontSize" Value="{DynamicResource ButtonDefaultFontSize}" />
<Setter Property="FontWeight" Value="{DynamicResource ButtonDefaultFontWeight}" />
<Setter Property="BackgroundSizing" Value="OuterBorderEdge" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Template">
<ControlTemplate TargetType="SplitButton">
<Grid ColumnDefinitions="*,Auto,Auto">
<Button
x:Name="PART_PrimaryButton"
Grid.Column="0"
Padding="{TemplateBinding Padding}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Command="{TemplateBinding Command}"
CommandParameter="{TemplateBinding CommandParameter}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
CornerRadius="3 0 0 3"
Focusable="False"
FontFamily="{TemplateBinding FontFamily}"
FontSize="{TemplateBinding FontSize}"
FontWeight="{TemplateBinding FontWeight}"
Foreground="{TemplateBinding Foreground}"
KeyboardNavigation.IsTabStop="False" />
<Border
x:Name="SeparatorBorder"
Grid.Column="1"
Width="{DynamicResource SplitButtonSeparatorWidth}"
Background="Transparent"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="0.5" />
<Button
x:Name="PART_SecondaryButton"
Grid.Column="2"
Padding="4,0"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="0 3 3 0"
Focusable="False"
Foreground="{TemplateBinding Foreground}"
KeyboardNavigation.IsTabStop="False">
<PathIcon
Width="12"
Height="12"
Data="{DynamicResource SplitButtonIconGlyph}"
Foreground="{Binding $parent[Button].Foreground}" />
</Button>
</Grid>
<ControlTemplate TargetType="Button">
<ContentPresenter
x:Name="PART_ContentPresenter"
Padding="{TemplateBinding Padding}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Background="{TemplateBinding Background}"
BackgroundSizing="{TemplateBinding BackgroundSizing}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
CornerRadius="{TemplateBinding CornerRadius}"
RecognizesAccessKey="True"
TextElement.FontSize="{TemplateBinding FontSize}"
TextElement.FontWeight="{TemplateBinding FontWeight}"
UseLayoutRounding="False" />
</ControlTemplate>
</Setter>
</ControlTheme>
<ControlTheme x:Key="{x:Type SplitButton}" TargetType="SplitButton">
<Setter Property="Background" Value="{DynamicResource ButtonDefaultBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultBorderBrush}" />
<Setter Property="CornerRadius" Value="{DynamicResource ButtonCornerRadius}" />
<Setter Property="BorderThickness" Value="{DynamicResource ButtonBorderThickness}" />
<Setter Property="Padding" Value="{DynamicResource ButtonDefaultPadding}" />
<Setter Property="RenderTransform" Value="none" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="{DynamicResource ButtonDefaultFontSize}" />
<Setter Property="FontWeight" Value="{DynamicResource ButtonDefaultFontWeight}" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="MinHeight" Value="{DynamicResource ButtonDefaultHeight}" />
<Setter Property="Template">
<ControlTemplate TargetType="SplitButton">
<Border
BackgroundSizing="OuterBorderEdge"
ClipToBounds="True"
CornerRadius="{TemplateBinding CornerRadius}">
<DockPanel>
<Button
x:Name="PART_SecondaryButton"
Padding="4,0"
VerticalAlignment="Stretch"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="0"
DockPanel.Dock="Right"
Focusable="False"
KeyboardNavigation.IsTabStop="False"
Theme="{DynamicResource SemiSplitButtonElement}">
<PathIcon
Width="12"
Height="12"
Data="{DynamicResource SplitButtonIconGlyph}"
Foreground="{Binding $parent[Button].Foreground}" />
</Button>
<Rectangle
x:Name="SeparatorBorder"
Width="{DynamicResource SplitButtonSeparatorWidth}"
VerticalAlignment="Stretch"
DockPanel.Dock="Right"
Fill="{TemplateBinding BorderBrush}"
StrokeThickness="0" />
<Button
x:Name="PART_PrimaryButton"
Padding="{TemplateBinding Padding}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
BorderThickness="{TemplateBinding BorderThickness}"
Command="{TemplateBinding Command}"
CommandParameter="{TemplateBinding CommandParameter}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
CornerRadius="0"
Focusable="False"
FontFamily="{TemplateBinding FontFamily}"
FontSize="{TemplateBinding FontSize}"
FontWeight="{TemplateBinding FontWeight}"
KeyboardNavigation.IsTabStop="False"
Theme="{DynamicResource SemiSplitButtonElement}" />
</DockPanel>
</Border>
</ControlTemplate>
</Setter>
<Style Selector="^ /template/ Button">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultBackground}" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPressedBorderBrush}" />
</Style>
</Style>
<Style Selector="^.Secondary /template/ Button">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultSecondaryForeground}" />
@@ -95,40 +151,75 @@
<Style Selector="^ /template/ Button">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPointeroverBackground}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPressedBackground}" />
</Style>
</Style>
<Style Selector="^.Secondary /template/ Button">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryPointeroverBackground}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryPressedBackground}" />
</Style>
</Style>
<Style Selector="^.Tertiary /template/ Button">
<Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryPointeroverBackground}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryPressedBackground}" />
</Style>
</Style>
<Style Selector="^.Success /template/ Button">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessPointeroverBackground}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessPressedBackground}" />
</Style>
</Style>
<Style Selector="^.Warning /template/ Button">
<Setter Property="Background" Value="{DynamicResource ButtonSolidWarningBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource ButtonSolidWarningPointeroverBackground}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource ButtonSolidWarningPressedBackground}" />
</Style>
</Style>
<Style Selector="^.Danger /template/ Button">
<Setter Property="Background" Value="{DynamicResource ButtonSolidDangerBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource ButtonSolidDangerPointeroverBackground}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource ButtonSolidDangerPressedBackground}" />
</Style>
</Style>
</Style>
<Style Selector="^.Large /template/ Button">
<Style Selector="^.Large /template/ Button#PART_PrimaryButton">
<Setter Property="Padding" Value="{DynamicResource ButtonLargePadding}" />
</Style>
<Style Selector="^.Small /template/ Button">
<Style Selector="^.Large">
<Setter Property="MinHeight" Value="{DynamicResource ButtonLargeHeight}" />
</Style>
<Style Selector="^.Small /template/ Button#PART_PrimaryButton">
<Setter Property="Padding" Value="{DynamicResource ButtonSmallPadding}" />
</Style>
<Style Selector="^:disabled /template/ Button">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
<Style Selector="^.Small">
<Setter Property="MinHeight" Value="{DynamicResource ButtonSmallHeight}" />
</Style>
<!-- only for ToggleSplitButton -->
<Style Selector="^:checked:disabled /template/ Button">
<Setter Property="Background" Value="{DynamicResource ButtonSolidDisabledBackground}" />
<Style Selector="^:disabled /template/ Button">
<Setter Property="Background" Value="{DynamicResource ButtonDefaultDisabledBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style>
</ControlTheme>
@@ -136,9 +227,10 @@
x:Key="SolidSplitButton"
BasedOn="{StaticResource {x:Type SplitButton}}"
TargetType="SplitButton">
<Setter Property="SplitButton.Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="SplitButton.Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
<Style Selector="^ /template/ Button">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPointeroverBackground}" />
</Style>
@@ -209,37 +301,7 @@
</Style>
<Style Selector="^:disabled /template/ Button">
<Setter Property="Background" Value="{DynamicResource ButtonSolidDisabledBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style>
</ControlTheme>
<ControlTheme
x:Key="OutlineSplitButton"
BasedOn="{StaticResource {x:Type SplitButton}}"
TargetType="SplitButton">
<Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
<Style Selector="^ /template/ Button">
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource ButtonOutlinePointeroverBackground}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource ButtonOutlinePressedBackground}" />
</Style>
</Style>
<Style Selector="^.Success /template/ Button">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineSuccessBorderBrush}" />
</Style>
<Style Selector="^.Warning /template/ Button">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineWarningBorderBrush}" />
</Style>
<Style Selector="^.Danger /template/ Button">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineDangerBorderBrush}" />
</Style>
<Style Selector="^:disabled /template/ Button">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultDisabledBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style>
</ControlTheme>
@@ -248,8 +310,10 @@
x:Key="BorderlessSplitButton"
BasedOn="{StaticResource {x:Type SplitButton}}"
TargetType="SplitButton">
<Setter Property="SplitButton.Background" Value="Transparent" />
<Setter Property="SplitButton.BorderBrush" Value="Transparent" />
<Style Selector="^ /template/ Button">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
</Style>
<Style Selector="^:disabled /template/ Button">
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Background" Value="Transparent" />

View File

@@ -129,7 +129,7 @@
x:Name="PART_ContentPresenter"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" />
<Rectangle Name="LightDismissLayer" />
<Rectangle Name="LightDismissLayer" IsVisible="False" />
</Panel>
</Grid>
@@ -235,8 +235,8 @@
</Style>
</Style>
<Style Selector="^:lightdismiss /template/ Rectangle#LightDismissLayer">
<Setter Property="Fill" Value="#99000000" />
<Style Selector="^:lightDismiss /template/ Rectangle#LightDismissLayer">
<Setter Property="Fill" Value="{DynamicResource SplitViewMaskBrush}" />
</Style>
<Style Selector="^:overlay:open /template/ Rectangle#LightDismissLayer">
<Setter Property="IsVisible" Value="True" />

View File

@@ -53,11 +53,14 @@
<Setter Property="TextBox.SelectionBrush" Value="{DynamicResource TextBoxSelectionBackground}" />
<Setter Property="TextBox.SelectionForegroundBrush" Value="{DynamicResource TextBoxSelectionForeground}" />
<Setter Property="TextBox.BorderThickness" Value="{DynamicResource TextBoxBorderThickness}" />
<Setter Property="TextBox.BackgroundSizing" Value="OuterBorderEdge" />
<Setter Property="TextBox.CornerRadius" Value="{DynamicResource TextBoxDefaultCornerRadius}" />
<Setter Property="TextBox.FontSize" Value="14" />
<Setter Property="TextBox.Cursor" Value="Ibeam" />
<Setter Property="TextBox.CaretBrush" Value="{DynamicResource TextBoxTextCaretBrush}" />
<Setter Property="TextBox.Padding" Value="{DynamicResource TextBoxContentPadding}" />
<Setter Property="TextBox.MinHeight" Value="{DynamicResource TextBoxDefaultHeight}" />
<Setter Property="TextBox.VerticalAlignment" Value="Center" />
<Setter Property="TextBox.VerticalContentAlignment" Value="Center" />
<Setter Property="TextBox.FocusAdorner" Value="{x:Null}" />
<Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="True" />
@@ -67,8 +70,9 @@
<DataValidationErrors>
<Border
Name="PART_ContentPresenterBorder"
MinHeight="{DynamicResource TextBoxWrapperDefaultHeight}"
MinHeight="{TemplateBinding MinHeight}"
Background="{TemplateBinding Background}"
BackgroundSizing="{TemplateBinding BackgroundSizing}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
@@ -105,6 +109,7 @@
<TextPresenter
Name="PART_TextPresenter"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
CaretBlinkInterval="{TemplateBinding CaretBlinkInterval}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
CaretBrush="{TemplateBinding CaretBrush}"
CaretIndex="{TemplateBinding CaretIndex}"
@@ -198,11 +203,11 @@
<Setter Property="IsVisible" Value="True" />
</Style>
</Style>
<Style Selector="^.Large /template/ Border#PART_ContentPresenterBorder">
<Setter Property="MinHeight" Value="{DynamicResource TextBoxWrapperLargeHeight}" />
<Style Selector="^.Large">
<Setter Property="MinHeight" Value="{DynamicResource TextBoxLargeHeight}" />
</Style>
<Style Selector="^.Small /template/ Border#PART_ContentPresenterBorder">
<Setter Property="MinHeight" Value="{DynamicResource TextBoxWrapperSmallHeight}" />
<Style Selector="^.Small">
<Setter Property="MinHeight" Value="{DynamicResource TextBoxSmallHeight}" />
</Style>
<Style Selector="^.Bordered">
@@ -255,13 +260,15 @@
<Setter Property="TextBox.BorderBrush" Value="{DynamicResource TextBoxDefaultBorderBrush}" />
<Setter Property="TextBox.SelectionBrush" Value="{DynamicResource TextBoxSelectionBackground}" />
<Setter Property="TextBox.SelectionForegroundBrush" Value="{DynamicResource TextBoxSelectionForeground}" />
<Setter Property="TextBox.BackgroundSizing" Value="OuterBorderEdge" />
<Setter Property="TextBox.BorderThickness" Value="{DynamicResource TextBoxBorderThickness}" />
<Setter Property="TextBox.CornerRadius" Value="{DynamicResource TextBoxDefaultCornerRadius}" />
<Setter Property="TextBox.FontSize" Value="14" />
<Setter Property="TextBox.Cursor" Value="Ibeam" />
<Setter Property="TextBox.CaretBrush" Value="{DynamicResource TextBoxTextCaretBrush}" />
<Setter Property="TextBox.Padding" Value="{DynamicResource TextBoxContentPadding}" />
<Setter Property="TextBox.MinHeight" Value="{DynamicResource TextBoxWrapperDefaultHeight}" />
<Setter Property="TextBox.MinHeight" Value="{DynamicResource TextBoxDefaultHeight}" />
<Setter Property="TextBox.VerticalAlignment" Value="Center" />
<Setter Property="TextBox.VerticalContentAlignment" Value="Center" />
<Setter Property="TextBox.FocusAdorner" Value="{x:Null}" />
<Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="True" />
@@ -273,10 +280,11 @@
Name="PART_ContentPresenterBorder"
MinHeight="{TemplateBinding MinHeight}"
Background="{TemplateBinding Background}"
BackgroundSizing="{TemplateBinding BackgroundSizing}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<Grid Margin="{TemplateBinding Padding}" ColumnDefinitions="Auto, *">
<Grid Margin="{TemplateBinding Padding}" ColumnDefinitions="Auto, *, Auto">
<ContentPresenter
Grid.Column="0"
Padding="{DynamicResource TextBoxInnerLeftContentPadding}"
@@ -305,6 +313,7 @@
Name="PART_TextPresenter"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
CaretBlinkInterval="{TemplateBinding CaretBlinkInterval}"
CaretBrush="{TemplateBinding CaretBrush}"
CaretIndex="{TemplateBinding CaretIndex}"
LineHeight="{TemplateBinding LineHeight}"
@@ -320,6 +329,13 @@
TextWrapping="{TemplateBinding TextWrapping}" />
</Panel>
</ScrollViewer>
<ContentPresenter
Grid.Column="2"
Padding="{DynamicResource TextBoxInnerRightContentPadding}"
VerticalAlignment="Center"
Content="{TemplateBinding InnerRightContent}"
Foreground="{DynamicResource TextBoxInnerForeground}"
IsVisible="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=InnerRightContent, Converter={x:Static ObjectConverters.IsNotNull}}" />
</Grid>
</Border>
</DataValidationErrors>
@@ -362,4 +378,80 @@
</Style>
</Style>
</ControlTheme>
<ControlTheme x:Key="LooklessTextBox" TargetType="TextBox">
<Setter Property="TextBox.Foreground" Value="{DynamicResource TextBoxForeground}" />
<Setter Property="TextBox.SelectionBrush" Value="{DynamicResource TextBoxSelectionBackground}" />
<Setter Property="TextBox.SelectionForegroundBrush" Value="{DynamicResource TextBoxSelectionForeground}" />
<Setter Property="TextBox.FontSize" Value="14" />
<Setter Property="TextBox.Cursor" Value="Ibeam" />
<Setter Property="TextBox.CaretBrush" Value="{DynamicResource TextBoxTextCaretBrush}" />
<Setter Property="TextBox.Padding" Value="{DynamicResource TextBoxContentPadding}" />
<Setter Property="TextBox.MinHeight" Value="{DynamicResource TextBoxDefaultHeight}" />
<Setter Property="TextBox.VerticalAlignment" Value="Center" />
<Setter Property="TextBox.VerticalContentAlignment" Value="Center" />
<Setter Property="TextBox.FocusAdorner" Value="{x:Null}" />
<Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="True" />
<Setter Property="TextBox.Template">
<ControlTemplate TargetType="TextBox">
<Border Name="PART_ContentPresenterBorder" MinHeight="{TemplateBinding MinHeight}">
<Grid Margin="{TemplateBinding Padding}" ColumnDefinitions="Auto, *, Auto">
<ContentPresenter
Grid.Column="0"
Padding="{DynamicResource TextBoxInnerLeftContentPadding}"
VerticalAlignment="Center"
Content="{TemplateBinding InnerLeftContent}"
Foreground="{DynamicResource TextBoxInnerForeground}"
IsVisible="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=InnerLeftContent, Converter={x:Static ObjectConverters.IsNotNull}}" />
<ScrollViewer
Grid.Column="1"
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}"
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
IsScrollChainingEnabled="{TemplateBinding (ScrollViewer.IsScrollChainingEnabled)}"
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}">
<Panel>
<TextBlock
Name="PART_Watermark"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
IsVisible="{TemplateBinding Text, Converter={x:Static StringConverters.IsNullOrEmpty}}"
Opacity="0.5"
Text="{TemplateBinding Watermark}"
TextAlignment="{TemplateBinding TextAlignment}"
TextWrapping="{TemplateBinding TextWrapping}" />
<TextPresenter
Name="PART_TextPresenter"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
CaretBrush="{TemplateBinding CaretBrush}"
CaretIndex="{TemplateBinding CaretIndex}"
LineHeight="{TemplateBinding LineHeight}"
PasswordChar="{TemplateBinding PasswordChar}"
RevealPassword="{TemplateBinding RevealPassword}"
SelectionBrush="{TemplateBinding SelectionBrush}"
SelectionEnd="{TemplateBinding SelectionEnd}"
SelectionForegroundBrush="{TemplateBinding SelectionForegroundBrush}"
SelectionStart="{TemplateBinding SelectionStart}"
Text="{TemplateBinding Text, Mode=TwoWay}"
TextAlignment="{TemplateBinding TextAlignment}"
TextWrapping="{TemplateBinding TextWrapping}" />
</Panel>
</ScrollViewer>
<ContentPresenter
Grid.Column="2"
Padding="{DynamicResource TextBoxInnerRightContentPadding}"
VerticalAlignment="Center"
Content="{TemplateBinding InnerRightContent}"
Foreground="{DynamicResource TextBoxInnerForeground}"
IsVisible="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=InnerRightContent, Converter={x:Static ObjectConverters.IsNotNull}}" />
</Grid>
</Border>
</ControlTemplate>
</Setter>
<Style Selector="^:disabled">
<Setter Property="Foreground" Value="{DynamicResource TextBoxDisabledForeground}" />
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -136,6 +136,7 @@
<Setter Property="CornerRadius" Value="3" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="MinHeight" Value="{DynamicResource DateTimePickerButtonDefaultHeight}" />
<Setter Property="Template">
<ControlTemplate>
<DataValidationErrors>
@@ -149,7 +150,7 @@
Grid.ColumnSpan="2"
Width="242"
MinWidth="242"
MinHeight="{DynamicResource DateTimePickerButtonDefaultHeight}"
MinHeight="{TemplateBinding MinHeight}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="{TemplateBinding Background}"
@@ -171,19 +172,19 @@
VerticalAlignment="Stretch">
<TextBlock
x:Name="PART_HourTextBlock"
Padding="12,4"
Padding="12,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontFamily="{TemplateBinding FontFamily}"
FontSize="{TemplateBinding FontSize}"
FontWeight="{TemplateBinding FontWeight}" />
FontWeight="{TemplateBinding FontWeight}"
Text="{DynamicResource STRING_TIMEPICKER_HOUR_TEXT}" />
</Border>
<Rectangle
Name="PART_FirstColumnDivider"
Grid.Column="1"
Width="1"
Margin="0,4"
HorizontalAlignment="Center"
Fill="{DynamicResource DateTimePickerSeparatorBackground}" />
@@ -194,19 +195,19 @@
VerticalAlignment="Stretch">
<TextBlock
x:Name="PART_MinuteTextBlock"
Padding="12,4"
Padding="12,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontFamily="{TemplateBinding FontFamily}"
FontSize="{TemplateBinding FontSize}"
FontWeight="{TemplateBinding FontWeight}" />
FontWeight="{TemplateBinding FontWeight}"
Text="{DynamicResource STRING_TIMEPICKER_MINUTE_TEXT}" />
</Border>
<Rectangle
Name="PART_SecondColumnDivider"
Grid.Column="3"
Width="1"
Margin="0,4"
HorizontalAlignment="Center"
Fill="{DynamicResource DateTimePickerSeparatorBackground}" />
@@ -217,7 +218,7 @@
VerticalAlignment="Stretch">
<TextBlock
x:Name="PART_PeriodTextBlock"
Padding="12,4"
Padding="12,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontFamily="{TemplateBinding FontFamily}"
@@ -278,10 +279,10 @@
<Setter Property="Foreground" Value="{DynamicResource DateTimePickerEmptyForeground}" />
</Style>
<Style Selector="^.Large /template/ Button#PART_FlyoutButton">
<Style Selector="^.Large">
<Setter Property="MinHeight" Value="{DynamicResource DateTimePickerButtonLargeHeight}" />
</Style>
<Style Selector="^.Small /template/ Button#PART_FlyoutButton">
<Style Selector="^.Small">
<Setter Property="MinHeight" Value="{DynamicResource DateTimePickerButtonSmallHeight}" />
</Style>
</ControlTheme>

View File

@@ -20,24 +20,30 @@
</StackPanel>
</Design.PreviewWith>
<ControlTheme x:Key="{x:Type ToggleButton}" TargetType="ToggleButton">
<Setter Property="ToggleButton.Background" Value="{DynamicResource ToggleButtonDefaultBackground}" />
<Setter Property="ToggleButton.Foreground" Value="{DynamicResource ToggleButtonDefaultPrimaryForeground}" />
<Setter Property="ToggleButton.BorderBrush" Value="{DynamicResource ToggleButtonDefaultBorderBrush}" />
<Setter Property="ToggleButton.CornerRadius" Value="{DynamicResource ToggleButtonCornerRadius}" />
<Setter Property="ToggleButton.BorderThickness" Value="{DynamicResource ToggleButtonBorderThickness}" />
<Setter Property="ToggleButton.Padding" Value="{DynamicResource ToggleButtonDefaultPadding}" />
<Setter Property="ToggleButton.RenderTransform" Value="none" />
<Setter Property="ToggleButton.FontSize" Value="{DynamicResource ToggleButtonDefaultFontSize}" />
<Setter Property="ToggleButton.FontWeight" Value="{DynamicResource ToggleButtonDefaultFontWeight}" />
<Setter Property="ToggleButton.HorizontalContentAlignment" Value="Center" />
<Setter Property="ToggleButton.VerticalContentAlignment" Value="Center" />
<Setter Property="ToggleButton.MinHeight" Value="12" />
<Setter Property="ToggleButton.Cursor" Value="Hand" />
<Setter Property="ToggleButton.Template">
<Setter Property="Background" Value="{DynamicResource ToggleButtonDefaultBackground}" />
<Setter Property="BackgroundSizing" Value="OuterBorderEdge" />
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonDefaultPrimaryForeground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonDefaultBorderBrush}" />
<Setter Property="CornerRadius" Value="{DynamicResource ToggleButtonCornerRadius}" />
<Setter Property="BorderThickness" Value="{DynamicResource ToggleButtonBorderThickness}" />
<Setter Property="Padding" Value="{DynamicResource ButtonDefaultPadding}" />
<Setter Property="RenderTransform" Value="none" />
<Setter Property="FontSize" Value="{DynamicResource ToggleButtonDefaultFontSize}" />
<Setter Property="FontWeight" Value="{DynamicResource ToggleButtonDefaultFontWeight}" />
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="MinHeight" Value="{DynamicResource ButtonDefaultHeight}" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Template">
<ControlTemplate TargetType="ToggleButton">
<ContentPresenter
x:Name="PART_ContentPresenter"
BackgroundSizing="{TemplateBinding BackgroundSizing}"
Padding="{TemplateBinding Padding}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Background="{TemplateBinding Background}"
@@ -67,7 +73,6 @@
<Style Selector="^:disabled">
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonDefaultDisabledBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ToggleButtonDefaultBackground}" />
</Style>
<Style Selector="^.Primary">
@@ -154,7 +159,6 @@
</Style>
<Style Selector="^:disabled">
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonDefaultDisabledBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ToggleButtonCheckedDisabledBackground}" />
</Style>
</Style>
@@ -244,19 +248,21 @@
</Style>
<Style Selector="^:disabled">
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonIndeterminateDisabledBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ToggleButtonDefaultBackground}" />
</Style>
</Style>
<Style Selector="^:disabled">
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonDefaultDisabledForeground}" />
<Setter Property="Background" Value="{DynamicResource ToggleButtonDefaultDisabledBackground}" />
</Style>
<Style Selector="^.Large">
<Setter Property="Padding" Value="{DynamicResource ButtonLargePadding}" />
<Setter Property="MinHeight" Value="{DynamicResource ButtonLargeHeight}" />
</Style>
<Style Selector="^.Small">
<Setter Property="Padding" Value="{DynamicResource ButtonSmallPadding}" />
<Setter Property="MinHeight" Value="{DynamicResource ButtonSmallHeight}" />
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -36,7 +36,8 @@
VerticalAlignment="Top"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
IsVisible="{TemplateBinding Content, Converter={x:Static ObjectConverters.IsNotNull}}"
IsVisible="{TemplateBinding Content,
Converter={x:Static ObjectConverters.IsNotNull}}"
RecognizesAccessKey="True" />
<Grid
Grid.Row="1"
@@ -47,34 +48,38 @@
Grid.ColumnSpan="2"
TemplatedControl.IsTemplateFocusTarget="True" />
<Border
x:Name="SwitchBackgroundBorder"
Name="SwitchBackgroundBorder"
Grid.Column="0"
Width="{DynamicResource ToggleSwitchDefaultWidth}"
Height="{DynamicResource ToggleSwitchDefaultHeight}"
Width="40"
Height="20"
CornerRadius="100">
<Border.Transitions>
<Transitions>
<BrushTransition Property="Background" Duration="0:0:0.2" />
</Transitions>
</Border.Transitions>
<Canvas
x:Name="PART_SwitchKnob"
Width="{DynamicResource ToggleSwitchIndicatorDefaultWidth}"
Height="{DynamicResource ToggleSwitchIndicatorDefaultWidth}"
HorizontalAlignment="Left">
<Grid
x:Name="PART_MovingKnobs"
Width="{DynamicResource ToggleSwitchIndicatorDefaultWidth}"
Height="{DynamicResource ToggleSwitchIndicatorDefaultWidth}"
Margin="{DynamicResource ToggleSwitchIndicatorDefaultMargin}">
<Border
x:Name="SwitchKnobIndicator"
Background="White"
BoxShadow="0 0 1 1 #222E3238"
CornerRadius="100" />
</Grid>
</Canvas>
</Border>
<Canvas
x:Name="PART_SwitchKnob"
Grid.Column="0"
Width="20"
Height="20"
HorizontalAlignment="Left">
<Grid
x:Name="PART_MovingKnobs"
Width="20"
Height="20">
<Border
x:Name="SwitchKnobIndicator"
Width="14"
Height="14"
Background="White"
BorderBrush="{DynamicResource ToggleSwitchIndicatorBorderBrush}"
BorderThickness="0.5"
BoxShadow="0 0 1 1 #222E3238"
CornerRadius="100" />
</Grid>
</Canvas>
<ContentPresenter
x:Name="PART_OnContentPresenter"
@@ -149,36 +154,6 @@
<Setter Property="Background" Value="{DynamicResource ToggleSwitchContainerCheckedDisabledBackground}" />
</Style>
</Style>
<Style Selector="^.Small">
<Style Selector="^ /template/ Border#SwitchBackgroundBorder">
<Setter Property="Width" Value="{DynamicResource ToggleSwitchSmallWidth}" />
<Setter Property="Height" Value="{DynamicResource ToggleSwitchSmallHeight}" />
</Style>
<Style Selector="^ /template/ Canvas#PART_SwitchKnob">
<Setter Property="Width" Value="{DynamicResource ToggleSwitchIndicatorSmallWidth}" />
<Setter Property="Height" Value="{DynamicResource ToggleSwitchIndicatorSmallWidth}" />
</Style>
<Style Selector="^ /template/ Grid#PART_MovingKnobs">
<Setter Property="Width" Value="{DynamicResource ToggleSwitchIndicatorSmallWidth}" />
<Setter Property="Height" Value="{DynamicResource ToggleSwitchIndicatorSmallWidth}" />
<Setter Property="Margin" Value="{DynamicResource ToggleSwitchIndicatorSmallMargin}"/>
</Style>
</Style>
<Style Selector="^.Large">
<Style Selector="^ /template/ Border#SwitchBackgroundBorder">
<Setter Property="Width" Value="{DynamicResource ToggleSwitchLargeWidth}" />
<Setter Property="Height" Value="{DynamicResource ToggleSwitchLargeHeight}" />
</Style>
<Style Selector="^ /template/ Canvas#PART_SwitchKnob">
<Setter Property="Width" Value="{DynamicResource ToggleSwitchIndicatorLargeWidth}" />
<Setter Property="Height" Value="{DynamicResource ToggleSwitchIndicatorLargeWidth}" />
</Style>
<Style Selector="^ /template/ Grid#PART_MovingKnobs">
<Setter Property="Width" Value="{DynamicResource ToggleSwitchIndicatorLargeWidth}" />
<Setter Property="Height" Value="{DynamicResource ToggleSwitchIndicatorLargeWidth}" />
<Setter Property="Margin" Value="{DynamicResource ToggleSwitchIndicatorLargeMargin}"/>
</Style>
</Style>
</ControlTheme>
<ControlTheme
@@ -230,40 +205,49 @@
<Grid
Background="{TemplateBinding Background}"
Cursor="Hand"
ColumnDefinitions="Auto, *">
RowDefinitions="*">
<Grid
Grid.Column="0"
Grid.ColumnSpan="2"
TemplatedControl.IsTemplateFocusTarget="True" />
<Border
x:Name="SwitchBackgroundBorder"
Grid.Column="0"
Width="{DynamicResource ToggleSwitchDefaultWidth}"
Height="{DynamicResource ToggleSwitchDefaultHeight}"
CornerRadius="100">
<Border.Transitions>
<Transitions>
<BrushTransition Property="Background" Duration="0:0:0.2" />
</Transitions>
</Border.Transitions>
Grid.Row="0"
Background="Transparent"
ColumnDefinitions="Auto, *">
<Grid
Grid.Column="0"
Grid.ColumnSpan="2"
TemplatedControl.IsTemplateFocusTarget="True" />
<Border
Name="SwitchBackgroundBorder"
Grid.Column="0"
Width="40"
Height="20"
CornerRadius="100">
<Border.Transitions>
<Transitions>
<BrushTransition Property="Background" Duration="0:0:0.2" />
</Transitions>
</Border.Transitions>
</Border>
<Canvas
x:Name="PART_SwitchKnob"
Width="{DynamicResource ToggleSwitchIndicatorDefaultWidth}"
Height="{DynamicResource ToggleSwitchIndicatorDefaultWidth}"
Grid.Column="0"
Width="20"
Height="20"
HorizontalAlignment="Left">
<Grid
x:Name="PART_MovingKnobs"
Width="{DynamicResource ToggleSwitchIndicatorDefaultWidth}"
Height="{DynamicResource ToggleSwitchIndicatorDefaultWidth}"
Margin="{DynamicResource ToggleSwitchIndicatorDefaultMargin}">
Width="20"
Height="20">
<Border
x:Name="SwitchKnobIndicator"
Width="14"
Height="14"
Background="White"
BorderBrush="{DynamicResource ToggleSwitchIndicatorBorderBrush}"
BorderThickness="0.5"
BoxShadow="0 0 1 1 #222E3238"
CornerRadius="100" />
</Grid>
</Canvas>
</Border>
</Grid>
</Grid>
</ControlTemplate>
</Setter>

View File

@@ -1,23 +0,0 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True">
<!-- Add Resources Here -->
<ControlTheme x:Key="{x:Type UserControl}" TargetType="UserControl">
<Setter Property="Template">
<ControlTemplate TargetType="UserControl">
<ContentPresenter
Name="PART_ContentPresenter"
Padding="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
CornerRadius="{TemplateBinding CornerRadius}" />
</ControlTemplate>
</Setter>
</ControlTheme>
</ResourceDictionary>

View File

@@ -1,7 +1,7 @@
<ResourceDictionary
x:CompileBindings="True"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="avares://Semi.Avalonia/Controls/AdornerLayer.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/AutoCompleteBox.axaml" />
@@ -14,7 +14,6 @@
<ResourceInclude Source="avares://Semi.Avalonia/Controls/Carousel.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/CheckBox.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/ComboBox.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/ContentControl.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/ContextMenu.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/DataValidationErrors.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/DatePicker.axaml" />
@@ -25,6 +24,7 @@
<ResourceInclude Source="avares://Semi.Avalonia/Controls/FlyoutPresenter.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/GridSplitter.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/HeaderedContentControl.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/HyperlinkButton.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/ItemsControl.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/Label.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/ListBox.axaml" />
@@ -57,7 +57,6 @@
<ResourceInclude Source="avares://Semi.Avalonia/Controls/Tooltip.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/TransitioningContentControl.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/TreeView.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/UserControl.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/Window.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/WindowNotificationManager.axaml" />
</ResourceDictionary.MergedDictionaries>

View File

@@ -1,6 +1,12 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
x:Class="Semi.Avalonia.Locale.en_us"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- DatePicker -->
<x:String x:Key="STRING_DATEPICKER_DAY_TEXT">day</x:String>
<x:String x:Key="STRING_DATEPICKER_MONTH_TEXT">month</x:String>
<x:String x:Key="STRING_DATEPICKER_YEAR_TEXT">year</x:String>
<!-- TimePicker -->
<x:String x:Key="STRING_TIMEPICKER_HOUR_TEXT">hour</x:String>
<x:String x:Key="STRING_TIMEPICKER_MINUTE_TEXT">minute</x:String>
<!-- TextBox/SelectableTextBox flyout -->
<x:String x:Key="STRING_MENU_CUT">Cut</x:String>
<x:String x:Key="STRING_MENU_COPY">Copy</x:String>

View File

@@ -1,8 +0,0 @@
using Avalonia.Controls;
namespace Semi.Avalonia.Locale;
public class en_us: ResourceDictionary
{
}

View File

@@ -1,6 +1,12 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
x:Class="Semi.Avalonia.Locale.zh_cn"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- DatePicker -->
<x:String x:Key="STRING_DATEPICKER_DAY_TEXT">日</x:String>
<x:String x:Key="STRING_DATEPICKER_MONTH_TEXT">月</x:String>
<x:String x:Key="STRING_DATEPICKER_YEAR_TEXT">年</x:String>
<!-- TimePicker -->
<x:String x:Key="STRING_TIMEPICKER_HOUR_TEXT">时</x:String>
<x:String x:Key="STRING_TIMEPICKER_MINUTE_TEXT">分</x:String>
<!-- TextBox/SelectableTextBox flyout -->
<x:String x:Key="STRING_MENU_CUT">剪切</x:String>
<x:String x:Key="STRING_MENU_COPY">复制</x:String>

View File

@@ -1,8 +0,0 @@
using Avalonia.Controls;
namespace Semi.Avalonia.Locale;
public class zh_cn: ResourceDictionary
{
}

View File

@@ -4,11 +4,7 @@
<PropertyGroup>
<Title>Semi.Avalonia</Title>
<PackageReleaseNotes>Update to 11.0.7.5</PackageReleaseNotes>
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
<IsAotCompatible>true</IsAotCompatible>
<PackageReleaseNotes>Update to 11.0.7</PackageReleaseNotes>
</PropertyGroup>
<ItemGroup>

View File

@@ -1,5 +1,5 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<BoxShadows x:Key="AutoCompleteBoxPopupBoxShadow">0 0 8 0 #1AFFFFFF</BoxShadows>
<SolidColorBrush x:Key="AutoCompleteBoxPopupBackground" Color="#35363C" />
<SolidColorBrush x:Key="AutoCompleteBoxPopupBorderBrush" Opacity="0.08" Color="#F9F9F9" />
<SolidColorBrush x:Key="AutoCompleteBoxPopupBorderBrush" Opacity="0.08" Color="White" />
</ResourceDictionary>

View File

@@ -1,5 +1,5 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<BoxShadows x:Key="BorderCardBoxShadow">0 0 14 0 #1AFFFFFF</BoxShadows>
<SolidColorBrush x:Key="BorderCardBackground" Color="#232429" />
<SolidColorBrush x:Key="BorderCardBorderBrush" Opacity="0.08" Color="White" />
<BoxShadows x:Key="BorderCardBoxShadow">0 0 14 0 #1AFFFFFF</BoxShadows>
</ResourceDictionary>

View File

@@ -2,7 +2,7 @@
<!-- Light -->
<SolidColorBrush x:Key="ButtonDefaultPrimaryForeground" Color="#54A9FF" />
<SolidColorBrush x:Key="ButtonDefaultSecondaryForeground" Color="#40B4F3" />
<SolidColorBrush x:Key="ButtonDefaultTertiaryForeground" Opacity="0.8" Color="#F9F9F9" />
<SolidColorBrush x:Key="ButtonDefaultTertiaryForeground" Color="#888D92" />
<SolidColorBrush x:Key="ButtonDefaultSuccessForeground" Color="#5DC264" />
<SolidColorBrush x:Key="ButtonDefaultWarningForeground" Color="#FFAE43" />
<SolidColorBrush x:Key="ButtonDefaultDangerForeground" Color="#FC725A" />
@@ -11,6 +11,7 @@
<SolidColorBrush x:Key="ButtonDefaultBackground" Opacity="0.12" Color="White" />
<SolidColorBrush x:Key="ButtonDefaultPointeroverBackground" Opacity="0.16" Color="White" />
<SolidColorBrush x:Key="ButtonDefaultPressedBackground" Opacity="0.20" Color="White" />
<SolidColorBrush x:Key="ButtonDefaultDisabledBackground" Opacity="0.04" Color="#E6E8EA" />
<SolidColorBrush x:Key="ButtonDefaultBorderBrush" Color="Transparent" />
<SolidColorBrush x:Key="ButtonDefaultPointeroverBorderBrush" Color="Transparent" />
@@ -68,20 +69,8 @@
<SolidColorBrush x:Key="ButtonSolidDangerBorderBrush" Color="#FC725A" />
<SolidColorBrush x:Key="ButtonSolidDangerPointeroverBorderBrush" Color="#FD9983" />
<SolidColorBrush x:Key="ButtonSolidDangerPressedBorderBrush" Color="#FDBEAC" />
<SolidColorBrush x:Key="ButtonSolidDisabledBackground" Color="#2E3238" />
<!-- end Solid -->
<!-- Outline -->
<SolidColorBrush x:Key="ButtonOutlineBackground" Color="Transparent" />
<SolidColorBrush x:Key="ButtonOutlineBorderBrush" Opacity="0.08" Color="White" />
<SolidColorBrush x:Key="ButtonOutlinePointeroverBackground" Opacity="0.12" Color="White" />
<SolidColorBrush x:Key="ButtonOutlinePressedBackground" Opacity="0.16" Color="White" />
<SolidColorBrush x:Key="ButtonOutlineSuccessBorderBrush" Color="#5DC264" />
<SolidColorBrush x:Key="ButtonOutlineWarningBorderBrush" Color="#FFAE43" />
<SolidColorBrush x:Key="ButtonOutlineDangerBorderBrush" Color="#FC725A" />
<!-- end Outline -->
<SolidColorBrush x:Key="ButtonInputInnerForeground" Color="#888D92" />
<SolidColorBrush x:Key="ButtonInputInnerPointeroverForeground" Color="#A7ABB0" />
<SolidColorBrush x:Key="ButtonInputInnerPressedForeground" Color="#C6CACD" />

View File

@@ -1,8 +1,8 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="ButtonSpinnerRepeatButtonBackground" Color="#FF35363C" />
<SolidColorBrush x:Key="ButtonSpinnerRepeatButtonBackground" Color="#35363C" />
<SolidColorBrush x:Key="ButtonSpinnerRepeatButtonPointeroverBackground" Opacity="0.12" Color="White" />
<SolidColorBrush x:Key="ButtonSpinnerRepeatButtonPressedBackground" Opacity="0.16" Color="White" />
<SolidColorBrush x:Key="ButtonSpinnerRepeatButtonDisabledBackground" Opacity="0.04" Color="#FF2E3238" />
<SolidColorBrush x:Key="ButtonSpinnerRepeatButtonDisabledBackground" Opacity="0.04" Color="#2E3238" />
<SolidColorBrush x:Key="ButtonSpinnerRepeatButtonForeground" Opacity="0.6" Color="#F9F9F9" />
<SolidColorBrush x:Key="ButtonSpinnerRepeatButtonBorderBrush" Opacity="0.08" Color="#F9F9F9" />
<SolidColorBrush x:Key="ButtonSpinnerRepeatButtonBorderBrush" Opacity="0.08" Color="White" />
</ResourceDictionary>

View File

@@ -1,7 +1,7 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="CalendarBackground" Color="#232429" />
<SolidColorBrush x:Key="CalendarForeground" Color="#F9F9F9" />
<SolidColorBrush x:Key="CalendarBorderBrush" Opacity="0.08" Color="#F9F9F9" />
<SolidColorBrush x:Key="CalendarBorderBrush" Opacity="0.08" Color="White" />
<SolidColorBrush x:Key="CalendarItemWeekDayNameForeground" Opacity="0.6" Color="#F9F9F9" />
<SolidColorBrush x:Key="CalendarItemIconForeground" Opacity="0.6" Color="#F9F9F9" />

View File

@@ -10,7 +10,7 @@
<BoxShadows x:Key="CalendarDatePickerPopupBoxShadows">0 0 8 0 #1AFFFFFF</BoxShadows>
<SolidColorBrush x:Key="CalendarDatePickerBorderedDefaultBackground" Color="Transparent" />
<SolidColorBrush x:Key="CalendarDatePickerBorderedDefaultBorderBrush" Opacity="0.12" Color="White" />
<SolidColorBrush x:Key="CalendarDatePickerBorderedDefaultBorderBrush" Opacity="0.08" Color="White" />
<SolidColorBrush x:Key="CalendarDatePickerBorderedPointeroverBackground" Color="Transparent" />
<SolidColorBrush x:Key="CalendarDatePickerBorderedPointeroverBorderBrush" Color="#0062D6" />
</ResourceDictionary>
<SolidColorBrush x:Key="CalendarDatePickerBorderedPointeroverBorderBrush" Color="#7FC1FF" />
</ResourceDictionary>

View File

@@ -9,7 +9,7 @@
<SolidColorBrush x:Key="CheckBoxDefaultBorderBrush" Opacity="0.35" Color="#F9F9F9" />
<SolidColorBrush x:Key="CheckBoxPointeroverBackground" Opacity="0.12" Color="White" />
<SolidColorBrush x:Key="CheckBoxPointeroverBorderBrush" Color="#54A9FF" />
<SolidColorBrush x:Key="CheckBoxPressedBackground" Opacity="0.16" Color="White" />
<SolidColorBrush x:Key="CheckBoxPressedBackground" Color="#A9D7FF" />
<SolidColorBrush x:Key="CheckBoxPressedBorderBrush" Color="#A9D7FF" />
<SolidColorBrush x:Key="CheckBoxCheckedDefaultBackground" Color="#54A9FF" />
@@ -20,15 +20,15 @@
<SolidColorBrush x:Key="CheckBoxCheckedPressedBorderBrush" Color="#A9D7FF" />
<SolidColorBrush x:Key="CheckBoxDefaultDisabledBackground" Opacity="0.04" Color="#E6E8EA" />
<SolidColorBrush x:Key="CheckBoxDefaultDisabledBorderBrush" Opacity="0.08" Color="#F9F9F9" />
<SolidColorBrush x:Key="CheckBoxCheckedDisabledBackground" Color="#135cb8" />
<SolidColorBrush x:Key="CheckBoxCheckedDisabledBorderBrush" Color="#135cb8" />
<SolidColorBrush x:Key="CheckBoxDefaultDisabledBorderBrush" Opacity="0.08" Color="White" />
<SolidColorBrush x:Key="CheckBoxCheckedDisabledBackground" Color="#135CB8" />
<SolidColorBrush x:Key="CheckBoxCheckedDisabledBorderBrush" Color="#135CB8" />
<SolidColorBrush x:Key="CheckBoxCardCheckedBackground" Opacity="0.2" Color="#FF54A9FF" />
<SolidColorBrush x:Key="CheckBoxCardCheckedBorderBrush" Color="#FF54A9FF" />
<SolidColorBrush x:Key="CheckBoxCardCheckedDisabledBorderBrush" Color="#FF135CB8" />
<SolidColorBrush x:Key="CheckBoxCardPointeroverBackground" Opacity="0.05" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="CheckBoxCardPressedBackground" Opacity="0.09" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="CheckBoxCardCheckedPointeroverBorderBrush" Color="#FF7FC1FF" />
<SolidColorBrush x:Key="CheckBoxCardCheckedPressedBorderBrush" Color="#FFA9D7FF" />
<SolidColorBrush x:Key="CheckBoxCardCheckedBackground" Opacity="0.2" Color="#54A9FF" />
<SolidColorBrush x:Key="CheckBoxCardCheckedBorderBrush" Color="#54A9FF" />
<SolidColorBrush x:Key="CheckBoxCardCheckedDisabledBorderBrush" Color="#135CB8" />
<SolidColorBrush x:Key="CheckBoxCardPointeroverBackground" Opacity="0.12" Color="White" />
<SolidColorBrush x:Key="CheckBoxCardPressedBackground" Opacity="0.16" Color="White" />
<SolidColorBrush x:Key="CheckBoxCardCheckedPointeroverBorderBrush" Color="#7FC1FF" />
<SolidColorBrush x:Key="CheckBoxCardCheckedPressedBorderBrush" Color="#A9D7FF" />
</ResourceDictionary>

View File

@@ -1,14 +1,17 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="ComboBoxSelectorBackground" Opacity="0.12" Color="White" />
<SolidColorBrush x:Key="ComboBoxSelectorPointeroverBackground" Opacity="0.16" Color="White" />
<SolidColorBrush x:Key="ComboBoxSelectorFocusBackground" Opacity="0.16" Color="White" />
<SolidColorBrush x:Key="ComboBoxSelectorPressedBackground" Opacity="0.20" Color="White" />
<SolidColorBrush x:Key="ComboBoxSelectorDisabledBackground" Opacity="0.04" Color="#E6E8EA" />
<SolidColorBrush x:Key="ComboBoxSelectorBorderBrush" Color="Transparent" />
<SolidColorBrush x:Key="ComboBoxSelectorPointeroverBorderBrush" Color="Transparent" />
<SolidColorBrush x:Key="ComboBoxSelectorPressedBorderBrush" Color="#A9D7FF" />
<SolidColorBrush x:Key="ComboBoxSelectorFocusBorderBrush" Color="#54A9FF" />
<SolidColorBrush x:Key="ComboBoxSelectorPressedBorderBrush" Color="#54A9FF" />
<SolidColorBrush x:Key="ComboBoxIconDefaultForeground" Opacity="0.6" Color="#F9F9F9" />
<SolidColorBrush x:Key="ComboBoxIconPointeroverForeground" Color="#F9F9F9" />
<SolidColorBrush x:Key="ComboBoxIconFocusForeground" Color="#F9F9F9" />
<SolidColorBrush x:Key="ComboBoxIconPressedForeground" Color="#F9F9F9" />
<SolidColorBrush x:Key="ComboBoxIconDisabledForeground" Opacity="0.35" Color="#F9F9F9" />
@@ -16,12 +19,13 @@
<BoxShadows x:Key="ComboBoxPopupBoxShadow">0 0 8 0 #1AFFFFFF</BoxShadows>
<SolidColorBrush x:Key="ComboBoxPopupBackground" Color="#35363C" />
<SolidColorBrush x:Key="ComboBoxPopupBorderBrush" Opacity="0.08" Color="#F9F9F9" />
<SolidColorBrush x:Key="ComboBoxPopupBorderBrush" Opacity="0.08" Color="White" />
<SolidColorBrush x:Key="ComboBoxItemForeground" Color="#F9F9F9" />
<SolidColorBrush x:Key="ComboBoxItemBackground" Color="Transparent" />
<SolidColorBrush x:Key="ComboBoxItemPointeroverBackground" Opacity="0.12" Color="White" />
<SolidColorBrush x:Key="ComboBoxItemFocusBackground" Opacity="0.12" Color="White" />
<SolidColorBrush x:Key="ComboBoxItemPressedBackground" Opacity="0.16" Color="White" />
<SolidColorBrush x:Key="ComboBoxItemSelectedBackground" Opacity="0.2" Color="#54A9FF" />
<SolidColorBrush x:Key="ComboBoxItemSelectedPointeroverBackground" Opacity="0.3" Color="#54A9FF" />
@@ -30,9 +34,11 @@
<SolidColorBrush x:Key="ComboBoxItemSelectedDisabledBackground" Opacity="0.04" Color="#E6E8EA" />
<SolidColorBrush x:Key="ComboBoxSelectorBorderedBackground" Color="Transparent" />
<SolidColorBrush x:Key="ComboBoxSelectorBorderedBorderBrush" Opacity="0.12" Color="White" />
<SolidColorBrush x:Key="ComboBoxSelectorBorderedBorderBrush" Opacity="0.08" Color="White" />
<SolidColorBrush x:Key="ComboBoxSelectorBorderedPointeroverBackground" Color="Transparent" />
<SolidColorBrush x:Key="ComboBoxSelectorBorderedPointeroverBorderBrush" Color="#7FC1FF" />
<SolidColorBrush x:Key="ComboBoxSelectorBorderedFocusBackground" Color="Transparent" />
<SolidColorBrush x:Key="ComboBoxSelectorBorderedFocusBorderBrush" Color="#7FC1FF" />
<SolidColorBrush x:Key="ComboBoxSelectorBorderedPressedBackground" Color="Transparent" />
<SolidColorBrush x:Key="ComboBoxSelectorBorderedPressedBorderBrush" Color="#7FC1FF" />
</ResourceDictionary>
<SolidColorBrush x:Key="ComboBoxSelectorBorderedPressedBorderBrush" Color="#A9D7FF" />
</ResourceDictionary>

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