Compare commits

..

1 Commits

Author SHA1 Message Date
Dong Bin
cf4705dbde misc:try 2025-04-30 17:09:15 +08:00
144 changed files with 1542 additions and 1445 deletions

View File

@@ -24,6 +24,9 @@ jobs:
- name: Publish .NET Project - name: Publish .NET Project
run: dotnet publish $PROJECT_PATH -c 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
- name: copy index.html to 404.html - name: copy index.html to 404.html
run: cp $OUTPUT_PATH/index.html $OUTPUT_PATH/404.html run: cp $OUTPUT_PATH/index.html $OUTPUT_PATH/404.html

View File

@@ -45,29 +45,29 @@ jobs:
- name: Pack Semi.Avalonia - name: Pack Semi.Avalonia
if: ${{ github.event.inputs.Semi_Avalonia == 'true' }} if: ${{ github.event.inputs.Semi_Avalonia == 'true' }}
run: dotnet pack src/Semi.Avalonia -o nugets /p:Version=${{ env.VERSION }} run: dotnet pack ./src/Semi.Avalonia -o ./nugets /p:Version=${{ env.VERSION }}
- name: Pack Semi.Avalonia.ColorPicker - name: Pack Semi.Avalonia.ColorPicker
if: ${{ github.event.inputs.Semi_Avalonia_ColorPicker == 'true' }} if: ${{ github.event.inputs.Semi_Avalonia_ColorPicker == 'true' }}
run: dotnet pack src/Semi.Avalonia.ColorPicker -o nugets /p:Version=${{ env.VERSION }} run: dotnet pack ./src/Semi.Avalonia.ColorPicker -o ./nugets /p:Version=${{ env.VERSION }}
- name: Pack Semi.Avalonia.DataGrid - name: Pack Semi.Avalonia.DataGrid
if: ${{ github.event.inputs.Semi_Avalonia_DataGrid == 'true' }} if: ${{ github.event.inputs.Semi_Avalonia_DataGrid == 'true' }}
run: dotnet pack src/Semi.Avalonia.DataGrid -o nugets /p:Version=${{ env.VERSION }} run: dotnet pack ./src/Semi.Avalonia.DataGrid -o ./nugets /p:Version=${{ env.VERSION }}
- name: Pack Semi.Avalonia.TreeDataGrid - name: Pack Semi.Avalonia.TreeDataGrid
if: ${{ github.event.inputs.Semi_Avalonia_TreeDataGrid == 'true' }} if: ${{ github.event.inputs.Semi_Avalonia_TreeDataGrid == 'true' }}
run: dotnet pack src/Semi.Avalonia.TreeDataGrid -o nugets /p:Version=${{ env.VERSION }} run: dotnet pack ./src/Semi.Avalonia.TreeDataGrid -o ./nugets /p:Version=${{ env.VERSION }}
- name: Add NuGet Source - name: Add NuGet Source
run: dotnet nuget add source ${{ secrets.IRIHI_NUGET_NIGHTLY_FEED }} -n irihi.tech -u ${{ secrets.IRIHI_NUGET_USERNAME }} -p ${{ secrets.IRIHI_NUGET_PASSWORD }} --store-password-in-clear-text run: dotnet nuget add source ${{ secrets.IRIHI_NUGET_NIGHTLY_FEED }} -n irihi.tech -u ${{ secrets.IRIHI_NUGET_USERNAME }} -p ${{ secrets.IRIHI_NUGET_PASSWORD }} --store-password-in-clear-text
- name: Publish Nightly Package - name: Publish Nightly Package
run: dotnet nuget push "nugets/*.nupkg" --api-key ${{ secrets.IRIHI_NUGET_API_KEY }} --source irihi.tech --skip-duplicate run: dotnet nuget push "./nugets/*.nupkg" --api-key ${{ secrets.IRIHI_NUGET_API_KEY }} --source irihi.tech --skip-duplicate
- name: Upload a Build Artifact - name: Upload a Build Artifact
uses: actions/upload-artifact@v4.3.1 uses: actions/upload-artifact@v4.3.1
with: with:
name: nugets name: nugets
path: nugets path: ./nugets
if: always() if: always()

View File

@@ -34,26 +34,26 @@ jobs:
- name: Pack Semi.Avalonia - name: Pack Semi.Avalonia
if: ${{ github.event.inputs.Semi_Avalonia == 'true' }} if: ${{ github.event.inputs.Semi_Avalonia == 'true' }}
run: dotnet pack src/Semi.Avalonia -o nugets run: dotnet pack ./src/Semi.Avalonia -o ./nugets
- name: Pack Semi.Avalonia.ColorPicker - name: Pack Semi.Avalonia.ColorPicker
if: ${{ github.event.inputs.Semi_Avalonia_ColorPicker == 'true' }} if: ${{ github.event.inputs.Semi_Avalonia_ColorPicker == 'true' }}
run: dotnet pack src/Semi.Avalonia.ColorPicker -o nugets run: dotnet pack ./src/Semi.Avalonia.ColorPicker -o ./nugets
- name: Pack Semi.Avalonia.DataGrid - name: Pack Semi.Avalonia.DataGrid
if: ${{ github.event.inputs.Semi_Avalonia_DataGrid == 'true' }} if: ${{ github.event.inputs.Semi_Avalonia_DataGrid == 'true' }}
run: dotnet pack src/Semi.Avalonia.DataGrid -o nugets run: dotnet pack ./src/Semi.Avalonia.DataGrid -o ./nugets
- name: Pack Semi.Avalonia.TreeDataGrid - name: Pack Semi.Avalonia.TreeDataGrid
if: ${{ github.event.inputs.Semi_Avalonia_TreeDataGrid == 'true' }} if: ${{ github.event.inputs.Semi_Avalonia_TreeDataGrid == 'true' }}
run: dotnet pack src/Semi.Avalonia.TreeDataGrid -o nugets run: dotnet pack ./src/Semi.Avalonia.TreeDataGrid -o ./nugets
- name: Publish NuGet package - name: Publish NuGet package
run: dotnet nuget push "nugets/*.nupkg" --api-key ${{ secrets.NUGET_ORG_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate run: dotnet nuget push "./nugets/*.nupkg" --api-key ${{ secrets.NUGET_ORG_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
- name: Upload a Build Artifact - name: Upload a Build Artifact
uses: actions/upload-artifact@v4.3.1 uses: actions/upload-artifact@v4.3.1
with: with:
name: nugets name: nugets
path: nugets path: ./nugets
if: always() if: always()

View File

@@ -13,23 +13,13 @@ on:
- 'linux' - 'linux'
- 'android' - 'android'
- 'all' - 'all'
win64: include_aot:
description: 'Windows x64' description: 'Include Windows AOT packaging'
required: true required: true
default: true default: true
type: boolean type: boolean
win64_aot: include_drm:
description: 'Windows x64 AOT' description: 'Include Linux DRM packaging'
required: true
default: true
type: boolean
linux64:
description: 'Linux x64'
required: true
default: true
type: boolean
linux64_drm:
description: 'Linux x64 DRM'
required: true required: true
default: true default: true
type: boolean type: boolean
@@ -46,36 +36,34 @@ jobs:
run: mkdir upload run: mkdir upload
- name: Publish win-x64 - name: Publish win-x64
if: ${{ github.event.inputs.win64 == 'true' }} run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/win64
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o publish/win64 --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
- name: Zip win-x64 - name: Zip win-x64
if: ${{ github.event.inputs.win64 == 'true' }}
run: | run: |
$files = Get-ChildItem -Path publish/win64/* -Recurse -Exclude *.pdb $files = Get-ChildItem -Path ./publish/win64/* -Recurse -Exclude *.pdb
Compress-Archive -Path $files.FullName -DestinationPath upload/Semi.Avalonia.Demo.Desktop.win-x64.zip Compress-Archive -Path $files.FullName -DestinationPath ./upload/Semi.Avalonia.Demo.Desktop.win-x64.zip
- name: Enable Native AOT in .csproj - name: Enable Native AOT in .csproj
if: ${{ github.event.inputs.win64_aot == 'true' }} if: ${{ github.event.inputs.include_aot == 'true' }}
run: | run: |
sed -i 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj 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 sed -i 's#<!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>-->#<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
- name: Publish win-x64 AOT - name: Publish win-x64 AOT
if: ${{ github.event.inputs.win64_aot == 'true' }} if: ${{ github.event.inputs.include_aot == 'true' }}
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o publish/win64-aot run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o ./publish/win64-aot
- name: Zip win-x64 AOT - name: Zip win-x64 AOT
if: ${{ github.event.inputs.win64_aot == 'true' }} if: ${{ github.event.inputs.include_aot == 'true' }}
run: | run: |
$files = Get-ChildItem -Path publish/win64-aot/* -Recurse -Exclude *.pdb $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 Compress-Archive -Path $files.FullName -DestinationPath ./upload/Semi.Avalonia.Demo.Desktop.win-x64.NativeAOT.zip
- name: Upload a Build Artifact - name: Upload a Build Artifact
uses: actions/upload-artifact@v4.3.1 uses: actions/upload-artifact@v4.3.1
with: with:
name: windows name: windows
path: upload path: ./upload
linux: linux:
if: ${{ github.event.inputs.platform == 'linux' || github.event.inputs.platform == 'all' }} if: ${{ github.event.inputs.platform == 'linux' || github.event.inputs.platform == 'all' }}
@@ -88,26 +76,24 @@ jobs:
run: mkdir upload run: mkdir upload
- name: Publish linux-x64 - name: Publish linux-x64
if: ${{ github.event.inputs.linux64 == 'true' }} run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r linux-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/linux64
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r linux-x64 -c Release -o publish/linux64 --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
- name: Zip linux-x64 - name: Zip linux-x64
if: ${{ github.event.inputs.linux64 == 'true' }} run: zip -j -r ./upload/Semi.Avalonia.Demo.Desktop.linux-x64.zip ./publish/linux64 -x "*.pdb"
run: zip -j -r upload/Semi.Avalonia.Demo.Desktop.linux-x64.zip publish/linux64 -x "*.pdb"
- name: Publish linux-x64 DRM - name: Publish linux-x64 DRM
if: ${{ github.event.inputs.linux64_drm == 'true' }} if: ${{ github.event.inputs.include_drm == 'true' }}
run: dotnet publish demo/Semi.Avalonia.Demo.Drm -r linux-x64 -c Release -o publish/drm --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true 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 - name: Zip linux-x64 DRM
if: ${{ github.event.inputs.linux64_drm == 'true' }} if: ${{ github.event.inputs.include_drm == 'true' }}
run: zip -j -r upload/Semi.Avalonia.Demo.Drm.linux-x64.zip publish/drm -x "*.pdb" run: zip -j -r ./upload/Semi.Avalonia.Demo.Drm.linux-x64.zip ./publish/drm -x "*.pdb"
- name: Upload a Build Artifact - name: Upload a Build Artifact
uses: actions/upload-artifact@v4.3.1 uses: actions/upload-artifact@v4.3.1
with: with:
name: linux name: linux
path: upload path: ./upload
android: android:
if: ${{ github.event.inputs.platform == 'android' || github.event.inputs.platform == 'all' }} if: ${{ github.event.inputs.platform == 'android' || github.event.inputs.platform == 'all' }}
@@ -117,16 +103,16 @@ jobs:
uses: actions/checkout@v4.1.1 uses: actions/checkout@v4.1.1
- name: CD Android - name: CD Android
run: cd demo/Semi.Avalonia.Demo.Android run: cd ./demo/Semi.Avalonia.Demo.Android
- name: Restore Dependencies - name: Restore Dependencies
run: dotnet restore run: dotnet restore
- name: Publish Android - name: Publish Android
run: dotnet publish demo/Semi.Avalonia.Demo.Android -c Release -f net8.0-android --no-restore -o publish -p:RuntimeIdentifier=android-arm64 run: dotnet publish demo/Semi.Avalonia.Demo.Android -c Release -f net8.0-android --no-restore -o ./publish -p:RuntimeIdentifier=android-arm64
- name: Upload a Build Artifact - name: Upload a Build Artifact
uses: actions/upload-artifact@v4.3.1 uses: actions/upload-artifact@v4.3.1
with: with:
name: android name: android
path: publish/*Signed.apk path: ./publish/*Signed.apk

View File

@@ -15,16 +15,16 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Pack Semi.Avalonia - name: Pack Semi.Avalonia
run: dotnet pack src/Semi.Avalonia -o nugets run: dotnet pack ./src/Semi.Avalonia -o ./nugets
- name: Pack Semi.Avalonia.ColorPicker - name: Pack Semi.Avalonia.ColorPicker
run: dotnet pack src/Semi.Avalonia.ColorPicker -o nugets run: dotnet pack ./src/Semi.Avalonia.ColorPicker -o ./nugets
- name: Upload a Build Artifact - name: Upload a Build Artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: nugets name: nugets
path: nugets path: ./nugets
publish-windows: publish-windows:
runs-on: windows-latest runs-on: windows-latest
@@ -36,12 +36,12 @@ jobs:
run: mkdir upload run: mkdir upload
- name: Publish win-x64 - name: Publish win-x64
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o publish/win64 --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true 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 - name: Zip win-x64
run: | run: |
$files = Get-ChildItem -Path publish/win64/* -Recurse -Exclude *.pdb $files = Get-ChildItem -Path ./publish/win64/* -Recurse -Exclude *.pdb
Compress-Archive -Path $files.FullName -DestinationPath upload/Semi.Avalonia.Demo.Desktop.win-x64.zip Compress-Archive -Path $files.FullName -DestinationPath ./upload/Semi.Avalonia.Demo.Desktop.win-x64.zip
- name: Enable Native AOT in .csproj - name: Enable Native AOT in .csproj
run: | run: |
@@ -49,18 +49,18 @@ jobs:
sed -i 's#<!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>-->#<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>#' 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 - name: Publish win-x64 AOT
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o publish/win64-aot run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o ./publish/win64-aot
- name: Zip win-x64 AOT - name: Zip win-x64 AOT
run: | run: |
$files = Get-ChildItem -Path publish/win64-aot/* -Recurse -Exclude *.pdb $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 Compress-Archive -Path $files.FullName -DestinationPath ./upload/Semi.Avalonia.Demo.Desktop.win-x64.NativeAOT.zip
- name: Upload a Build Artifact - name: Upload a Build Artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: windows name: windows
path: upload path: ./upload
publish-linux: publish-linux:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -72,22 +72,22 @@ jobs:
run: mkdir upload run: mkdir upload
- name: Publish linux-x64 - name: Publish linux-x64
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r linux-x64 -c Release -o publish/linux64 --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true 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 - name: Zip linux-x64
run: zip -j -r upload/Semi.Avalonia.Demo.Desktop.linux-x64.zip publish/linux64 -x "*.pdb" run: zip -j -r ./upload/Semi.Avalonia.Demo.Desktop.linux-x64.zip ./publish/linux64 -x "*.pdb"
- name: Publish linux-x64 DRM - name: Publish linux-x64 DRM
run: dotnet publish demo/Semi.Avalonia.Demo.Drm -r linux-x64 -c Release -o publish/drm --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true 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 - name: Zip linux-x64 DRM
run: zip -j -r upload/Semi.Avalonia.Demo.Drm.linux-x64.zip publish/drm -x "*.pdb" run: zip -j -r ./upload/Semi.Avalonia.Demo.Drm.linux-x64.zip ./publish/drm -x "*.pdb"
- name: Upload a Build Artifact - name: Upload a Build Artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: linux name: linux
path: upload path: ./upload
publish-android: publish-android:
runs-on: windows-latest runs-on: windows-latest
@@ -96,19 +96,19 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: CD Android - name: CD Android
run: cd demo/Semi.Avalonia.Demo.Android run: cd ./demo/Semi.Avalonia.Demo.Android
- name: Restore Dependencies - name: Restore Dependencies
run: dotnet restore run: dotnet restore
- name: Publish Android - name: Publish Android
run: dotnet publish demo/Semi.Avalonia.Demo.Android -c Release -f net8.0-android --no-restore -o publish -p:RuntimeIdentifier=android-arm64 run: dotnet publish demo/Semi.Avalonia.Demo.Android -c Release -f net8.0-android --no-restore -o ./publish -p:RuntimeIdentifier=android-arm64
- name: Upload a Build Artifact - name: Upload a Build Artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: android name: android
path: publish/*Signed.apk path: ./publish/*Signed.apk
draft-release: draft-release:
needs: [ pack, publish-windows, publish-linux, publish-android ] needs: [ pack, publish-windows, publish-linux, publish-android ]

View File

@@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2022 IRIHI Technology Copyright (c) 2022 iriHi Technology
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,7 +1,7 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<AvaloniaVersion>11.3.0</AvaloniaVersion> <AvaloniaVersion>11.2.5</AvaloniaVersion>
<DataGridVersion>11.3.0</DataGridVersion> <DataGridVersion>11.2.5</DataGridVersion>
<CommunityToolkitVersion>8.4.0</CommunityToolkitVersion> <CommunityToolkitVersion>8.4.0</CommunityToolkitVersion>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@@ -5,8 +5,8 @@ namespace Semi.Avalonia.Demo.Constant;
public static class ColorTokens public static class ColorTokens
{ {
public static IReadOnlyList<Tuple<string, string>> PrimaryTokens { get; } = public static IReadOnlyList<Tuple<string, string>> PrimaryTokens { get; } = new List<Tuple<string, string>>
[ {
new("SemiColorPrimary", "Primary"), new("SemiColorPrimary", "Primary"),
new("SemiColorPrimaryPointerover", "Primary Pointerover"), new("SemiColorPrimaryPointerover", "Primary Pointerover"),
new("SemiColorPrimaryActive", "Primary Active"), new("SemiColorPrimaryActive", "Primary Active"),
@@ -14,130 +14,130 @@ public static class ColorTokens
new("SemiColorPrimaryLight", "Primary Light"), new("SemiColorPrimaryLight", "Primary Light"),
new("SemiColorPrimaryLightPointerover", "Primary Light Pointerover"), new("SemiColorPrimaryLightPointerover", "Primary Light Pointerover"),
new("SemiColorPrimaryLightActive", "Primary Light Active"), new("SemiColorPrimaryLightActive", "Primary Light Active"),
]; };
public static IReadOnlyList<Tuple<string, string>> SecondaryTokens { get; } = public static IReadOnlyList<Tuple<string, string>> SecondaryTokens { get; } = new List<Tuple<string, string>>
[ {
new("SemiColorSecondary", "Secondary"), new("SemiColorSecondary", "Secondary"),
new("SemiColorSecondaryPointerover", "Secondary Pointerover"), new("SemiColorSecondaryPointerover", "Secondary Pointerover"),
new("SemiColorSecondaryActive", "Secondary Active"), new("SemiColorSecondaryActive", "Secondary Active"),
new("SemiColorSecondaryDisabled", "Secondary Disabled"), new("SemiColorSecondaryDisabled", "Secondary Disabled"),
new("SemiColorSecondaryLight", "Secondary Light"), new("SemiColorSecondaryLight", "Secondary Light"),
new("SemiColorSecondaryLightPointerover", "Secondary Light Pointerover"), new("SemiColorSecondaryLightPointerover", "Secondary Light Pointerover"),
new("SemiColorSecondaryLightActive", "Secondary Light Active") new("SemiColorSecondaryLightActive", "Secondary Light Active"),
]; };
public static IReadOnlyList<Tuple<string, string>> TertiaryTokens { get; } = public static IReadOnlyList<Tuple<string, string>> TertiaryTokens { get; } = new List<Tuple<string, string>>
[ {
new("SemiColorTertiary", "Tertiary"), new("SemiColorTertiary", "Tertiary"),
new("SemiColorTertiaryPointerover", "Tertiary Pointerover"), new("SemiColorTertiaryPointerover", "Tertiary Pointerover"),
new("SemiColorTertiaryActive", "Tertiary Active"), new("SemiColorTertiaryActive", "Tertiary Active"),
new("SemiColorTertiaryLight", "Tertiary Light"), new("SemiColorTertiaryLight", "Tertiary Light"),
new("SemiColorTertiaryLightPointerover", "Tertiary Light Pointerover"), new("SemiColorTertiaryLightPointerover", "Tertiary Light Pointerover"),
new("SemiColorTertiaryLightActive", "Tertiary Light Active") new("SemiColorTertiaryLightActive", "Tertiary Light Active"),
]; };
public static IReadOnlyList<Tuple<string, string>> InformationTokens { get; } = public static IReadOnlyList<Tuple<string, string>> InformationTokens { get; } = new List<Tuple<string, string>>
[ {
new("SemiColorInformation", "Information"), new("SemiColorInformation", "Information"),
new("SemiColorInformationPointerover", "Information Pointerover"), new("SemiColorInformationPointerover", "Information Pointerover"),
new("SemiColorInformationActive", "Information Active"), new("SemiColorInformationActive", "Information Active"),
new("SemiColorInformationDisabled", "Information Disabled"), new("SemiColorInformationDisabled", "Information Disabled"),
new("SemiColorInformationLight", "Information Light"), new("SemiColorInformationLight", "Information Light"),
new("SemiColorInformationLightPointerover", "Information Light Pointerover"), new("SemiColorInformationLightPointerover", "Information Light Pointerover"),
new("SemiColorInformationLightActive", "Information Light Active") new("SemiColorInformationLightActive", "Information Light Active"),
]; };
public static IReadOnlyList<Tuple<string, string>> SuccessTokens { get; } = public static IReadOnlyList<Tuple<string, string>> SuccessTokens { get; } = new List<Tuple<string, string>>
[ {
new("SemiColorSuccess", "Success"), new("SemiColorSuccess", "Success"),
new("SemiColorSuccessPointerover", "Success Pointerover"), new("SemiColorSuccessPointerover", "Success Pointerover"),
new("SemiColorSuccessActive", "Success Active"), new("SemiColorSuccessActive", "Success Active"),
new("SemiColorSuccessDisabled", "Success Disabled"), new("SemiColorSuccessDisabled", "Success Disabled"),
new("SemiColorSuccessLight", "Success Light"), new("SemiColorSuccessLight", "Success Light"),
new("SemiColorSuccessLightPointerover", "Success Light Pointerover"), new("SemiColorSuccessLightPointerover", "Success Light Pointerover"),
new("SemiColorSuccessLightActive", "Success Light Active") new("SemiColorSuccessLightActive", "Success Light Active"),
]; };
public static IReadOnlyList<Tuple<string, string>> WarningTokens { get; } = public static IReadOnlyList<Tuple<string, string>> WarningTokens { get; } = new List<Tuple<string, string>>
[ {
new("SemiColorWarning", "Warning"), new("SemiColorWarning", "Warning"),
new("SemiColorWarningPointerover", "Warning Pointerover"), new("SemiColorWarningPointerover", "Warning Pointerover"),
new("SemiColorWarningActive", "Warning Active"), new("SemiColorWarningActive", "Warning Active"),
new("SemiColorWarningLight", "Warning Light"), new("SemiColorWarningLight", "Warning Light"),
new("SemiColorWarningLightPointerover", "Warning Light Pointerover"), new("SemiColorWarningLightPointerover", "Warning Light Pointerover"),
new("SemiColorWarningLightActive", "Warning Light Active") new("SemiColorWarningLightActive", "Warning Light Active"),
]; };
public static IReadOnlyList<Tuple<string, string>> DangerTokens { get; } = public static IReadOnlyList<Tuple<string, string>> DangerTokens { get; } = new List<Tuple<string, string>>
[ {
new("SemiColorDanger", "Danger"), new("SemiColorDanger", "Danger"),
new("SemiColorDangerPointerover", "Danger Pointerover"), new("SemiColorDangerPointerover", "Danger Pointerover"),
new("SemiColorDangerActive", "Danger Active"), new("SemiColorDangerActive", "Danger Active"),
new("SemiColorDangerLight", "Danger Light"), new("SemiColorDangerLight", "Danger Light"),
new("SemiColorDangerLightPointerover", "Danger Light Pointerover"), new("SemiColorDangerLightPointerover", "Danger Light Pointerover"),
new("SemiColorDangerLightActive", "Danger Light Active") new("SemiColorDangerLightActive", "Danger Light Active"),
]; };
public static IReadOnlyList<Tuple<string, string>> TextTokens { get; } = public static IReadOnlyList<Tuple<string, string>> TextTokens { get; } = new List<Tuple<string, string>>
[ {
new("SemiColorText0", "Text 0"), new("SemiColorText0", "Text 0"),
new("SemiColorText1", "Text 1"), new("SemiColorText1", "Text 1"),
new("SemiColorText2", "Text 2"), new("SemiColorText2", "Text 2"),
new("SemiColorText3", "Text 3") new("SemiColorText3", "Text 3"),
]; };
public static IReadOnlyList<Tuple<string, string>> LinkTokens { get; } = public static IReadOnlyList<Tuple<string, string>> LinkTokens { get; } = new List<Tuple<string, string>>
[ {
new("SemiColorLink", "Link"), new("SemiColorLink", "Link"),
new("SemiColorLinkPointerover", "Link Pointerover"), new("SemiColorLinkPointerover", "Link Pointerover"),
new("SemiColorLinkActive", "Link Active"), new("SemiColorLinkActive", "Link Active"),
new("SemiColorLinkVisited", "Link Visited") new("SemiColorLinkVisited", "Link Visited"),
]; };
public static IReadOnlyList<Tuple<string, string>> BackgroundTokens { get; } = public static IReadOnlyList<Tuple<string, string>> BackgroundTokens { get; } = new List<Tuple<string, string>>
[ {
new("SemiColorBackground0", "Background 0"), new("SemiColorBackground0", "Background 0"),
new("SemiColorBackground1", "Background 1"), new("SemiColorBackground1", "Background 1"),
new("SemiColorBackground2", "Background 2"), new("SemiColorBackground2", "Background 2"),
new("SemiColorBackground3", "Background 3"), new("SemiColorBackground3", "Background 3"),
new("SemiColorBackground4", "Background 4") new("SemiColorBackground4", "Background 4"),
]; };
public static IReadOnlyList<Tuple<string, string>> FillTokens { get; } = public static IReadOnlyList<Tuple<string, string>> FillTokens { get; } = new List<Tuple<string, string>>
[ {
new("SemiColorFill0", "Fill 0"), new("SemiColorFill0", "Fill 0"),
new("SemiColorFill1", "Fill 1"), new("SemiColorFill1", "Fill 1"),
new("SemiColorFill2", "Fill 2") new("SemiColorFill2", "Fill 2"),
]; };
public static IReadOnlyList<Tuple<string, string>> BorderTokens { get; } = public static IReadOnlyList<Tuple<string, string>> BorderTokens { get; } = new List<Tuple<string, string>>
[ {
new("SemiColorBorder", "Border"), new("SemiColorBorder", "Border"),
new("SemiColorFocusBorder", "Focus Border") new("SemiColorFocusBorder", "Focus Border"),
]; };
public static IReadOnlyList<Tuple<string, string>> DisabledTokens { get; } = public static IReadOnlyList<Tuple<string, string>> DisabledTokens { get; } = new List<Tuple<string, string>>
[ {
new("SemiColorDisabledText", "Disabled Text"), new("SemiColorDisabledText", "Disabled Text"),
new("SemiColorDisabledBorder", "Disabled Border"), new("SemiColorDisabledBorder", "Disabled Border"),
new("SemiColorDisabledBackground", "Disabled Background"), new("SemiColorDisabledBackground", "Disabled Background"),
new("SemiColorDisabledFill", "Disabled Fill") new("SemiColorDisabledFill", "Disabled Fill"),
]; };
public static IReadOnlyList<Tuple<string, string>> OtherTokens { get; } = public static IReadOnlyList<Tuple<string, string>> OtherTokens { get; } = new List<Tuple<string, string>>
[ {
new("SemiColorWhite", "White"), new("SemiColorWhite", "White"),
new("SemiColorBlack", "Black"), new("SemiColorBlack", "Black"),
new("SemiColorNavBackground", "Navigation Background"), new("SemiColorNavBackground", "Navigation Background"),
new("SemiColorOverlayBackground", "Overlay Background"), new("SemiColorOverlayBackground", "Overlay Background"),
new("SemiColorHighlightBackground", "Highlight Background"), new("SemiColorHighlightBackground", "Highlight Background"),
new("SemiColorHighlight", "Highlight Text") new("SemiColorHighlight", "Highlight Text"),
]; };
public static IReadOnlyList<Tuple<string, string>> ShadowTokens { get; } = public static IReadOnlyList<Tuple<string, string>> ShadowTokens { get; } = new List<Tuple<string, string>>
[ {
new("SemiColorShadow", "Shadow"), new("SemiColorShadow", "Shadow"),
new("SemiShadowElevated", "Shadow Elevated") new("SemiShadowElevated", "Shadow Elevated"),
]; };
} }

View File

@@ -1,237 +0,0 @@
<UserControl
x:Class="Semi.Avalonia.Demo.Pages.AboutUs"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:collections="clr-namespace:Avalonia.Collections;assembly=Avalonia.Base"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:iri="https://irihi.tech/shared"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
x:DataType="vm:AboutUsViewModel"
x:CompileBindings="True"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
<collections:AvaloniaList x:Key="CanvasPalette" x:TypeArguments="Color">
<Color>#FFFDB7A5</Color>
<Color>#FFF6A0B5</Color>
<Color>#FFDD9BE0</Color>
<Color>#FFC4A7E9</Color>
<Color>#FFA7B3E1</Color>
<Color>#FF98CDFD</Color>
<Color>#FF95D8F8</Color>
</collections:AvaloniaList>
<LinearGradientBrush x:Key="TileTitleForeground" StartPoint="">
<GradientStop Offset="0.0" Color="#FFA20B48" />
<GradientStop Offset="0.3" Color="#FF71168A" />
<GradientStop Offset="0.6" Color="#FF46259E" />
<GradientStop Offset="1.0" Color="#FF28348C" />
</LinearGradientBrush>
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<collections:AvaloniaList x:Key="CanvasPalette" x:TypeArguments="Color">
<Color>#FFB42019</Color>
<Color>#FFA41751</Color>
<Color>#FF731F8A</Color>
<Color>#FF582EA0</Color>
<Color>#FF29368E</Color>
<Color>#FF135CB8</Color>
<Color>#FF0366A9</Color>
</collections:AvaloniaList>
<LinearGradientBrush x:Key="TileTitleForeground">
<GradientStop Offset="0.0" Color="#FFF7A8BC" />
<GradientStop Offset="0.3" Color="#FFDDA0E1" />
<GradientStop Offset="0.6" Color="#FFBEADE9" />
<GradientStop Offset="1.0" Color="#FFA7B4E2" />
</LinearGradientBrush>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
<ControlTheme x:Key="TileButton" TargetType="Button">
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="Padding" Value="24" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Template">
<ControlTemplate>
<Border
Padding="0"
Classes="Hover"
Cursor="Hand"
Theme="{DynamicResource CardBorder}">
<Border.Transitions>
<Transitions>
<BrushTransition Property="BorderBrush" Duration="0.5" />
</Transitions>
</Border.Transitions>
<ContentPresenter
Padding="{TemplateBinding Padding}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" />
</Border>
</ControlTemplate>
</Setter>
<Style Selector="^:pointerover /template/ Border">
<Setter Property="BorderBrush" Value="{DynamicResource TileTitleForeground}" />
</Style>
</ControlTheme>
</ResourceDictionary>
</UserControl.Resources>
<UserControl.Styles>
<Style Selector="TextBlock.TileTitle">
<Setter Property="FontWeight" Value="700" />
<Setter Property="FontSize" Value="24" />
<Setter Property="Margin" Value="0 0 0 8" />
<Setter Property="Foreground" Value="{DynamicResource TileTitleForeground}" />
</Style>
</UserControl.Styles>
<Grid RowDefinitions="*, Auto">
<ScrollViewer>
<StackPanel>
<Grid
Margin="0,96,0,48"
HorizontalAlignment="Center"
ColumnDefinitions="*, *"
RowDefinitions="*, *">
<iri:IrihiLogo
Grid.Row="0"
Grid.RowSpan="2"
Grid.Column="0"
Fill="{DynamicResource TextBlockSecondaryForeground}"
Width="96"
Margin="0,0,24,0"
VerticalAlignment="Center" />
<TextBlock
Grid.Row="0"
Grid.Column="1"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Classes="Secondary"
FontSize="48"
FontWeight="700"
Text="铱泓科技" />
<TextBlock
Grid.Row="1"
Grid.Column="1"
Margin="12,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Classes="Secondary"
FontSize="16"
Text="IRIHI Technology" />
</Grid>
<TextBlock
HorizontalAlignment="Center"
Classes="Tertiary"
FontSize="20"
FontWeight="700"
Text="聚焦生产力的美学进化" />
<TextBlock
HorizontalAlignment="Center"
Classes="Tertiary"
FontSize="20"
Text="Aesthetic Evolution of Productivity" />
<UniformGrid
MaxWidth="810"
Margin="24"
HorizontalAlignment="Center"
Columns="2">
<Button
Margin="8"
Command="{Binding NavigateCommand}"
CommandParameter="semi"
Theme="{DynamicResource TileButton}">
<StackPanel HorizontalAlignment="Left">
<TextBlock Classes="TileTitle" Text="Semi" />
<StackPanel Orientation="Horizontal" Margin="0 0 0 8">
<Label Theme="{DynamicResource TagLabel}" Classes="Blue Ghost">Open Source</Label>
</StackPanel>
<TextBlock Text="开箱即用的独立主题库" />
<TextBlock Text="A ready-to-use standalone theme library" />
</StackPanel>
</Button>
<Button
Margin="8"
Command="{Binding NavigateCommand}"
CommandParameter="ursa"
Theme="{DynamicResource TileButton}">
<StackPanel HorizontalAlignment="Left">
<TextBlock Classes="TileTitle" Text="Ursa" />
<StackPanel Orientation="Horizontal" Margin="0 0 0 8">
<Label Theme="{DynamicResource TagLabel}" Classes="Blue Ghost">Open Source</Label>
</StackPanel>
<TextBlock Text="高性能企业级桌面客户端控件库" />
<TextBlock Text="High-performance enterprise level control library for desktop apps" />
</StackPanel>
</Button>
<Button
Margin="8"
Command="{Binding NavigateCommand}"
CommandParameter="mantra"
Theme="{DynamicResource TileButton}">
<StackPanel HorizontalAlignment="Left">
<TextBlock Classes="TileTitle" Text="Mantra" />
<StackPanel Orientation="Horizontal" Margin="0 0 0 8">
<Label Theme="{DynamicResource TagLabel}" Classes="Purple Ghost">Commercial</Label>
</StackPanel>
<TextBlock Text="高性能文字排版渲染控件库" />
<TextBlock Text="High-performance typography control library" />
</StackPanel>
</Button>
<Button
Margin="8"
Command="{Binding NavigateCommand}"
CommandParameter="huska"
Theme="{DynamicResource TileButton}">
<StackPanel HorizontalAlignment="Left">
<TextBlock Classes="TileTitle" Text="Huska" />
<StackPanel Orientation="Horizontal" Margin="0 0 0 8">
<Label Theme="{DynamicResource TagLabel}" Classes="Purple Ghost">Commercial</Label>
</StackPanel>
<TextBlock Text="手绘风格主题库" />
<TextBlock Text="Hand-drawing theme library" />
</StackPanel>
</Button>
</UniformGrid>
</StackPanel>
</ScrollViewer>
<StackPanel
Grid.Row="1"
Margin="0,16"
Spacing="32"
HorizontalAlignment="Center"
Orientation="Horizontal">
<StackPanel Orientation="Horizontal">
<HyperlinkButton
Classes="WithIcon"
VerticalAlignment="Center"
Content="Homepage"
NavigateUri="https://irihi.tech">
<HyperlinkButton.Styles>
<Style Selector=".WithIcon /template/ PathIcon">
<Setter Property="Data" Value="{StaticResource SemiIconHome}" />
</Style>
</HyperlinkButton.Styles>
</HyperlinkButton>
</StackPanel>
<StackPanel Orientation="Horizontal">
<HyperlinkButton
Classes="WithIcon"
Content="GitHub"
NavigateUri="https://github.com/irihitech">
<HyperlinkButton.Styles>
<Style Selector=".WithIcon /template/ PathIcon">
<Setter Property="Data" Value="{StaticResource SemiIconGithubLogo}" />
</Style>
</HyperlinkButton.Styles>
</HyperlinkButton>
</StackPanel>
</StackPanel>
</Grid>
</UserControl>

View File

@@ -1,24 +0,0 @@
using Avalonia.Controls;
using Avalonia.Interactivity;
using Semi.Avalonia.Demo.ViewModels;
namespace Semi.Avalonia.Demo.Pages;
public partial class AboutUs : UserControl
{
public AboutUs()
{
InitializeComponent();
this.DataContext = new AboutUsViewModel();
}
protected override void OnLoaded(RoutedEventArgs e)
{
base.OnLoaded(e);
if (this.DataContext is AboutUsViewModel vm)
{
var launcher = TopLevel.GetTopLevel(this)?.Launcher;
vm.Launcher = launcher;
}
}
}

View File

@@ -3,15 +3,15 @@
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Semi.Avalonia.Demo.Pages"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
x:CompileBindings="False" x:CompileBindings="False"
x:DataType="vm:AutoCompleteBoxDemoViewModel" x:DataType="local:AutoCompleteBoxDemoViewModel"
mc:Ignorable="d"> mc:Ignorable="d">
<Design.DataContext> <Design.DataContext>
<vm:AutoCompleteBoxDemoViewModel /> <local:AutoCompleteBoxDemoViewModel />
</Design.DataContext> </Design.DataContext>
<StackPanel HorizontalAlignment="Left" Spacing="20"> <StackPanel HorizontalAlignment="Left" Spacing="20">
<StackPanel.Styles> <StackPanel.Styles>
@@ -21,7 +21,7 @@
<Binding Path="States" /> <Binding Path="States" />
</Setter> </Setter>
<Setter Property="ItemTemplate"> <Setter Property="ItemTemplate">
<DataTemplate DataType="vm:StateData"> <DataTemplate DataType="local:StateData">
<TextBlock Text="{Binding Name}" /> <TextBlock Text="{Binding Name}" />
</DataTemplate> </DataTemplate>
</Setter> </Setter>

View File

@@ -1,5 +1,9 @@
using System.Collections.ObjectModel;
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Semi.Avalonia.Demo.ViewModels; using Avalonia.Markup.Xaml;
using System.Collections.Generic;
using CommunityToolkit.Mvvm.ComponentModel;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;
@@ -11,3 +15,85 @@ public partial class AutoCompleteBoxDemo : UserControl
this.DataContext = new AutoCompleteBoxDemoViewModel(); this.DataContext = new AutoCompleteBoxDemoViewModel();
} }
} }
public class AutoCompleteBoxDemoViewModel: ObservableObject
{
public ObservableCollection<StateData> States { get; set; }
public AutoCompleteBoxDemoViewModel()
{
States = new ObservableCollection<StateData>(GetStates());
}
private static List<StateData> GetStates()
{
return new List<StateData>
{
new StateData("Alabama", "AL", "Montgomery"),
new StateData("Alaska", "AK", "Juneau"),
new StateData("Arizona", "AZ", "Phoenix"),
new StateData("Arkansas", "AR", "Little Rock"),
new StateData("California", "CA", "Sacramento"),
new StateData("Colorado", "CO", "Denver"),
new StateData("Connecticut", "CT", "Hartford"),
new StateData("Delaware", "DE", "Dover"),
new StateData("Florida", "FL", "Tallahassee"),
new StateData("Georgia", "GA", "Atlanta"),
new StateData("Hawaii", "HI", "Honolulu"),
new StateData("Idaho", "ID", "Boise"),
new StateData("Illinois", "IL", "Springfield"),
new StateData("Indiana", "IN", "Indianapolis"),
new StateData("Iowa", "IA", "Des Moines"),
new StateData("Kansas", "KS", "Topeka"),
new StateData("Kentucky", "KY", "Frankfort"),
new StateData("Louisiana", "LA", "Baton Rouge"),
new StateData("Maine", "ME", "Augusta"),
new StateData("Maryland", "MD", "Annapolis"),
new StateData("Massachusetts", "MA", "Boston"),
new StateData("Michigan", "MI", "Lansing"),
new StateData("Minnesota", "MN", "St. Paul"),
new StateData("Mississippi", "MS", "Jackson"),
new StateData("Missouri", "MO", "Jefferson City"),
new StateData("Montana", "MT", "Helena"),
new StateData("Nebraska", "NE", "Lincoln"),
new StateData("Nevada", "NV", "Carson City"),
new StateData("New Hampshire", "NH", "Concord"),
new StateData("New Jersey", "NJ", "Trenton"),
new StateData("New Mexico", "NM", "Santa Fe"),
new StateData("New York", "NY", "Albany"),
new StateData("North Carolina", "NC", "Raleigh"),
new StateData("North Dakota", "ND", "Bismarck"),
new StateData("Ohio", "OH", "Columbus"),
new StateData("Oklahoma", "OK", "Oklahoma City"),
new StateData("Oregon", "OR", "Salem"),
new StateData("Pennsylvania", "PA", "Harrisburg"),
new StateData("Rhode Island", "RI", "Providence"),
new StateData("South Carolina", "SC", "Columbia"),
new StateData("South Dakota", "SD", "Pierre"),
new StateData("Tennessee", "TN", "Nashville"),
new StateData("Texas", "TX", "Austin"),
new StateData("Utah", "UT", "Salt Lake City"),
new StateData("Vermont", "VT", "Montpelier"),
new StateData("Virginia", "VA", "Richmond"),
new StateData("Washington", "WA", "Olympia"),
new StateData("West Virginia", "WV", "Charleston"),
new StateData("Wisconsin", "WI", "Madison"),
new StateData("Wyoming", "WY", "Cheyenne"),
};
}
}
public class StateData
{
public string Name { get; private set; }
public string Abbreviation { get; private set; }
public string Capital { get; private set; }
public StateData(string name, string abbreviation, string capital)
{
Name = name;
Abbreviation = abbreviation;
Capital = capital;
}
}

View File

@@ -1,4 +1,6 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;

View File

@@ -112,14 +112,14 @@
IsEnabled="False" /> IsEnabled="False" />
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal" Spacing="8"> <StackPanel Orientation="Horizontal" Spacing="8">
<DropDownButton Content="Default" Classes="Success" /> <DropDownButton Content="Default" Classes="Success"/>
<DropDownButton Content="Solid" Theme="{DynamicResource SolidDropDownButton}" Classes="Success" /> <DropDownButton Content="Solid" Theme="{DynamicResource SolidDropDownButton}" Classes="Success"/>
<DropDownButton Content="Outline" Theme="{DynamicResource OutlineDropDownButton}" Classes="Success" /> <DropDownButton Content="Outline" Theme="{DynamicResource OutlineDropDownButton}" Classes="Success"/>
<DropDownButton Content="Borderless" Theme="{DynamicResource BorderlessDropDownButton}" Classes="Success" /> <DropDownButton Content="Borderless" Theme="{DynamicResource BorderlessDropDownButton}" Classes="Success"/>
<DropDownButton Content="Default" Classes="Success" IsEnabled="False" /> <DropDownButton Content="Default" Classes="Success" IsEnabled="False"/>
<DropDownButton Content="Solid" Theme="{DynamicResource SolidDropDownButton}" 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="Outline" Theme="{DynamicResource OutlineDropDownButton}" Classes="Success" IsEnabled="False"/>
<DropDownButton Content="Borderless" Theme="{DynamicResource BorderlessDropDownButton}" Classes="Success" IsEnabled="False" /> <DropDownButton Content="Borderless" Theme="{DynamicResource BorderlessDropDownButton}" Classes="Success" IsEnabled="False"/>
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal" Spacing="8"> <StackPanel Orientation="Horizontal" Spacing="8">
<DropDownButton Classes="Small" Content="Small" /> <DropDownButton Classes="Small" Content="Small" />
@@ -139,7 +139,7 @@
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal" Spacing="8"> <StackPanel Orientation="Horizontal" Spacing="8">
<SplitButton Content="Default" Classes="Success" /> <SplitButton Content="Default" Classes="Success" />
<SplitButton Content="Solid" Theme="{DynamicResource SolidSplitButton}" Classes="Success" /> <SplitButton Content="Solid" Theme="{DynamicResource SolidSplitButton}" Classes="Success" />
<SplitButton Content="Outline" Theme="{DynamicResource OutlineSplitButton}" Classes="Success" /> <SplitButton Content="Outline" Theme="{DynamicResource OutlineSplitButton}" Classes="Success" />
<SplitButton Content="Borderless" Theme="{DynamicResource BorderlessSplitButton}" Classes="Success" /> <SplitButton Content="Borderless" Theme="{DynamicResource BorderlessSplitButton}" Classes="Success" />
<SplitButton Content="Default" Classes="Success" IsEnabled="False" /> <SplitButton Content="Default" Classes="Success" IsEnabled="False" />
@@ -165,7 +165,7 @@
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal" Spacing="8"> <StackPanel Orientation="Horizontal" Spacing="8">
<ToggleSplitButton Content="Default" Classes="Success" /> <ToggleSplitButton Content="Default" Classes="Success" />
<ToggleSplitButton Content="Checked" Classes="Success" IsChecked="True" /> <ToggleSplitButton Content="Checked" Classes="Success" IsChecked="True" />
<ToggleSplitButton Content="Default" Classes="Success" IsEnabled="False" /> <ToggleSplitButton Content="Default" Classes="Success" IsEnabled="False" />
<ToggleSplitButton Content="Checked" Classes="Success" IsChecked="True" IsEnabled="False" /> <ToggleSplitButton Content="Checked" Classes="Success" IsChecked="True" IsEnabled="False" />
</StackPanel> </StackPanel>

View File

@@ -1,4 +1,6 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;

View File

@@ -1,5 +1,7 @@
using System; using System;
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;
@@ -29,6 +31,7 @@ public partial class ButtonSpinnerDemo : UserControl
txtBox.Text = _mountains[value]; txtBox.Text = _mountains[value];
} }
} }
private readonly string[] _mountains = new[] private readonly string[] _mountains = new[]

View File

@@ -1,4 +1,6 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;

View File

@@ -1,4 +1,6 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;
@@ -8,4 +10,9 @@ public partial class CalendarDemo : UserControl
{ {
InitializeComponent(); InitializeComponent();
} }
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
} }

View File

@@ -1,4 +1,7 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;

View File

@@ -1,4 +1,6 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;

View File

@@ -1,4 +1,6 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;

View File

@@ -4,12 +4,12 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels" xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
d:DesignHeight="800" d:DesignHeight="800"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">
<Design.DataContext> <Design.DataContext>
<vm:ComboBoxDemoViewModel /> <pages:ComboBoxDemoViewModel />
</Design.DataContext> </Design.DataContext>
<StackPanel Spacing="20"> <StackPanel Spacing="20">
<StackPanel.Styles> <StackPanel.Styles>
@@ -28,13 +28,13 @@
<ComboBox Classes="Bordered" /> <ComboBox Classes="Bordered" />
<ComboBox Classes="Bordered" IsEnabled="False" /> <ComboBox Classes="Bordered" IsEnabled="False" />
<ComboBox> <ComboBox>
<ComboBox.SelectionBoxItemTemplate> <ComboBox.SelectionBoxItemTemplate>
<DataTemplate DataType="x:String"> <DataTemplate DataType="x:String">
<ContentControl BorderThickness="1" <ContentControl BorderThickness="1"
BorderBrush="Gold" BorderBrush="Gold"
Content="{Binding}" /> Content="{Binding}" />
</DataTemplate> </DataTemplate>
</ComboBox.SelectionBoxItemTemplate> </ComboBox.SelectionBoxItemTemplate>
</ComboBox> </ComboBox>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">

View File

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

View File

@@ -12,54 +12,54 @@
mc:Ignorable="d"> mc:Ignorable="d">
<TabControl> <TabControl>
<TabItem Header="DataGrid"> <TabItem Header="DataGrid">
<Grid RowDefinitions="Auto, *"> <Grid RowDefinitions="Auto, *">
<StackPanel Grid.Row="0" Orientation="Horizontal"> <StackPanel Grid.Row="0" Orientation="Horizontal">
<ToggleSwitch Content="Enable" Name="enable" IsChecked="True" /> <ToggleSwitch Content="Enable" Name="enable" IsChecked="True" />
<ToggleSwitch Content="Inset Content" Name="inset" /> <ToggleSwitch Content="Inset Content" Name="inset" />
<ToggleSwitch Content="ScrollBar Auto Hide" Name="autohide" /> <ToggleSwitch Content="ScrollBar Auto Hide" Name="autohide" />
</StackPanel> </StackPanel>
<DataGrid Grid.Row="1" <DataGrid Grid.Row="1"
Margin="8" Margin="8"
CanUserReorderColumns="True" CanUserReorderColumns="True"
CanUserResizeColumns="True" CanUserResizeColumns="True"
CanUserSortColumns="True" CanUserSortColumns="True"
HeadersVisibility="All" HeadersVisibility="All"
IsReadOnly="True" IsReadOnly="True"
Classes.InsetContent="{Binding #inset.IsChecked}" Classes.InsetContent="{Binding #inset.IsChecked}"
ScrollViewer.AllowAutoHide="{Binding #autohide.IsChecked}" ScrollViewer.AllowAutoHide="{Binding #autohide.IsChecked}"
IsEnabled="{Binding #enable.IsChecked}" IsEnabled="{Binding #enable.IsChecked}"
ItemsSource="{Binding GridData1}"> ItemsSource="{Binding GridData1}">
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn <DataGridTextColumn
Width="6*" Width="6*"
x:DataType="vm:Song" x:DataType="vm:Song"
Binding="{Binding Title}" Binding="{Binding Title}"
Header="Title" /> Header="Title" />
<DataGridTextColumn <DataGridTextColumn
Width="6*" Width="6*"
x:DataType="vm:Song" x:DataType="vm:Song"
Binding="{Binding Artist}" Binding="{Binding Artist}"
Header="Artist" /> Header="Artist" />
<DataGridTextColumn <DataGridTextColumn
Width="6*" Width="6*"
x:DataType="vm:Song" x:DataType="vm:Song"
Binding="{Binding Album}" Binding="{Binding Album}"
Header="Album" /> Header="Album" />
<DataGridTemplateColumn Header="Duration" SortMemberPath="Duration"> <DataGridTemplateColumn Header="Duration" SortMemberPath="Duration">
<DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.CellTemplate>
<DataTemplate> <DataTemplate>
<TextBlock <TextBlock
Margin="8,0,0,0" Margin="8,0,0,0"
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{Binding Duration}" /> Text="{Binding Duration}" />
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn> </DataGridTemplateColumn>
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
</Grid> </Grid>
</TabItem> </TabItem>
<TabItem Header="Grouping"> <TabItem Header="Grouping">
<DataGrid <DataGrid

View File

@@ -1,4 +1,18 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using Avalonia;
using Avalonia.Collections;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Controls.Primitives;
using Avalonia.Data;
using Avalonia.Input;
using Avalonia.Input.Raw;
using Avalonia.Markup.Xaml;
using Avalonia.Threading;
using Semi.Avalonia.Demo.ViewModels; using Semi.Avalonia.Demo.ViewModels;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;

View File

@@ -1,4 +1,6 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;
@@ -8,4 +10,9 @@ public partial class DataValidationErrorsDemo : UserControl
{ {
InitializeComponent(); InitializeComponent();
} }
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
} }

View File

@@ -1,4 +1,7 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using Avalonia.Media;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;
@@ -8,4 +11,14 @@ public partial class DatePickerDemo : UserControl
{ {
InitializeComponent(); InitializeComponent();
} }
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
public override void Render(DrawingContext context)
{
base.Render(context);
}
} }

View File

@@ -1,4 +1,6 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;

View File

@@ -1,4 +1,7 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.LogicalTree;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;

View File

@@ -1,4 +1,5 @@
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;
@@ -8,4 +9,9 @@ public partial class GridSplitterDemo : UserControl
{ {
InitializeComponent(); InitializeComponent();
} }
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
} }

View File

@@ -1,4 +1,7 @@
using System;
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;

View File

@@ -31,7 +31,7 @@
VerticalAlignment="Top" VerticalAlignment="Top"
ColumnDefinitions="Auto, *" ColumnDefinitions="Auto, *"
RowDefinitions="*,*,*,*,*,*,*,*,*,*,*"> RowDefinitions="*,*,*,*,*,*,*,*,*,*,*">
<TextBlock Grid.Row="0" Grid.Column="0">Classes</TextBlock> <TextBlock Grid.Row="0" Grid.Column="0">Classes</TextBlock>
<TextBlock Grid.Row="1" Grid.Column="0">-</TextBlock> <TextBlock Grid.Row="1" Grid.Column="0">-</TextBlock>
<TextBlock Grid.Row="2" Grid.Column="0">Secondary</TextBlock> <TextBlock Grid.Row="2" Grid.Column="0">Secondary</TextBlock>
<TextBlock Grid.Row="3" Grid.Column="0">Tertiary</TextBlock> <TextBlock Grid.Row="3" Grid.Column="0">Tertiary</TextBlock>

View File

@@ -1,4 +1,6 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;

View File

@@ -16,7 +16,7 @@
Header="Default"> Header="Default">
<ScrollViewer> <ScrollViewer>
<StackPanel Spacing="20"> <StackPanel Spacing="20">
<TextBlock Text="Theme: Default" /> <TextBlock Text="Theme: Default"/>
<ListBox ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" /> <ListBox ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
<ListBox IsEnabled="False"> <ListBox IsEnabled="False">
<ListBoxItem IsSelected="True">Avalonia</ListBoxItem> <ListBoxItem IsSelected="True">Avalonia</ListBoxItem>
@@ -31,7 +31,7 @@
Theme="{DynamicResource GroupBox}" Theme="{DynamicResource GroupBox}"
Header="RadioGroupListBox"> Header="RadioGroupListBox">
<StackPanel Spacing="20"> <StackPanel Spacing="20">
<TextBlock Text="Theme: RadioGroupListBox" /> <TextBlock Text="Theme: RadioGroupListBox"/>
<ListBox <ListBox
Theme="{DynamicResource RadioGroupListBox}" Theme="{DynamicResource RadioGroupListBox}"
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" /> ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
@@ -40,7 +40,7 @@
<ListBoxItem IsSelected="True">WPF</ListBoxItem> <ListBoxItem IsSelected="True">WPF</ListBoxItem>
</ListBox> </ListBox>
<TextBlock Text="Theme: ButtonRadioGroupListBox" /> <TextBlock Text="Theme: ButtonRadioGroupListBox"/>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Border HorizontalAlignment="Left" Theme="{StaticResource RadioButtonGroupBorder}"> <Border HorizontalAlignment="Left" Theme="{StaticResource RadioButtonGroupBorder}">
<ListBox Theme="{DynamicResource ButtonRadioGroupListBox}"> <ListBox Theme="{DynamicResource ButtonRadioGroupListBox}">
@@ -93,7 +93,7 @@
</Border> </Border>
</StackPanel> </StackPanel>
<TextBlock Text="Theme: CardRadioGroupListBox" /> <TextBlock Text="Theme: CardRadioGroupListBox"/>
<ListBox Theme="{DynamicResource CardRadioGroupListBox}" <ListBox Theme="{DynamicResource CardRadioGroupListBox}"
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" /> ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
<ListBox Theme="{DynamicResource CardRadioGroupListBox}" IsEnabled="False"> <ListBox Theme="{DynamicResource CardRadioGroupListBox}" IsEnabled="False">
@@ -101,7 +101,7 @@
<ListBoxItem>WPF</ListBoxItem> <ListBoxItem>WPF</ListBoxItem>
</ListBox> </ListBox>
<TextBlock Text="Theme: PureCardRadioGroupListBox" /> <TextBlock Text="Theme: PureCardRadioGroupListBox"/>
<ListBox Theme="{DynamicResource PureCardRadioGroupListBox}" <ListBox Theme="{DynamicResource PureCardRadioGroupListBox}"
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" /> ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
<ListBox Theme="{DynamicResource PureCardRadioGroupListBox}" IsEnabled="False"> <ListBox Theme="{DynamicResource PureCardRadioGroupListBox}" IsEnabled="False">
@@ -117,7 +117,7 @@
Header="CheckGroupListBox"> Header="CheckGroupListBox">
<ScrollViewer> <ScrollViewer>
<StackPanel Spacing="20"> <StackPanel Spacing="20">
<TextBlock Text="Theme: CheckGroupListBox" /> <TextBlock Text="Theme: CheckGroupListBox"/>
<ListBox <ListBox
SelectionMode="Multiple,Toggle" SelectionMode="Multiple,Toggle"
Theme="{DynamicResource CheckGroupListBox}" Theme="{DynamicResource CheckGroupListBox}"
@@ -129,7 +129,7 @@
<ListBoxItem>WPF</ListBoxItem> <ListBoxItem>WPF</ListBoxItem>
</ListBox> </ListBox>
<TextBlock Text="Theme: CardCheckGroupListBox" /> <TextBlock Text="Theme: CardCheckGroupListBox"/>
<ListBox <ListBox
SelectionMode="Multiple,Toggle" SelectionMode="Multiple,Toggle"
Theme="{DynamicResource CardCheckGroupListBox}" Theme="{DynamicResource CardCheckGroupListBox}"

View File

@@ -1,4 +1,6 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;
@@ -9,4 +11,8 @@ public partial class MenuDemo : UserControl
InitializeComponent(); InitializeComponent();
} }
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
} }

View File

@@ -1,4 +1,6 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;
@@ -9,4 +11,8 @@ public partial class NumericUpDownDemo : UserControl
InitializeComponent(); InitializeComponent();
} }
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
} }

View File

@@ -9,7 +9,7 @@ public partial class Overview : UserControl
InitializeComponent(); InitializeComponent();
} }
public string MainInstall { get; set; } = "dotnet add package Semi.Avalonia --version 11.2.1.8"; public string MainInstall { get; set; } = "dotnet add package Semi.Avalonia --version 11.2.1.7";
public string MainStyle { get; set; } = public string MainStyle { get; set; } =
""" """
@@ -18,7 +18,7 @@ public partial class Overview : UserControl
</Application.Styles> </Application.Styles>
"""; """;
public string ColorPickerInstall { get; set; } = "dotnet add package Semi.Avalonia.ColorPicker --version 11.2.1.8"; public string ColorPickerInstall { get; set; } = "dotnet add package Semi.Avalonia.ColorPicker --version 11.2.1.7";
public string ColorPickerStyle { get; set; } = public string ColorPickerStyle { get; set; } =
""" """
@@ -27,7 +27,7 @@ public partial class Overview : UserControl
</Application.Styles> </Application.Styles>
"""; """;
public string DataGridInstall { get; set; } = "dotnet add package Semi.Avalonia.DataGrid --version 11.2.1.8"; public string DataGridInstall { get; set; } = "dotnet add package Semi.Avalonia.DataGrid --version 11.2.1.7";
public string DataGridStyle { get; set; } = public string DataGridStyle { get; set; } =
""" """
@@ -36,7 +36,7 @@ public partial class Overview : UserControl
</Application.Styles> </Application.Styles>
"""; """;
public string TreeDataGridInstall { get; set; } = "dotnet add package Semi.Avalonia.TreeDataGrid --version 11.0.10.4"; public string TreeDataGridInstall { get; set; } = "dotnet add package Semi.Avalonia.TreeDataGrid --version 11.0.10.3";
public string TreeDataGridStyle { get; set; } = public string TreeDataGridStyle { get; set; } =
""" """

View File

@@ -1,4 +1,6 @@
using Avalonia.Controls; using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;

View File

@@ -20,16 +20,15 @@
Minimum="{Binding #slider.Minimum}" Minimum="{Binding #slider.Minimum}"
Theme="{DynamicResource ProgressRing}" Theme="{DynamicResource ProgressRing}"
Value="{Binding #slider.Value}" Value="{Binding #slider.Value}"
ShowProgressText="True" /> ShowProgressText="True"/>
<ProgressBar <ProgressBar
Width="100" Width="100"
Height="100" Height="100"
IsIndeterminate="True" IsIndeterminate="True"
BorderThickness="16"
Maximum="{Binding #slider.Maximum}" Maximum="{Binding #slider.Maximum}"
Minimum="{Binding #slider.Minimum}" Minimum="{Binding #slider.Minimum}"
Theme="{DynamicResource ProgressRing}" Theme="{DynamicResource ProgressRing}"
ShowProgressText="True" /> ShowProgressText="True"/>
</StackPanel> </StackPanel>
<Slider <Slider
Name="slider" Name="slider"

View File

@@ -1,4 +1,6 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;
@@ -8,4 +10,9 @@ public partial class ProgressBarDemo : UserControl
{ {
InitializeComponent(); InitializeComponent();
} }
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
} }

View File

@@ -1,4 +1,6 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;

View File

@@ -4,10 +4,10 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels" xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
x:DataType="vm:RefreshContainerDemoViewModel" x:DataType="pages:RefreshContainerDemoViewModel"
x:CompileBindings="True" x:CompileBindings="True"
mc:Ignorable="d"> mc:Ignorable="d">
<DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Top"> <DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Top">

View File

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

View File

@@ -1,4 +1,6 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;

View File

@@ -1,4 +1,6 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;
@@ -8,4 +10,9 @@ public partial class ScrollViewerDemo : UserControl
{ {
InitializeComponent(); InitializeComponent();
} }
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
} }

View File

@@ -1,4 +1,6 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;
@@ -9,4 +11,8 @@ public partial class SelectableTextBlockDemo : UserControl
InitializeComponent(); InitializeComponent();
} }
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
} }

View File

@@ -1,4 +1,6 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;
@@ -9,4 +11,8 @@ public partial class SliderDemo : UserControl
InitializeComponent(); InitializeComponent();
} }
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
} }

View File

@@ -4,12 +4,12 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels" xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
d:DesignHeight="1000" d:DesignHeight="1000"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">
<Design.DataContext> <Design.DataContext>
<vm:SplitViewDemoViewModel /> <pages:SplitViewDemoViewModel />
</Design.DataContext> </Design.DataContext>
<Border> <Border>
<Grid ColumnDefinitions="*,400"> <Grid ColumnDefinitions="*,400">
@@ -49,7 +49,7 @@
Grid.Row="3" Grid.Column="1" Grid.Row="3" Grid.Column="1"
Name="DisplayModeSelector" Name="DisplayModeSelector"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
ItemsSource="{x:Static vm:SplitViewDemoViewModel.DisplayModes}" ItemsSource="{x:Static pages:SplitViewDemoViewModel.DisplayModes}"
SelectedItem="{x:Static SplitViewDisplayMode.CompactInline}" /> SelectedItem="{x:Static SplitViewDisplayMode.CompactInline}" />
<Label <Label
@@ -114,7 +114,8 @@
Theme="{DynamicResource IconBorderlessToggleSwitch}" Theme="{DynamicResource IconBorderlessToggleSwitch}"
Content="{StaticResource SemiIconSidebar}" Content="{StaticResource SemiIconSidebar}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
IsChecked="{Binding #SplitView.IsPaneOpen}" /> IsChecked="{Binding #SplitView.IsPaneOpen}">
</ToggleSwitch>
</Grid> </Grid>
</SplitView.Pane> </SplitView.Pane>
@@ -204,7 +205,8 @@
Theme="{DynamicResource IconBorderlessToggleSwitch}" Theme="{DynamicResource IconBorderlessToggleSwitch}"
Content="{StaticResource SemiIconSidebar}" Content="{StaticResource SemiIconSidebar}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
IsChecked="{Binding #SplitView2.IsPaneOpen}" /> IsChecked="{Binding #SplitView2.IsPaneOpen}">
</ToggleSwitch>
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
Margin="8,12" Margin="8,12"

View File

@@ -1,5 +1,7 @@
using System.Collections.ObjectModel;
using Avalonia.Controls; using Avalonia.Controls;
using Semi.Avalonia.Demo.ViewModels; using Avalonia.Markup.Xaml;
using CommunityToolkit.Mvvm.ComponentModel;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;
@@ -10,4 +12,33 @@ public partial class SplitViewDemo : UserControl
InitializeComponent(); InitializeComponent();
this.DataContext = new SplitViewDemoViewModel(); this.DataContext = new SplitViewDemoViewModel();
} }
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
}
public class SplitViewDemoViewModel : ObservableObject
{
public ObservableCollection<string> Songs { get; set; } =
[
"320万年前",
"隐德来希",
"孔明",
"锦鲤卟噜噜",
"指鹿为马",
"热带季风Remix",
"加州梦境",
"渐近自由",
"世界所有的烂漫",
];
public static ObservableCollection<SplitViewDisplayMode> DisplayModes { get; set; } =
[
SplitViewDisplayMode.Inline,
SplitViewDisplayMode.CompactInline,
SplitViewDisplayMode.Overlay,
SplitViewDisplayMode.CompactOverlay,
];
} }

View File

@@ -1,4 +1,6 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using Semi.Avalonia.Demo.ViewModels; using Semi.Avalonia.Demo.ViewModels;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;

View File

@@ -1,4 +1,6 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;

View File

@@ -15,6 +15,7 @@
<TextBox Width="300" Classes="revealPasswordButton" Text="123456" /> <TextBox Width="300" Classes="revealPasswordButton" Text="123456" />
<TextBox <TextBox
Width="300" Width="300"
IsReadOnly="True"
Classes="ClearButton RevealPasswordButton" Classes="ClearButton RevealPasswordButton"
InnerLeftContent="https://" InnerLeftContent="https://"
InnerRightContent=".com" InnerRightContent=".com"

View File

@@ -1,4 +1,6 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;

View File

@@ -17,9 +17,9 @@
<TimePicker Classes="Large" /> <TimePicker Classes="Large" />
<TimePicker Classes="Small" /> <TimePicker Classes="Small" />
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TimePicker Classes="Large" ClockIdentifier="12HourClock" /> <TimePicker Classes="Large" ClockIdentifier="12HourClock"/>
<TimePicker ClockIdentifier="12HourClock" /> <TimePicker ClockIdentifier="12HourClock"/>
<TimePicker Classes="Small" ClockIdentifier="12HourClock" /> <TimePicker Classes="Small" ClockIdentifier="12HourClock"/>
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TimePicker IsEnabled="False" /> <TimePicker IsEnabled="False" />

View File

@@ -1,4 +1,6 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;
@@ -8,4 +10,9 @@ public partial class TimePickerDemo : UserControl
{ {
InitializeComponent(); InitializeComponent();
} }
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
} }

View File

@@ -1,4 +1,6 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;
@@ -8,4 +10,9 @@ public partial class ToggleButtonDemo : UserControl
{ {
InitializeComponent(); InitializeComponent();
} }
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
} }

View File

@@ -1,4 +1,6 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;
@@ -8,4 +10,9 @@ public partial class ToggleSwitchDemo : UserControl
{ {
InitializeComponent(); InitializeComponent();
} }
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
} }

View File

@@ -1,4 +1,6 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;
@@ -8,4 +10,9 @@ public partial class ToolTipDemo : UserControl
{ {
InitializeComponent(); InitializeComponent();
} }
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
} }

View File

@@ -1,5 +1,7 @@
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.ComponentModel;
namespace Semi.Avalonia.Demo.Pages; namespace Semi.Avalonia.Demo.Pages;
@@ -23,16 +25,14 @@ public class TreeViewVm : ObservableObject
{ {
Items = new ObservableCollection<TreeViewItemVm>() Items = new ObservableCollection<TreeViewItemVm>()
{ {
new TreeViewItemVm() { Name = "Item 1", Id = "1" }, new TreeViewItemVm() {Name = "Item 1", Id = "1"},
new TreeViewItemVm() { Name = "Item 2", Id = "2" }, new TreeViewItemVm() {Name = "Item 2", Id = "2"},
new TreeViewItemVm() new TreeViewItemVm() {Name = "Item 3", Id = "3", Items = new ObservableCollection<TreeViewItemVm>()
{ {
Name = "Item 3", Id = "3", Items = new ObservableCollection<TreeViewItemVm>() new TreeViewItemVm() {Name = "Item 3.1", Id = "3.1"},
{ new TreeViewItemVm() {Name = "Item 3.2", Id = "3.2"},
new TreeViewItemVm() { Name = "Item 3.1", Id = "3.1" }, new TreeViewItemVm() {Name = "Item 3.3", Id = "3.3"},
new TreeViewItemVm() { Name = "Item 3.2", Id = "3.2" }, },
new TreeViewItemVm() { Name = "Item 3.3", Id = "3.3" },
},
}, },
}; };
@@ -50,10 +50,8 @@ public class TreeViewVm : ObservableObject
ThirdItem thirdItem = new ThirdItem { Id = k, Name = $"ThirdItem {k}" }; ThirdItem thirdItem = new ThirdItem { Id = k, Name = $"ThirdItem {k}" };
secondItem.ThirdItemItems.Add(thirdItem); secondItem.ThirdItemItems.Add(thirdItem);
} }
firstItem.SecondItems.Add(secondItem); firstItem.SecondItems.Add(secondItem);
} }
MultipleLevelItems.Add(firstItem); MultipleLevelItems.Add(firstItem);
} }
} }
@@ -71,17 +69,18 @@ public class ItemBase
public int Id { get; set; } public int Id { get; set; }
public string? Name { get; set; } public string? Name { get; set; }
} }
public class FirstItem : ItemBase public class FirstItem : ItemBase
{ {
public ObservableCollection<SecondItem>? SecondItems { get; set; } public ObservableCollection<SecondItem>? SecondItems { get; set; }
} }
public class SecondItem : ItemBase public class SecondItem : ItemBase
{ {
public ObservableCollection<ThirdItem>? ThirdItemItems { get; set; } public ObservableCollection<ThirdItem>? ThirdItemItems { get; set; }
}
}
public class ThirdItem : ItemBase public class ThirdItem : ItemBase
{ {
} }

View File

@@ -19,7 +19,6 @@
<PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets> <PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets>
</PackageReference> </PackageReference>
<PackageReference Include="CommunityToolkit.Mvvm" Version="$(CommunityToolkitVersion)"/> <PackageReference Include="CommunityToolkit.Mvvm" Version="$(CommunityToolkitVersion)"/>
<PackageReference Include="Irihi.Avalonia.Shared" Version="0.3.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -1,37 +0,0 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Windows.Input;
using Avalonia.Platform.Storage;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
namespace Semi.Avalonia.Demo.ViewModels;
public partial class AboutUsViewModel : ObservableObject
{
public ICommand NavigateCommand { get; set; }
internal ILauncher? Launcher { get; set; }
public AboutUsViewModel()
{
NavigateCommand = new AsyncRelayCommand<string>(OnNavigateAsync);
}
private static readonly IReadOnlyDictionary<string, string> _keyToUrlMapping = new Dictionary<string, string>()
{
["semi"] = "https://github.com/irihitech/Semi.Avalonia",
["ursa"] = "https://github.com/irihitech/Ursa.Avalonia",
["mantra"] = "https://www.bilibili.com/video/BV15pfKYbEEQ",
["huska"] = "https://www.bilibili.com/video/BV1knj1zWE4A",
};
private async Task OnNavigateAsync(string? arg)
{
if (Launcher is not null && arg is not null && _keyToUrlMapping.TryGetValue(arg.ToLower(), out var uri))
{
await Launcher.LaunchUriAsync(new Uri(uri));
}
}
}

View File

@@ -2,10 +2,11 @@ using Avalonia;
using Avalonia.Controls.ApplicationLifetimes; using Avalonia.Controls.ApplicationLifetimes;
using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input; using CommunityToolkit.Mvvm.Input;
using Semi.Avalonia.Demo.Views;
namespace Semi.Avalonia.Demo.ViewModels; namespace Semi.Avalonia.Demo.ViewModels;
public partial class ApplicationViewModel : ObservableObject public partial class ApplicationViewModel: ObservableObject
{ {
[RelayCommand] [RelayCommand]
private void Exit() private void Exit()

View File

@@ -1,68 +0,0 @@
using System.Collections.ObjectModel;
using CommunityToolkit.Mvvm.ComponentModel;
namespace Semi.Avalonia.Demo.ViewModels;
public class AutoCompleteBoxDemoViewModel : ObservableObject
{
public ObservableCollection<StateData> States { get; set; } =
[
new("Alabama", "AL", "Montgomery"),
new("Alaska", "AK", "Juneau"),
new("Arizona", "AZ", "Phoenix"),
new("Arkansas", "AR", "Little Rock"),
new("California", "CA", "Sacramento"),
new("Colorado", "CO", "Denver"),
new("Connecticut", "CT", "Hartford"),
new("Delaware", "DE", "Dover"),
new("Florida", "FL", "Tallahassee"),
new("Georgia", "GA", "Atlanta"),
new("Hawaii", "HI", "Honolulu"),
new("Idaho", "ID", "Boise"),
new("Illinois", "IL", "Springfield"),
new("Indiana", "IN", "Indianapolis"),
new("Iowa", "IA", "Des Moines"),
new("Kansas", "KS", "Topeka"),
new("Kentucky", "KY", "Frankfort"),
new("Louisiana", "LA", "Baton Rouge"),
new("Maine", "ME", "Augusta"),
new("Maryland", "MD", "Annapolis"),
new("Massachusetts", "MA", "Boston"),
new("Michigan", "MI", "Lansing"),
new("Minnesota", "MN", "St. Paul"),
new("Mississippi", "MS", "Jackson"),
new("Missouri", "MO", "Jefferson City"),
new("Montana", "MT", "Helena"),
new("Nebraska", "NE", "Lincoln"),
new("Nevada", "NV", "Carson City"),
new("New Hampshire", "NH", "Concord"),
new("New Jersey", "NJ", "Trenton"),
new("New Mexico", "NM", "Santa Fe"),
new("New York", "NY", "Albany"),
new("North Carolina", "NC", "Raleigh"),
new("North Dakota", "ND", "Bismarck"),
new("Ohio", "OH", "Columbus"),
new("Oklahoma", "OK", "Oklahoma City"),
new("Oregon", "OR", "Salem"),
new("Pennsylvania", "PA", "Harrisburg"),
new("Rhode Island", "RI", "Providence"),
new("South Carolina", "SC", "Columbia"),
new("South Dakota", "SD", "Pierre"),
new("Tennessee", "TN", "Nashville"),
new("Texas", "TX", "Austin"),
new("Utah", "UT", "Salt Lake City"),
new("Vermont", "VT", "Montpelier"),
new("Virginia", "VA", "Richmond"),
new("Washington", "WA", "Olympia"),
new("West Virginia", "WV", "Charleston"),
new("Wisconsin", "WI", "Madison"),
new("Wyoming", "WY", "Cheyenne")
];
}
public class StateData(string name, string abbreviation, string capital)
{
public string Name { get; private set; } = name;
public string Abbreviation { get; private set; } = abbreviation;
public string Capital { get; private set; } = capital;
}

View File

@@ -1,9 +0,0 @@
using System.Collections.ObjectModel;
using CommunityToolkit.Mvvm.ComponentModel;
namespace Semi.Avalonia.Demo.ViewModels;
public class ComboBoxDemoViewModel : ObservableObject
{
public ObservableCollection<string> Items { get; set; } = ["Ding", "Otter", "Husky", "Mr.17", "Cass"];
}

View File

@@ -1,22 +0,0 @@
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using CommunityToolkit.Mvvm.ComponentModel;
namespace Semi.Avalonia.Demo.ViewModels;
public class RefreshContainerDemoViewModel : ObservableObject
{
public ObservableCollection<string> Items { get; }
public RefreshContainerDemoViewModel()
{
Items = new ObservableCollection<string>(Enumerable.Range(1, 200).Select(i => $"Item {i}"));
}
public async Task AddToTop()
{
await Task.Delay(1000);
Items.Insert(0, $"Item {200 - Items.Count}");
}
}

View File

@@ -1,29 +0,0 @@
using System.Collections.ObjectModel;
using Avalonia.Controls;
using CommunityToolkit.Mvvm.ComponentModel;
namespace Semi.Avalonia.Demo.ViewModels;
public class SplitViewDemoViewModel : ObservableObject
{
public ObservableCollection<string> Songs { get; set; } =
[
"320万年前",
"隐德来希",
"孔明",
"锦鲤卟噜噜",
"指鹿为马",
"热带季风Remix",
"加州梦境",
"渐近自由",
"世界所有的烂漫",
];
public static ObservableCollection<SplitViewDisplayMode> DisplayModes { get; set; } =
[
SplitViewDisplayMode.Inline,
SplitViewDisplayMode.CompactInline,
SplitViewDisplayMode.Overlay,
SplitViewDisplayMode.CompactOverlay,
];
}

View File

@@ -2,7 +2,7 @@ using CommunityToolkit.Mvvm.ComponentModel;
namespace Semi.Avalonia.Demo.ViewModels; namespace Semi.Avalonia.Demo.ViewModels;
public class TreeDataGridDemoViewModel : ObservableObject public class TreeDataGridDemoViewModel: ObservableObject
{ {
public SongsPageViewModel SongsContext { get; } = new(); public SongsPageViewModel SongsContext { get; } = new();
public FilesPageViewModel FilesContext { get; } = new(); public FilesPageViewModel FilesContext { get; } = new();

View File

@@ -111,9 +111,6 @@
<TabItem Header="Overview"> <TabItem Header="Overview">
<pages:Overview /> <pages:Overview />
</TabItem> </TabItem>
<TabItem Header="About Us">
<pages:AboutUs />
</TabItem>
<TabItem <TabItem
Theme="{DynamicResource CategoryTabItem}" Theme="{DynamicResource CategoryTabItem}"
Header="Resource Browser" /> Header="Resource Browser" />

View File

@@ -120,12 +120,6 @@ public partial class MainViewModel : ObservableObject
Command = SelectLocaleCommand, Command = SelectLocaleCommand,
CommandParameter = new CultureInfo("es-es") CommandParameter = new CultureInfo("es-es")
}, },
new MenuItemViewModel
{
Header = "Polski",
Command = SelectLocaleCommand,
CommandParameter = new CultureInfo("pl-pl")
},
] ]
} }
]; ];

View File

@@ -1,4 +1,5 @@
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Controls.Notifications;
namespace Semi.Avalonia.Demo.Views; namespace Semi.Avalonia.Demo.Views;

View File

@@ -3,7 +3,7 @@
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks> <TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<Version>11.2.1.8</Version> <Version>11.2.1.7</Version>
<Authors>IRIHI Technology Co., Ltd.</Authors> <Authors>IRIHI Technology Co., Ltd.</Authors>
<Description>Avalonia Theme inspired by Semi Design.</Description> <Description>Avalonia Theme inspired by Semi Design.</Description>
<RepositoryUrl>https://github.com/irihitech/Semi.Avalonia</RepositoryUrl> <RepositoryUrl>https://github.com/irihitech/Semi.Avalonia</RepositoryUrl>
@@ -14,7 +14,6 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<None Include="..\..\irihi.png" Pack="true" PackagePath="\" Link="Properties\irihi.png"/> <None Include="irihi.png" Pack="true" PackagePath=""/>
<None Include="..\..\LICENSE" Pack="true" PackagePath="\" Link="Properties\LICENSE"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -3,10 +3,10 @@
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="ColorPicker.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia.ColorPicker/Controls/ColorPicker.axaml" />
<ResourceInclude Source="ColorPreviewer.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia.ColorPicker/Controls/ColorPreviewer.axaml" />
<ResourceInclude Source="ColorSlider.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia.ColorPicker/Controls/ColorSlider.axaml" />
<ResourceInclude Source="ColorSpectrum.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia.ColorPicker/Controls/ColorSpectrum.axaml" />
<ResourceInclude Source="ColorView.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia.ColorPicker/Controls/ColorView.axaml" />
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>

View File

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

View File

@@ -4,7 +4,7 @@
<PropertyGroup> <PropertyGroup>
<Title>Semi.Avalonia.ColorPicker</Title> <Title>Semi.Avalonia.ColorPicker</Title>
<PackageReleaseNotes>Update to Semi.Avalonia.ColorPicker 11.2.1.8</PackageReleaseNotes> <PackageReleaseNotes>Update to Semi.Avalonia.ColorPicker 11.2.1.7</PackageReleaseNotes>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))"> <PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">

View File

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

View File

@@ -4,8 +4,8 @@
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks> <TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<Version>11.2.1.8</Version> <Version>11.2.1.7</Version>
<PackageReleaseNotes>Update to Semi.Avalonia.DataGrid 11.2.1.8</PackageReleaseNotes> <PackageReleaseNotes>Update to Semi.Avalonia.DataGrid 11.2.1.7</PackageReleaseNotes>
<Authors>IRIHI Technology Co., Ltd.</Authors> <Authors>IRIHI Technology Co., Ltd.</Authors>
<Description>Avalonia Theme inspired by Semi Design.</Description> <Description>Avalonia Theme inspired by Semi Design.</Description>
<RepositoryUrl>https://github.com/irihitech/Semi.Avalonia</RepositoryUrl> <RepositoryUrl>https://github.com/irihitech/Semi.Avalonia</RepositoryUrl>
@@ -21,8 +21,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.2.1"/> <PackageReference Include="Avalonia.Controls.DataGrid" Version="11.2.1"/>
<None Include="..\..\irihi.png" Pack="true" PackagePath="\" Link="Properties\irihi.png"/> <None Include="irihi.png" Pack="true" PackagePath=""/>
<None Include="..\..\LICENSE" Pack="true" PackagePath="\" Link="Properties\LICENSE"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

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

View File

@@ -4,8 +4,8 @@
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<Version>11.0.10.4</Version> <Version>11.0.10.3</Version>
<PackageReleaseNotes>Update to 11.0.10.4</PackageReleaseNotes> <PackageReleaseNotes>Update to 11.0.10.3</PackageReleaseNotes>
<Authors>IRIHI Technology Co., Ltd.</Authors> <Authors>IRIHI Technology Co., Ltd.</Authors>
<Description>Avalonia Theme inspired by Semi Design.</Description> <Description>Avalonia Theme inspired by Semi Design.</Description>
<RepositoryUrl>https://github.com/irihitech/Semi.Avalonia</RepositoryUrl> <RepositoryUrl>https://github.com/irihitech/Semi.Avalonia</RepositoryUrl>
@@ -20,8 +20,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia.Controls.TreeDataGrid" Version="11.0.10"/> <PackageReference Include="Avalonia.Controls.TreeDataGrid" Version="11.0.10"/>
<None Include="..\..\irihi.png" Pack="true" PackagePath="\" Link="Properties\irihi.png"/> <None Include="irihi.png" Pack="true" PackagePath=""/>
<None Include="..\..\LICENSE" Pack="true" PackagePath="\" Link="Properties\LICENSE"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -1,8 +1,7 @@
<Styles <Styles xmlns="https://github.com/avaloniaui"
x:Class="Semi.Avalonia.SemiPopupAnimations" x:Class="Semi.Avalonia.SemiPopupAnimations"
xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:converters="clr-namespace:Semi.Avalonia.Converters">
xmlns:converters="clr-namespace:Semi.Avalonia.Converters">
<Style Selector="Popup LayoutTransformControl#PART_LayoutTransform"> <Style Selector="Popup LayoutTransformControl#PART_LayoutTransform">
<Setter Property="RenderTransformOrigin" Value="{Binding $parent[Popup].Placement, Converter={x:Static converters:PlacementToRenderTransformOriginConverter.Instance}}" /> <Setter Property="RenderTransformOrigin" Value="{Binding $parent[Popup].Placement, Converter={x:Static converters:PlacementToRenderTransformOriginConverter.Instance}}" />
</Style> </Style>

View File

@@ -2,4 +2,7 @@ using Avalonia.Styling;
namespace Semi.Avalonia; namespace Semi.Avalonia;
public class SemiPopupAnimations : Styles; public class SemiPopupAnimations: Styles
{
}

View File

@@ -8,21 +8,21 @@
<!-- Button Light --> <!-- Button Light -->
<ControlTheme x:Key="{x:Type Button}" TargetType="Button"> <ControlTheme x:Key="{x:Type Button}" TargetType="Button">
<Setter Property="Padding" Value="{DynamicResource ButtonDefaultPadding}" />
<Setter Property="MinHeight" Value="{DynamicResource ButtonDefaultHeight}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonDefaultBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultBorderBrush}" />
<Setter Property="BorderThickness" Value="{DynamicResource ButtonBorderThickness}" />
<Setter Property="CornerRadius" Value="{DynamicResource ButtonCornerRadius}" /> <Setter Property="CornerRadius" Value="{DynamicResource ButtonCornerRadius}" />
<Setter Property="BorderThickness" Value="{DynamicResource ButtonBorderThickness}" />
<Setter Property="Padding" Value="{DynamicResource ButtonDefaultPadding}" />
<Setter Property="HorizontalAlignment" Value="Center" /> <Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" /> <Setter Property="RenderTransform" Value="none" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="FontSize" Value="{DynamicResource ButtonDefaultFontSize}" /> <Setter Property="FontSize" Value="{DynamicResource ButtonDefaultFontSize}" />
<Setter Property="FontWeight" Value="{DynamicResource ButtonDefaultFontWeight}" /> <Setter Property="FontWeight" Value="{DynamicResource ButtonDefaultFontWeight}" />
<Setter Property="RenderTransform" Value="none" />
<Setter Property="BackgroundSizing" Value="OuterBorderEdge" /> <Setter Property="BackgroundSizing" Value="OuterBorderEdge" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="MinHeight" Value="{DynamicResource ButtonDefaultHeight}" />
<Setter Property="Cursor" Value="Hand" /> <Setter Property="Cursor" Value="Hand" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="Button"> <ControlTemplate TargetType="Button">
@@ -35,9 +35,9 @@
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
BackgroundSizing="{TemplateBinding BackgroundSizing}" BackgroundSizing="{TemplateBinding BackgroundSizing}"
BorderThickness="{TemplateBinding BorderThickness}" BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
Content="{TemplateBinding Content}" Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplate="{TemplateBinding ContentTemplate}"
CornerRadius="{TemplateBinding CornerRadius}"
RecognizesAccessKey="True" RecognizesAccessKey="True"
TextElement.FontSize="{TemplateBinding FontSize}" TextElement.FontSize="{TemplateBinding FontSize}"
TextElement.FontWeight="{TemplateBinding FontWeight}" TextElement.FontWeight="{TemplateBinding FontWeight}"
@@ -46,42 +46,42 @@
</Setter> </Setter>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{TemplateBinding Background}" />
<Setter Property="BorderBrush" Value="{TemplateBinding BorderBrush}" /> <Setter Property="BorderBrush" Value="{TemplateBinding BorderBrush}" />
<Setter Property="Background" Value="{TemplateBinding Background}" />
</Style> </Style>
<Style Selector="^.Primary /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^.Primary">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
</Style> </Style>
<Style Selector="^.Secondary /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^.Secondary">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultSecondaryForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultSecondaryForeground}" />
</Style> </Style>
<Style Selector="^.Tertiary /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^.Tertiary">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultTertiaryForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultTertiaryForeground}" />
</Style> </Style>
<Style Selector="^.Success /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^.Success">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultSuccessForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultSuccessForeground}" />
</Style> </Style>
<Style Selector="^.Warning /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^.Warning">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultWarningForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultWarningForeground}" />
</Style> </Style>
<Style Selector="^.Danger /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^.Danger">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDangerForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDangerForeground}" />
</Style> </Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPointeroverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPointeroverBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPointeroverBackground}" />
</Style> </Style>
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPressedBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPressedBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPressedBackground}" />
</Style> </Style>
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultDisabledBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultDisabledBorderBrush}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style> </Style>
<Style Selector="^.Large"> <Style Selector="^.Large">
@@ -243,9 +243,9 @@
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineDangerBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineDangerBorderBrush}" />
</Style> </Style>
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style> </Style>
</ControlTheme> </ControlTheme>
@@ -254,13 +254,13 @@
BasedOn="{StaticResource {x:Type Button}}" BasedOn="{StaticResource {x:Type Button}}"
TargetType="Button"> TargetType="Button">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonBorderlessBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderlessBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderlessBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonBorderlessBackground}" />
</Style> </Style>
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonBorderlessBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderlessBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderlessBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonBorderlessBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style> </Style>
</ControlTheme> </ControlTheme>

View File

@@ -2,113 +2,117 @@
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True"> x:CompileBindings="True">
<Design.PreviewWith>
<StackPanel Margin="20">
<DropDownButton Content="Button" />
<DropDownButton Classes="Primary" Content="Button" />
<DropDownButton Classes="Secondary" Content="Button" />
<DropDownButton IsEnabled="False" Classes="Tertiary" Content="Button" />
<DropDownButton Theme="{DynamicResource SolidDropDownButton}" Classes="Success" Content="Button" />
<DropDownButton Theme="{DynamicResource OutlineDropDownButton}" Classes="Warning" Content="Button" />
<DropDownButton Theme="{DynamicResource BorderlessDropDownButton}" Classes="Danger" Content="Button" />
</StackPanel>
</Design.PreviewWith>
<ControlTheme x:Key="{x:Type DropDownButton}" TargetType="DropDownButton"> <ControlTheme x:Key="{x:Type DropDownButton}" TargetType="DropDownButton">
<Setter Property="Padding" Value="{DynamicResource ButtonDefaultPadding}" />
<Setter Property="MinHeight" Value="{DynamicResource ButtonDefaultHeight}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonDefaultBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultBorderBrush}" />
<Setter Property="BorderThickness" Value="{DynamicResource ButtonBorderThickness}" />
<Setter Property="CornerRadius" Value="{DynamicResource ButtonCornerRadius}" /> <Setter Property="CornerRadius" Value="{DynamicResource ButtonCornerRadius}" />
<Setter Property="BorderThickness" Value="{DynamicResource ButtonBorderThickness}" />
<Setter Property="Padding" Value="{DynamicResource ButtonDefaultPadding}" />
<Setter Property="RenderTransform" Value="none" />
<Setter Property="HorizontalAlignment" Value="Center" /> <Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="FontSize" Value="{DynamicResource ButtonDefaultFontSize}" /> <Setter Property="FontSize" Value="{DynamicResource ButtonDefaultFontSize}" />
<Setter Property="FontWeight" Value="{DynamicResource ButtonDefaultFontWeight}" /> <Setter Property="FontWeight" Value="{DynamicResource ButtonDefaultFontWeight}" />
<Setter Property="RenderTransform" Value="none" /> <Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="BackgroundSizing" Value="OuterBorderEdge" /> <Setter Property="BackgroundSizing" Value="OuterBorderEdge" />
<Setter Property="MinHeight" Value="{DynamicResource ButtonDefaultHeight}" />
<Setter Property="Cursor" Value="Hand" /> <Setter Property="Cursor" Value="Hand" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="DropDownButton"> <ControlTemplate TargetType="DropDownButton">
<Border <Border
Name="PART_Background" Name="RootBorder"
Padding="{TemplateBinding Padding}" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
BackgroundSizing="{TemplateBinding BackgroundSizing}"
BorderThickness="{TemplateBinding BorderThickness}" BorderThickness="{TemplateBinding BorderThickness}"
ClipToBounds="True"
CornerRadius="{TemplateBinding CornerRadius}"> CornerRadius="{TemplateBinding CornerRadius}">
<DockPanel> <Grid Name="InnerGrid" ColumnDefinitions="*,Auto">
<PathIcon
Name="DropDownGlyph"
DockPanel.Dock="Right"
Theme="{DynamicResource InnerPathIcon}"
HorizontalAlignment="Right"
Margin="8,0,0,0"
Data="{DynamicResource DropDownButtonIconGlyph}"
Foreground="{Binding #PART_ContentPresenter.Foreground}"
IsHitTestVisible="False"
UseLayoutRounding="False" />
<ContentPresenter <ContentPresenter
Name="PART_ContentPresenter" Name="PART_ContentPresenter"
Grid.Column="0"
Padding="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}" Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplate="{TemplateBinding ContentTemplate}"
Foreground="{TemplateBinding Foreground}" Foreground="{TemplateBinding Foreground}"
RecognizesAccessKey="True" /> RecognizesAccessKey="True" />
</DockPanel> <PathIcon
Name="DropDownGlyph"
Grid.Column="1"
Theme="{DynamicResource InnerPathIcon}"
Margin="0,0,8,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Data="{DynamicResource DropDownButtonIconGlyph}"
Foreground="{TemplateBinding Foreground}"
IsHitTestVisible="False"
UseLayoutRounding="False" />
</Grid>
</Border> </Border>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^ /template/ Border#PART_Background"> <Style Selector="^ /template/ Border#RootBorder">
<Setter Property="Background" Value="{TemplateBinding Background}" />
<Setter Property="BorderBrush" Value="{TemplateBinding BorderBrush}" /> <Setter Property="BorderBrush" Value="{TemplateBinding BorderBrush}" />
<Setter Property="Background" Value="{TemplateBinding Background}" />
</Style> </Style>
<Style Selector="^.Primary /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^:pointerover /template/ Border#RootBorder">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPointeroverBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPointeroverBackground}" />
</Style>
<Style Selector="^:pressed /template/ Border#RootBorder">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPressedBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPressedBackground}" />
</Style>
<Style Selector="^.Primary">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
</Style> </Style>
<Style Selector="^.Secondary /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^.Secondary">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultSecondaryForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultSecondaryForeground}" />
</Style> </Style>
<Style Selector="^.Tertiary /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^.Tertiary">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultTertiaryForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultTertiaryForeground}" />
</Style> </Style>
<Style Selector="^.Success /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^.Success">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultSuccessForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultSuccessForeground}" />
</Style> </Style>
<Style Selector="^.Warning /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^.Warning">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultWarningForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultWarningForeground}" />
</Style> </Style>
<Style Selector="^.Danger /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^.Danger">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDangerForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDangerForeground}" />
</Style> </Style>
<Style Selector="^:pointerover /template/ Border#PART_Background"> <Style Selector="^:pointerover /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPointeroverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPointeroverBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPointeroverBackground}" />
</Style> </Style>
<Style Selector="^:pressed /template/ Border#PART_Background"> <Style Selector="^:pressed /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPressedBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPressedBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPressedBackground}" />
</Style> </Style>
<Style Selector="^:disabled">
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style> </Style>
<Style Selector="^:disabled /template/ Border#PART_Background"> <Style Selector="^:disabled /template/ Border#RootBorder">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultDisabledBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultDisabledBorderBrush}" />
</Style> </Style>
<Style Selector="^.Large"> <Style Selector="^.Large">
<Setter Property="MinHeight" Value="{DynamicResource ButtonLargeHeight}" />
<Setter Property="Padding" Value="{DynamicResource ButtonLargePadding}" /> <Setter Property="Padding" Value="{DynamicResource ButtonLargePadding}" />
<Setter Property="MinHeight" Value="{DynamicResource ButtonLargeHeight}" />
</Style> </Style>
<Style Selector="^.Small"> <Style Selector="^.Small">
<Setter Property="MinHeight" Value="{DynamicResource ButtonSmallHeight}" />
<Setter Property="Padding" Value="{DynamicResource ButtonSmallPadding}" /> <Setter Property="Padding" Value="{DynamicResource ButtonSmallPadding}" />
<Setter Property="MinHeight" Value="{DynamicResource ButtonSmallHeight}" />
</Style> </Style>
</ControlTheme> </ControlTheme>
@@ -123,133 +127,114 @@
</FocusAdornerTemplate> </FocusAdornerTemplate>
</Setter> </Setter>
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" /> <Style Selector="^ /template/ Border#RootBorder">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" />
<Style Selector="^:pointerover /template/ Border#PART_Background"> </Style>
<Style Selector="^:pointerover /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPointeroverBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPointeroverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPointeroverBorderBrush}" />
</Style> </Style>
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^:pressed /template/ Border#RootBorder">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidPrimaryPressedForeground}" />
</Style>
<Style Selector="^:pressed /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPressedBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPressedBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPressedBorderBrush}" />
</Style> </Style>
<Style Selector="^.Primary"> <Style Selector="^.Primary">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> <Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" /> <Style Selector="^ /template/ Border#RootBorder">
</Style>
<Style Selector="^ /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" />
</Style> </Style>
<Style Selector="^:pointerover /template/ Border#PART_Background"> <Style Selector="^:pointerover /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPointeroverBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPointeroverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPointeroverBorderBrush}" />
</Style> </Style>
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^:pressed /template/ Border#RootBorder">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidPrimaryPressedForeground}" />
</Style>
<Style Selector="^:pressed /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPressedBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPressedBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPressedBorderBrush}" />
</Style> </Style>
</Style> </Style>
<Style Selector="^.Secondary"> <Style Selector="^.Secondary">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> <Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" /> <Style Selector="^ /template/ Border#RootBorder">
</Style>
<Style Selector="^ /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryBorderBrush}" />
</Style> </Style>
<Style Selector="^:pointerover /template/ Border#PART_Background"> <Style Selector="^:pointerover /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryPointeroverBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryPointeroverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryPointeroverBorderBrush}" />
</Style> </Style>
<Style Selector="^:pressed /template/ Border#PART_Background"> <Style Selector="^:pressed /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryPressedBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryPressedBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryPressedBorderBrush}" />
</Style> </Style>
</Style> </Style>
<Style Selector="^.Tertiary"> <Style Selector="^.Tertiary">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> <Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" /> <Style Selector="^ /template/ Border#RootBorder">
</Style>
<Style Selector="^ /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryBorderBrush}" />
</Style> </Style>
<Style Selector="^:pointerover /template/ Border#PART_Background"> <Style Selector="^:pointerover /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryPointeroverBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryPointeroverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryPointeroverBorderBrush}" />
</Style> </Style>
<Style Selector="^:pressed /template/ Border#PART_Background"> <Style Selector="^:pressed /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryPressedBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryPressedBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryPressedBorderBrush}" />
</Style> </Style>
</Style> </Style>
<Style Selector="^.Success"> <Style Selector="^.Success">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> <Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" /> <Style Selector="^ /template/ Border#RootBorder">
</Style>
<Style Selector="^ /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessBorderBrush}" />
</Style> </Style>
<Style Selector="^:pointerover /template/ Border#PART_Background"> <Style Selector="^:pointerover /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessPointeroverBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessPointeroverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessPointeroverBorderBrush}" />
</Style> </Style>
<Style Selector="^:pressed /template/ Border#PART_Background"> <Style Selector="^:pressed /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessPressedBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessPressedBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessPressedBorderBrush}" />
</Style> </Style>
</Style> </Style>
<Style Selector="^.Warning"> <Style Selector="^.Warning">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> <Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" /> <Style Selector="^ /template/ Border#RootBorder">
</Style>
<Style Selector="^ /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidWarningBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidWarningBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningBorderBrush}" />
</Style> </Style>
<Style Selector="^:pointerover /template/ Border#PART_Background"> <Style Selector="^:pointerover /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidWarningPointeroverBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidWarningPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningPointeroverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningPointeroverBorderBrush}" />
</Style> </Style>
<Style Selector="^:pressed /template/ Border#PART_Background"> <Style Selector="^:pressed /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidWarningPressedBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidWarningPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningPressedBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningPressedBorderBrush}" />
</Style> </Style>
</Style> </Style>
<Style Selector="^.Danger"> <Style Selector="^.Danger">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> <Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" /> <Style Selector="^ /template/ Border#RootBorder">
</Style>
<Style Selector="^ /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidDangerBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidDangerBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerBorderBrush}" />
</Style> </Style>
<Style Selector="^:pointerover /template/ Border#PART_Background"> <Style Selector="^:pointerover /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidDangerPointeroverBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidDangerPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerPointeroverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerPointeroverBorderBrush}" />
</Style> </Style>
<Style Selector="^:pressed /template/ Border#PART_Background"> <Style Selector="^:pressed /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonSolidDangerPressedBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidDangerPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerPressedBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerPressedBorderBrush}" />
</Style> </Style>
</Style> </Style>
<Style Selector="^:disabled /template/ Border#RootBorder">
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidDisabledForeground}" />
</Style>
<Style Selector="^:disabled /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidDisabledBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDisabledBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDisabledBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidDisabledBackground}" />
</Style>
<Style Selector="^:disabled">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidDisabledForeground}" />
</Style> </Style>
</ControlTheme> </ControlTheme>
@@ -257,59 +242,47 @@
x:Key="OutlineDropDownButton" x:Key="OutlineDropDownButton"
BasedOn="{StaticResource {x:Type DropDownButton}}" BasedOn="{StaticResource {x:Type DropDownButton}}"
TargetType="DropDownButton"> TargetType="DropDownButton">
<Style Selector="^ /template/ Border#PART_Background"> <Style Selector="^ /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlinePrimaryBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonOutlinePointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlinePrimaryBorderBrush}" />
</Style>
<Style Selector="^:pressed /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonOutlinePressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlinePrimaryBorderBrush}" />
</Style>
<Style Selector="^.Primary /template/ Border#PART_Background">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlinePrimaryBorderBrush}" />
</Style>
<Style Selector="^.Secondary /template/ Border#PART_Background">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineSecondaryBorderBrush}" />
</Style>
<Style Selector="^.Tertiary /template/ Border#PART_Background">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineTertiaryBorderBrush}" />
</Style>
<Style Selector="^.Success /template/ Border#PART_Background">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineSuccessBorderBrush}" />
</Style>
<Style Selector="^.Warning /template/ Border#PART_Background">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineWarningBorderBrush}" />
</Style>
<Style Selector="^.Danger /template/ Border#PART_Background">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineDangerBorderBrush}" />
</Style>
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style>
<Style Selector="^:disabled /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
</Style> </Style>
<Style Selector="^:pointerover /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonOutlinePointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
</Style>
<Style Selector="^:pressed /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonOutlinePressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
</Style>
<Style Selector="^.Success /template/ Border#RootBorder">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineSuccessBorderBrush}" />
</Style>
<Style Selector="^.Warning /template/ Border#RootBorder">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineWarningBorderBrush}" />
</Style>
<Style Selector="^.Danger /template/ Border#RootBorder">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineDangerBorderBrush}" />
</Style>
<Style Selector="^:disabled /template/ Border#RootBorder">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" />
</Style>
<Style Selector="^:disabled">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style>
</ControlTheme> </ControlTheme>
<ControlTheme <ControlTheme
x:Key="BorderlessDropDownButton" x:Key="BorderlessDropDownButton"
BasedOn="{StaticResource {x:Type DropDownButton}}" BasedOn="{StaticResource {x:Type DropDownButton}}"
TargetType="DropDownButton"> TargetType="DropDownButton">
<Style Selector="^ /template/ Border#PART_Background"> <Style Selector="^ /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource ButtonBorderlessBackground}" /> <Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderlessBorderBrush}" /> <Setter Property="BorderBrush" Value="Transparent" />
</Style> </Style>
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^:disabled /template/ Border#RootBorder">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" /> <Setter Property="BorderBrush" Value="Transparent" />
</Style> <Setter Property="Background" Value="Transparent" />
<Style Selector="^:disabled /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonBorderlessBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderlessBorderBrush}" />
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -344,7 +344,6 @@
<ControlTheme x:Key="ProgressRing" TargetType="ProgressBar"> <ControlTheme x:Key="ProgressRing" TargetType="ProgressBar">
<Setter Property="Foreground" Value="{DynamicResource ProgressBarIndicatorBrush}" /> <Setter Property="Foreground" Value="{DynamicResource ProgressBarIndicatorBrush}" />
<Setter Property="Background" Value="{DynamicResource ProgressBarBackground}" /> <Setter Property="Background" Value="{DynamicResource ProgressBarBackground}" />
<Setter Property="BorderThickness" Value="6" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="ProgressBar"> <ControlTemplate TargetType="ProgressBar">
<Panel> <Panel>
@@ -356,7 +355,7 @@
Stroke="{TemplateBinding Background}" Stroke="{TemplateBinding Background}"
StrokeJoin="Round" StrokeJoin="Round"
StrokeLineCap="Round" StrokeLineCap="Round"
StrokeThickness="{Binding BorderThickness.Left, RelativeSource={RelativeSource TemplatedParent}}" StrokeThickness="6"
SweepAngle="360" /> SweepAngle="360" />
<Arc <Arc
Name="Indicator" Name="Indicator"
@@ -365,7 +364,7 @@
Stroke="{TemplateBinding Foreground}" Stroke="{TemplateBinding Foreground}"
StrokeJoin="Round" StrokeJoin="Round"
StrokeLineCap="Round" StrokeLineCap="Round"
StrokeThickness="{Binding BorderThickness.Left, RelativeSource={RelativeSource TemplatedParent}}" StrokeThickness="6"
SweepAngle="{TemplateBinding Percentage, SweepAngle="{TemplateBinding Percentage,
Converter={StaticResource AngleConverter}}" /> Converter={StaticResource AngleConverter}}" />
<Arc <Arc
@@ -376,7 +375,7 @@
Stroke="{TemplateBinding Foreground}" Stroke="{TemplateBinding Foreground}"
StrokeJoin="Round" StrokeJoin="Round"
StrokeLineCap="Round" StrokeLineCap="Round"
StrokeThickness="{Binding BorderThickness.Left, RelativeSource={RelativeSource TemplatedParent}}" StrokeThickness="6"
SweepAngle="{TemplateBinding Percentage, SweepAngle="{TemplateBinding Percentage,
Converter={StaticResource AngleConverter}}" /> Converter={StaticResource AngleConverter}}" />
<TextBlock <TextBlock

View File

@@ -269,6 +269,17 @@
</Grid> </Grid>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^ /template/ ScrollBar">
<Setter Property="Opacity" Value="0" />
</Style>
<Style Selector="^:pointerover">
<Style Selector="^ /template/ ScrollBar#PART_HorizontalScrollBar">
<Setter Property="Opacity" Value="1" />
</Style>
<Style Selector="^ /template/ ScrollBar#PART_VerticalScrollBar">
<Setter Property="Opacity" Value="1" />
</Style>
</Style>
<Style Selector="^.InsetContent /template/ ScrollContentPresenter#PART_ContentPresenter"> <Style Selector="^.InsetContent /template/ ScrollContentPresenter#PART_ContentPresenter">
<Setter Property="Grid.RowSpan" Value="1"/> <Setter Property="Grid.RowSpan" Value="1"/>
<Setter Property="Grid.ColumnSpan" Value="1"/> <Setter Property="Grid.ColumnSpan" Value="1"/>

View File

@@ -20,10 +20,10 @@
</Design.PreviewWith> </Design.PreviewWith>
<ControlTheme x:Key="SemiSplitButtonElement" TargetType="Button"> <ControlTheme x:Key="SemiSplitButtonElement" TargetType="Button">
<Setter Property="Padding" Value="{DynamicResource ButtonDefaultPadding}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
<Setter Property="BorderThickness" Value="{DynamicResource ButtonBorderThickness}" />
<Setter Property="CornerRadius" Value="{DynamicResource ButtonCornerRadius}" /> <Setter Property="CornerRadius" Value="{DynamicResource ButtonCornerRadius}" />
<Setter Property="BorderThickness" Value="{DynamicResource ButtonBorderThickness}" />
<Setter Property="Padding" Value="{DynamicResource ButtonDefaultPadding}" />
<Setter Property="RenderTransform" Value="none" /> <Setter Property="RenderTransform" Value="none" />
<Setter Property="FontSize" Value="{DynamicResource ButtonDefaultFontSize}" /> <Setter Property="FontSize" Value="{DynamicResource ButtonDefaultFontSize}" />
<Setter Property="FontWeight" Value="{DynamicResource ButtonDefaultFontWeight}" /> <Setter Property="FontWeight" Value="{DynamicResource ButtonDefaultFontWeight}" />
@@ -38,13 +38,13 @@
VerticalAlignment="{TemplateBinding VerticalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
BackgroundSizing="{TemplateBinding BackgroundSizing}"
Background="{TemplateBinding Background}" Background="{TemplateBinding Background}"
BackgroundSizing="{TemplateBinding BackgroundSizing}"
BorderBrush="{TemplateBinding BorderBrush}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
Content="{TemplateBinding Content}" Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplate="{TemplateBinding ContentTemplate}"
CornerRadius="{TemplateBinding CornerRadius}"
RecognizesAccessKey="True" RecognizesAccessKey="True"
TextElement.FontSize="{TemplateBinding FontSize}" TextElement.FontSize="{TemplateBinding FontSize}"
TextElement.FontWeight="{TemplateBinding FontWeight}" TextElement.FontWeight="{TemplateBinding FontWeight}"
@@ -54,22 +54,20 @@
</ControlTheme> </ControlTheme>
<ControlTheme x:Key="{x:Type SplitButton}" TargetType="SplitButton"> <ControlTheme x:Key="{x:Type SplitButton}" TargetType="SplitButton">
<Setter Property="Padding" Value="{DynamicResource ButtonDefaultPadding}" />
<Setter Property="MinHeight" Value="{DynamicResource ButtonDefaultHeight}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonDefaultBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultBorderBrush}" />
<Setter Property="BorderThickness" Value="{DynamicResource ButtonBorderThickness}" />
<Setter Property="CornerRadius" Value="{DynamicResource ButtonCornerRadius}" /> <Setter Property="CornerRadius" Value="{DynamicResource ButtonCornerRadius}" />
<Setter Property="BorderThickness" Value="{DynamicResource ButtonBorderThickness}" />
<Setter Property="Padding" Value="{DynamicResource ButtonDefaultPadding}" />
<Setter Property="RenderTransform" Value="none" />
<Setter Property="HorizontalAlignment" Value="Center" /> <Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="FontSize" Value="{DynamicResource ButtonDefaultFontSize}" /> <Setter Property="FontSize" Value="{DynamicResource ButtonDefaultFontSize}" />
<Setter Property="FontWeight" Value="{DynamicResource ButtonDefaultFontWeight}" /> <Setter Property="FontWeight" Value="{DynamicResource ButtonDefaultFontWeight}" />
<Setter Property="RenderTransform" Value="none" /> <Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="BackgroundSizing" Value="OuterBorderEdge" /> <Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Cursor" Value="Hand" /> <Setter Property="MinHeight" Value="{DynamicResource ButtonDefaultHeight}" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="SplitButton"> <ControlTemplate TargetType="SplitButton">
<Border <Border
@@ -118,8 +116,8 @@
<Style Selector="^ /template/ Button"> <Style Selector="^ /template/ Button">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultBackground}" />
<Style Selector="^:pointerover"> <Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPointeroverBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonDefaultPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPointeroverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPointeroverBorderBrush}" />
@@ -131,9 +129,6 @@
</Style> </Style>
<Style Selector="^.Primary /template/ Button">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
</Style>
<Style Selector="^.Secondary /template/ Button"> <Style Selector="^.Secondary /template/ Button">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultSecondaryForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultSecondaryForeground}" />
</Style> </Style>
@@ -157,8 +152,8 @@
Classes="Solid" /> Classes="Solid" />
</FocusAdornerTemplate> </FocusAdornerTemplate>
</Setter> </Setter>
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Style Selector="^:pointerover"> <Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPointeroverBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPointeroverBackground}" />
</Style> </Style>
@@ -167,15 +162,6 @@
</Style> </Style>
</Style> </Style>
<Style Selector="^.Primary /template/ Button">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPointeroverBackground}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPressedBackground}" />
</Style>
</Style>
<Style Selector="^.Secondary /template/ Button"> <Style Selector="^.Secondary /template/ Button">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryBackground}" />
<Style Selector="^:pointerover"> <Style Selector="^:pointerover">
@@ -235,13 +221,13 @@
<Setter Property="MinHeight" Value="{DynamicResource ButtonSmallHeight}" /> <Setter Property="MinHeight" Value="{DynamicResource ButtonSmallHeight}" />
</Style> </Style>
<Style Selector="^:disabled /template/ Button"> <Style Selector="^:disabled /template/ Button">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonDefaultBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style> </Style>
<!-- only for ToggleSplitButton --> <!-- only for ToggleSplitButton -->
<Style Selector="^:checked:disabled /template/ Button"> <Style Selector="^:checked:disabled /template/ Button">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidDisabledForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidDisabledBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidDisabledBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidDisabledForeground}" />
</Style> </Style>
</ControlTheme> </ControlTheme>
@@ -329,8 +315,8 @@
</Style> </Style>
<Style Selector="^:disabled /template/ Button"> <Style Selector="^:disabled /template/ Button">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidDisabledForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidDisabledBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidDisabledBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidDisabledForeground}" />
</Style> </Style>
</ControlTheme> </ControlTheme>
@@ -358,9 +344,9 @@
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineDangerBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineDangerBorderBrush}" />
</Style> </Style>
<Style Selector="^:disabled /template/ Button"> <Style Selector="^:disabled /template/ Button">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style> </Style>
</ControlTheme> </ControlTheme>
@@ -373,9 +359,9 @@
<Setter Property="BorderBrush" Value="Transparent" /> <Setter Property="BorderBrush" Value="Transparent" />
</Style> </Style>
<Style Selector="^:disabled /template/ Button"> <Style Selector="^:disabled /template/ Button">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" /> <Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -468,17 +468,11 @@
Name="PART_Watermark" Name="PART_Watermark"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
IsVisible="{TemplateBinding Text, Converter={x:Static StringConverters.IsNullOrEmpty}}"
Opacity="0.5" Opacity="0.5"
Text="{TemplateBinding Watermark}" Text="{TemplateBinding Watermark}"
TextAlignment="{TemplateBinding TextAlignment}" 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 <TextPresenter
Name="PART_TextPresenter" Name="PART_TextPresenter"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"

View File

@@ -19,10 +19,77 @@
<ToggleButton Classes="Danger" IsThreeState="True">Toggle 3</ToggleButton> <ToggleButton Classes="Danger" IsThreeState="True">Toggle 3</ToggleButton>
</StackPanel> </StackPanel>
</Design.PreviewWith> </Design.PreviewWith>
<ControlTheme <ControlTheme x:Key="{x:Type ToggleButton}" TargetType="ToggleButton">
x:Key="{x:Type ToggleButton}" <Setter Property="Background" Value="{DynamicResource ToggleButtonDefaultBackground}" />
BasedOn="{StaticResource {x:Type Button}}" <Setter Property="BackgroundSizing" Value="OuterBorderEdge" />
TargetType="ToggleButton"> <Setter Property="Foreground" Value="{DynamicResource ToggleButtonDefaultPrimaryForeground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonDefaultBorderBrush}" />
<Setter Property="CornerRadius" Value="{DynamicResource ToggleButtonCornerRadius}" />
<Setter Property="BorderThickness" Value="{DynamicResource ToggleButtonBorderThickness}" />
<Setter Property="Padding" Value="{DynamicResource ButtonDefaultPadding}" />
<Setter Property="RenderTransform" Value="none" />
<Setter Property="FontSize" Value="{DynamicResource ToggleButtonDefaultFontSize}" />
<Setter Property="FontWeight" Value="{DynamicResource ToggleButtonDefaultFontWeight}" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="MinHeight" Value="{DynamicResource ButtonDefaultHeight}" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Template">
<ControlTemplate TargetType="ToggleButton">
<ContentPresenter
Name="PART_ContentPresenter"
BackgroundSizing="{TemplateBinding BackgroundSizing}"
Padding="{TemplateBinding Padding}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
CornerRadius="{TemplateBinding CornerRadius}"
RecognizesAccessKey="True"
TextElement.FontSize="{TemplateBinding FontSize}"
TextElement.FontWeight="{TemplateBinding FontWeight}"
UseLayoutRounding="False" />
</ControlTemplate>
</Setter>
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource ToggleButtonDefaultPointeroverBackground}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource ToggleButtonDefaultPressedBackground}" />
</Style>
<Style Selector="^:disabled">
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonDefaultDisabledBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ToggleButtonDefaultBackground}" />
</Style>
<Style Selector="^.Primary">
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonDefaultPrimaryForeground}" />
</Style>
<Style Selector="^.Secondary">
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonDefaultSecondaryForeground}" />
</Style>
<Style Selector="^.Tertiary">
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonDefaultTertiaryForeground}" />
</Style>
<Style Selector="^.Success">
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonDefaultSuccessForeground}" />
</Style>
<Style Selector="^.Warning">
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonDefaultWarningForeground}" />
</Style>
<Style Selector="^.Danger">
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonDefaultDangerForeground}" />
</Style>
<Style Selector="^:checked"> <Style Selector="^:checked">
<Setter Property="FocusAdorner"> <Setter Property="FocusAdorner">
@@ -31,155 +98,182 @@
Classes="Solid" /> Classes="Solid" />
</FocusAdornerTemplate> </FocusAdornerTemplate>
</Setter> </Setter>
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ToggleButtonCheckedForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" /> <Setter Property="Background" Value="{DynamicResource ToggleButtonPrimaryCheckedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonPrimaryCheckedBorderBrush}" />
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidPrimaryPressedForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPressedBorderBrush}" />
</Style>
<Style Selector="^.Primary"> <Style Selector="^.Primary">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> <Setter Property="Background" Value="{DynamicResource ToggleButtonPrimaryCheckedBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidPrimaryPressedForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPressedBorderBrush}" />
</Style>
</Style> </Style>
<Style Selector="^.Secondary"> <Style Selector="^.Secondary">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> <Setter Property="Background" Value="{DynamicResource ToggleButtonSecondaryCheckedBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryPressedBorderBrush}" />
</Style>
</Style> </Style>
<Style Selector="^.Tertiary"> <Style Selector="^.Tertiary">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> <Setter Property="Background" Value="{DynamicResource ToggleButtonTertiaryCheckedBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryPressedBorderBrush}" />
</Style>
</Style> </Style>
<Style Selector="^.Success"> <Style Selector="^.Success">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> <Setter Property="Background" Value="{DynamicResource ToggleButtonSuccessCheckedBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessPressedBorderBrush}" />
</Style>
</Style> </Style>
<Style Selector="^.Warning"> <Style Selector="^.Warning">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> <Setter Property="Background" Value="{DynamicResource ToggleButtonWarningCheckedBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidWarningBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningBorderBrush}" />
</Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidWarningPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningPointeroverBorderBrush}" />
</Style>
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonSolidWarningPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningPressedBorderBrush}" />
</Style>
</Style> </Style>
<Style Selector="^.Danger"> <Style Selector="^.Danger">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> <Setter Property="Background" Value="{DynamicResource ToggleButtonDangerCheckedBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" /> </Style>
<Setter Property="Background" Value="{DynamicResource ButtonSolidDangerBackground}" /> <Style Selector="^:pointerover">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerBorderBrush}" /> <Setter Property="Background" Value="{DynamicResource ToggleButtonPrimaryCheckedPointeroverBackground}" />
<Style Selector="^.Primary">
<Setter Property="Background" Value="{DynamicResource ToggleButtonPrimaryCheckedPointeroverBackground}" />
</Style> </Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^.Secondary">
<Setter Property="Background" Value="{DynamicResource ButtonSolidDangerPointeroverBackground}" /> <Setter Property="Background" Value="{DynamicResource ToggleButtonSecondaryCheckedPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerPointeroverBorderBrush}" />
</Style> </Style>
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^.Tertiary">
<Setter Property="Background" Value="{DynamicResource ButtonSolidDangerPressedBackground}" /> <Setter Property="Background" Value="{DynamicResource ToggleButtonTertiaryCheckedPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerPressedBorderBrush}" /> </Style>
<Style Selector="^.Success">
<Setter Property="Background" Value="{DynamicResource ToggleButtonSuccessCheckedPointeroverBackground}" />
</Style>
<Style Selector="^.Warning">
<Setter Property="Background" Value="{DynamicResource ToggleButtonWarningCheckedPointeroverBackground}" />
</Style>
<Style Selector="^.Danger">
<Setter Property="Background" Value="{DynamicResource ToggleButtonDangerCheckedPointeroverBackground}" />
</Style> </Style>
</Style> </Style>
<Style Selector="^:pressed">
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> <Setter Property="Foreground" Value="{DynamicResource ToggleButtonPrimaryCheckedPressedForeground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidDisabledForeground}" /> <Setter Property="Background" Value="{DynamicResource ToggleButtonPrimaryCheckedPressedBackground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidDisabledBackground}" /> <Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonPrimaryCheckedPressedBorderBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDisabledBorderBrush}" /> <Style Selector="^.Primary">
<Setter Property="Background" Value="{DynamicResource ToggleButtonPrimaryCheckedPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonPrimaryCheckedPressedBorderBrush}" />
</Style>
<Style Selector="^.Secondary">
<Setter Property="Background" Value="{DynamicResource ToggleButtonSecondaryCheckedPressedBackground}" />
</Style>
<Style Selector="^.Tertiary">
<Setter Property="Background" Value="{DynamicResource ToggleButtonTertiaryCheckedPressedBackground}" />
</Style>
<Style Selector="^.Success">
<Setter Property="Background" Value="{DynamicResource ToggleButtonSuccessCheckedPressedBackground}" />
</Style>
<Style Selector="^.Warning">
<Setter Property="Background" Value="{DynamicResource ToggleButtonWarningCheckedPressedBackground}" />
</Style>
<Style Selector="^.Danger">
<Setter Property="Background" Value="{DynamicResource ToggleButtonDangerCheckedPressedBackground}" />
</Style>
</Style>
<Style Selector="^:disabled">
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonDefaultDisabledBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ToggleButtonCheckedDisabledBackground}" />
</Style> </Style>
</Style> </Style>
<Style Selector="^:indeterminate"> <Style Selector="^:indeterminate">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> <Setter Property="BorderThickness" Value="1" />
<Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" /> <Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonPrimaryIndeterminateBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ToggleButtonPrimaryIndeterminateBackground}" />
<Style Selector="^.Primary">
<Setter Property="Background" Value="{DynamicResource ToggleButtonPrimaryIndeterminateBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonPrimaryIndeterminateBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonPrimaryIndeterminateBorderBrush}" />
</Style> </Style>
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^.Secondary">
<Setter Property="Background" Value="{DynamicResource ButtonOutlinePointeroverBackground}" /> <Setter Property="Background" Value="{DynamicResource ToggleButtonSecondaryIndeterminateBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonPrimaryIndeterminateBorderBrush}" />
</Style>
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ButtonOutlinePressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonPrimaryIndeterminateBorderBrush}" />
</Style>
<Style Selector="^.Primary /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonPrimaryIndeterminateBorderBrush}" />
</Style>
<Style Selector="^.Secondary /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonSecondaryIndeterminateBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonSecondaryIndeterminateBorderBrush}" />
</Style> </Style>
<Style Selector="^.Tertiary /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^.Tertiary">
<Setter Property="Background" Value="{DynamicResource ToggleButtonTertiaryIndeterminateBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonTertiaryIndeterminateBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonTertiaryIndeterminateBorderBrush}" />
</Style> </Style>
<Style Selector="^.Success /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^.Success">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineSuccessBorderBrush}" /> <Setter Property="Background" Value="{DynamicResource ToggleButtonSuccessIndeterminateBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonSuccessIndeterminateBorderBrush}" />
</Style> </Style>
<Style Selector="^.Warning /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^.Warning">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineWarningBorderBrush}" /> <Setter Property="Background" Value="{DynamicResource ToggleButtonWarningIndeterminateBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonWarningIndeterminateBorderBrush}" />
</Style> </Style>
<Style Selector="^.Danger /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^.Danger">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineDangerBorderBrush}" /> <Setter Property="Background" Value="{DynamicResource ToggleButtonDangerIndeterminateBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonDangerIndeterminateBorderBrush}" />
</Style> </Style>
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="^:pointerover">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" /> <Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonPrimaryIndeterminatePointeroverBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" /> <Setter Property="Foreground" Value="{DynamicResource ToggleButtonPrimaryIndeterminatePointeroverForeground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" /> <Style Selector="^.Primary">
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonPrimaryIndeterminatePointeroverBorderBrush}" />
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonPrimaryIndeterminatePointeroverForeground}" />
</Style>
<Style Selector="^.Secondary">
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonSecondaryIndeterminatePointeroverBorderBrush}" />
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonSecondaryIndeterminatePointeroverForeground}" />
</Style>
<Style Selector="^.Tertiary">
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonTertiaryIndeterminatePointeroverBorderBrush}" />
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonTertiaryIndeterminatePointeroverForeground}" />
</Style>
<Style Selector="^.Success">
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonSuccessIndeterminatePointeroverBorderBrush}" />
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonSuccessIndeterminatePointeroverForeground}" />
</Style>
<Style Selector="^.Warning">
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonWarningIndeterminatePointeroverBorderBrush}" />
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonWarningIndeterminatePointeroverForeground}" />
</Style>
<Style Selector="^.Danger">
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonDangerIndeterminatePointeroverBorderBrush}" />
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonDangerIndeterminatePointeroverForeground}" />
</Style>
</Style> </Style>
<Style Selector="^:pressed">
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonPrimaryIndeterminatePressedBorderBrush}" />
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonPrimaryIndeterminatePressedBorderBrush}" />
<Style Selector="^.Primary">
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonPrimaryIndeterminatePressedBorderBrush}" />
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonPrimaryIndeterminatePressedForeground}" />
</Style>
<Style Selector="^.Secondary">
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonSecondaryIndeterminatePressedBorderBrush}" />
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonSecondaryIndeterminatePressedForeground}" />
</Style>
<Style Selector="^.Tertiary">
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonTertiaryIndeterminatePressedBorderBrush}" />
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonTertiaryIndeterminatePressedForeground}" />
</Style>
<Style Selector="^.Success">
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonSuccessIndeterminatePressedBorderBrush}" />
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonSuccessIndeterminatePressedForeground}" />
</Style>
<Style Selector="^.Warning">
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonWarningIndeterminatePressedBorderBrush}" />
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonWarningIndeterminatePressedForeground}" />
</Style>
<Style Selector="^.Danger">
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonDangerIndeterminatePressedBorderBrush}" />
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonDangerIndeterminatePressedForeground}" />
</Style>
</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}" />
<Style Selector="^:checked">
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonCheckedDisabledForeground}" />
</Style>
</Style>
<Style Selector="^.Large">
<Setter Property="Padding" Value="{DynamicResource ButtonLargePadding}" />
<Setter Property="MinHeight" Value="{DynamicResource ButtonLargeHeight}" />
</Style>
<Style Selector="^.Small">
<Setter Property="Padding" Value="{DynamicResource ButtonSmallPadding}" />
<Setter Property="MinHeight" Value="{DynamicResource ButtonSmallHeight}" />
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -114,6 +114,20 @@
</GradientStops> </GradientStops>
</ConicGradientBrush> </ConicGradientBrush>
</Arc.Stroke> </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> </Arc>
</Panel> </Panel>
</Canvas> </Canvas>
@@ -194,16 +208,6 @@
</Style> </Style>
<Style Selector="^ /template/ Arc#SwitchKnobLoadingIndicator"> <Style Selector="^ /template/ Arc#SwitchKnobLoadingIndicator">
<Setter Property="IsVisible" Value="True" /> <Setter Property="IsVisible" Value="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> </Style>
<Style Selector="^:unchecked /template/ Border#SwitchBackgroundBorder"> <Style Selector="^:unchecked /template/ Border#SwitchBackgroundBorder">
<Setter Property="Background" Value="{DynamicResource ToggleSwitchContainerUnCheckedPointeroverBackground}" /> <Setter Property="Background" Value="{DynamicResource ToggleSwitchContainerUnCheckedPointeroverBackground}" />
@@ -265,10 +269,10 @@
<ControlTemplate TargetType="ToggleSwitch"> <ControlTemplate TargetType="ToggleSwitch">
<Border <Border
Name="SwitchBackgroundBorder" Name="SwitchBackgroundBorder"
Background="{TemplateBinding Background}"
Width="{DynamicResource ToggleSwitchDefaultWidth}" Width="{DynamicResource ToggleSwitchDefaultWidth}"
Height="{DynamicResource ToggleSwitchDefaultHeight}" Height="{DynamicResource ToggleSwitchDefaultHeight}"
BackgroundSizing="OuterBorderEdge" BackgroundSizing="OuterBorderEdge"
Background="{TemplateBinding Background}"
BorderBrush="{DynamicResource ToggleSwitchDefaultBorderBrush}" BorderBrush="{DynamicResource ToggleSwitchDefaultBorderBrush}"
BorderThickness="{DynamicResource ToggleSwitchDefaultBorderThickness}" BorderThickness="{DynamicResource ToggleSwitchDefaultBorderThickness}"
CornerRadius="{DynamicResource ToggleSwitchDefaultCornerRadius}"> CornerRadius="{DynamicResource ToggleSwitchDefaultCornerRadius}">
@@ -312,6 +316,20 @@
</GradientStops> </GradientStops>
</ConicGradientBrush> </ConicGradientBrush>
</Arc.Stroke> </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> </Arc>
</Panel> </Panel>
</Canvas> </Canvas>
@@ -354,26 +372,24 @@
</ControlTheme> </ControlTheme>
<ControlTheme x:Key="ButtonToggleSwitch" TargetType="ToggleSwitch"> <ControlTheme x:Key="ButtonToggleSwitch" TargetType="ToggleSwitch">
<Setter Property="Padding" Value="{DynamicResource ButtonDefaultPadding}" />
<Setter Property="MinHeight" Value="{DynamicResource ButtonDefaultHeight}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonBorderlessBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderlessBorderBrush}" />
<Setter Property="BorderThickness" Value="{DynamicResource ButtonBorderThickness}" />
<Setter Property="CornerRadius" Value="{DynamicResource ButtonCornerRadius}" />
<Setter Property="HorizontalAlignment" Value="Center" /> <Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" /> <Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" /> <Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="FontSize" Value="{DynamicResource ButtonDefaultFontSize}" /> <Setter Property="Padding" Value="{DynamicResource ButtonDefaultPadding}" />
<Setter Property="FontWeight" Value="{DynamicResource ButtonDefaultFontWeight}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
<Setter Property="RenderTransform" Value="none" /> <Setter Property="Background" Value="{DynamicResource ButtonBorderlessBackground}" />
<Setter Property="BackgroundSizing" Value="OuterBorderEdge" /> <Setter Property="BackgroundSizing" Value="OuterBorderEdge" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderlessBorderBrush}" />
<Setter Property="BorderThickness" Value="{DynamicResource ButtonBorderThickness}" />
<Setter Property="CornerRadius" Value="{DynamicResource ButtonCornerRadius}" />
<Setter Property="Cursor" Value="Hand" /> <Setter Property="Cursor" Value="Hand" />
<Setter Property="OnContent" Value="{x:Null}" /> <Setter Property="OnContent" Value="{x:Null}" />
<Setter Property="OffContent" Value="{x:Null}" /> <Setter Property="OffContent" Value="{x:Null}" />
<Setter Property="Content" Value="{x:Null}" /> <Setter Property="Content" Value="{x:Null}" />
<Setter Property="MinHeight" Value="{DynamicResource ButtonDefaultHeight}" />
<Setter Property="FontSize" Value="{DynamicResource ButtonDefaultFontSize}" />
<Setter Property="FontWeight" Value="{DynamicResource ButtonDefaultFontWeight}" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="ToggleSwitch"> <ControlTemplate TargetType="ToggleSwitch">
<Border <Border

View File

@@ -3,61 +3,61 @@
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="AdornerLayer.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/AdornerLayer.axaml" />
<ResourceInclude Source="AutoCompleteBox.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/AutoCompleteBox.axaml" />
<ResourceInclude Source="Border.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/Border.axaml" />
<ResourceInclude Source="Button.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/Button.axaml" />
<ResourceInclude Source="ButtonSpinner.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/ButtonSpinner.axaml" />
<ResourceInclude Source="Calendar.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/Calendar.axaml" />
<ResourceInclude Source="CalendarDatePicker.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/CalendarDatePicker.axaml" />
<ResourceInclude Source="CaptionButtons.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/CaptionButtons.axaml" />
<ResourceInclude Source="Carousel.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/Carousel.axaml" />
<ResourceInclude Source="CheckBox.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/CheckBox.axaml" />
<ResourceInclude Source="ComboBox.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/ComboBox.axaml" />
<ResourceInclude Source="ContextMenu.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/ContextMenu.axaml" />
<ResourceInclude Source="DataValidationErrors.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/DataValidationErrors.axaml" />
<ResourceInclude Source="DatePicker.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/DatePicker.axaml" />
<ResourceInclude Source="DateTimePickerShared.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/DateTimePickerShared.axaml" />
<ResourceInclude Source="DropDownButton.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/DropDownButton.axaml" />
<ResourceInclude Source="EmbeddableControlRoot.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/EmbeddableControlRoot.axaml" />
<ResourceInclude Source="Expander.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/Expander.axaml" />
<ResourceInclude Source="FlyoutPresenter.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/FlyoutPresenter.axaml" />
<ResourceInclude Source="GridSplitter.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/GridSplitter.axaml" />
<ResourceInclude Source="HeaderedContentControl.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/HeaderedContentControl.axaml" />
<ResourceInclude Source="HyperlinkButton.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/HyperlinkButton.axaml" />
<ResourceInclude Source="ItemsControl.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/ItemsControl.axaml" />
<ResourceInclude Source="Label.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/Label.axaml" />
<ResourceInclude Source="ListBox.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/ListBox.axaml" />
<ResourceInclude Source="ManagedFileChooser.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/ManagedFileChooser.axaml" />
<ResourceInclude Source="Menu.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/Menu.axaml" />
<ResourceInclude Source="MenuFlyoutPresenter.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/MenuFlyoutPresenter.axaml" />
<ResourceInclude Source="NotificationCard.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/NotificationCard.axaml" />
<ResourceInclude Source="NumericUpDown.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/NumericUpDown.axaml" />
<ResourceInclude Source="PathIcon.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/PathIcon.axaml" />
<ResourceInclude Source="Popup.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/Popup.axaml" />
<ResourceInclude Source="ProgressBar.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/ProgressBar.axaml" />
<ResourceInclude Source="RadioButton.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/RadioButton.axaml" />
<ResourceInclude Source="RefreshContainer.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/RefreshContainer.axaml" />
<ResourceInclude Source="RepeatButton.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/RepeatButton.axaml" />
<ResourceInclude Source="SelectableTextBlock.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/SelectableTextBlock.axaml" />
<ResourceInclude Source="ScrollViewer.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/ScrollViewer.axaml" />
<ResourceInclude Source="Slider.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/Slider.axaml" />
<ResourceInclude Source="SplitButton.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/SplitButton.axaml" />
<ResourceInclude Source="SplitView.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/SplitView.axaml" />
<ResourceInclude Source="TabControl.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/TabControl.axaml" />
<ResourceInclude Source="TabItem.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/TabItem.axaml" />
<ResourceInclude Source="TabStrip.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/TabStrip.axaml" />
<ResourceInclude Source="TextBlock.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/TextBlock.axaml" />
<ResourceInclude Source="TextBox.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/TextBox.axaml" />
<ResourceInclude Source="ThemeVariantScope.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/ThemeVariantScope.axaml" />
<ResourceInclude Source="TimePicker.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/TimePicker.axaml" />
<ResourceInclude Source="TitleBar.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/TitleBar.axaml" />
<ResourceInclude Source="ToggleButton.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/ToggleButton.axaml" />
<ResourceInclude Source="ToggleSwitch.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/ToggleSwitch.axaml" />
<ResourceInclude Source="Tooltip.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/Tooltip.axaml" />
<ResourceInclude Source="TransitioningContentControl.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/TransitioningContentControl.axaml" />
<ResourceInclude Source="TreeView.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/TreeView.axaml" />
<ResourceInclude Source="Window.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/Window.axaml" />
<ResourceInclude Source="WindowNotificationManager.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/WindowNotificationManager.axaml" />
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -1,9 +1,6 @@
<ResourceDictionary <ResourceDictionary x:Class="Semi.Avalonia.Icons" xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
x:Class="Semi.Avalonia.Icons"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="Icon.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Icons/Icon.axaml" />
<ResourceInclude Source="IconPatch.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Icons/IconPatch.axaml" />
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -4,22 +4,22 @@
<Styles.Resources> <Styles.Resources>
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.ThemeDictionaries> <ResourceDictionary.ThemeDictionaries>
<ResourceInclude x:Key="Default" Source="/Schemes/LightScheme.axaml" /> <ResourceInclude x:Key="Default" Source="avares://Semi.Avalonia/Schemes/LightScheme.axaml" />
<ResourceInclude x:Key="Dark" Source="/Schemes/DarkScheme.axaml" /> <ResourceInclude x:Key="Dark" Source="avares://Semi.Avalonia/Schemes/DarkScheme.axaml" />
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Aquatic}" Source="/Schemes/AquaticScheme.axaml" /> <ResourceInclude x:Key="{x:Static semi:SemiTheme.Aquatic}" Source="avares://Semi.Avalonia/Schemes/AquaticScheme.axaml" />
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Desert}" Source="/Schemes/DesertScheme.axaml" /> <ResourceInclude x:Key="{x:Static semi:SemiTheme.Desert}" Source="avares://Semi.Avalonia/Schemes/DesertScheme.axaml" />
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Dusk}" Source="/Schemes/DuskScheme.axaml" /> <ResourceInclude x:Key="{x:Static semi:SemiTheme.Dusk}" Source="avares://Semi.Avalonia/Schemes/DuskScheme.axaml" />
<ResourceInclude x:Key="{x:Static semi:SemiTheme.NightSky}" Source="/Schemes/NightSkyScheme.axaml" /> <ResourceInclude x:Key="{x:Static semi:SemiTheme.NightSky}" Source="avares://Semi.Avalonia/Schemes/NightSkyScheme.axaml" />
</ResourceDictionary.ThemeDictionaries> </ResourceDictionary.ThemeDictionaries>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="/Controls/_index.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/_index.axaml" />
<ResourceInclude Source="/Themes/Shared/_index.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Shared/_index.axaml" />
<ResourceInclude Source="/Tokens/Variables.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Tokens/Variables.axaml" />
<ResourceInclude Source="/Locale/zh-cn.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Locale/zh-cn.axaml" />
<ResourceInclude Source="/Icons/_index.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Icons/_index.axaml" />
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>
</Styles.Resources> </Styles.Resources>
<StyleInclude Source="/Styles/_index.axaml" /> <StyleInclude Source="avares://Semi.Avalonia/Styles/_index.axaml" />
</Styles> </Styles>

View File

@@ -1,21 +0,0 @@
using Avalonia.Controls;
namespace Semi.Avalonia.Locale;
public class de_de : ResourceDictionary;
public class en_us : ResourceDictionary;
public class es_es : ResourceDictionary;
public class ja_jp : ResourceDictionary;
public class pl_pl : ResourceDictionary;
public class ru_ru : ResourceDictionary;
public class uk_ua : ResourceDictionary;
public class zh_cn : ResourceDictionary;
public class zh_tw : ResourceDictionary;

View File

@@ -1,7 +1,6 @@
<ResourceDictionary <ResourceDictionary x:Class="Semi.Avalonia.Locale.de_de"
x:Class="Semi.Avalonia.Locale.de_de" xmlns="https://github.com/avaloniaui"
xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- DatePicker --> <!-- DatePicker -->
<x:String x:Key="STRING_DATEPICKER_DAY_TEXT">Tag</x:String> <x:String x:Key="STRING_DATEPICKER_DAY_TEXT">Tag</x:String>
<x:String x:Key="STRING_DATEPICKER_MONTH_TEXT">Monat</x:String> <x:String x:Key="STRING_DATEPICKER_MONTH_TEXT">Monat</x:String>

View File

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

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