Compare commits
64 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8afe83892f | ||
![]() |
a757d32e1b | ||
![]() |
a912f95cc8 | ||
![]() |
478b4659c1 | ||
![]() |
7c685deadc | ||
![]() |
71e84bfb30 | ||
![]() |
1813952747 | ||
![]() |
6a52029305 | ||
![]() |
fab8c9de53 | ||
![]() |
f6a7cdbda2 | ||
![]() |
c725362d16 | ||
![]() |
33e4510097 | ||
![]() |
4c122cc3e9 | ||
![]() |
56c4073f4a | ||
![]() |
6e94913d5c | ||
![]() |
1d975fa734 | ||
![]() |
5161331b98 | ||
![]() |
20f30f3867 | ||
![]() |
1124e79ae8 | ||
![]() |
8f5c496cc5 | ||
![]() |
9220c46d43 | ||
![]() |
d1089b9779 | ||
![]() |
c1c2920bb2 | ||
![]() |
423d5f3609 | ||
![]() |
cb6d676ae9 | ||
![]() |
c18cf9ec73 | ||
![]() |
c20b931959 | ||
![]() |
2fadfdd5de | ||
![]() |
871f112800 | ||
![]() |
1311aaabdd | ||
![]() |
8e65334652 | ||
![]() |
c8acf08936 | ||
![]() |
2a363edeee | ||
![]() |
72ed2d442d | ||
![]() |
5a095a9321 | ||
![]() |
b0f4777aff | ||
![]() |
7347aff7f9 | ||
![]() |
e2ca3f31b1 | ||
![]() |
d759570259 | ||
![]() |
2b37df580f | ||
![]() |
d41d1ff9d4 | ||
![]() |
c127544bc7 | ||
![]() |
a614002ead | ||
![]() |
fe5c51599f | ||
![]() |
d318975d73 | ||
![]() |
504d6a1927 | ||
![]() |
253f88d982 | ||
![]() |
8005997332 | ||
![]() |
ae0375f194 | ||
![]() |
28b04705aa | ||
![]() |
84a255656b | ||
![]() |
11c3109ae1 | ||
![]() |
34674599ec | ||
![]() |
004067d10b | ||
![]() |
afacdf2c56 | ||
![]() |
047c9f953e | ||
![]() |
ef3d40bc6d | ||
![]() |
7bd6c08e94 | ||
![]() |
e484dbfd21 | ||
![]() |
c2bf03c337 | ||
![]() |
7df583b81c | ||
![]() |
efc7870554 | ||
![]() |
99184b49ee | ||
![]() |
6a1d5b2bd1 |
58
.github/workflows/Pack.yml
vendored
@ -1,58 +0,0 @@
|
||||
name: Pack
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "release" ]
|
||||
pull_request:
|
||||
branches: [ "release" ]
|
||||
|
||||
jobs:
|
||||
nuget_desktop:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Nuget Semi.Avalonia
|
||||
run: dotnet pack ./src/Semi.Avalonia -o ./nugets
|
||||
|
||||
- name: Nuget Semi.Avalonia.ColorPicker
|
||||
run: dotnet pack ./src/Semi.Avalonia.ColorPicker -o ./nugets
|
||||
|
||||
- name: Nuget Semi.Avalonia.DataGrid
|
||||
run: dotnet pack ./src/Semi.Avalonia.DataGrid -o ./nugets
|
||||
|
||||
- name: Nuget Semi.Avalonia.TreeDataGrid
|
||||
run: dotnet pack ./src/Semi.Avalonia.TreeDataGrid -o ./nugets
|
||||
|
||||
- name: Desktop
|
||||
run: dotnet publish ./demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true --self-contained true
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v3.1.2
|
||||
with:
|
||||
name: nuget_desktop
|
||||
path: |
|
||||
./nugets
|
||||
./**/publish/*.exe
|
||||
|
||||
android:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: CD Android
|
||||
run: cd ./demo/Semi.Avalonia.Demo.Android
|
||||
|
||||
- name: Restore Dependencies
|
||||
run: dotnet restore
|
||||
|
||||
- name: Build
|
||||
run: dotnet publish ./demo/Semi.Avalonia.Demo.Android -c Release -f net7.0-android --no-restore
|
||||
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v3.1.2
|
||||
with:
|
||||
name: android
|
||||
path: ./**/publish/*Signed.apk
|
23
.github/workflows/deploy.yml
vendored
@ -2,12 +2,12 @@ name: Deploy to GitHub Pages
|
||||
|
||||
env:
|
||||
PROJECT_PATH: demo/Semi.Avalonia.Demo.Web/Semi.Avalonia.Demo.Web.csproj
|
||||
OUTPUT_PATH: demo/Semi.Avalonia.Demo.Web/bin/Release/net7.0/browser-wasm/AppBundle
|
||||
OUTPUT_PATH: demo/Semi.Avalonia.Demo.Web/bin/Release/net8.0-browser/publish/wwwroot
|
||||
on:
|
||||
push:
|
||||
branches: [ "deploy" ]
|
||||
branches: [ "action/deploy" ]
|
||||
pull_request:
|
||||
branches: [ "deploy" ]
|
||||
branches: [ "action/deploy" ]
|
||||
|
||||
jobs:
|
||||
deploy-to-github-pages:
|
||||
@ -16,19 +16,16 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
|
||||
- name: Setup .NET 7
|
||||
- name: Setup .NET 8
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 7.0.405
|
||||
dotnet-version: 8.0.x
|
||||
|
||||
- name: Install wasm-tools
|
||||
run: dotnet workload install wasm-tools wasm-tools-net7
|
||||
|
||||
- name: Install DotNetCompress
|
||||
run: dotnet tool install --global DotNetCompress --version 3.0.0 --no-cache
|
||||
run: dotnet workload install wasm-tools
|
||||
|
||||
- name: Publish .NET Project
|
||||
run: dotnet publish $PROJECT_PATH -c Release -o release --nologo
|
||||
run: dotnet publish $PROJECT_PATH -c Release --nologo
|
||||
|
||||
- name: Change base-tag in index.html
|
||||
run: sed -i 's/<base href="\/" \/>/<base href="\/Semi.Avalonia\/" \/>/g' $OUTPUT_PATH/index.html
|
||||
@ -36,12 +33,6 @@ 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
|
||||
|
||||
|
32
.github/workflows/pack.yml
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
name: Pack Nuget
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "action/pack" ]
|
||||
pull_request:
|
||||
branches: [ "action/pack" ]
|
||||
|
||||
jobs:
|
||||
nuget:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
|
||||
- name: Nuget Semi.Avalonia
|
||||
run: dotnet pack ./src/Semi.Avalonia -o ./nugets
|
||||
|
||||
- name: Nuget Semi.Avalonia.ColorPicker
|
||||
run: dotnet pack ./src/Semi.Avalonia.ColorPicker -o ./nugets
|
||||
|
||||
- name: Nuget Semi.Avalonia.DataGrid
|
||||
run: dotnet pack ./src/Semi.Avalonia.DataGrid -o ./nugets
|
||||
|
||||
- name: Nuget Semi.Avalonia.TreeDataGrid
|
||||
run: dotnet pack ./src/Semi.Avalonia.TreeDataGrid -o ./nugets
|
||||
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: nugets
|
||||
path: ./nugets
|
92
.github/workflows/publish.yml
vendored
Normal file
@ -0,0 +1,92 @@
|
||||
name: Publish Demo
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "action/publish" ]
|
||||
pull_request:
|
||||
branches: [ "action/publish" ]
|
||||
|
||||
jobs:
|
||||
windows:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
|
||||
- name: Make upload directory
|
||||
run: mkdir upload
|
||||
|
||||
- name: Publish win-x64
|
||||
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/win64
|
||||
|
||||
- name: Zip win-x64
|
||||
run: |
|
||||
$files = Get-ChildItem -Path ./publish/win64/* -Recurse -Exclude *.pdb
|
||||
Compress-Archive -Path $files.FullName -DestinationPath ./upload/Semi.Avalonia.Demo.Desktop.win-x64.zip
|
||||
|
||||
- name: Enable Native AOT in .csproj
|
||||
run: |
|
||||
sed -i 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
|
||||
sed -i 's#<!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>-->#<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
|
||||
|
||||
- name: Publish win-x64 AOT
|
||||
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o ./publish/win64-aot
|
||||
|
||||
- name: Zip win-x64 AOT
|
||||
run: |
|
||||
$files = Get-ChildItem -Path ./publish/win64-aot/* -Recurse -Exclude *.pdb
|
||||
Compress-Archive -Path $files.FullName -DestinationPath ./upload/Semi.Avalonia.Demo.Desktop.win-x64.NativeAOT.zip
|
||||
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: windows
|
||||
path: ./upload
|
||||
|
||||
linux:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
|
||||
- name: Make upload directory
|
||||
run: mkdir upload
|
||||
|
||||
- name: Publish linux-x64
|
||||
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r linux-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/linux64
|
||||
|
||||
- name: Zip linux-x64
|
||||
run: zip -j -r ./upload/Semi.Avalonia.Demo.Desktop.linux-x64.zip ./publish/linux64 -x "*.pdb"
|
||||
|
||||
- name: Publish linux-x64 DRM
|
||||
run: dotnet publish demo/Semi.Avalonia.Demo.Drm -r linux-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/drm
|
||||
|
||||
- name: Zip linux-x64 DRM
|
||||
run: zip -j -r ./upload/Semi.Avalonia.Demo.Drm.linux-x64.zip ./publish/drm -x "*.pdb"
|
||||
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: linux
|
||||
path: ./upload
|
||||
|
||||
android:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
|
||||
- name: CD Android
|
||||
run: cd ./demo/Semi.Avalonia.Demo.Android
|
||||
|
||||
- name: Restore Dependencies
|
||||
run: dotnet restore
|
||||
|
||||
- name: Publish Android
|
||||
run: dotnet publish demo/Semi.Avalonia.Demo.Android -c Release -f net8.0-android --no-restore -o ./publish
|
||||
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: android
|
||||
path: ./publish/*Signed.apk
|
@ -1,6 +1,6 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="SC-Single" type="DotNetFolderPublish" factoryName="Publish to folder">
|
||||
<riderPublish configuration="Release" include_native_libs_for_self_extract="true" platform="Any CPU" produce_single_file="true" runtime="win-x64" self_contained="true" target_folder="$PROJECT_DIR$/demo/Semi.Avalonia.Demo.Desktop/bin/Release/net7.0/win-x64/publish" target_framework="net7.0" uuid_high="3088527218258560748" uuid_low="-8649338673481336678" />
|
||||
<riderPublish configuration="Release" include_native_libs_for_self_extract="true" platform="Any CPU" produce_single_file="true" runtime="win-x64" self_contained="true" target_folder="$PROJECT_DIR$/demo/Semi.Avalonia.Demo.Desktop/bin/Release/net8.0/win-x64/publish" target_framework="net8.0" uuid_high="3088527218258560748" uuid_low="-8649338673481336678" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
@ -9,7 +9,7 @@ Avalonia Theme inspired by Semi Design
|
||||
|
||||
## Installation
|
||||
```bash
|
||||
dotnet add package Semi.Avalonia --version 11.0.7
|
||||
dotnet add package Semi.Avalonia
|
||||
```
|
||||
Include Semi Design Styles in application:
|
||||
|
||||
@ -23,9 +23,9 @@ That's all.
|
||||
|
||||
ColorPicker, DataGrid and TreeDataGrid are distributed in separated packages. Please install if you need.
|
||||
```bash
|
||||
dotnet add package Semi.Avalonia.ColorPicker --version 11.0.7
|
||||
dotnet add package Semi.Avalonia.DataGrid --version 11.0.7
|
||||
dotnet add package Semi.Avalonia.TreeDataGrid --version 11.0.7
|
||||
dotnet add package Semi.Avalonia.ColorPicker
|
||||
dotnet add package Semi.Avalonia.DataGrid
|
||||
dotnet add package Semi.Avalonia.TreeDataGrid
|
||||
```
|
||||
```xaml
|
||||
<Application.Styles>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net7.0-android</TargetFramework>
|
||||
<TargetFramework>net8.0-android</TargetFramework>
|
||||
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
|
||||
<ApplicationId>com.irihitech.Semi.Avalonia</ApplicationId>
|
||||
<ApplicationVersion>1</ApplicationVersion>
|
||||
|
3
demo/Semi.Avalonia.Demo.Desktop/Roots.xml
Normal file
@ -0,0 +1,3 @@
|
||||
<linker>
|
||||
<assembly fullname="Semi.Avalonia.Demo" preserve="All"/>
|
||||
</linker>
|
@ -1,14 +1,17 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
||||
<!-- Uncomment below to enable Native AOT compilation-->
|
||||
<!--
|
||||
<PublishAot>true</PublishAot>
|
||||
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
|
||||
-->
|
||||
<!--<PublishAot>true</PublishAot>-->
|
||||
<!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>-->
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
|
||||
<IsTrimmable>true</IsTrimmable>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
@ -16,7 +19,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<RdXmlFile Include="rd.xml" />
|
||||
<TrimmerRootDescriptor Include="Roots.xml" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Directives>
|
||||
<!--
|
||||
This file is part of RdXmlLibrary project.
|
||||
Visit https://github.com/kant2002/rdxmllibrary for latest version.
|
||||
If you have modifications specific to this Nuget package,
|
||||
please contribute back.
|
||||
-->
|
||||
<Application>
|
||||
<Assembly Name="Avalonia.Markup.Xaml" Dynamic="Required All"/>
|
||||
<Assembly Name="Semi.Avalonia" Dynamic="Required All"/>
|
||||
<Assembly Name="Semi.Avalonia.DataGrid" Dynamic="Required All"/>
|
||||
<Assembly Name="Semi.Avalonia.ColorPicker" Dynamic="Required All"/>
|
||||
<Assembly Name="Semi.Avalonia.Demo" Dynamic="Required All"/>
|
||||
</Application>
|
||||
</Directives>
|
@ -3,6 +3,7 @@ using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using Avalonia;
|
||||
using Avalonia.Dialogs;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Drm;
|
||||
|
||||
@ -28,7 +29,7 @@ class Program
|
||||
if (args.Contains("--drm"))
|
||||
{
|
||||
SilenceConsole();
|
||||
return builder.StartLinuxDrm(args: args, card: "/dev/dri/card1", scaling: GetScaling());
|
||||
return builder.StartLinuxDrm(args, scaling: GetScaling());
|
||||
}
|
||||
|
||||
return builder.StartWithClassicDesktopLifetime(args);
|
||||
@ -37,7 +38,9 @@ class Program
|
||||
// Avalonia configuration, don't remove; also used by visual designer.
|
||||
public static AppBuilder BuildAvaloniaApp()
|
||||
=> AppBuilder.Configure<App>()
|
||||
.UseManagedSystemDialogs()
|
||||
.UsePlatformDetect()
|
||||
.With(new Win32PlatformOptions())
|
||||
.LogToTrace();
|
||||
|
||||
private static void SilenceConsole()
|
||||
|
162
demo/Semi.Avalonia.Demo.Drm/README.md
Normal file
@ -0,0 +1,162 @@
|
||||
# DRM Start Steps
|
||||
|
||||
[中文](README_CN.md)
|
||||
|
||||
(Ubuntu 20.04 live server linux-x64 Virtual Machine Test Success)
|
||||
(Orange Pi Zero2 Ubuntu20.04-arm64 Test Success)
|
||||
|
||||
[Avalonia Official Reference Document](https://docs.avaloniaui.net/docs/next/guides/platforms/rpi/running-on-raspbian-lite-via-drm)
|
||||
|
||||
## Setup Running Environment
|
||||
|
||||
1. Run the following commands on the Linux side
|
||||
```bash
|
||||
sudo apt update
|
||||
sudo apt upgrade
|
||||
sudo reboot
|
||||
sudo apt-get install libgbm1 libgl1-mesa-dri libegl1-mesa libinput10
|
||||
```
|
||||
|
||||
2. Install the test tool (if a colored cube appears, the environment is installed)
|
||||
```bash
|
||||
sudo apt-get install kmscube
|
||||
sudo kmscube
|
||||
```
|
||||
|
||||
3. [Install .NET Runtime](https://learn.microsoft.com/dotnet/core/install/linux?WT.mc_id=dotnet-35129-website)
|
||||
|
||||
4. Add the Avalonia.LinuxFramebuffer package in NuGet
|
||||
|
||||
```bash
|
||||
dotnet add package Avalonia.LinuxFramebuffer
|
||||
```
|
||||
|
||||
5. Add StartLinuxDrm code
|
||||
|
||||
```csharp
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
var builder = BuildAvaloniaApp();
|
||||
if (args.Contains("--drm"))
|
||||
{
|
||||
SilenceConsole();
|
||||
// By default, Avalonia will try to detect output card automatically.
|
||||
// But you can specify one, for example "/dev/dri/card1".
|
||||
return builder.StartLinuxDrm(args: args, card: null, scaling: 1.0);
|
||||
}
|
||||
|
||||
return builder.StartWithClassicDesktopLifetime(args);
|
||||
}
|
||||
|
||||
private static void SilenceConsole()
|
||||
{
|
||||
new Thread(() =>
|
||||
{
|
||||
Console.CursorVisible = false;
|
||||
while (true)
|
||||
Console.ReadKey(true);
|
||||
})
|
||||
{ IsBackground = true }.Start();
|
||||
}
|
||||
```
|
||||
|
||||
6. Publish the app to Linux
|
||||
|
||||
```bash
|
||||
dotnet publish demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj -c Release -r linux-x64 --sc -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
|
||||
```
|
||||
|
||||
Add the following code to the csproj file for AOT publishing
|
||||
|
||||
```xml
|
||||
<PropertyGroup>
|
||||
<PublishAot>true</PublishAot>
|
||||
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
|
||||
</PropertyGroup>
|
||||
```
|
||||
|
||||
```bash
|
||||
dotnet publish demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj -c Release -r linu-x64
|
||||
```
|
||||
|
||||
7. Run the program
|
||||
|
||||
```bash
|
||||
sudo ./Semi.Avalonia.Demo.Drm --drm
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
1. Error message
|
||||
|
||||
> Unhandled exception. Avalonia.Markup.Xaml.XamlLoadException: No precompiled XAML found for avares://Semi.Avalonia/Themes/Light/Light.axaml (baseUri: avares://Semi.Avalonia/Themes/Index.axaml), make sure to specify x:Class and include your XAML file as AvaloniaResource
|
||||
|
||||
Solution:
|
||||
|
||||
If you use the Semi release file, do not trim it, otherwise an error will occur.
|
||||
|
||||
24.8.18 update: This issue has been fixed.
|
||||
|
||||
2. Error message
|
||||
|
||||
> Unhandled exception. System.TypeInitializationException: The type initializer for 'SkiaSharp.SKImageInfo' threw an exception.**
|
||||
**--->System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies.In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibSkiaSharp: cannot open shared object file: No such file or directory
|
||||
at SkiaSharp.SkiaApi.sk_colortype_get_default_8888()
|
||||
at SkiaSharp.SKImageInfo..cctor()
|
||||
|
||||
Solution:
|
||||
|
||||
Linux CLI installation
|
||||
|
||||
```bash
|
||||
sudo apt-get install -y libfontconfig1
|
||||
```
|
||||
[Reference](https://github.com/mono/SkiaSharp/issues/509)
|
||||
|
||||
3. Error message
|
||||
|
||||
> Permission denied
|
||||
|
||||
Solution:
|
||||
|
||||
add permission
|
||||
|
||||
```bash
|
||||
sudo chmod +x ./Semi.Avalonia.Demo.Drm
|
||||
```
|
||||
|
||||
4. Error message
|
||||
|
||||
> Unhandled exception. System.ComponentModel.Win32Exception (95): drmModeGetResources failed
|
||||
at Avalonia.LinuxFramebuffer.Output.DrmResources..ctor(Int32 fd, Boolean connectorsForceProbe) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs:line 91
|
||||
at Avalonia.LinuxFramebuffer.Output.DrmCard.GetResources(Boolean connectorsForceProbe) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs:line 171
|
||||
at Avalonia.LinuxFramebuffer.Output.DrmOutput..ctor(String path, Boolean connectorsForceProbe, DrmOutputOptions options) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs:line 60
|
||||
at LinuxFramebufferPlatformExtensions.StartLinuxDrm(AppBuilder builder, String[] args, String card, Double scaling, IInputBackend inputBackend) in /_/src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs:line 166
|
||||
at Semi.Avalonia.Demo.Drm.Program.Main(String[] args)
|
||||
|
||||
Solution:
|
||||
|
||||
The `program.cs` graphics card path is incorrect, it may not be `dev/dri/card1`, see if there are other graphics cards in the `dev/dri` directory such as `card0`.
|
||||
|
||||
24.8.18 update: Avalonia will now automatically detect the graphics card path, so you don't need to specify the graphics card path.
|
||||
|
||||
```csharp
|
||||
return builder.StartLinuxDrm(args: args, card: null, scaling: 1.0);
|
||||
```
|
||||
|
||||
5. Error message
|
||||
>Unhandled exception. System.ComponentModel.Win32Exception (2): Couldn't open /dev/dri/card1
|
||||
at Avalonia.LinuxFramebuffer.Output.DrmCard..ctor(String ) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs:line 167
|
||||
at Avalonia.LinuxFramebuffer.Output.DrmOutput..ctor(String , Boolean , DrmOutputOptions ) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs:line 58
|
||||
at LinuxFramebufferPlatformExtensions.StartLinuxDrm(AppBuilder, String[], String , Double , IInputBackend ) in /_/src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs:line 166
|
||||
at Semi.Avalonia.Demo.Drm.Program.Main(String[])
|
||||
|
||||
Solution:
|
||||
|
||||
Unable to open `/dev/dri/card1`, may be the graphics card is mounted to another folder.
|
||||
|
||||
24.8.18 update: Avalonia will now automatically detect the graphics card path, so you don't need to specify the graphics card path.
|
||||
|
||||
```csharp
|
||||
return builder.StartLinuxDrm(args: args, card: null, scaling: 1.0);
|
||||
```
|
162
demo/Semi.Avalonia.Demo.Drm/README_CN.md
Normal file
@ -0,0 +1,162 @@
|
||||
# DRM启动步骤
|
||||
|
||||
[English](README.md)
|
||||
|
||||
(Ubuntu 20.04 live server linux-x64 虚拟机测试成功)
|
||||
(Orange Pi Zero2 Ubuntu20.04-arm64 测试成功)
|
||||
|
||||
[Avalonia 官方参考文档](https://docs.avaloniaui.net/docs/next/guides/platforms/rpi/running-on-raspbian-lite-via-drm)
|
||||
|
||||
## 搭建运行环境
|
||||
|
||||
1. Linux端运行命令
|
||||
```bash
|
||||
sudo apt update
|
||||
sudo apt upgrade
|
||||
sudo reboot
|
||||
sudo apt-get install libgbm1 libgl1-mesa-dri libegl1-mesa libinput10
|
||||
```
|
||||
|
||||
2. 安装测试工具(出现一个彩色立方体说明环境安装完成)
|
||||
```bash
|
||||
sudo apt-get install kmscube
|
||||
sudo kmscube
|
||||
```
|
||||
|
||||
3. [安装.net运行时](https://learn.microsoft.com/dotnet/core/install/linux?WT.mc_id=dotnet-35129-website)
|
||||
|
||||
4. NuGet里面添加Avalonia.LinuxFramebuffer包
|
||||
|
||||
```bash
|
||||
dotnet add package Avalonia.LinuxFramebuffer
|
||||
```
|
||||
|
||||
5. 添加StartLinuxDrm代码
|
||||
|
||||
```csharp
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
var builder = BuildAvaloniaApp();
|
||||
if (args.Contains("--drm"))
|
||||
{
|
||||
SilenceConsole();
|
||||
// By default, Avalonia will try to detect output card automatically.
|
||||
// But you can specify one, for example "/dev/dri/card1".
|
||||
return builder.StartLinuxDrm(args: args, card: null, scaling: 1.0);
|
||||
}
|
||||
|
||||
return builder.StartWithClassicDesktopLifetime(args);
|
||||
}
|
||||
|
||||
private static void SilenceConsole()
|
||||
{
|
||||
new Thread(() =>
|
||||
{
|
||||
Console.CursorVisible = false;
|
||||
while (true)
|
||||
Console.ReadKey(true);
|
||||
})
|
||||
{ IsBackground = true }.Start();
|
||||
}
|
||||
```
|
||||
|
||||
6. 发布程序到Linux
|
||||
|
||||
```bash
|
||||
dotnet publish demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj -c Release -r linux-x64 --sc -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
|
||||
```
|
||||
|
||||
AOT发布需要在csproj文件中添加以下代码
|
||||
|
||||
```xml
|
||||
<PropertyGroup>
|
||||
<PublishAot>true</PublishAot>
|
||||
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
|
||||
</PropertyGroup>
|
||||
```
|
||||
|
||||
```bash
|
||||
dotnet publish demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj -c Release -r linu-x64
|
||||
```
|
||||
|
||||
7. 运行程序
|
||||
|
||||
```bash
|
||||
sudo ./Semi.Avalonia.Demo.Drm --drm
|
||||
```
|
||||
|
||||
## 报错处理
|
||||
|
||||
1. 报错内容
|
||||
|
||||
> Unhandled exception. Avalonia.Markup.Xaml.XamlLoadException: No precompiled XAML found for avares://Semi.Avalonia/Themes/Light/Light.axaml (baseUri: avares://Semi.Avalonia/Themes/Index.axaml), make sure to specify x:Class and include your XAML file as AvaloniaResource
|
||||
|
||||
解决方法:
|
||||
|
||||
如果使用Semi发布文件不要裁剪,如果裁剪会报错。
|
||||
|
||||
24.8.18更新:现在已经修复了这个问题。
|
||||
|
||||
2. 报错内容
|
||||
|
||||
> Unhandled exception. System.TypeInitializationException: The type initializer for 'SkiaSharp.SKImageInfo' threw an exception.**
|
||||
**--->System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies.In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibSkiaSharp: cannot open shared object file: No such file or directory
|
||||
at SkiaSharp.SkiaApi.sk_colortype_get_default_8888()
|
||||
at SkiaSharp.SKImageInfo..cctor()
|
||||
|
||||
解决方法:
|
||||
|
||||
Linux 命令行安装
|
||||
|
||||
```bash
|
||||
sudo apt-get install -y libfontconfig1
|
||||
```
|
||||
|
||||
[参考网址](https://github.com/mono/SkiaSharp/issues/509)
|
||||
|
||||
3. 报错内容
|
||||
|
||||
> Permission denied
|
||||
|
||||
解决方法:
|
||||
|
||||
添加执行权限
|
||||
```bash
|
||||
sudo chmod +x ./Semi.Avalonia.Demo.Drm
|
||||
```
|
||||
|
||||
4. 报错内容
|
||||
|
||||
> Unhandled exception. System.ComponentModel.Win32Exception (95): drmModeGetResources failed
|
||||
at Avalonia.LinuxFramebuffer.Output.DrmResources..ctor(Int32 fd, Boolean connectorsForceProbe) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs:line 91
|
||||
at Avalonia.LinuxFramebuffer.Output.DrmCard.GetResources(Boolean connectorsForceProbe) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs:line 171
|
||||
at Avalonia.LinuxFramebuffer.Output.DrmOutput..ctor(String path, Boolean connectorsForceProbe, DrmOutputOptions options) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs:line 60
|
||||
at LinuxFramebufferPlatformExtensions.StartLinuxDrm(AppBuilder builder, String[] args, String card, Double scaling, IInputBackend inputBackend) in /_/src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs:line 166
|
||||
at Semi.Avalonia.Demo.Drm.Program.Main(String[] args)
|
||||
|
||||
解决方法:
|
||||
|
||||
`program.cs`的显卡路径错误,可能不是`dev/dri/card1`,看在`dev/dri`目录下有无其他的显卡如`card0`。
|
||||
|
||||
24.8.18更新:现在Avalonia会自动检测显卡路径,所以不需要指定显卡路径。
|
||||
|
||||
```csharp
|
||||
return builder.StartLinuxDrm(args: args, card: null, scaling: 1.0);
|
||||
```
|
||||
|
||||
5. 报错内容
|
||||
>Unhandled exception. System.ComponentModel.Win32Exception (2): Couldn't open /dev/dri/card1
|
||||
at Avalonia.LinuxFramebuffer.Output.DrmCard..ctor(String ) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs:line 167
|
||||
at Avalonia.LinuxFramebuffer.Output.DrmOutput..ctor(String , Boolean , DrmOutputOptions ) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs:line 58
|
||||
at LinuxFramebufferPlatformExtensions.StartLinuxDrm(AppBuilder, String[], String , Double , IInputBackend ) in /_/src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs:line 166
|
||||
at Semi.Avalonia.Demo.Drm.Program.Main(String[])
|
||||
|
||||
解决办法:
|
||||
|
||||
找不到显卡路径`dev/dri/card1`,可能是显卡挂载到别的文件夹下了。
|
||||
|
||||
24.8.18更新:现在Avalonia会自动检测显卡路径,所以不需要指定显卡路径。
|
||||
|
||||
```csharp
|
||||
return builder.StartLinuxDrm(args: args, card: null, scaling: 1.0);
|
||||
```
|
3
demo/Semi.Avalonia.Demo.Drm/Roots.xml
Normal file
@ -0,0 +1,3 @@
|
||||
<linker>
|
||||
<assembly fullname="Semi.Avalonia.Demo" preserve="All"/>
|
||||
</linker>
|
@ -1,12 +1,26 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
||||
<!-- Uncomment below to enable Native AOT compilation-->
|
||||
<!--<PublishAot>true</PublishAot>-->
|
||||
<!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>-->
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
|
||||
<IsTrimmable>true</IsTrimmable>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<TrimmerRootDescriptor Include="Roots.xml" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
|
||||
@ -15,7 +29,6 @@
|
||||
<PackageReference Include="Avalonia.LinuxFramebuffer" Version="$(AvaloniaVersion)" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Semi.Avalonia.Demo\Semi.Avalonia.Demo.csproj" />
|
||||
</ItemGroup>
|
||||
|
@ -1,77 +0,0 @@
|
||||
# DRM启动步骤
|
||||
|
||||
(Ubuntu18.04Server版本 虚拟机测试OK)
|
||||
(Orange Pi Zero2 Ubuntu20.04-arm64 测试OK)
|
||||
|
||||
Avalonia官方参考文档:https://docs.avaloniaui.net/docs/next/guides/platforms/rpi/running-on-raspbian-lite-via-drm
|
||||
|
||||
1.Linux端运行命令
|
||||
```
|
||||
sudo apt update
|
||||
sudo apt upgrade
|
||||
sudo reboot
|
||||
sudo apt - get install libgbm1 libgl1 - mesa - dri libegl1 - mesa libinput10
|
||||
```
|
||||
|
||||
2.安装测试工具测试(出现一个彩色立方体说明环境安装完成)
|
||||
```
|
||||
sudo apt-get install kmscube
|
||||
sudo kmscube
|
||||
```
|
||||
|
||||
3.安装.net运行时(参考网址:https://learn.microsoft.com/zh-cn/dotnet/core/install/linux?WT.mc_id=dotnet-35129-website)
|
||||
|
||||
4.新建一个Avalonia项目,nuget里面添加Avalonia.LinuxFramebuffer包
|
||||
|
||||
5.添加StartLinuxDrm代码(不知道怎么添加看Semi.Avalonia.Demo.Drm项目代码)
|
||||
|
||||
6.发布程序到Linux(安装.net,怎么运行这些省略)
|
||||
|
||||
7.运行 ./Semi.Avalonia.Demo.Drm --drm
|
||||
|
||||
## 报错处理:
|
||||
|
||||
1. 报错内容
|
||||
|
||||
>Unhandled exception. Avalonia.Markup.Xaml.XamlLoadException: No precompiled XAML found for avares://Semi.Avalonia/Themes/Light/Light.axaml (baseUri: avares://Semi.Avalonia/Themes/Index.axaml), make sure to specify x:Class and include your XAML file as AvaloniaResource
|
||||
|
||||
解决方法:
|
||||
>如果使用Semi发布文件不要裁剪,如果裁剪会报错
|
||||
|
||||
|
||||
2. 报错内容
|
||||
>Unhandled exception. System.TypeInitializationException: The type initializer for 'SkiaSharp.SKImageInfo' threw an exception.**
|
||||
**--->System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies.In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibSkiaSharp: cannot open shared object file: No such file or directory
|
||||
at SkiaSharp.SkiaApi.sk_colortype_get_default_8888()
|
||||
at SkiaSharp.SKImageInfo..cctor()
|
||||
|
||||
解决方法:
|
||||
>Linux命令行安装一下 apt-get install -y libfontconfig1
|
||||
参考网址:https://github.com/mono/SkiaSharp/issues/509
|
||||
|
||||
3. 报错内容
|
||||
>Permission denied
|
||||
|
||||
解决方法:
|
||||
>sudo chmod +x ./Semi.Avalonia.Demo.Drm
|
||||
|
||||
4. 报错内容
|
||||
>Unhandled exception. System.ComponentModel.Win32Exception (95): drmModeGetResources failed
|
||||
at Avalonia.LinuxFramebuffer.Output.DrmResources..ctor(Int32 fd, Boolean connectorsForceProbe) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs:line 91
|
||||
at Avalonia.LinuxFramebuffer.Output.DrmCard.GetResources(Boolean connectorsForceProbe) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs:line 171
|
||||
at Avalonia.LinuxFramebuffer.Output.DrmOutput..ctor(String path, Boolean connectorsForceProbe, DrmOutputOptions options) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs:line 60
|
||||
at LinuxFramebufferPlatformExtensions.StartLinuxDrm(AppBuilder builder, String[] args, String card, Double scaling, IInputBackend inputBackend) in /_/src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs:line 166
|
||||
at Semi.Avalonia.Demo.Drm.Program.Main(String[] args)
|
||||
|
||||
解决方法:
|
||||
>`program.cs`的显卡路径错误,可能不是`dev/dri/card1`,看在`dev/dri`目录下有无其他的显卡如`card0`。
|
||||
|
||||
5. 报错内容
|
||||
>Unhandled exception. System.ComponentModel.Win32Exception (2): Couldn't open /dev/dri/card1
|
||||
at Avalonia.LinuxFramebuffer.Output.DrmCard..ctor(String ) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs:line 167
|
||||
at Avalonia.LinuxFramebuffer.Output.DrmOutput..ctor(String , Boolean , DrmOutputOptions ) in /_/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs:line 58
|
||||
at LinuxFramebufferPlatformExtensions.StartLinuxDrm(AppBuilder, String[], String , Double , IInputBackend ) in /_/src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs:line 166
|
||||
at Semi.Avalonia.Demo.Drm.Program.Main(String[])
|
||||
|
||||
解决办法:
|
||||
>找不到显卡路径`dev/dri/card1`,可能是显卡挂载到别的文件夹下了,待解决。
|
16
demo/Semi.Avalonia.Demo.Web/AvaloniaAppBuilderExtensions.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Web;
|
||||
|
||||
public static class AvaloniaAppBuilderExtensions
|
||||
{
|
||||
private static string DefaultFontFamily => "avares://Semi.Avalonia.Demo.Web/Assets#Source Han Sans CN";
|
||||
|
||||
public static AppBuilder WithSourceHanSansCNFont(this AppBuilder builder) =>
|
||||
builder.With(new FontManagerOptions
|
||||
{
|
||||
DefaultFamilyName = DefaultFontFamily,
|
||||
FontFallbacks = new[] { new FontFallback { FontFamily = new FontFamily(DefaultFontFamily) } }
|
||||
});
|
||||
}
|
@ -7,9 +7,10 @@ using Avalonia.Browser;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Web;
|
||||
|
||||
internal partial class Program
|
||||
internal sealed partial class Program
|
||||
{
|
||||
private static async Task Main(string[] args) => await BuildAvaloniaApp()
|
||||
private static Task Main(string[] args) => BuildAvaloniaApp()
|
||||
.WithSourceHanSansCNFont()
|
||||
.StartBrowserAppAsync("out");
|
||||
|
||||
public static AppBuilder BuildAvaloniaApp()
|
||||
|
@ -1,20 +1,18 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk.WebAssembly">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
|
||||
<WasmMainJSPath>AppBundle\main.js</WasmMainJSPath>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0-browser</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<WasmExtraFilesToDeploy Include="AppBundle\**" />
|
||||
<AvaloniaResource Include="Assets\**"/>
|
||||
</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>
|
||||
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 172 KiB After Width: | Height: | Size: 172 KiB |
@ -7,8 +7,8 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<base href="/" />
|
||||
<link rel="modulepreload" href="./main.js" />
|
||||
<link rel="modulepreload" href="./dotnet.js" />
|
||||
<link rel="modulepreload" href="./avalonia.js" />
|
||||
<link rel="modulepreload" href="./_framework/dotnet.js" />
|
||||
<link rel="modulepreload" href="./_framework/avalonia.js" />
|
||||
<link rel="stylesheet" href="./app.css" />
|
||||
</head>
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { dotnet } from './dotnet.js'
|
||||
import { dotnet } from './_framework/dotnet.js'
|
||||
|
||||
const is_browser = typeof window != "undefined";
|
||||
if (!is_browser) throw new Error(`Expected to be running in a browser`);
|
||||
@ -10,4 +10,4 @@ const dotnetRuntime = await dotnet
|
||||
|
||||
const config = dotnetRuntime.getConfig();
|
||||
|
||||
await dotnetRuntime.runMainAndExit(config.mainAssemblyName, [window.location.search]);
|
||||
await dotnetRuntime.runMain(config.mainAssemblyName, [window.location.search]);
|
@ -4,10 +4,36 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<ScrollViewer>
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="SplitButton">
|
||||
<Setter Property="Flyout">
|
||||
<MenuFlyout Placement="BottomEdgeAlignedRight">
|
||||
<MenuItem Header="Submit All" />
|
||||
<MenuItem Header="Submit Updated" />
|
||||
</MenuFlyout>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style Selector="DropDownButton">
|
||||
<Setter Property="Flyout">
|
||||
<MenuFlyout Placement="BottomEdgeAlignedRight">
|
||||
<MenuItem Header="Submit All" />
|
||||
<MenuItem Header="Submit Updated" />
|
||||
</MenuFlyout>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style Selector="ToggleSplitButton">
|
||||
<Setter Property="Flyout">
|
||||
<MenuFlyout Placement="BottomEdgeAlignedRight">
|
||||
<MenuItem Header="Submit All" />
|
||||
<MenuItem Header="Submit Updated" />
|
||||
</MenuFlyout>
|
||||
</Setter>
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
|
||||
<TextBlock>Light (Default)</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<Button Classes="Primary">Primary</Button>
|
||||
@ -16,7 +42,7 @@
|
||||
<Button Classes="Success">Success</Button>
|
||||
<Button Classes="Warning">Warning</Button>
|
||||
<Button Classes="Danger">Danger</Button>
|
||||
<Button Classes="Primary" IsEnabled="False">Danger</Button>
|
||||
<Button Classes="Danger" IsEnabled="False">Disabled</Button>
|
||||
</StackPanel>
|
||||
<TextBlock>Solid</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
@ -27,12 +53,22 @@
|
||||
<Button Classes="Warning" Theme="{DynamicResource SolidButton}">Warning</Button>
|
||||
<Button Classes="Danger" Theme="{DynamicResource SolidButton}">Danger</Button>
|
||||
<Button
|
||||
Classes="Primary"
|
||||
Classes="Danger"
|
||||
IsEnabled="False"
|
||||
Theme="{DynamicResource SolidButton}">
|
||||
Danger
|
||||
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>
|
||||
@ -42,76 +78,102 @@
|
||||
<Button Classes="Warning" Theme="{DynamicResource BorderlessButton}">Warning</Button>
|
||||
<Button Classes="Danger" Theme="{DynamicResource BorderlessButton}">Danger</Button>
|
||||
<Button
|
||||
Classes="Primary"
|
||||
Classes="Danger"
|
||||
IsEnabled="False"
|
||||
Theme="{DynamicResource BorderlessButton}">
|
||||
Danger
|
||||
Disabled
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<TextBlock>Disabled</TextBlock>
|
||||
<StackPanel Background="{DynamicResource SemiColorBackground1}" Orientation="Horizontal" Spacing="20">
|
||||
<Button IsEnabled="False">Light</Button>
|
||||
<Button IsEnabled="False" Theme="{DynamicResource SolidButton}">Solid</Button>
|
||||
<Button IsEnabled="False" Theme="{DynamicResource OutlineButton}">Outline</Button>
|
||||
<Button IsEnabled="False" Theme="{DynamicResource BorderlessButton}">Borderless</Button>
|
||||
</StackPanel>
|
||||
<TextBlock>Size Classes</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<Button Classes="Primary Small">Small</Button>
|
||||
<Button Classes="Primary">Default</Button>
|
||||
<Button Classes="Primary Large">Large</Button>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock>DropDownButton</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<DropDownButton Content="Submit">
|
||||
<DropDownButton.Flyout>
|
||||
<MenuFlyout Placement="BottomEdgeAlignedRight">
|
||||
<MenuItem Header="Submit All" />
|
||||
<MenuItem Header="Submit Updated" />
|
||||
</MenuFlyout>
|
||||
</DropDownButton.Flyout>
|
||||
</DropDownButton>
|
||||
<DropDownButton Content="Submit" Theme="{DynamicResource SolidDropDownButton}">
|
||||
<DropDownButton.Flyout>
|
||||
<MenuFlyout Placement="BottomEdgeAlignedRight">
|
||||
<MenuItem Header="Submit All" />
|
||||
<MenuItem Header="Submit Updated" />
|
||||
</MenuFlyout>
|
||||
</DropDownButton.Flyout>
|
||||
</DropDownButton>
|
||||
<DropDownButton Content="Submit" Theme="{DynamicResource BorderlessDropDownButton}">
|
||||
<DropDownButton.Flyout>
|
||||
<MenuFlyout Placement="BottomEdgeAlignedRight">
|
||||
<MenuItem Header="Submit All" />
|
||||
<MenuItem Header="Submit Updated" />
|
||||
</MenuFlyout>
|
||||
</DropDownButton.Flyout>
|
||||
</DropDownButton>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<SplitButton Content="Submit">
|
||||
<SplitButton.Flyout>
|
||||
<MenuFlyout Placement="BottomEdgeAlignedRight">
|
||||
<MenuItem Header="Submit All" />
|
||||
<MenuItem Header="Submit Updated" />
|
||||
</MenuFlyout>
|
||||
</SplitButton.Flyout>
|
||||
</SplitButton>
|
||||
<SplitButton Classes="Secondary" Content="Submit" />
|
||||
<SplitButton Classes="Tertiary" Content="Submit" />
|
||||
<SplitButton Classes="Success" Content="Submit" />
|
||||
<SplitButton Classes="Warning" Content="Submit" />
|
||||
<SplitButton Classes="Danger" Content="Submit" />
|
||||
<SplitButton
|
||||
<DropDownButton Content="Primary" />
|
||||
<DropDownButton Classes="Secondary" Content="Secondary" />
|
||||
<DropDownButton Classes="Tertiary" Content="Tertiary" />
|
||||
<DropDownButton Classes="Success" Content="Success" />
|
||||
<DropDownButton Classes="Warning" Content="Warning" />
|
||||
<DropDownButton Classes="Danger" Content="Danger" />
|
||||
<DropDownButton
|
||||
Classes="Danger"
|
||||
Content="Submit"
|
||||
Content="Disabled"
|
||||
IsEnabled="False" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<ToggleSplitButton Content="Submit">
|
||||
<ToggleSplitButton.Flyout>
|
||||
<MenuFlyout Placement="BottomEdgeAlignedRight">
|
||||
<MenuItem Header="Submit All" />
|
||||
<MenuItem Header="Submit Updated" />
|
||||
</MenuFlyout>
|
||||
</ToggleSplitButton.Flyout>
|
||||
</ToggleSplitButton>
|
||||
<ToggleSplitButton Classes="Secondary" Content="Submit" />
|
||||
<ToggleSplitButton Classes="Tertiary" Content="Submit" />
|
||||
<ToggleSplitButton Classes="Success" Content="Submit" />
|
||||
<ToggleSplitButton Classes="Warning" Content="Submit" />
|
||||
<ToggleSplitButton Classes="Danger" Content="Submit" />
|
||||
<ToggleSplitButton
|
||||
Classes="Danger"
|
||||
Content="Submit"
|
||||
IsEnabled="False" />
|
||||
<DropDownButton Content="Default" Classes="Success"/>
|
||||
<DropDownButton Content="Solid" Theme="{DynamicResource SolidDropDownButton}" Classes="Success"/>
|
||||
<DropDownButton Content="Outline" Theme="{DynamicResource OutlineDropDownButton}" Classes="Success"/>
|
||||
<DropDownButton Content="Borderless" Theme="{DynamicResource BorderlessDropDownButton}" Classes="Success"/>
|
||||
<DropDownButton Content="Default" Classes="Success" IsEnabled="False"/>
|
||||
<DropDownButton Content="Solid" Theme="{DynamicResource SolidDropDownButton}" Classes="Success" IsEnabled="False"/>
|
||||
<DropDownButton Content="Outline" Theme="{DynamicResource OutlineDropDownButton}" Classes="Success" IsEnabled="False"/>
|
||||
<DropDownButton Content="Borderless" Theme="{DynamicResource BorderlessDropDownButton}" Classes="Success" IsEnabled="False"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<DropDownButton Classes="Small" Content="Small" />
|
||||
<DropDownButton Content="Default" />
|
||||
<DropDownButton Classes="Large" Content="Large" />
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock>SplitButton</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<SplitButton Content="Primary" />
|
||||
<SplitButton Classes="Secondary" Content="Secondary" />
|
||||
<SplitButton Classes="Tertiary" Content="Tertiary" />
|
||||
<SplitButton Classes="Success" Content="Success" />
|
||||
<SplitButton Classes="Warning" Content="Warning" />
|
||||
<SplitButton Classes="Danger" Content="Danger" />
|
||||
<SplitButton Classes="Danger" Content="Disabled" IsEnabled="False" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<SplitButton Content="Default" Classes="Success" />
|
||||
<SplitButton Content="Solid" Theme="{DynamicResource SolidSplitButton}" Classes="Success" />
|
||||
<SplitButton Content="Outline" Theme="{DynamicResource OutlineSplitButton}" Classes="Success" />
|
||||
<SplitButton Content="Borderless" Theme="{DynamicResource BorderlessSplitButton}" Classes="Success" />
|
||||
<SplitButton Content="Default" Classes="Success" IsEnabled="False" />
|
||||
<SplitButton Content="Solid" Theme="{DynamicResource SolidSplitButton}" Classes="Success" IsEnabled="False" />
|
||||
<SplitButton Content="Outline" Theme="{DynamicResource OutlineSplitButton}" Classes="Success" IsEnabled="False" />
|
||||
<SplitButton Content="Borderless" Theme="{DynamicResource BorderlessSplitButton}" Classes="Success" IsEnabled="False" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<SplitButton Classes="Small" Content="Small" />
|
||||
<SplitButton Content="Default" />
|
||||
<SplitButton Classes="Large" Content="Large" />
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock>ToggleSplitButton</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<ToggleSplitButton Content="Primary" />
|
||||
<ToggleSplitButton Classes="Secondary" Content="Secondary" />
|
||||
<ToggleSplitButton Classes="Tertiary" Content="Tertiary" />
|
||||
<ToggleSplitButton Classes="Success" Content="Success" />
|
||||
<ToggleSplitButton Classes="Warning" Content="Warning" />
|
||||
<ToggleSplitButton Classes="Danger" Content="Danger" />
|
||||
<ToggleSplitButton Classes="Danger" Content="Disabled" IsEnabled="False" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<ToggleSplitButton Content="Default" Classes="Success" />
|
||||
<ToggleSplitButton Content="Checked" Classes="Success" IsChecked="True" />
|
||||
<ToggleSplitButton Content="Default" Classes="Success" IsEnabled="False" />
|
||||
<ToggleSplitButton Content="Checked" Classes="Success" IsChecked="True" IsEnabled="False" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<ToggleSplitButton Classes="Small" Content="Small" />
|
||||
<ToggleSplitButton Content="Default" />
|
||||
<ToggleSplitButton Classes="Large" Content="Large" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
@ -8,11 +8,22 @@
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
||||
<CalendarDatePicker />
|
||||
<CalendarDatePicker Classes="ClearButton" Width="200" />
|
||||
<CalendarDatePicker Width="500" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<CalendarDatePicker Classes="Large" />
|
||||
<CalendarDatePicker />
|
||||
<CalendarDatePicker Classes="Small" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<CalendarDatePicker IsEnabled="False" />
|
||||
<CalendarDatePicker Classes="Bordered" />
|
||||
<CalendarDatePicker Classes="Bordered" IsEnabled="False" />
|
||||
</StackPanel>
|
||||
|
||||
<CalendarDatePicker Width="500" />
|
||||
|
||||
<CalendarDatePicker Classes="ClearButton" Width="200" />
|
||||
|
||||
<CalendarDatePicker
|
||||
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>
|
@ -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>
|
@ -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"];
|
||||
}
|
@ -14,7 +14,10 @@
|
||||
<TabControl>
|
||||
<TabItem Header="DataGrid">
|
||||
<Grid RowDefinitions="Auto, *">
|
||||
<ToggleSwitch Grid.Row="0" Content="Disable" Name="DisableToggle"></ToggleSwitch>
|
||||
<StackPanel Grid.Row="0" Orientation="Horizontal">
|
||||
<ToggleSwitch Content="Disable" Name="DisableToggle" />
|
||||
<ToggleSwitch Content="ScrollViewerHide" Name="ScrollViewerHide" />
|
||||
</StackPanel>
|
||||
<DataGrid Grid.Row="1"
|
||||
Margin="8"
|
||||
CanUserReorderColumns="True"
|
||||
@ -22,6 +25,7 @@
|
||||
CanUserSortColumns="True"
|
||||
HeadersVisibility="All"
|
||||
IsReadOnly="True"
|
||||
ScrollViewer.AllowAutoHide="{Binding #ScrollViewerHide.IsChecked}"
|
||||
IsEnabled="{Binding #DisableToggle.IsChecked}"
|
||||
ItemsSource="{Binding GridData1}">
|
||||
<DataGrid.Columns>
|
||||
|
@ -78,8 +78,8 @@
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Border HorizontalAlignment="Left" Theme="{StaticResource RadioButtonGroupBorder}">
|
||||
<ListBox Theme="{DynamicResource ButtonRadioGroupListBox}">
|
||||
<ListBoxItem Classes="Large" IsSelected="True">Small 1</ListBoxItem>
|
||||
<ListBoxItem Classes="Large">Small 2</ListBoxItem>
|
||||
<ListBoxItem Classes="Large" IsSelected="True">Large 1</ListBoxItem>
|
||||
<ListBoxItem Classes="Large">Large 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">Small 1</ListBoxItem>
|
||||
<ListBoxItem Classes="Large">Small 2</ListBoxItem>
|
||||
<ListBoxItem Classes="Large" IsSelected="True">Large 1</ListBoxItem>
|
||||
<ListBoxItem Classes="Large">Large 2</ListBoxItem>
|
||||
</ListBox>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
|
@ -8,8 +8,13 @@
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="10">
|
||||
<Button Name="openFileDialog">Open File</Button>
|
||||
<Button Name="selectFolderDialog">Select Folder</Button>
|
||||
<Button Name="saveFileDialog">Save File</Button>
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="Button">
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<Button Name="OpenFileButton" Content="Open File" />
|
||||
<Button Name="SelectFolderButton" Content="Select Folder" />
|
||||
<Button Name="SaveFileButton" Content="Save File" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
@ -1,10 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Dialogs;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.Platform.Storage;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
@ -14,14 +10,14 @@ public partial class ManagedFileChooserDemo : UserControl
|
||||
public ManagedFileChooserDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
openFileDialog.Click += OpenFileDialog;
|
||||
selectFolderDialog.Click += SelectFolderDialog;
|
||||
saveFileDialog.Click += SaveFileDialog;
|
||||
OpenFileButton.Click += OpenFileDialog;
|
||||
SelectFolderButton.Click += SelectFolderDialog;
|
||||
SaveFileButton.Click += SaveFileDialog;
|
||||
}
|
||||
|
||||
private async void OpenFileDialog(object sender, RoutedEventArgs args)
|
||||
private async void OpenFileDialog(object? sender, RoutedEventArgs args)
|
||||
{
|
||||
IStorageProvider? sp = GetStorageProvider();
|
||||
var sp = GetStorageProvider();
|
||||
if (sp is null) return;
|
||||
var result = await sp.OpenFilePickerAsync(new FilePickerOpenOptions()
|
||||
{
|
||||
@ -30,9 +26,10 @@ public partial class ManagedFileChooserDemo : UserControl
|
||||
AllowMultiple = true,
|
||||
});
|
||||
}
|
||||
private async void SelectFolderDialog(object sender, RoutedEventArgs args)
|
||||
|
||||
private async void SelectFolderDialog(object? sender, RoutedEventArgs args)
|
||||
{
|
||||
IStorageProvider? sp = GetStorageProvider();
|
||||
var sp = GetStorageProvider();
|
||||
if (sp is null) return;
|
||||
var result = await sp.OpenFolderPickerAsync(new FolderPickerOpenOptions()
|
||||
{
|
||||
@ -40,13 +37,14 @@ public partial class ManagedFileChooserDemo : UserControl
|
||||
AllowMultiple = true,
|
||||
});
|
||||
}
|
||||
private async void SaveFileDialog(object sender, RoutedEventArgs args)
|
||||
|
||||
private async void SaveFileDialog(object? sender, RoutedEventArgs args)
|
||||
{
|
||||
IStorageProvider? sp = GetStorageProvider();
|
||||
var sp = GetStorageProvider();
|
||||
if (sp is null) return;
|
||||
var result = await sp.SaveFilePickerAsync(new FilePickerSaveOptions()
|
||||
{
|
||||
Title = "Open File",
|
||||
Title = "Save File",
|
||||
});
|
||||
}
|
||||
|
||||
@ -58,10 +56,10 @@ public partial class ManagedFileChooserDemo : UserControl
|
||||
|
||||
List<FilePickerFileType>? GetFileTypes()
|
||||
{
|
||||
return new List<FilePickerFileType>
|
||||
{
|
||||
return
|
||||
[
|
||||
FilePickerFileTypes.All,
|
||||
FilePickerFileTypes.TextPlain
|
||||
};
|
||||
];
|
||||
}
|
||||
}
|
@ -7,11 +7,23 @@
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="20">
|
||||
<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" />
|
||||
<StackPanel Spacing="20">
|
||||
<UniformGrid Rows="2" Columns="2" Width="500" HorizontalAlignment="Left">
|
||||
<UniformGrid.Styles>
|
||||
<Style Selector="RadioButton">
|
||||
<Setter Property="Theme" Value="{DynamicResource PureCardRadioButton}" />
|
||||
</Style>
|
||||
</UniformGrid.Styles>
|
||||
<RadioButton Click="PositionButton_OnClick" Content="TopLeft" />
|
||||
<RadioButton Click="PositionButton_OnClick" Content="TopRight" IsChecked="True" />
|
||||
<RadioButton Click="PositionButton_OnClick" Content="BottomLeft" />
|
||||
<RadioButton Click="PositionButton_OnClick" Content="BottomRight" />
|
||||
</UniformGrid>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<Button Click="NormalButton_OnClick" Content="Information" />
|
||||
<Button Click="NormalButton_OnClick" Content="Success" Classes="Success" />
|
||||
<Button Click="NormalButton_OnClick" Content="Warning" Classes="Warning" />
|
||||
<Button Click="NormalButton_OnClick" Content="Error" Classes="Danger" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
@ -22,13 +22,22 @@ public partial class NotificationDemo : UserControl
|
||||
_manager = new WindowNotificationManager(topLevel) { MaxItems = 3 };
|
||||
}
|
||||
|
||||
private void InfoButton_OnClick(object? sender, RoutedEventArgs e)
|
||||
private void NormalButton_OnClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button b && b.Content is string s)
|
||||
{
|
||||
_manager?.Show(Enum.TryParse<NotificationType>(s, out NotificationType t)
|
||||
_manager?.Show(Enum.TryParse<NotificationType>(s, out var t)
|
||||
? new Notification(t.ToString(), "This is message", t)
|
||||
: new Notification(s, "This is message"));
|
||||
}
|
||||
}
|
||||
|
||||
private void PositionButton_OnClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is RadioButton b && b.Content is string s)
|
||||
{
|
||||
Enum.TryParse<NotificationPosition>(s, out var t);
|
||||
_manager.Position = t;
|
||||
}
|
||||
}
|
||||
}
|
@ -155,7 +155,7 @@
|
||||
Value="60" />
|
||||
<ProgressBar
|
||||
Width="200"
|
||||
Classes="Error"
|
||||
Classes="Danger"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
ShowProgressText="True"
|
||||
|
@ -16,7 +16,7 @@
|
||||
<RepeatButton Classes="Success">Success</RepeatButton>
|
||||
<RepeatButton Classes="Warning">Warning</RepeatButton>
|
||||
<RepeatButton Classes="Danger">Danger</RepeatButton>
|
||||
<RepeatButton Classes="Primary" IsEnabled="False">Danger</RepeatButton>
|
||||
<RepeatButton Classes="Danger" IsEnabled="False">Disabled</RepeatButton>
|
||||
</StackPanel>
|
||||
<TextBlock>Solid</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
@ -27,10 +27,25 @@
|
||||
<RepeatButton Classes="Warning" Theme="{DynamicResource SolidRepeatButton}">Warning</RepeatButton>
|
||||
<RepeatButton Classes="Danger" Theme="{DynamicResource SolidRepeatButton}">Danger</RepeatButton>
|
||||
<RepeatButton
|
||||
Classes="Primary"
|
||||
Classes="Danger"
|
||||
IsEnabled="False"
|
||||
Theme="{DynamicResource SolidRepeatButton}">
|
||||
Danger
|
||||
Disabled
|
||||
</RepeatButton>
|
||||
</StackPanel>
|
||||
<TextBlock>Outline</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<RepeatButton Classes="Primary" Theme="{DynamicResource OutlineRepeatButton}">Primary</RepeatButton>
|
||||
<RepeatButton Classes="Secondary" Theme="{DynamicResource OutlineRepeatButton}">Secondary</RepeatButton>
|
||||
<RepeatButton Classes="Tertiary" Theme="{DynamicResource OutlineRepeatButton}">Tertiary</RepeatButton>
|
||||
<RepeatButton Classes="Success" Theme="{DynamicResource OutlineRepeatButton}">Success</RepeatButton>
|
||||
<RepeatButton Classes="Warning" Theme="{DynamicResource OutlineRepeatButton}">Warning</RepeatButton>
|
||||
<RepeatButton Classes="Danger" Theme="{DynamicResource OutlineRepeatButton}">Danger</RepeatButton>
|
||||
<RepeatButton
|
||||
Classes="Danger"
|
||||
IsEnabled="False"
|
||||
Theme="{DynamicResource OutlineRepeatButton}">
|
||||
Disabled
|
||||
</RepeatButton>
|
||||
</StackPanel>
|
||||
<TextBlock>Borderless</TextBlock>
|
||||
@ -42,11 +57,24 @@
|
||||
<RepeatButton Classes="Warning" Theme="{DynamicResource BorderlessRepeatButton}">Warning</RepeatButton>
|
||||
<RepeatButton Classes="Danger" Theme="{DynamicResource BorderlessRepeatButton}">Danger</RepeatButton>
|
||||
<RepeatButton
|
||||
Classes="Primary"
|
||||
Classes="Danger"
|
||||
IsEnabled="False"
|
||||
Theme="{DynamicResource BorderlessRepeatButton}">
|
||||
Danger
|
||||
Disabled
|
||||
</RepeatButton>
|
||||
</StackPanel>
|
||||
<TextBlock>Disabled</TextBlock>
|
||||
<StackPanel Background="{DynamicResource SemiColorBackground1}" Orientation="Horizontal" Spacing="20">
|
||||
<Button IsEnabled="False">Light</Button>
|
||||
<Button IsEnabled="False" Theme="{DynamicResource SolidButton}">Solid</Button>
|
||||
<Button IsEnabled="False" Theme="{DynamicResource OutlineButton}">Outline</Button>
|
||||
<Button IsEnabled="False" Theme="{DynamicResource BorderlessButton}">Borderless</Button>
|
||||
</StackPanel>
|
||||
<TextBlock>Size Classes</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<RepeatButton Classes="Small">Small</RepeatButton>
|
||||
<RepeatButton>Default</RepeatButton>
|
||||
<RepeatButton Classes="Large">Large</RepeatButton>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
@ -4,143 +4,190 @@
|
||||
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="1000"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<Design.DataContext>
|
||||
<pages:SplitViewDemoViewModel />
|
||||
</Design.DataContext>
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<StreamGeometry x:Key="NavigationMenuExpandIconGlyph">M5 2H19C20.6569 2 22 3.34315 22 5V19C22 20.6569 20.6569 22 19 22H5C3.34315 22 2 20.6569 2 19V5C2 3.34315 3.34315 2 5 2ZM6 4C5.44772 4 5 4.44772 5 5V19C5 19.5523 5.44772 20 6 20H9C9.55229 20 10 19.5523 10 19V5C10 4.44772 9.55229 4 9 4H6Z</StreamGeometry>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
<Border>
|
||||
<Grid ColumnDefinitions="*,400">
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
Orientation="Vertical"
|
||||
Spacing="4">
|
||||
<ToggleButton
|
||||
Name="PaneOpenButton"
|
||||
Content="IsPaneOpen"
|
||||
IsChecked="{Binding IsPaneOpen, ElementName=SplitView}" />
|
||||
|
||||
<ToggleButton
|
||||
Name="UseLightDismissOverlayModeButton"
|
||||
Content="UseLightDismissOverlayMode"
|
||||
IsChecked="{Binding UseLightDismissOverlayMode, ElementName=SplitView}" />
|
||||
|
||||
<Border Grid.Column="1" VerticalAlignment="Top" Margin="10 0 0 0">
|
||||
<Grid RowDefinitions="*, *, *, *, *, *" ColumnDefinitions="Auto, *">
|
||||
<Label
|
||||
Grid.Row="0" Grid.Column="0"
|
||||
VerticalAlignment="Center"
|
||||
Content="IsPaneOpen" />
|
||||
<ToggleSwitch
|
||||
Content="Placement"
|
||||
Grid.Row="0" Grid.Column="1"
|
||||
Name="PaneOpenButton"
|
||||
IsChecked="{Binding #SplitView.IsPaneOpen}" />
|
||||
|
||||
<Label
|
||||
Grid.Row="1" Grid.Column="0"
|
||||
VerticalAlignment="Center"
|
||||
Content="UseLightDismissOverlayMode" />
|
||||
<ToggleSwitch
|
||||
Grid.Row="1" Grid.Column="1"
|
||||
Name="UseLightDismissOverlayModeButton"
|
||||
IsChecked="{Binding #SplitView.UseLightDismissOverlayMode}" />
|
||||
|
||||
<Label
|
||||
Grid.Row="2" Grid.Column="0"
|
||||
VerticalAlignment="Center"
|
||||
Content="Placement" />
|
||||
<ToggleSwitch
|
||||
Grid.Row="2" Grid.Column="1"
|
||||
OffContent="Left"
|
||||
OnContent="Right" />
|
||||
OnContent="Right"
|
||||
IsChecked="{Binding #SplitView.PanePlacement, Mode=OneWayToSource}" />
|
||||
|
||||
<TextBlock Text="DisplayMode" />
|
||||
<Label
|
||||
Grid.Row="3" Grid.Column="0"
|
||||
VerticalAlignment="Center"
|
||||
Content="DisplayMode" />
|
||||
<ComboBox
|
||||
Grid.Row="3" Grid.Column="1"
|
||||
Name="DisplayModeSelector"
|
||||
Width="170"
|
||||
Margin="10"
|
||||
SelectedIndex="{Binding DisplayMode}">
|
||||
<ComboBoxItem>Inline</ComboBoxItem>
|
||||
<ComboBoxItem>CompactInline</ComboBoxItem>
|
||||
<ComboBoxItem>Overlay</ComboBoxItem>
|
||||
<ComboBoxItem>CompactOverlay</ComboBoxItem>
|
||||
</ComboBox>
|
||||
HorizontalAlignment="Stretch"
|
||||
ItemsSource="{Binding DisplayModes}"
|
||||
SelectedIndex="{Binding #SplitView.DisplayMode}" />
|
||||
|
||||
<TextBlock Text="PaneBackground" />
|
||||
<ComboBox
|
||||
Name="PaneBackgroundSelector"
|
||||
Width="170"
|
||||
Margin="10"
|
||||
SelectedIndex="0">
|
||||
<ComboBoxItem Tag="White">White</ComboBoxItem>
|
||||
<ComboBoxItem Tag="Red">Red</ComboBoxItem>
|
||||
<ComboBoxItem Tag="Blue">Blue</ComboBoxItem>
|
||||
<ComboBoxItem Tag="Green">Green</ComboBoxItem>
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock Text="{Binding Value, ElementName=OpenPaneLengthSlider, StringFormat='{}OpenPaneLength: {0}'}" />
|
||||
<Label
|
||||
Grid.Row="4" Grid.Column="0"
|
||||
VerticalAlignment="Center"
|
||||
Content="{Binding #CompactPaneLengthSlider.Value, StringFormat='{}CompactPaneLength: {0}'}" />
|
||||
<Slider
|
||||
Grid.Row="4" Grid.Column="1"
|
||||
Name="CompactPaneLengthSlider"
|
||||
Maximum="128"
|
||||
Minimum="0"
|
||||
TickFrequency="1"
|
||||
IsSnapToTickEnabled="True"
|
||||
Value="{Binding #SplitView.CompactPaneLength}" />
|
||||
|
||||
<Label
|
||||
Grid.Row="5" Grid.Column="0"
|
||||
VerticalAlignment="Center"
|
||||
Content="{Binding #OpenPaneLengthSlider.Value,StringFormat='{}OpenPaneLength: {0}'}" />
|
||||
<Slider
|
||||
Grid.Row="5" Grid.Column="1"
|
||||
Name="OpenPaneLengthSlider"
|
||||
Width="150"
|
||||
Maximum="500"
|
||||
Minimum="128"
|
||||
Value="256" />
|
||||
|
||||
<TextBlock Text="{Binding Value, ElementName=CompactPaneLengthSlider, StringFormat='{}CompactPaneLength: {0}'}" />
|
||||
<Slider
|
||||
Name="CompactPaneLengthSlider"
|
||||
Width="150"
|
||||
Maximum="128"
|
||||
Minimum="24"
|
||||
Value="48" />
|
||||
</StackPanel>
|
||||
<Border BorderBrush="{DynamicResource SystemControlHighlightBaseLowBrush}" BorderThickness="1">
|
||||
<!-- {Binding SelectedItem.Tag, ElementName=PaneBackgroundSelector} -->
|
||||
TickFrequency="1"
|
||||
IsSnapToTickEnabled="True"
|
||||
Value="{Binding #SplitView.OpenPaneLength}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border
|
||||
Grid.Column="0"
|
||||
BorderBrush="{DynamicResource SemiGrey1}"
|
||||
BorderThickness="1">
|
||||
<SplitView
|
||||
Name="SplitView"
|
||||
CompactPaneLength="{Binding Value, ElementName=CompactPaneLengthSlider}"
|
||||
DisplayMode="CompactOverlay"
|
||||
OpenPaneLength="{Binding Value, ElementName=OpenPaneLengthSlider}"
|
||||
PaneBackground="{Binding SelectedItem.Tag, ElementName=PaneBackgroundSelector}"
|
||||
PanePlacement="{Binding PanePlacement}">
|
||||
CompactPaneLength="48"
|
||||
OpenPaneLength="256">
|
||||
<SplitView.Background>
|
||||
<LinearGradientBrush StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
<GradientStop Color="#6b4c1b" Offset="0" />
|
||||
<GradientStop Color="#291e10" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
</SplitView.Background>
|
||||
<SplitView.Pane>
|
||||
<Grid RowDefinitions="Auto,Auto,*,Auto">
|
||||
<Grid RowDefinitions="Auto,*,Auto">
|
||||
<TextBlock
|
||||
Grid.Row="0"
|
||||
Name="PaneHeader"
|
||||
Margin="5,12,0,0"
|
||||
Margin="8,12"
|
||||
FontWeight="Bold"
|
||||
Text="PANE CONTENT" />
|
||||
<ComboBox Grid.Row="1" Width="150">
|
||||
<ComboBoxItem Content="Item1" />
|
||||
<ComboBoxItem Content="Item2" />
|
||||
<ComboBoxItem Content="Item3" />
|
||||
</ComboBox>
|
||||
<ListBoxItem
|
||||
Text="Playlist" />
|
||||
<ListBox
|
||||
Grid.Row="1"
|
||||
ItemsSource="{Binding Songs}" />
|
||||
<ToggleSwitch
|
||||
Grid.Row="2"
|
||||
Margin="0,10"
|
||||
VerticalAlignment="Top">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<!-- Path glyph from materialdesignicons.com -->
|
||||
<Border Width="48">
|
||||
<Viewbox
|
||||
Width="24"
|
||||
Height="24"
|
||||
HorizontalAlignment="Left">
|
||||
<Canvas Width="24" Height="24">
|
||||
<Path Data="M16 17V19H2V17S2 13 9 13 16 17 16 17M12.5 7.5A3.5 3.5 0 1 0 9 11A3.5 3.5 0 0 0 12.5 7.5M15.94 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13M15 4A3.39 3.39 0 0 0 13.07 4.59A5 5 0 0 1 13.07 10.41A3.39 3.39 0 0 0 15 11A3.5 3.5 0 0 0 15 4Z" Fill="{DynamicResource SystemControlForegroundBaseHighBrush}" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</Border>
|
||||
<TextBlock VerticalAlignment="Center" Text="People" />
|
||||
</StackPanel>
|
||||
</ListBoxItem>
|
||||
<TextBlock
|
||||
Grid.Row="3"
|
||||
Margin="60,12"
|
||||
Text="Item at bottom" />
|
||||
Theme="{DynamicResource ButtonToggleSwitch}"
|
||||
IsChecked="{Binding #SplitView.IsPaneOpen}">
|
||||
<ToggleSwitch.OnContent>
|
||||
<PathIcon
|
||||
Width="16"
|
||||
Height="16"
|
||||
Data="{StaticResource NavigationMenuExpandIconGlyph}" />
|
||||
</ToggleSwitch.OnContent>
|
||||
<ToggleSwitch.OffContent>
|
||||
<PathIcon
|
||||
Width="16"
|
||||
Height="16"
|
||||
Data="{StaticResource NavigationMenuExpandIconGlyph}" />
|
||||
</ToggleSwitch.OffContent>
|
||||
</ToggleSwitch>
|
||||
</Grid>
|
||||
</SplitView.Pane>
|
||||
|
||||
<Grid>
|
||||
<Grid.Styles>
|
||||
<Style Selector="TextBlock">
|
||||
<Setter Property="FontSize" Value="14" />
|
||||
<Setter Property="FontWeight" Value="700" />
|
||||
<Panel>
|
||||
<Panel.Styles>
|
||||
<Style Selector="Image#AlbumCover">
|
||||
<Style.Animations>
|
||||
<Animation IterationCount="Infinite" Duration="0:0:40">
|
||||
<KeyFrame Cue="0%">
|
||||
<Setter Property="RotateTransform.Angle" Value="0" />
|
||||
</KeyFrame>
|
||||
<KeyFrame Cue="100%">
|
||||
<Setter Property="RotateTransform.Angle" Value="360" />
|
||||
</KeyFrame>
|
||||
</Animation>
|
||||
</Style.Animations>
|
||||
</Style>
|
||||
</Grid.Styles>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Text="SplitViewContent" />
|
||||
<TextBlock Text="SplitViewContent" TextAlignment="Left" />
|
||||
<TextBlock
|
||||
HorizontalAlignment="Right"
|
||||
Text="SplitViewContent"
|
||||
TextAlignment="Left" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Bottom"
|
||||
Text="SplitViewContent"
|
||||
TextAlignment="Left" />
|
||||
<TextBlock
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Bottom"
|
||||
Text="SplitViewContent"
|
||||
TextAlignment="Left" />
|
||||
</Grid>
|
||||
</Panel.Styles>
|
||||
<Image
|
||||
Source="/Assets/WORLD.png"
|
||||
Name="AlbumCover"
|
||||
Width="200"
|
||||
Height="200" />
|
||||
<Arc
|
||||
Width="290"
|
||||
Height="290"
|
||||
StartAngle="0"
|
||||
SweepAngle="360"
|
||||
StrokeJoin="Round"
|
||||
StrokeLineCap="Round"
|
||||
StrokeThickness="45">
|
||||
<Arc.Stroke>
|
||||
<LinearGradientBrush StartPoint="0%,0%" EndPoint="100%,0%">
|
||||
<GradientStop Color="#010101" Offset="0" />
|
||||
<GradientStop Color="#363636" Offset="0.5" />
|
||||
<GradientStop Color="#010101" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
</Arc.Stroke>
|
||||
</Arc>
|
||||
<Arc
|
||||
Width="294"
|
||||
Height="294"
|
||||
StartAngle="0"
|
||||
SweepAngle="360"
|
||||
StrokeJoin="Round"
|
||||
StrokeLineCap="Round"
|
||||
StrokeThickness="4"
|
||||
Stroke="Black" />
|
||||
<Arc
|
||||
Width="310"
|
||||
Height="310"
|
||||
StartAngle="0"
|
||||
SweepAngle="360"
|
||||
StrokeJoin="Round"
|
||||
StrokeLineCap="Round"
|
||||
StrokeThickness="10"
|
||||
Stroke="#C6CACD"
|
||||
Opacity="0.1" />
|
||||
</Panel>
|
||||
|
||||
</SplitView>
|
||||
</Border>
|
||||
|
@ -1,6 +1,7 @@
|
||||
using Avalonia;
|
||||
using System.Collections.ObjectModel;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
@ -9,6 +10,7 @@ public partial class SplitViewDemo : UserControl
|
||||
public SplitViewDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = new SplitViewDemoViewModel();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
@ -16,3 +18,27 @@ public partial class SplitViewDemo : UserControl
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
|
||||
public class SplitViewDemoViewModel : ObservableObject
|
||||
{
|
||||
public ObservableCollection<string> Songs { get; set; } =
|
||||
[
|
||||
"320万年前",
|
||||
"隐德来希",
|
||||
"孔明",
|
||||
"锦鲤卟噜噜",
|
||||
"指鹿为马",
|
||||
"热带季风Remix",
|
||||
"加州梦境",
|
||||
"渐近自由",
|
||||
"世界所有的烂漫",
|
||||
];
|
||||
|
||||
public ObservableCollection<SplitViewDisplayMode> DisplayModes { get; set; } =
|
||||
[
|
||||
SplitViewDisplayMode.Inline,
|
||||
SplitViewDisplayMode.CompactInline,
|
||||
SplitViewDisplayMode.Overlay,
|
||||
SplitViewDisplayMode.CompactOverlay,
|
||||
];
|
||||
}
|
@ -24,8 +24,9 @@
|
||||
<TextBox Width="300" PasswordChar="*" />
|
||||
<TextBox
|
||||
Width="300"
|
||||
Classes="revealPasswordButton"
|
||||
PasswordChar="*" />
|
||||
Classes="ClearButton RevealPasswordButton"
|
||||
PasswordChar="*"
|
||||
Text="123456" />
|
||||
<TextBox
|
||||
Width="500"
|
||||
InnerLeftContent="http://"
|
||||
@ -42,6 +43,7 @@
|
||||
InnerLeftContent="http://"
|
||||
InnerRightContent=".com"
|
||||
IsEnabled="False" />
|
||||
<TextBox Width="300" Classes="TextArea" />
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
|
@ -17,7 +17,7 @@
|
||||
<ToggleButton Classes="Success">Success</ToggleButton>
|
||||
<ToggleButton Classes="Warning">Warning</ToggleButton>
|
||||
<ToggleButton Classes="Danger">Danger</ToggleButton>
|
||||
<ToggleButton Classes="Danger" IsEnabled="False">Danger</ToggleButton>
|
||||
<ToggleButton Classes="Danger" IsEnabled="False">Disabled</ToggleButton>
|
||||
</StackPanel>
|
||||
<TextBlock Text="Toggle Button Checked State" />
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
@ -28,18 +28,71 @@
|
||||
<ToggleButton Classes="Success" IsChecked="True">Success</ToggleButton>
|
||||
<ToggleButton Classes="Warning" IsChecked="True">Warning</ToggleButton>
|
||||
<ToggleButton Classes="Danger" IsChecked="True">Danger</ToggleButton>
|
||||
<ToggleButton Classes="Danger" IsChecked="True" IsEnabled="False">Danger</ToggleButton>
|
||||
<ToggleButton
|
||||
Classes="Danger"
|
||||
IsChecked="True"
|
||||
IsEnabled="False">
|
||||
Disabled
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
<TextBlock Text="Toggle Button Three State" />
|
||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||
<ToggleButton IsThreeState="True" IsChecked="{x:Null}">Default</ToggleButton>
|
||||
<ToggleButton Classes="Primary" IsThreeState="True" IsChecked="{x:Null}">Primary</ToggleButton>
|
||||
<ToggleButton Classes="Secondary" IsThreeState="True" IsChecked="{x:Null}">Secondary</ToggleButton>
|
||||
<ToggleButton Classes="Tertiary" IsThreeState="True" IsChecked="{x:Null}">Tertiary</ToggleButton>
|
||||
<ToggleButton Classes="Success" IsThreeState="True" IsChecked="{x:Null}">Success</ToggleButton>
|
||||
<ToggleButton Classes="Warning" IsThreeState="True" IsChecked="{x:Null}">Warning</ToggleButton>
|
||||
<ToggleButton Classes="Danger" IsThreeState="True" IsChecked="{x:Null}">Danger</ToggleButton>
|
||||
<ToggleButton Classes="Danger" IsThreeState="True" IsChecked="{x:Null}" IsEnabled="False">Danger</ToggleButton>
|
||||
<ToggleButton IsChecked="{x:Null}" IsThreeState="True">Default</ToggleButton>
|
||||
<ToggleButton
|
||||
Classes="Primary"
|
||||
IsChecked="{x:Null}"
|
||||
IsThreeState="True">
|
||||
Primary
|
||||
</ToggleButton>
|
||||
<ToggleButton
|
||||
Classes="Secondary"
|
||||
IsChecked="{x:Null}"
|
||||
IsThreeState="True">
|
||||
Secondary
|
||||
</ToggleButton>
|
||||
<ToggleButton
|
||||
Classes="Tertiary"
|
||||
IsChecked="{x:Null}"
|
||||
IsThreeState="True">
|
||||
Tertiary
|
||||
</ToggleButton>
|
||||
<ToggleButton
|
||||
Classes="Success"
|
||||
IsChecked="{x:Null}"
|
||||
IsThreeState="True">
|
||||
Success
|
||||
</ToggleButton>
|
||||
<ToggleButton
|
||||
Classes="Warning"
|
||||
IsChecked="{x:Null}"
|
||||
IsThreeState="True">
|
||||
Warning
|
||||
</ToggleButton>
|
||||
<ToggleButton
|
||||
Classes="Danger"
|
||||
IsChecked="{x:Null}"
|
||||
IsThreeState="True">
|
||||
Danger
|
||||
</ToggleButton>
|
||||
<ToggleButton
|
||||
Classes="Danger"
|
||||
IsChecked="{x:Null}"
|
||||
IsEnabled="False"
|
||||
IsThreeState="True">
|
||||
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">
|
||||
<ToggleButton Classes="Small" IsThreeState="True">Small</ToggleButton>
|
||||
<ToggleButton IsThreeState="True">Default</ToggleButton>
|
||||
<ToggleButton Classes="Large" IsThreeState="True">Large</ToggleButton>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
@ -7,7 +7,7 @@
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel Spacing="20">
|
||||
<StackPanel Spacing="8" Margin="20">
|
||||
<ToggleSwitch
|
||||
Content="Content"
|
||||
OffContent="OffContent"
|
||||
@ -24,11 +24,42 @@
|
||||
IsEnabled="False"
|
||||
OffContent="OffContent"
|
||||
OnContent="OnContent" />
|
||||
<ToggleSwitch
|
||||
Theme="{DynamicResource SimpleToggleSwitch}"
|
||||
Content="Content"
|
||||
OffContent="OffContent"
|
||||
OnContent="OnContent" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Small" />
|
||||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Small" IsChecked="True" />
|
||||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Small Loading" />
|
||||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Small Loading" IsChecked="True" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" />
|
||||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" IsChecked="True" />
|
||||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Loading" />
|
||||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Loading" IsChecked="True" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Large" />
|
||||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Large" IsChecked="True" />
|
||||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Large Loading" />
|
||||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Large Loading" IsChecked="True" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" OffContent="关" OnContent="开"/>
|
||||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" OffContent="〇" OnContent="|"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" OffContent="关" OnContent="开" IsChecked="True" />
|
||||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" OffContent="〇" OnContent="|" IsChecked="True" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" OffContent="关" OnContent="开" Classes="Large" />
|
||||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" OffContent="〇" OnContent="|" Classes="Large" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" OffContent="关" OnContent="开" Classes="Large" IsChecked="True" />
|
||||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" OffContent="〇" OnContent="|" Classes="Large" IsChecked="True" />
|
||||
</StackPanel>
|
||||
|
||||
<ToggleSwitch Theme="{DynamicResource ButtonToggleSwitch}">
|
||||
<ToggleSwitch.OnContent>
|
||||
<PathIcon
|
||||
|
@ -1,5 +0,0 @@
|
||||
<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>
|
@ -7,7 +7,6 @@
|
||||
|
||||
<ItemGroup>
|
||||
<AvaloniaResource Include="Assets\**" />
|
||||
<TrimmerRootDescriptor Include="Roots.xml" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -121,7 +121,7 @@ public class Song
|
||||
new("指鹿为马", "熊猫堂ProducePandas", 3, 12, "W.O.R.L.D.", 74, 2063175272),
|
||||
new("热带季风Remix", "熊猫堂ProducePandas", 3, 22, "W.O.R.L.D.", 23, 2063173319),
|
||||
new("加州梦境", "熊猫堂ProducePandas", 2, 56, "W.O.R.L.D.", 1662, 2063173324),
|
||||
new("渐进自由", "熊猫堂ProducePandas", 4, 19, "W.O.R.L.D.", 124, 2063173321),
|
||||
new("渐近自由", "熊猫堂ProducePandas", 4, 19, "W.O.R.L.D.", 124, 2063173321),
|
||||
new("世界所有的烂漫", "熊猫堂ProducePandas", 3, 30, "W.O.R.L.D.", 335, 2053388775),
|
||||
};
|
||||
}
|
||||
|
@ -47,8 +47,8 @@ public class PaletteDemoViewModel: ObservableObject
|
||||
|
||||
public PaletteDemoViewModel()
|
||||
{
|
||||
_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;
|
||||
_lightResourceDictionary = new Light.Palette();
|
||||
_darkResourceDictionary = new Dark.Palette();
|
||||
WeakReferenceMessenger.Default.Register<PaletteDemoViewModel, ColorItemViewModel>(this, OnClickColorItem);
|
||||
}
|
||||
|
||||
@ -251,7 +251,7 @@ public static class ColorTokens
|
||||
{
|
||||
new ("SemiColorPrimary", "Primary"),
|
||||
new ("SemiColorPrimaryPointerover", "Primary Pointerover"),
|
||||
new ("SemiColorPrimaryPressed", "Primary Pressed"),
|
||||
new ("SemiColorPrimaryActive", "Primary Active"),
|
||||
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 ("SemiColorSecondaryPressed", "Secondary Pressed"),
|
||||
new ("SemiColorSecondaryActive", "Secondary Active"),
|
||||
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 ("SemiColorTertiaryPressed", "Tertiary Pressed"),
|
||||
new ("SemiColorTertiaryActive", "Tertiary Active"),
|
||||
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 ("SemiColorInformationPressed", "Information Pressed"),
|
||||
new ("SemiColorInformationActive", "Information Active"),
|
||||
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 ("SemiColorSuccessPressed", "Success Pressed"),
|
||||
new ("SemiColorSuccessActive", "Success Active"),
|
||||
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 ("SemiColorWarningPressed", "Warning Pressed"),
|
||||
new ("SemiColorWarningActive", "Warning Active"),
|
||||
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 ("SemiColorDangerPressed", "Danger Pressed"),
|
||||
new ("SemiColorDangerActive", "Danger Active"),
|
||||
new ("SemiColorDangerLight", "Danger Light"),
|
||||
new ("SemiColorDangerLightPointerover", "Danger Light Pointerover"),
|
||||
new ("SemiColorDangerLightActive", "Danger Light Active"),
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"sdk": {
|
||||
"version": "7.0"
|
||||
"version": "8.0"
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"sdk": {
|
||||
"version": "7.0.0",
|
||||
"version": "8.0.0",
|
||||
"rollForward": "latestMajor",
|
||||
"allowPrerelease": true
|
||||
}
|
||||
|
@ -1,13 +1,19 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0;net8.0;netstandard2.0</TargetFrameworks>
|
||||
<Nullable>enable</Nullable>
|
||||
<LangVersion>11</LangVersion>
|
||||
<Version>11.0.7</Version>
|
||||
<Authors>IRIHI Technology</Authors>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Version>11.0.7.7</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>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="irihi.png" Pack="true" PackagePath=""/>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -2,8 +2,8 @@
|
||||
<Styles.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<MergeResourceInclude x:Key="Default" Source="avares://Semi.Avalonia.ColorPicker/Light.axaml" />
|
||||
<MergeResourceInclude x:Key="Dark" Source="avares://Semi.Avalonia.ColorPicker/Dark.axaml" />
|
||||
<ResourceInclude x:Key="Default" Source="avares://Semi.Avalonia.ColorPicker/Light.axaml" />
|
||||
<ResourceInclude x:Key="Dark" Source="avares://Semi.Avalonia.ColorPicker/Dark.axaml" />
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceInclude Source="avares://Semi.Avalonia.ColorPicker/Controls/ColorPicker.axaml" />
|
||||
|
@ -4,7 +4,11 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<Title>Semi.Avalonia.ColorPicker</Title>
|
||||
<PackageReleaseNotes>Update to 11.0.7</PackageReleaseNotes>
|
||||
<PackageReleaseNotes>Update to 11.0.7.7</PackageReleaseNotes>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
|
||||
<IsAotCompatible>true</IsAotCompatible>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
BIN
src/Semi.Avalonia.ColorPicker/irihi.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
@ -292,7 +292,7 @@
|
||||
Name="BackgroundBorder"
|
||||
Grid.RowSpan="2"
|
||||
Grid.ColumnSpan="2"
|
||||
Margin="2"
|
||||
Margin="{DynamicResource DataGridRowMargin}"
|
||||
Background="{DynamicResource DataGridRowBackground}"
|
||||
CornerRadius="3" />
|
||||
<Rectangle
|
||||
@ -471,6 +471,7 @@
|
||||
<Setter Property="VerticalScrollBarVisibility" Value="Auto" />
|
||||
<Setter Property="SelectionMode" Value="Extended" />
|
||||
<Setter Property="GridLinesVisibility" Value="None" />
|
||||
<Setter Property="ScrollViewer.AllowAutoHide" Value="True" />
|
||||
<Setter Property="HorizontalGridLinesBrush" Value="{DynamicResource DataGridLineBrush}" />
|
||||
<Setter Property="VerticalGridLinesBrush" Value="{DynamicResource DataGridLineBrush}" />
|
||||
<Setter Property="DropLocationIndicatorTemplate">
|
||||
@ -570,5 +571,15 @@
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^[(ScrollViewer.AllowAutoHide)=False]">
|
||||
<Style Selector="^ /template/ DataGridRowsPresenter#PART_RowsPresenter">
|
||||
<Setter Property="Grid.RowSpan" Value="1" />
|
||||
<Setter Property="Grid.ColumnSpan" Value="2" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ DataGridColumnHeadersPresenter#PART_ColumnHeadersPresenter">
|
||||
<Setter Property="Grid.ColumnSpan" Value="1" />
|
||||
</Style>
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
|
@ -2,8 +2,8 @@
|
||||
<Styles.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<MergeResourceInclude x:Key="Default" Source="avares://Semi.Avalonia.DataGrid/Light.axaml" />
|
||||
<MergeResourceInclude x:Key="Dark" Source="avares://Semi.Avalonia.DataGrid/Dark.axaml" />
|
||||
<ResourceInclude x:Key="Default" Source="avares://Semi.Avalonia.DataGrid/Light.axaml" />
|
||||
<ResourceInclude x:Key="Dark" Source="avares://Semi.Avalonia.DataGrid/Dark.axaml" />
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceInclude Source="avares://Semi.Avalonia.DataGrid/DataGrid.axaml" />
|
||||
|
@ -20,7 +20,6 @@
|
||||
<SolidColorBrush x:Key="DataGridRowPointeroverBackground" Opacity="0.09" Color="#2E3238" />
|
||||
<SolidColorBrush x:Key="DataGridRowSelectedBackground" Color="#EAF5FF" />
|
||||
<SolidColorBrush x:Key="DataGridRowSelectedPointeroverBackground" Color="#CBE7FE" />
|
||||
|
||||
<SolidColorBrush x:Key="DataGridRowGroupHeaderExpandIconForeground" Opacity="0.62" Color="#1C1F23" />
|
||||
<SolidColorBrush x:Key="DataGridRowGroupHeaderBackground" Opacity="0.05" Color="#2E3238" />
|
||||
|
||||
|
@ -4,7 +4,11 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<Title>Semi.Avalonia.DataGrid</Title>
|
||||
<PackageReleaseNotes>Update to 11.0.7</PackageReleaseNotes>
|
||||
<PackageReleaseNotes>Update to 11.0.7.7</PackageReleaseNotes>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
|
||||
<IsAotCompatible>true</IsAotCompatible>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -12,6 +12,7 @@
|
||||
<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>
|
||||
|
||||
|
BIN
src/Semi.Avalonia.DataGrid/irihi.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
@ -3,17 +3,24 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<LangVersion>11</LangVersion>
|
||||
<Version>11.0.1</Version>
|
||||
<Authors>IRIHI Technology</Authors>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Version>11.0.10</Version>
|
||||
<Authors>IRIHI Technology Co., Ltd.</Authors>
|
||||
<Description>Avalonia Theme inspired by Semi Design.</Description>
|
||||
<PackageProjectUrl>https://github.com/irihitech/Semi.Avalonia</PackageProjectUrl>
|
||||
<AvaloniaVersion>11.0.0</AvaloniaVersion>
|
||||
<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>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia.Controls.TreeDataGrid" Version="$(AvaloniaVersion)"/>
|
||||
<None Include="irihi.png" Pack="true" PackagePath=""/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -5,4 +5,5 @@
|
||||
</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>
|
||||
|
@ -149,7 +149,7 @@
|
||||
<Panel>
|
||||
<Border
|
||||
Name="RowBorder"
|
||||
Margin="2"
|
||||
Margin="{DynamicResource TreeDataGridRowMargin}"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Background="{TemplateBinding Background}"
|
||||
@ -183,8 +183,7 @@
|
||||
<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}" />
|
||||
@ -239,8 +238,7 @@
|
||||
DockPanel.Dock="Left">
|
||||
<ToggleButton
|
||||
Focusable="False"
|
||||
IsChecked="{TemplateBinding IsExpanded,
|
||||
Mode=TwoWay}"
|
||||
IsChecked="{TemplateBinding IsExpanded, Mode=TwoWay}"
|
||||
IsVisible="{TemplateBinding ShowExpander}"
|
||||
Theme="{StaticResource TreeDataGridExpandCollapseChevron}" />
|
||||
</Border>
|
||||
@ -287,8 +285,7 @@
|
||||
<TextBox
|
||||
Name="PART_Edit"
|
||||
Classes="Small"
|
||||
Text="{TemplateBinding Value,
|
||||
Mode=TwoWay}" />
|
||||
Text="{TemplateBinding Value, Mode=TwoWay}" />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
BIN
src/Semi.Avalonia.TreeDataGrid/irihi.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
13
src/Semi.Avalonia/Controls/AdornerLayer.axaml
Normal file
@ -0,0 +1,13 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:ClassModifier="internal">
|
||||
<ControlTheme x:Key="{x:Type AdornerLayer}" TargetType="AdornerLayer">
|
||||
<Setter Property="DefaultFocusAdorner">
|
||||
<FocusAdornerTemplate>
|
||||
<Border BorderThickness="{DynamicResource AdornerLayerBorderThickness}"
|
||||
BorderBrush="{DynamicResource AdornerLayerStroke}" />
|
||||
</FocusAdornerTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
@ -2,9 +2,9 @@
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:CompileBindings="True">
|
||||
<!-- 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 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 Light -->
|
||||
<ControlTheme x:Key="{x:Type Button}" TargetType="Button">
|
||||
@ -76,7 +76,6 @@
|
||||
|
||||
<Style Selector="^:disabled">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultDisabledBorderBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ButtonDefaultDisabledBackground}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
|
||||
</Style>
|
||||
|
||||
@ -186,7 +185,37 @@
|
||||
|
||||
<Style Selector="^:disabled">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultDisabledBorderBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ButtonDefaultDisabledBackground}" />
|
||||
<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="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
@ -41,7 +41,6 @@
|
||||
<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">
|
||||
@ -49,8 +48,7 @@
|
||||
Grid.Column="1"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
UseLayoutRounding="False">
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<ContentPresenter
|
||||
Name="PART_ContentPresenter"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
|
@ -31,6 +31,7 @@
|
||||
</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>
|
||||
@ -53,7 +54,7 @@
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<Grid
|
||||
MinWidth="{DynamicResource CalendarMinWidth}"
|
||||
MinWidth="{TemplateBinding MinWidth}"
|
||||
MinHeight="{TemplateBinding MinHeight}"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
|
@ -27,15 +27,14 @@
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
CornerRadius="{TemplateBinding CornerRadius}"/>
|
||||
<Grid
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
ColumnDefinitions="*, Auto, Auto">
|
||||
VerticalAlignment="Stretch"
|
||||
ColumnDefinitions="*, Auto">
|
||||
<TextBox
|
||||
Name="PART_TextBox"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
MinHeight="{DynamicResource CalendarDatePickerDefaultHeight}"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
@ -82,7 +81,7 @@
|
||||
Theme="{DynamicResource InnerIconButton}" />
|
||||
<Button
|
||||
Name="PART_Button"
|
||||
Grid.Column="2"
|
||||
Grid.Column="1"
|
||||
Padding="0,0,8,0"
|
||||
Content="{DynamicResource CalendarDatePickerIconGlyph}"
|
||||
Focusable="False"
|
||||
@ -113,7 +112,6 @@
|
||||
</Border>
|
||||
</Popup>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
</Panel>
|
||||
</DataValidationErrors>
|
||||
@ -123,20 +121,19 @@
|
||||
|
||||
<Style Selector="^.clearButton, ^.ClearButton">
|
||||
<Style Selector="^:pointerover /template/ Button#ClearButton">
|
||||
<Setter Property="IsVisible" Value="{Binding $parent[CalendarDatePicker].SelectedDate, Converter={x:Static ObjectConverters.IsNotNull}}"></Setter>
|
||||
<Setter Property="IsVisible" Value="{Binding $parent[CalendarDatePicker].SelectedDate, Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||
</Style>
|
||||
<Style Selector="^:pointerover /template/ Button#PART_Button">
|
||||
<Setter Property="IsVisible" Value="{Binding $parent[CalendarDatePicker].SelectedDate, Converter={x:Static ObjectConverters.IsNull}}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.Large">
|
||||
<Style Selector="^ /template/ TextBox#PART_TextBox">
|
||||
<Style Selector="^.Large /template/ TextBox#PART_TextBox">
|
||||
<Setter Property="MinHeight" Value="{DynamicResource CalendarDatePickerInnerLargeHeight}" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^.Small">
|
||||
<Style Selector="^ /template/ TextBox#PART_TextBox">
|
||||
<Style Selector="^.Small /template/ TextBox#PART_TextBox">
|
||||
<Setter Property="MinHeight" Value="{DynamicResource CalendarDatePickerInnerSmallHeight}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:pointerover">
|
||||
<Style Selector="^ /template/ Border#Background">
|
||||
|
@ -26,6 +26,7 @@
|
||||
<Grid x:Name="RootGrid" ColumnDefinitions="Auto,*">
|
||||
<Grid
|
||||
Grid.Column="0"
|
||||
TemplatedControl.IsTemplateFocusTarget="True"
|
||||
Margin="0,0,0,0"
|
||||
VerticalAlignment="Center">
|
||||
<Border
|
||||
@ -123,8 +124,8 @@
|
||||
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckedDisabledBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Path#CheckGlyph">
|
||||
<Setter Property="Fill" Value="{DynamicResource CheckBoxGlyphDisabledFill}" />
|
||||
<Style Selector="^ /template/ PathIcon#CheckGlyph">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxGlyphDisabledFill}" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
@ -166,8 +167,8 @@
|
||||
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckedDisabledBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Path#CheckGlyph">
|
||||
<Setter Property="Fill" Value="{DynamicResource CheckBoxGlyphDisabledFill}" />
|
||||
<Style Selector="^ /template/ PathIcon#CheckGlyph">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxGlyphDisabledFill}" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
@ -275,8 +276,8 @@
|
||||
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckedDisabledBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Path#CheckGlyph">
|
||||
<Setter Property="Fill" Value="{DynamicResource CheckBoxGlyphDisabledFill}" />
|
||||
<Style Selector="^ /template/ PathIcon#CheckGlyph">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxGlyphDisabledFill}" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
@ -315,8 +316,8 @@
|
||||
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckedDisabledBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Path#CheckGlyph">
|
||||
<Setter Property="Fill" Value="{DynamicResource CheckBoxGlyphDisabledFill}" />
|
||||
<Style Selector="^ /template/ PathIcon#CheckGlyph">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxGlyphDisabledFill}" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
@ -457,8 +458,8 @@
|
||||
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckedDisabledBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Path#CheckGlyph">
|
||||
<Setter Property="Fill" Value="{DynamicResource CheckBoxGlyphDisabledFill}" />
|
||||
<Style Selector="^ /template/ PathIcon#CheckGlyph">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxGlyphDisabledFill}" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
@ -512,8 +513,8 @@
|
||||
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckedDisabledBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ Path#CheckGlyph">
|
||||
<Setter Property="Fill" Value="{DynamicResource CheckBoxGlyphDisabledFill}" />
|
||||
<Style Selector="^ /template/ PathIcon#CheckGlyph">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxGlyphDisabledFill}" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
|
@ -41,26 +41,27 @@
|
||||
<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>
|
||||
<Grid ColumnDefinitions="*, Auto, 32">
|
||||
<Grid ColumnDefinitions="*, Auto">
|
||||
<Border
|
||||
x:Name="Background"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="3"
|
||||
MinWidth="{DynamicResource ComboBoxThemeMinWidth}"
|
||||
MinHeight="{DynamicResource ComboBoxDefaultHeight}"
|
||||
Grid.ColumnSpan="2"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}" />
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
MinHeight="{TemplateBinding MinHeight}" />
|
||||
<TextBlock
|
||||
x:Name="PlaceholderTextBlock"
|
||||
Grid.Column="0"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
IsVisible="{TemplateBinding SelectionBoxItem,
|
||||
Converter={x:Static ObjectConverters.IsNull}}"
|
||||
@ -77,13 +78,15 @@
|
||||
<Button
|
||||
Name="ClearButton"
|
||||
Grid.Column="1"
|
||||
Margin="0,0,8,0"
|
||||
Command="{Binding $parent[ComboBox].Clear}"
|
||||
Content="{DynamicResource IconButtonClearData}"
|
||||
Focusable="False"
|
||||
IsVisible="False"
|
||||
Theme="{DynamicResource InnerIconButton}" />
|
||||
<Border
|
||||
x:Name="DropDownOverlay"
|
||||
Grid.Column="2"
|
||||
Grid.Column="1"
|
||||
Width="30"
|
||||
Margin="0,1,1,1"
|
||||
HorizontalAlignment="Right"
|
||||
@ -92,12 +95,10 @@
|
||||
|
||||
<PathIcon
|
||||
x:Name="DropDownGlyph"
|
||||
Grid.Column="2"
|
||||
Grid.Column="1"
|
||||
Width="12"
|
||||
Height="12"
|
||||
Margin="0,0,10,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,0,12,0"
|
||||
Data="{DynamicResource ComboBoxIcon}"
|
||||
Foreground="{DynamicResource ComboBoxIconDefaultForeground}"
|
||||
IsHitTestVisible="False"
|
||||
@ -145,12 +146,15 @@
|
||||
<Style Selector="^:pointerover /template/ Button#ClearButton">
|
||||
<Setter Property="IsVisible" Value="{Binding $parent[ComboBox].SelectionBoxItem, Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||
</Style>
|
||||
<Style Selector="^:pointerover /template/ PathIcon#DropDownGlyph">
|
||||
<Setter Property="IsVisible" Value="{Binding $parent[ComboBox].SelectionBoxItem, Converter={x:Static ObjectConverters.IsNull}}"/>
|
||||
</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>
|
||||
|
||||
@ -158,10 +162,19 @@
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Background" Value="{DynamicResource ComboBoxSelectorPointeroverBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxSelectorPointeroverBorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:pointerover /template/ PathIcon#DropDownGlyph">
|
||||
<Style Selector="^ /template/ PathIcon#DropDownGlyph">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxIconPointeroverForeground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<!-- 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 -->
|
||||
<Style Selector="^:pressed">
|
||||
@ -221,6 +234,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}" />
|
||||
@ -283,6 +300,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>
|
||||
@ -302,5 +323,6 @@
|
||||
<Setter Property="Background" Value="{DynamicResource ComboBoxItemSelectedPointeroverBackground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
|
@ -26,7 +26,7 @@
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
BoxShadow="{DynamicResource MenuFlyoutBorderBoxShadow}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<ScrollViewer Theme="{DynamicResource MenuScrollViewer}">
|
||||
<ScrollViewer Theme="{DynamicResource MenuScrollViewer}" CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<ItemsPresenter
|
||||
Name="PART_ItemsPresenter"
|
||||
Grid.IsSharedSizeScope="True"
|
||||
|
@ -170,8 +170,7 @@
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
FontWeight="{TemplateBinding FontWeight}"
|
||||
Text="day" />
|
||||
FontWeight="{TemplateBinding FontWeight}" />
|
||||
<TextBlock
|
||||
Name="PART_MonthTextBlock"
|
||||
Padding="12,4"
|
||||
@ -179,7 +178,6 @@
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
FontWeight="{TemplateBinding FontWeight}"
|
||||
Text="month"
|
||||
TextAlignment="Left" />
|
||||
<TextBlock
|
||||
Name="PART_YearTextBlock"
|
||||
@ -188,8 +186,7 @@
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
FontWeight="{TemplateBinding FontWeight}"
|
||||
Text="year" />
|
||||
FontWeight="{TemplateBinding FontWeight}" />
|
||||
<Rectangle
|
||||
x:Name="PART_FirstSpacer"
|
||||
Grid.Column="1"
|
||||
|
@ -88,7 +88,6 @@
|
||||
|
||||
<Style Selector="^:disabled">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultDisabledBorderBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ButtonDefaultDisabledBackground}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
|
||||
</Style>
|
||||
|
||||
@ -235,7 +234,37 @@
|
||||
|
||||
<Style Selector="^:disabled">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultDisabledBorderBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ButtonDefaultDisabledBackground}" />
|
||||
<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}" />
|
||||
</Style>
|
||||
<Style Selector="^:disabled">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
@ -131,13 +131,13 @@
|
||||
<ColumnDefinition Width="200" SharedSizeGroup="Size" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<GridSplitter Grid.Column="1" Width="1" />
|
||||
<TextBlock Grid.Column="2" Text="Name" />
|
||||
<TextBlock Grid.Column="2" Text="{DynamicResource STRING_CHOOSER_NAME_COLUMN}" />
|
||||
<GridSplitter Grid.Column="3" Width="1" />
|
||||
<TextBlock Grid.Column="4" Text="Date Modified" />
|
||||
<TextBlock Grid.Column="4" Text="{DynamicResource STRING_CHOOSER_DATEMODIFIED_COLUMN}" />
|
||||
<GridSplitter Grid.Column="5" Width="1" />
|
||||
<TextBlock Grid.Column="6" Text="Type" />
|
||||
<TextBlock Grid.Column="6" Text="{DynamicResource STRING_CHOOSER_TYPE_COLUMN}" />
|
||||
<GridSplitter Grid.Column="7" Width="1" />
|
||||
<TextBlock Grid.Column="8" Text="Size" />
|
||||
<TextBlock Grid.Column="8" Text="{DynamicResource STRING_CHOOSER_SIZE_COLUMN}" />
|
||||
</Grid>
|
||||
<ListBox
|
||||
Name="PART_Files"
|
||||
|
@ -10,6 +10,9 @@
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="ScrollViewer">
|
||||
<Border
|
||||
ClipToBounds="True"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<DockPanel>
|
||||
<DockPanel.Styles>
|
||||
<Style Selector="RepeatButton:pressed">
|
||||
@ -26,11 +29,14 @@
|
||||
DockPanel.Dock="Top"
|
||||
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}" />
|
||||
<MultiBinding
|
||||
Converter="{x:Static converters:MenuScrollingVisibilityConverter.Instance}"
|
||||
ConverterParameter="0">
|
||||
<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
|
||||
@ -49,11 +55,14 @@
|
||||
DockPanel.Dock="Bottom"
|
||||
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}" />
|
||||
<MultiBinding
|
||||
Converter="{x:Static converters:MenuScrollingVisibilityConverter.Instance}"
|
||||
ConverterParameter="100">
|
||||
<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
|
||||
@ -77,6 +86,7 @@
|
||||
</ScrollContentPresenter.GestureRecognizers>
|
||||
</ScrollContentPresenter>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
@ -147,6 +157,7 @@
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Content="{TemplateBinding Header}"
|
||||
ContentTemplate="{TemplateBinding HeaderTemplate}"
|
||||
RecognizesAccessKey="True" />
|
||||
<TextBlock
|
||||
x:Name="PART_InputGestureText"
|
||||
@ -190,7 +201,7 @@
|
||||
BorderThickness="{DynamicResource MenuFlyoutBorderThickness}"
|
||||
BoxShadow="{DynamicResource MenuFlyoutBorderBoxShadow}"
|
||||
CornerRadius="{DynamicResource MenuFlyoutCornerRadius}">
|
||||
<ScrollViewer Theme="{StaticResource MenuScrollViewer}">
|
||||
<ScrollViewer Theme="{StaticResource MenuScrollViewer}" CornerRadius="{DynamicResource MenuFlyoutCornerRadius}">
|
||||
<ItemsPresenter
|
||||
Name="PART_ItemsPresenter"
|
||||
Grid.IsSharedSizeScope="True"
|
||||
@ -267,6 +278,7 @@
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Content="{TemplateBinding Header}"
|
||||
ContentTemplate="{TemplateBinding HeaderTemplate}"
|
||||
RecognizesAccessKey="True" />
|
||||
<Popup
|
||||
Name="PART_Popup"
|
||||
@ -292,7 +304,7 @@
|
||||
BorderThickness="{DynamicResource MenuFlyoutBorderThickness}"
|
||||
BoxShadow="{DynamicResource MenuFlyoutBorderBoxShadow}"
|
||||
CornerRadius="{DynamicResource MenuFlyoutCornerRadius}">
|
||||
<ScrollViewer Theme="{StaticResource MenuScrollViewer}">
|
||||
<ScrollViewer Theme="{StaticResource MenuScrollViewer}" CornerRadius="{DynamicResource MenuFlyoutCornerRadius}">
|
||||
<ItemsPresenter
|
||||
Name="PART_ItemsPresenter"
|
||||
Grid.IsSharedSizeScope="True"
|
||||
|
@ -2,7 +2,21 @@
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:CompileBindings="True">
|
||||
<!-- Add Resources Here -->
|
||||
<Design.PreviewWith>
|
||||
<ThemeVariantScope RequestedThemeVariant="Dark">
|
||||
<MenuFlyoutPresenter>
|
||||
<MenuFlyoutPresenter.Items>
|
||||
<MenuItem Header="Menu Item 1" />
|
||||
<MenuItem Header="Menu Item 2" />
|
||||
<MenuItem Header="Menu Item 3" />
|
||||
<MenuItem Header="Menu Item 4" />
|
||||
<MenuItem Header="Menu Item 5" />
|
||||
<MenuItem Header="Menu Item 6" />
|
||||
</MenuFlyoutPresenter.Items>
|
||||
</MenuFlyoutPresenter>
|
||||
</ThemeVariantScope>
|
||||
</Design.PreviewWith>
|
||||
|
||||
<ControlTheme x:Key="{x:Type MenuFlyoutPresenter}" TargetType="MenuFlyoutPresenter">
|
||||
<Setter Property="MenuFlyoutPresenter.Background" Value="{DynamicResource MenuFlyoutBackground}" />
|
||||
<Setter Property="MenuFlyoutPresenter.BorderBrush" Value="{DynamicResource MenuFlyoutBorderBrush}" />
|
||||
@ -23,12 +37,13 @@
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
BoxShadow="{DynamicResource MenuFlyoutBorderBoxShadow}"
|
||||
ClipToBounds="False"
|
||||
ClipToBounds="True"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
UseLayoutRounding="False">
|
||||
<ScrollViewer
|
||||
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
||||
Theme="{StaticResource MenuScrollViewer}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
||||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
|
||||
<ItemsPresenter
|
||||
Name="PART_ItemsPresenter"
|
||||
|
@ -3,65 +3,69 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:CompileBindings="True">
|
||||
<Design.PreviewWith>
|
||||
<ThemeVariantScope RequestedThemeVariant="Dark">
|
||||
<StackPanel>
|
||||
<NotificationCard />
|
||||
<NotificationCard>
|
||||
<TextBlock Text="Hello World" />
|
||||
Hello, Semi.Avalonia!
|
||||
</NotificationCard>
|
||||
</StackPanel>
|
||||
</ThemeVariantScope>
|
||||
</Design.PreviewWith>
|
||||
<ControlTheme x:Key="{x:Type NotificationCard}" TargetType="NotificationCard">
|
||||
<Setter Property="UseLayoutRounding" Value="True" />
|
||||
<Setter Property="MinWidth" Value="{DynamicResource NotificationCardWidth}" />
|
||||
<Setter Property="FontSize" Value="14" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource NotificationCardForeground}" />
|
||||
<Setter Property="RenderTransformOrigin" Value="50%,75%" />
|
||||
<Setter Property="BorderThickness" Value="{DynamicResource NotificationCardBorderThickness}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource NotificationCardBorderBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource NotificationCardBackground}" />
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource NotificationCardCornerRadius}" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="NotificationCard">
|
||||
<LayoutTransformControl Name="PART_LayoutTransformControl" UseRenderTransform="True">
|
||||
<Border
|
||||
Margin="8"
|
||||
BoxShadow="{DynamicResource NotificationCardBoxShadows}"
|
||||
Margin="{DynamicResource NotificationCardMargin}"
|
||||
Background="{TemplateBinding Background}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<Border
|
||||
Background="{TemplateBinding Background}"
|
||||
x:Name="PART_RootBorder"
|
||||
Padding="{DynamicResource NotificationCardPadding}"
|
||||
BoxShadow="{DynamicResource NotificationCardBoxShadows}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
ClipToBounds="True"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<DockPanel>
|
||||
<DockPanel MinWidth="{DynamicResource NotificationCardMinWidth}">
|
||||
<PathIcon
|
||||
Name="NotificationIcon"
|
||||
Width="16"
|
||||
Height="16"
|
||||
Margin="16,16,12,0"
|
||||
Width="{DynamicResource NotificationCardIconWidth}"
|
||||
Height="{DynamicResource NotificationCardIconHeight}"
|
||||
Margin="{DynamicResource NotificationCardIconMargin}"
|
||||
VerticalAlignment="Top"
|
||||
IsVisible="False"
|
||||
Data="{DynamicResource NotificationCardInformationIconPathData}"/>
|
||||
Data="{DynamicResource NotificationCardInformationIconPathData}" />
|
||||
<ContentControl
|
||||
Name="PART_Content"
|
||||
MinHeight="64"
|
||||
Content="{TemplateBinding Content}">
|
||||
<ContentControl.DataTemplates>
|
||||
<DataTemplate DataType="INotification">
|
||||
<StackPanel Margin="0,8,8,8" Spacing="8">
|
||||
<TextBlock
|
||||
FontSize="16"
|
||||
FontWeight="600"
|
||||
<StackPanel Spacing="{DynamicResource NotificationCardTitleSpacing}">
|
||||
<SelectableTextBlock
|
||||
Foreground="{DynamicResource NotificationCardTitleForeground}"
|
||||
FontSize="{DynamicResource NotificationCardTitleFontSize}"
|
||||
FontWeight="{DynamicResource NotificationCardTitleFontWeight}"
|
||||
IsVisible="{Binding Title, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
|
||||
Text="{Binding Title}" />
|
||||
<TextBlock
|
||||
MaxHeight="80"
|
||||
Margin="0,0,8,0"
|
||||
FontSize="14"
|
||||
FontWeight="400"
|
||||
<SelectableTextBlock
|
||||
Foreground="{DynamicResource NotificationCardMessageForeground}"
|
||||
FontSize="{DynamicResource NotificationCardMessageFontSize}"
|
||||
FontWeight="{DynamicResource NotificationCardMessageFontWeight}"
|
||||
IsVisible="{Binding Message, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
|
||||
Text="{Binding Message}"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="x:String">
|
||||
<TextBlock
|
||||
Margin="12"
|
||||
<SelectableTextBlock
|
||||
Foreground="{DynamicResource NotificationCardMessageForeground}"
|
||||
FontSize="{DynamicResource NotificationCardMessageFontSize}"
|
||||
FontWeight="{DynamicResource NotificationCardMessageFontWeight}"
|
||||
Text="{Binding}"
|
||||
TextWrapping="Wrap" />
|
||||
</DataTemplate>
|
||||
|
@ -185,6 +185,10 @@
|
||||
<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>
|
||||
@ -411,6 +415,10 @@
|
||||
<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>
|
||||
|
@ -39,7 +39,11 @@
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<Grid ColumnDefinitions="Auto,*">
|
||||
<Grid Margin="{DynamicResource RadioButtonIconMargin}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
|
||||
<Grid
|
||||
Grid.Column="0"
|
||||
TemplatedControl.IsTemplateFocusTarget="True"
|
||||
Margin="{DynamicResource RadioButtonIconMargin}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
|
||||
<Ellipse
|
||||
Name="OuterEllipse"
|
||||
Width="{DynamicResource RadioButtonIconRadius}"
|
||||
|
@ -71,7 +71,6 @@
|
||||
|
||||
<Style Selector="^:disabled">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultDisabledBorderBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ButtonDefaultDisabledBackground}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
|
||||
</Style>
|
||||
|
||||
@ -172,7 +171,37 @@
|
||||
|
||||
<Style Selector="^:disabled">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultDisabledBorderBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ButtonDefaultDisabledBackground}" />
|
||||
<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="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
@ -124,9 +124,12 @@
|
||||
<Setter Property="Padding" Value="{DynamicResource ButtonSmallPadding}" />
|
||||
</Style>
|
||||
<Style Selector="^:disabled /template/ Button">
|
||||
<Setter Property="Background" Value="{DynamicResource ButtonDefaultDisabledBackground}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
|
||||
</Style>
|
||||
<!-- only for ToggleSplitButton -->
|
||||
<Style Selector="^:checked:disabled /template/ Button">
|
||||
<Setter Property="Background" Value="{DynamicResource ButtonSolidDisabledBackground}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme
|
||||
@ -206,7 +209,37 @@
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:disabled /template/ Button">
|
||||
<Setter Property="Background" Value="{DynamicResource ButtonDefaultDisabledBackground}" />
|
||||
<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="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
@ -24,29 +24,6 @@
|
||||
</MenuFlyout>
|
||||
|
||||
<ControlTheme x:Key="{x:Type TextBox}" TargetType="TextBox">
|
||||
<ControlTheme.Resources>
|
||||
<ControlTheme x:Key="InputToggleButton" TargetType="ToggleButton">
|
||||
<Setter Property="ToggleButton.Foreground" Value="{DynamicResource TextBoxButtonDefaultForeground}" />
|
||||
<Setter Property="ToggleButton.Cursor" Value="Hand" />
|
||||
<Setter Property="ToggleButton.Template">
|
||||
<ControlTemplate TargetType="ToggleButton">
|
||||
<!-- Background must be transparent or hit test will fail -->
|
||||
<Panel Background="Transparent">
|
||||
<PathIcon
|
||||
Width="16"
|
||||
Height="16"
|
||||
Data="{DynamicResource PasswordBoxRevealButtonData}"
|
||||
IsVisible="{Binding $parent[ToggleButton].IsChecked, Converter={x:Static BoolConverters.Not}}" />
|
||||
<PathIcon
|
||||
Width="16"
|
||||
Height="16"
|
||||
Data="{DynamicResource PasswordBoxHideButtonData}"
|
||||
IsVisible="{Binding $parent[ToggleButton].IsChecked}" />
|
||||
</Panel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
</ControlTheme.Resources>
|
||||
<Setter Property="TextBox.Foreground" Value="{DynamicResource TextBoxForeground}" />
|
||||
<Setter Property="TextBox.Background" Value="{DynamicResource TextBoxDefaultBackground}" />
|
||||
<Setter Property="TextBox.BorderBrush" Value="{DynamicResource TextBoxDefaultBorderBrush}" />
|
||||
@ -97,8 +74,8 @@
|
||||
TextWrapping="{TemplateBinding TextWrapping}">
|
||||
<TextBlock.IsVisible>
|
||||
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
||||
<Binding ElementName="PART_TextPresenter" Path="PreeditText" Converter="{x:Static StringConverters.IsNullOrEmpty}"/>
|
||||
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Text" Converter="{x:Static StringConverters.IsNullOrEmpty}"/>
|
||||
<Binding ElementName="PART_TextPresenter" Path="PreeditText" Converter="{x:Static StringConverters.IsNullOrEmpty}" />
|
||||
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Text" Converter="{x:Static StringConverters.IsNullOrEmpty}" />
|
||||
</MultiBinding>
|
||||
</TextBlock.IsVisible>
|
||||
</TextBlock>
|
||||
@ -115,8 +92,7 @@
|
||||
SelectionEnd="{TemplateBinding SelectionEnd}"
|
||||
SelectionForegroundBrush="{TemplateBinding SelectionForegroundBrush}"
|
||||
SelectionStart="{TemplateBinding SelectionStart}"
|
||||
Text="{TemplateBinding Text,
|
||||
Mode=TwoWay}"
|
||||
Text="{TemplateBinding Text, Mode=TwoWay}"
|
||||
TextAlignment="{TemplateBinding TextAlignment}"
|
||||
TextWrapping="{TemplateBinding TextWrapping}" />
|
||||
</Panel>
|
||||
@ -132,8 +108,7 @@
|
||||
Name="PART_RevealButton"
|
||||
Grid.Column="3"
|
||||
Margin="4,0,0,0"
|
||||
IsChecked="{TemplateBinding RevealPassword,
|
||||
Mode=TwoWay}"
|
||||
IsChecked="{TemplateBinding RevealPassword, Mode=TwoWay}"
|
||||
IsVisible="False"
|
||||
Theme="{StaticResource InputToggleButton}" />
|
||||
<ContentPresenter
|
||||
@ -240,6 +215,13 @@
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.TextArea">
|
||||
<Setter Property="AcceptsReturn" Value="True" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Top" />
|
||||
<Setter Property="Padding" Value="{DynamicResource TextBoxTextAreaContentPadding}" />
|
||||
<Setter Property="MinHeight" Value="{DynamicResource TextBoxTextAreaHeight}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="NonErrorTextBox" TargetType="TextBox">
|
||||
@ -269,7 +251,7 @@
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<Grid Margin="{TemplateBinding Padding}" ColumnDefinitions="Auto, *">
|
||||
<Grid Margin="{TemplateBinding Padding}" ColumnDefinitions="Auto, *, Auto, Auto, Auto">
|
||||
<ContentPresenter
|
||||
Grid.Column="0"
|
||||
Padding="{DynamicResource TextBoxInnerLeftContentPadding}"
|
||||
@ -288,12 +270,17 @@
|
||||
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}" />
|
||||
TextWrapping="{TemplateBinding TextWrapping}">
|
||||
<TextBlock.IsVisible>
|
||||
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
||||
<Binding ElementName="PART_TextPresenter" Path="PreeditText" Converter="{x:Static StringConverters.IsNullOrEmpty}" />
|
||||
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Text" Converter="{x:Static StringConverters.IsNullOrEmpty}" />
|
||||
</MultiBinding>
|
||||
</TextBlock.IsVisible>
|
||||
</TextBlock>
|
||||
<TextPresenter
|
||||
Name="PART_TextPresenter"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
@ -307,12 +294,32 @@
|
||||
SelectionEnd="{TemplateBinding SelectionEnd}"
|
||||
SelectionForegroundBrush="{TemplateBinding SelectionForegroundBrush}"
|
||||
SelectionStart="{TemplateBinding SelectionStart}"
|
||||
Text="{TemplateBinding Text,
|
||||
Mode=TwoWay}"
|
||||
Text="{TemplateBinding Text, Mode=TwoWay}"
|
||||
TextAlignment="{TemplateBinding TextAlignment}"
|
||||
TextWrapping="{TemplateBinding TextWrapping}" />
|
||||
</Panel>
|
||||
</ScrollViewer>
|
||||
<Button
|
||||
Name="PART_ClearButton"
|
||||
Grid.Column="2"
|
||||
Command="{Binding $parent[TextBox].Clear}"
|
||||
Content="{DynamicResource IconButtonClearData}"
|
||||
IsVisible="False"
|
||||
Theme="{StaticResource InnerIconButton}" />
|
||||
<ToggleButton
|
||||
Name="PART_RevealButton"
|
||||
Grid.Column="3"
|
||||
Margin="4,0,0,0"
|
||||
IsChecked="{TemplateBinding RevealPassword, Mode=TwoWay}"
|
||||
IsVisible="False"
|
||||
Theme="{StaticResource InputToggleButton}" />
|
||||
<ContentPresenter
|
||||
Grid.Column="4"
|
||||
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>
|
||||
@ -354,5 +361,98 @@
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsSelectedBorderBrush}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.clearButton, ^.ClearButton">
|
||||
<Style
|
||||
Selector="^[AcceptsReturn=False][IsReadOnly=False]:focus:not(:empty) /template/ Button#PART_ClearButton">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
<Style
|
||||
Selector="^[AcceptsReturn=False][IsReadOnly=False]:pointerover:not(:empty) /template/ Button#PART_ClearButton">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^.revealPasswordButton, ^.RevealPasswordButton">
|
||||
<Style Selector="^ /template/ ToggleButton#PART_RevealButton">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^.Large /template/ Border#PART_ContentPresenterBorder">
|
||||
<Setter Property="MinHeight" Value="{DynamicResource TextBoxWrapperLargeHeight}" />
|
||||
</Style>
|
||||
<Style Selector="^.Small /template/ Border#PART_ContentPresenterBorder">
|
||||
<Setter Property="MinHeight" Value="{DynamicResource TextBoxWrapperSmallHeight}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.Bordered">
|
||||
<Setter Property="Background" Value="{DynamicResource TextBoxBorderedDefaultBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource TextBoxBorderedDefaultBorderBrush}" />
|
||||
<Style Selector="^:pointerover /template/ Border#PART_ContentPresenterBorder">
|
||||
<Setter Property="Background" Value="{DynamicResource TextBoxBorderedPointeroverBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource TextBoxBorderedPointeroverBorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:focus">
|
||||
<Setter Property="Background" Value="{DynamicResource TextBoxBorderedPointeroverBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource TextBoxBorderedPointeroverBorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:disabled /template/ Border#PART_ContentPresenterBorder">
|
||||
<Setter Property="TextBox.Background" Value="{DynamicResource TextBoxDisabledBackground}" />
|
||||
<Setter Property="TextBox.BorderBrush" Value="{DynamicResource TextBoxDisabledBorderBrush}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:error">
|
||||
<Style Selector="^ /template/ Border#PART_ContentPresenterBorder">
|
||||
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsBorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:pointerover /template/ Border#PART_ContentPresenterBorder">
|
||||
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointerOverBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsPointerOverBorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed /template/ Border#PART_ContentPresenterBorder">
|
||||
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPressedBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsPressedBorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:focus /template/ Border#PART_ContentPresenterBorder">
|
||||
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsSelectedBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsSelectedBorderBrush}" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.TextArea">
|
||||
<Setter Property="AcceptsReturn" Value="True" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Top" />
|
||||
<Setter Property="Padding" Value="{DynamicResource TextBoxTextAreaContentPadding}" />
|
||||
<Setter Property="MinHeight" Value="{DynamicResource TextBoxTextAreaHeight}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="InputToggleButton" TargetType="ToggleButton">
|
||||
<Setter Property="ToggleButton.Foreground" Value="{DynamicResource ButtonInputInnerForeground}" />
|
||||
<Setter Property="ToggleButton.Cursor" Value="Hand" />
|
||||
<Setter Property="ToggleButton.Template">
|
||||
<ControlTemplate TargetType="ToggleButton">
|
||||
<!-- Background must be transparent or hit test will fail -->
|
||||
<Panel Background="Transparent">
|
||||
<PathIcon
|
||||
Width="16"
|
||||
Height="16"
|
||||
Data="{DynamicResource PasswordBoxRevealButtonData}"
|
||||
IsVisible="{Binding $parent[ToggleButton].IsChecked, Converter={x:Static BoolConverters.Not}}" />
|
||||
<PathIcon
|
||||
Width="16"
|
||||
Height="16"
|
||||
Data="{DynamicResource PasswordBoxHideButtonData}"
|
||||
IsVisible="{Binding $parent[ToggleButton].IsChecked}" />
|
||||
</Panel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonInputInnerPointeroverForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonInputInnerPressedForeground}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
@ -67,6 +67,7 @@
|
||||
|
||||
<Style Selector="^:disabled">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonDefaultDisabledBorderBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ToggleButtonDefaultBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.Primary">
|
||||
@ -153,6 +154,7 @@
|
||||
</Style>
|
||||
<Style Selector="^:disabled">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonDefaultDisabledBorderBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ToggleButtonCheckedDisabledBackground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
@ -242,12 +244,12 @@
|
||||
</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">
|
||||
|
@ -15,6 +15,13 @@
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="FocusAdorner">
|
||||
<FocusAdornerTemplate>
|
||||
<Border BorderThickness="{DynamicResource AdornerLayerBorderThickness}"
|
||||
BorderBrush="{DynamicResource AdornerLayerStroke}"
|
||||
CornerRadius="100"/>
|
||||
</FocusAdornerTemplate>
|
||||
</Setter>
|
||||
<Setter Property="KnobTransitions">
|
||||
<Transitions>
|
||||
<DoubleTransition
|
||||
@ -28,81 +35,99 @@
|
||||
<Grid
|
||||
Background="{TemplateBinding Background}"
|
||||
Cursor="Hand"
|
||||
RowDefinitions="Auto,*">
|
||||
RowDefinitions="Auto,*"
|
||||
ColumnDefinitions="Auto, *">
|
||||
<ContentPresenter
|
||||
x:Name="PART_ContentPresenter"
|
||||
Grid.Row="0"
|
||||
Grid.Row="0" Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Margin="{DynamicResource ToggleSwitchHeaderMargin}"
|
||||
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"
|
||||
Background="Transparent"
|
||||
ColumnDefinitions="Auto, *">
|
||||
<Grid
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
TemplatedControl.IsTemplateFocusTarget="True" />
|
||||
|
||||
<Border
|
||||
Name="SwitchBackgroundBorder"
|
||||
Grid.Column="0"
|
||||
Width="40"
|
||||
Height="20"
|
||||
x:Name="SwitchBackgroundBorder"
|
||||
Grid.Row="1" Grid.Column="0"
|
||||
TemplatedControl.IsTemplateFocusTarget="True"
|
||||
Width="{DynamicResource ToggleSwitchDefaultWidth}"
|
||||
Height="{DynamicResource ToggleSwitchDefaultHeight}"
|
||||
CornerRadius="100">
|
||||
<Border.Transitions>
|
||||
<Transitions>
|
||||
<BrushTransition Property="Background" Duration="0:0:0.2" />
|
||||
</Transitions>
|
||||
</Border.Transitions>
|
||||
</Border>
|
||||
<Canvas
|
||||
x:Name="PART_SwitchKnob"
|
||||
Grid.Column="0"
|
||||
Width="20"
|
||||
Height="20"
|
||||
Width="{DynamicResource ToggleSwitchIndicatorDefaultWidth}"
|
||||
Height="{DynamicResource ToggleSwitchIndicatorDefaultWidth}"
|
||||
HorizontalAlignment="Left">
|
||||
<Grid
|
||||
x:Name="PART_MovingKnobs"
|
||||
Width="20"
|
||||
Height="20">
|
||||
Width="{DynamicResource ToggleSwitchIndicatorDefaultWidth}"
|
||||
Height="{DynamicResource ToggleSwitchIndicatorDefaultWidth}"
|
||||
Margin="{DynamicResource ToggleSwitchIndicatorDefaultMargin}">
|
||||
<Border
|
||||
x:Name="SwitchKnobIndicator"
|
||||
Width="14"
|
||||
Height="14"
|
||||
Background="White"
|
||||
BorderBrush="{DynamicResource ToggleSwitchIndicatorBorderBrush}"
|
||||
BorderThickness="0.5"
|
||||
BoxShadow="0 0 1 1 #222E3238"
|
||||
CornerRadius="100" />
|
||||
<Arc
|
||||
x:Name="SwitchKnobLoadingIndicator"
|
||||
IsVisible="False"
|
||||
StrokeThickness="2"
|
||||
StartAngle="0"
|
||||
SweepAngle="140"
|
||||
StrokeJoin="Round"
|
||||
StrokeLineCap="Round">
|
||||
<Arc.Stroke>
|
||||
<ConicGradientBrush>
|
||||
<GradientStops>
|
||||
<GradientStop Offset="0.1" Color="Transparent" />
|
||||
<GradientStop Offset="0.7" Color="White" />
|
||||
</GradientStops>
|
||||
</ConicGradientBrush>
|
||||
</Arc.Stroke>
|
||||
<Arc.Styles>
|
||||
<Style Selector="Arc[IsVisible=True]">
|
||||
<Style.Animations>
|
||||
<Animation IterationCount="Infinite" Duration="0:0:0.6">
|
||||
<KeyFrame Cue="0%">
|
||||
<Setter Property="RotateTransform.Angle" Value="0.0" />
|
||||
</KeyFrame>
|
||||
<KeyFrame Cue="100%">
|
||||
<Setter Property="RotateTransform.Angle" Value="360.0" />
|
||||
</KeyFrame>
|
||||
</Animation>
|
||||
</Style.Animations>
|
||||
</Style>
|
||||
</Arc.Styles>
|
||||
</Arc>
|
||||
</Grid>
|
||||
</Canvas>
|
||||
</Border>
|
||||
|
||||
<ContentPresenter
|
||||
x:Name="PART_OnContentPresenter"
|
||||
Grid.Column="1"
|
||||
Grid.Row="1" Grid.Column="1"
|
||||
Margin="{DynamicResource ToggleSwitchOnContentMargin}"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Content="{TemplateBinding OnContent}"
|
||||
ContentTemplate="{TemplateBinding OnContentTemplate}"
|
||||
IsVisible="True" />
|
||||
ContentTemplate="{TemplateBinding OnContentTemplate}" />
|
||||
<ContentPresenter
|
||||
x:Name="PART_OffContentPresenter"
|
||||
Grid.Column="1"
|
||||
Grid.Row="1" Grid.Column="1"
|
||||
Margin="{DynamicResource ToggleSwitchOnContentMargin}"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Content="{TemplateBinding OffContent}"
|
||||
ContentTemplate="{TemplateBinding OffContentTemplate}"
|
||||
IsVisible="False" />
|
||||
|
||||
</Grid>
|
||||
ContentTemplate="{TemplateBinding OffContentTemplate}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
@ -154,6 +179,58 @@
|
||||
<Setter Property="Background" Value="{DynamicResource ToggleSwitchContainerCheckedDisabledBackground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^.Loading">
|
||||
<Style Selector="^ /template/ Border#SwitchKnobIndicator">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Arc#SwitchKnobLoadingIndicator">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
<Style Selector="^:unchecked /template/ Border#SwitchBackgroundBorder">
|
||||
<Setter Property="Background" Value="{DynamicResource ToggleSwitchContainerUnCheckedPointeroverBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^:checked /template/ Border#SwitchBackgroundBorder">
|
||||
<Setter Property="Background" Value="{DynamicResource ToggleSwitchContainerCheckedPointeroverBackground}" />
|
||||
</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 Selector="^ /template/ Arc#SwitchKnobLoadingIndicator">
|
||||
<Setter Property="StrokeThickness" Value="{DynamicResource ToggleSwitchLoadingIndicatorSmallStrokeThickness}" />
|
||||
</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 Selector="^ /template/ Arc#SwitchKnobLoadingIndicator">
|
||||
<Setter Property="StrokeThickness" Value="{DynamicResource ToggleSwitchLoadingIndicatorLargeStrokeThickness}" />
|
||||
</Style>
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme
|
||||
@ -163,6 +240,12 @@
|
||||
<Setter Property="Padding" Value="8" />
|
||||
<Setter Property="CornerRadius" Value="3" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="FocusAdorner">
|
||||
<FocusAdornerTemplate>
|
||||
<Border BorderThickness="{DynamicResource AdornerLayerBorderThickness}"
|
||||
BorderBrush="{DynamicResource AdornerLayerStroke}" />
|
||||
</FocusAdornerTemplate>
|
||||
</Setter>
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="ToggleSwitch">
|
||||
<Border
|
||||
@ -171,9 +254,9 @@
|
||||
Background="{TemplateBinding Background}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Cursor="Hand">
|
||||
<Grid ColumnDefinitions="Auto">
|
||||
<Grid x:Name="PART_SwitchKnob" />
|
||||
<Grid x:Name="PART_MovingKnobs" />
|
||||
<Panel>
|
||||
<Panel x:Name="PART_SwitchKnob" />
|
||||
<Panel x:Name="PART_MovingKnobs" />
|
||||
<ContentPresenter
|
||||
x:Name="PART_OnContentPresenter"
|
||||
Margin="{DynamicResource ToggleSwitchOnContentMargin}"
|
||||
@ -184,7 +267,7 @@
|
||||
Margin="{DynamicResource ToggleSwitchOnContentMargin}"
|
||||
Content="{TemplateBinding OffContent}"
|
||||
ContentTemplate="{TemplateBinding OffContentTemplate}" />
|
||||
</Grid>
|
||||
</Panel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
@ -200,56 +283,110 @@
|
||||
x:Key="SimpleToggleSwitch"
|
||||
BasedOn="{StaticResource {x:Type ToggleSwitch}}"
|
||||
TargetType="ToggleSwitch">
|
||||
<Setter Property="OnContent" Value="{x:Null}" />
|
||||
<Setter Property="OffContent" Value="{x:Null}" />
|
||||
<Setter Property="FontSize" Value="{DynamicResource SimpleToggleSwitchFontSize}" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="ToggleSwitch">
|
||||
<Grid
|
||||
<Border
|
||||
x:Name="SwitchBackgroundBorder"
|
||||
Background="{TemplateBinding Background}"
|
||||
Cursor="Hand"
|
||||
RowDefinitions="*">
|
||||
<Grid
|
||||
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"
|
||||
Width="{DynamicResource ToggleSwitchDefaultWidth}"
|
||||
Height="{DynamicResource ToggleSwitchDefaultHeight}"
|
||||
CornerRadius="100">
|
||||
<Border.Transitions>
|
||||
<Transitions>
|
||||
<BrushTransition Property="Background" Duration="0:0:0.2" />
|
||||
</Transitions>
|
||||
</Border.Transitions>
|
||||
</Border>
|
||||
<Grid
|
||||
ColumnDefinitions="*,*">
|
||||
<Canvas
|
||||
x:Name="PART_SwitchKnob"
|
||||
Grid.Column="0"
|
||||
Width="20"
|
||||
Height="20"
|
||||
Grid.ColumnSpan="2"
|
||||
Width="{DynamicResource ToggleSwitchIndicatorDefaultWidth}"
|
||||
Height="{DynamicResource ToggleSwitchIndicatorDefaultWidth}"
|
||||
HorizontalAlignment="Left">
|
||||
<Grid
|
||||
x:Name="PART_MovingKnobs"
|
||||
Width="20"
|
||||
Height="20">
|
||||
Width="{DynamicResource ToggleSwitchIndicatorDefaultWidth}"
|
||||
Height="{DynamicResource ToggleSwitchIndicatorDefaultWidth}"
|
||||
Margin="{DynamicResource ToggleSwitchIndicatorDefaultMargin}">
|
||||
<Border
|
||||
x:Name="SwitchKnobIndicator"
|
||||
Width="14"
|
||||
Height="14"
|
||||
Background="White"
|
||||
BorderBrush="{DynamicResource ToggleSwitchIndicatorBorderBrush}"
|
||||
BorderThickness="0.5"
|
||||
BoxShadow="0 0 1 1 #222E3238"
|
||||
CornerRadius="100" />
|
||||
<Arc
|
||||
x:Name="SwitchKnobLoadingIndicator"
|
||||
IsVisible="False"
|
||||
StrokeThickness="2"
|
||||
StartAngle="0"
|
||||
SweepAngle="140"
|
||||
StrokeJoin="Round"
|
||||
StrokeLineCap="Round">
|
||||
<Arc.Stroke>
|
||||
<ConicGradientBrush>
|
||||
<GradientStops>
|
||||
<GradientStop Offset="0.1" Color="Transparent" />
|
||||
<GradientStop Offset="0.7" Color="White" />
|
||||
</GradientStops>
|
||||
</ConicGradientBrush>
|
||||
</Arc.Stroke>
|
||||
<Arc.Styles>
|
||||
<Style Selector="Arc[IsVisible=True]">
|
||||
<Style.Animations>
|
||||
<Animation IterationCount="Infinite" Duration="0:0:0.6">
|
||||
<KeyFrame Cue="0%">
|
||||
<Setter Property="RotateTransform.Angle" Value="0.0" />
|
||||
</KeyFrame>
|
||||
<KeyFrame Cue="100%">
|
||||
<Setter Property="RotateTransform.Angle" Value="360.0" />
|
||||
</KeyFrame>
|
||||
</Animation>
|
||||
</Style.Animations>
|
||||
</Style>
|
||||
</Arc.Styles>
|
||||
</Arc>
|
||||
</Grid>
|
||||
</Canvas>
|
||||
<ContentPresenter
|
||||
x:Name="PART_OnContentPresenter"
|
||||
Grid.Column="0"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Content="{TemplateBinding OnContent}"
|
||||
ContentTemplate="{TemplateBinding OnContentTemplate}" />
|
||||
<ContentPresenter
|
||||
x:Name="PART_OffContentPresenter"
|
||||
Grid.Column="1"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Content="{TemplateBinding OffContent}"
|
||||
ContentTemplate="{TemplateBinding OffContentTemplate}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
<Style Selector="^:unchecked">
|
||||
<Setter Property="Foreground" Value="{DynamicResource SimpleToggleSwitchContainerUnCheckedForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^:checked">
|
||||
<Setter Property="Foreground" Value="{DynamicResource SimpleToggleSwitchContainerCheckedForeground}" />
|
||||
</Style>
|
||||
<Style Selector="^.Small">
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_OnContentPresenter">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_OffContentPresenter">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
@ -21,6 +21,11 @@
|
||||
<Setter Property="HorizontalAlignment" Value="Right" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:topcenter /template/ ReversibleStackPanel#PART_Items">
|
||||
<Setter Property="VerticalAlignment" Value="Top" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:bottomleft /template/ ReversibleStackPanel#PART_Items">
|
||||
<Setter Property="ReverseOrder" Value="True" />
|
||||
<Setter Property="VerticalAlignment" Value="Bottom" />
|
||||
@ -32,5 +37,11 @@
|
||||
<Setter Property="VerticalAlignment" Value="Bottom" />
|
||||
<Setter Property="HorizontalAlignment" Value="Right" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:bottomcenter /template/ ReversibleStackPanel#PART_Items">
|
||||
<Setter Property="ReverseOrder" Value="True" />
|
||||
<Setter Property="VerticalAlignment" Value="Bottom" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
|
@ -3,6 +3,7 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:CompileBindings="True">
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/AdornerLayer.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/AutoCompleteBox.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/Border.axaml" />
|
||||
<ResourceInclude Source="avares://Semi.Avalonia/Controls/Button.axaml" />
|
||||
|
@ -1,10 +1,17 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
x:Class="Semi.Avalonia.Locale.en_us"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- TextBox/SelectableTextBox flyout -->
|
||||
<x:String x:Key="STRING_MENU_CUT">Cut</x:String>
|
||||
<x:String x:Key="STRING_MENU_COPY">Copy</x:String>
|
||||
<x:String x:Key="STRING_MENU_PASTE">Paste</x:String>
|
||||
<!-- ManagedFileChooser -->
|
||||
<x:String x:Key="STRING_CHOOSER_FILE_NAME">File name</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_SHOW_HIDDEN_FILES">Show hidden flies</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_DIALOG_OK">OK</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_DIALOG_CANCEL">Cancel</x:String>
|
||||
<x:String x:Key="STRING_MENU_CUT">Cut</x:String>
|
||||
<x:String x:Key="STRING_MENU_COPY">Copy</x:String>
|
||||
<x:String x:Key="STRING_MENU_PASTE">Paste</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_NAME_COLUMN">Name</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_DATEMODIFIED_COLUMN">Date Modified</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_TYPE_COLUMN">Type</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_SIZE_COLUMN">Size</x:String>
|
||||
</ResourceDictionary>
|
8
src/Semi.Avalonia/Locale/en-us.axaml.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Semi.Avalonia.Locale;
|
||||
|
||||
public class en_us: ResourceDictionary
|
||||
{
|
||||
|
||||
}
|
17
src/Semi.Avalonia/Locale/ja-jp.axaml
Normal file
@ -0,0 +1,17 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
x:Class="Semi.Avalonia.Locale.ja_jp"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- TextBox/SelectableTextBox flyout -->
|
||||
<x:String x:Key="STRING_MENU_CUT">切り取り</x:String>
|
||||
<x:String x:Key="STRING_MENU_COPY">コピー</x:String>
|
||||
<x:String x:Key="STRING_MENU_PASTE">貼り付け</x:String>
|
||||
<!-- ManagedFileChooser -->
|
||||
<x:String x:Key="STRING_CHOOSER_FILE_NAME">ファイル名</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_SHOW_HIDDEN_FILES">隠しファイルを表示</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_DIALOG_OK">確認</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_DIALOG_CANCEL">キャンセル</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_NAME_COLUMN">名前</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_DATEMODIFIED_COLUMN">更新日時</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_TYPE_COLUMN">種類</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_SIZE_COLUMN">サイズ</x:String>
|
||||
</ResourceDictionary>
|
8
src/Semi.Avalonia/Locale/ja-jp.axaml.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Semi.Avalonia.Locale;
|
||||
|
||||
public class ja_jp: ResourceDictionary
|
||||
{
|
||||
|
||||
}
|
17
src/Semi.Avalonia/Locale/ru-ru.axaml
Normal file
@ -0,0 +1,17 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
x:Class="Semi.Avalonia.Locale.ru_ru"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- TextBox/SelectableTextBox flyout -->
|
||||
<x:String x:Key="STRING_MENU_CUT">Вырезать</x:String>
|
||||
<x:String x:Key="STRING_MENU_COPY">Копировать</x:String>
|
||||
<x:String x:Key="STRING_MENU_PASTE">Вставить</x:String>
|
||||
<!-- ManagedFileChooser -->
|
||||
<x:String x:Key="STRING_CHOOSER_FILE_NAME">Имя файла</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_SHOW_HIDDEN_FILES">Показать скрытые файлы</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_DIALOG_OK">OK</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_DIALOG_CANCEL">Отмена</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_NAME_COLUMN">Имя</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_DATEMODIFIED_COLUMN">Дата изменения</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_TYPE_COLUMN">Тип</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_SIZE_COLUMN">Размер</x:String>
|
||||
</ResourceDictionary>
|
8
src/Semi.Avalonia/Locale/ru-ru.axaml.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Semi.Avalonia.Locale;
|
||||
|
||||
public class ru_ru : ResourceDictionary
|
||||
{
|
||||
|
||||
}
|
@ -1,10 +1,17 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
x:Class="Semi.Avalonia.Locale.zh_cn"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- TextBox/SelectableTextBox flyout -->
|
||||
<x:String x:Key="STRING_MENU_CUT">剪切</x:String>
|
||||
<x:String x:Key="STRING_MENU_COPY">复制</x:String>
|
||||
<x:String x:Key="STRING_MENU_PASTE">粘贴</x:String>
|
||||
<!-- ManagedFileChooser -->
|
||||
<x:String x:Key="STRING_CHOOSER_FILE_NAME">文件名</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_SHOW_HIDDEN_FILES">显示隐藏文件</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_DIALOG_OK">确认</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_DIALOG_CANCEL">取消</x:String>
|
||||
<x:String x:Key="STRING_MENU_CUT">剪切</x:String>
|
||||
<x:String x:Key="STRING_MENU_COPY">复制</x:String>
|
||||
<x:String x:Key="STRING_MENU_PASTE">粘贴</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_NAME_COLUMN">名称</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_DATEMODIFIED_COLUMN">修改日期</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_TYPE_COLUMN">类型</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_SIZE_COLUMN">大小</x:String>
|
||||
</ResourceDictionary>
|
8
src/Semi.Avalonia/Locale/zh-cn.axaml.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Semi.Avalonia.Locale;
|
||||
|
||||
public class zh_cn: ResourceDictionary
|
||||
{
|
||||
|
||||
}
|
@ -4,7 +4,11 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<Title>Semi.Avalonia</Title>
|
||||
<PackageReleaseNotes>Update to 11.0.7</PackageReleaseNotes>
|
||||
<PackageReleaseNotes>Update to 11.0.7.7</PackageReleaseNotes>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
|
||||
<IsAotCompatible>true</IsAotCompatible>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
3
src/Semi.Avalonia/Themes/Dark/AdornerLayer.axaml
Normal file
@ -0,0 +1,3 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<SolidColorBrush x:Key="AdornerLayerStroke" Opacity="0.4" Color="#54A9FF" />
|
||||
</ResourceDictionary>
|
@ -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="AutoCompleteBoxPopupBackground" Color="#43444A" />
|
||||
<SolidColorBrush x:Key="AutoCompleteBoxPopupBorderBrush" Opacity="0.08" Color="White" />
|
||||
</ResourceDictionary>
|
@ -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>
|
@ -2,7 +2,7 @@
|
||||
<!-- Light -->
|
||||
<SolidColorBrush x:Key="ButtonDefaultPrimaryForeground" Color="#54A9FF" />
|
||||
<SolidColorBrush x:Key="ButtonDefaultSecondaryForeground" Color="#40B4F3" />
|
||||
<SolidColorBrush x:Key="ButtonDefaultTertiaryForeground" Color="#888D92" />
|
||||
<SolidColorBrush x:Key="ButtonDefaultTertiaryForeground" Opacity="0.8" Color="#F9F9F9" />
|
||||
<SolidColorBrush x:Key="ButtonDefaultSuccessForeground" Color="#5DC264" />
|
||||
<SolidColorBrush x:Key="ButtonDefaultWarningForeground" Color="#FFAE43" />
|
||||
<SolidColorBrush x:Key="ButtonDefaultDangerForeground" Color="#FC725A" />
|
||||
@ -11,7 +11,6 @@
|
||||
<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" />
|
||||
@ -69,9 +68,21 @@
|
||||
<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 -->
|
||||
|
||||
<SolidColorBrush x:Key="ButtonInputInnerForeground" Color="#888D92" />
|
||||
<SolidColorBrush x:Key="ButtonInputInnerPointeroverForeground" Color="#A7ABB0" />
|
||||
<SolidColorBrush x:Key="ButtonInputInnerPressedForeground" Color="#C6CACD" />
|
||||
<!-- 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" Opacity="0.6" Color="#F9F9F9" />
|
||||
<SolidColorBrush x:Key="ButtonInputInnerPointeroverForeground" Color="#7FC1FF" />
|
||||
<SolidColorBrush x:Key="ButtonInputInnerPressedForeground" Color="#A9D7FF" />
|
||||
</ResourceDictionary>
|
@ -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>
|
@ -1,17 +1,17 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<SolidColorBrush x:Key="CalendarBackground" Color="#232429" />
|
||||
<SolidColorBrush x:Key="CalendarBackground" Color="#43444A" />
|
||||
<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" />
|
||||
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarButtonBackground" Color="#232429" />
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarButtonBackground" Color="#43444A" />
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarButtonForeground" Color="#F9F9F9" />
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarButtonBorderBrush" Color="Transparent" />
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarButtonPointeroverBackground" Opacity="0.16" Color="White" />
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarButtonPressedBackground" Opacity="0.20" Color="White" />
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarButtonSelectedBackground" Color="#54A9FF" />
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarButtonSelectedForeground" Color="#232429" />
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarButtonSelectedForeground" Color="#43444A" />
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarButtonDisabledForeground" Opacity="0.35" Color="#F9F9F9" />
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarButtonBlackoutForeground" Opacity="0.35" Color="#F9F9F9" />
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarButtonInactiveForeground" Opacity="0.65" Color="#F9F9F9" />
|
||||
@ -24,7 +24,7 @@
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonPressedBackground" Opacity="0.20" Color="White" />
|
||||
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonSelectedBackground" Color="#54A9FF" />
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonSelectedForeground" Color="#232429" />
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonSelectedForeground" Color="#43444A" />
|
||||
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonTodayForeground" Color="#54A9FF" />
|
||||
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonTodayBackground" Opacity="0.12" Color="White" />
|
||||
|
@ -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" />
|
||||
<SolidColorBrush x:Key="CalendarDatePickerBorderedPointeroverBorderBrush" Color="#7FC1FF" />
|
||||
</ResourceDictionary>
|