mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-11 11:46:36 +08:00
Compare commits
30 Commits
v12.0.0-pr
...
editorconf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
16e646ddde | ||
|
|
4447475f18 | ||
|
|
e53e744d1f | ||
|
|
6eaa47e7ce | ||
|
|
1edc65c091 | ||
|
|
1348149957 | ||
|
|
3b4443cd54 | ||
|
|
35bea6ff1f | ||
|
|
c393d41112 | ||
|
|
d4c4ef1dba | ||
|
|
35b62fe3af | ||
|
|
c48d96e40f | ||
|
|
c128feb4ff | ||
|
|
48c3837d81 | ||
|
|
f22709fcb1 | ||
|
|
0fbcf43309 | ||
|
|
a1bda0d2d9 | ||
|
|
52cc3887b1 | ||
|
|
9cf27b3906 | ||
|
|
bfb3dd671b | ||
|
|
665dca3bd3 | ||
|
|
f5e56511ac | ||
|
|
b3b7459088 | ||
|
|
96f7f3d1e1 | ||
|
|
64e2b50a1d | ||
|
|
fbfe5b0b6a | ||
|
|
bd4d4e2096 | ||
|
|
01e213d741 | ||
|
|
77dffc55b1 | ||
|
|
3ba357b691 |
243
.editorconfig
Normal file
243
.editorconfig
Normal file
@@ -0,0 +1,243 @@
|
|||||||
|
# editorconfig.org
|
||||||
|
|
||||||
|
# top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
# Default settings:
|
||||||
|
# A newline ending every file
|
||||||
|
# Use 4 spaces as indentation
|
||||||
|
[*]
|
||||||
|
insert_final_newline = true
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
|
# C# files
|
||||||
|
[*.cs]
|
||||||
|
# New line preferences
|
||||||
|
csharp_new_line_before_open_brace = all
|
||||||
|
csharp_new_line_before_else = true
|
||||||
|
csharp_new_line_before_catch = true
|
||||||
|
csharp_new_line_before_finally = true
|
||||||
|
csharp_new_line_before_members_in_object_initializers = true
|
||||||
|
csharp_new_line_before_members_in_anonymous_types = true
|
||||||
|
csharp_new_line_between_query_expression_clauses = true
|
||||||
|
# trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
# Indentation preferences
|
||||||
|
csharp_indent_block_contents = true
|
||||||
|
csharp_indent_braces = false
|
||||||
|
csharp_indent_case_contents = true
|
||||||
|
csharp_indent_switch_labels = true
|
||||||
|
csharp_indent_labels = one_less_than_current
|
||||||
|
|
||||||
|
# avoid this. unless absolutely necessary
|
||||||
|
dotnet_style_qualification_for_field = false:suggestion
|
||||||
|
dotnet_style_qualification_for_property = false:suggestion
|
||||||
|
dotnet_style_qualification_for_method = false:suggestion
|
||||||
|
dotnet_style_qualification_for_event = false:suggestion
|
||||||
|
|
||||||
|
# prefer var
|
||||||
|
csharp_style_var_for_built_in_types = true
|
||||||
|
csharp_style_var_when_type_is_apparent = true
|
||||||
|
csharp_style_var_elsewhere = true:suggestion
|
||||||
|
|
||||||
|
# use language keywords instead of BCL types
|
||||||
|
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
|
||||||
|
dotnet_style_predefined_type_for_member_access = true:suggestion
|
||||||
|
|
||||||
|
# name all constant fields using PascalCase
|
||||||
|
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
|
||||||
|
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
|
||||||
|
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
|
||||||
|
|
||||||
|
dotnet_naming_symbols.constant_fields.applicable_kinds = field
|
||||||
|
dotnet_naming_symbols.constant_fields.required_modifiers = const
|
||||||
|
|
||||||
|
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
|
||||||
|
|
||||||
|
# private static fields should have s_ prefix
|
||||||
|
dotnet_naming_rule.private_static_fields_should_have_prefix.severity = suggestion
|
||||||
|
dotnet_naming_rule.private_static_fields_should_have_prefix.symbols = private_static_fields
|
||||||
|
dotnet_naming_rule.private_static_fields_should_have_prefix.style = private_static_prefix_style
|
||||||
|
|
||||||
|
dotnet_naming_symbols.private_static_fields.applicable_kinds = field
|
||||||
|
dotnet_naming_symbols.private_static_fields.required_modifiers = static
|
||||||
|
dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private
|
||||||
|
|
||||||
|
dotnet_naming_style.private_static_prefix_style.required_prefix = s_
|
||||||
|
dotnet_naming_style.private_static_prefix_style.capitalization = camel_case
|
||||||
|
|
||||||
|
# internal and private fields should be _camelCase
|
||||||
|
dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
|
||||||
|
dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
|
||||||
|
dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
|
||||||
|
|
||||||
|
dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
|
||||||
|
dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
|
||||||
|
|
||||||
|
dotnet_naming_style.camel_case_underscore_style.required_prefix = _
|
||||||
|
dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
|
||||||
|
|
||||||
|
# use accessibility modifiers
|
||||||
|
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
|
||||||
|
|
||||||
|
# Code style defaults
|
||||||
|
dotnet_sort_system_directives_first = true
|
||||||
|
csharp_preserve_single_line_blocks = true
|
||||||
|
csharp_preserve_single_line_statements = false
|
||||||
|
|
||||||
|
# Expression-level preferences
|
||||||
|
dotnet_style_object_initializer = true:suggestion
|
||||||
|
dotnet_style_collection_initializer = true:suggestion
|
||||||
|
dotnet_style_explicit_tuple_names = true:suggestion
|
||||||
|
dotnet_style_coalesce_expression = true:suggestion
|
||||||
|
dotnet_style_null_propagation = true:suggestion
|
||||||
|
|
||||||
|
# Expression-bodied members
|
||||||
|
csharp_style_expression_bodied_methods = false:none
|
||||||
|
csharp_style_expression_bodied_constructors = false:none
|
||||||
|
csharp_style_expression_bodied_operators = false:none
|
||||||
|
csharp_style_expression_bodied_properties = true:none
|
||||||
|
csharp_style_expression_bodied_indexers = true:none
|
||||||
|
csharp_style_expression_bodied_accessors = true:none
|
||||||
|
|
||||||
|
# Pattern matching
|
||||||
|
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
|
||||||
|
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
|
||||||
|
csharp_style_inlined_variable_declaration = true:suggestion
|
||||||
|
|
||||||
|
# Null checking preferences
|
||||||
|
csharp_style_throw_expression = true:suggestion
|
||||||
|
csharp_style_conditional_delegate_call = true:suggestion
|
||||||
|
|
||||||
|
# Space preferences
|
||||||
|
csharp_space_after_cast = false
|
||||||
|
csharp_space_after_colon_in_inheritance_clause = true
|
||||||
|
csharp_space_after_comma = true
|
||||||
|
csharp_space_after_dot = false
|
||||||
|
csharp_space_after_keywords_in_control_flow_statements = true
|
||||||
|
csharp_space_after_semicolon_in_for_statement = true
|
||||||
|
csharp_space_around_binary_operators = before_and_after
|
||||||
|
csharp_space_around_declaration_statements = false
|
||||||
|
csharp_space_before_colon_in_inheritance_clause = true
|
||||||
|
csharp_space_before_comma = false
|
||||||
|
csharp_space_before_dot = false
|
||||||
|
csharp_space_before_open_square_brackets = false
|
||||||
|
csharp_space_before_semicolon_in_for_statement = false
|
||||||
|
csharp_space_between_empty_square_brackets = false
|
||||||
|
csharp_space_between_method_call_empty_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_method_call_name_and_opening_parenthesis = false
|
||||||
|
csharp_space_between_method_call_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_method_declaration_name_and_open_parenthesis = false
|
||||||
|
csharp_space_between_method_declaration_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_parentheses = false
|
||||||
|
csharp_space_between_square_brackets = false
|
||||||
|
space_within_single_line_array_initializer_braces = true
|
||||||
|
|
||||||
|
#Net Analyzer
|
||||||
|
dotnet_analyzer_diagnostic.category-Performance.severity = none #error - Uncomment when all violations are fixed.
|
||||||
|
|
||||||
|
# CA1018: Mark attributes with AttributeUsageAttribute
|
||||||
|
dotnet_diagnostic.CA1018.severity = warning
|
||||||
|
# CA1304: Specify CultureInfo
|
||||||
|
dotnet_diagnostic.CA1304.severity = warning
|
||||||
|
# CA1802: Use literals where appropriate
|
||||||
|
dotnet_diagnostic.CA1802.severity = warning
|
||||||
|
# CA1813: Avoid unsealed attributes
|
||||||
|
dotnet_diagnostic.CA1813.severity = warning
|
||||||
|
# CA1815: Override equals and operator equals on value types
|
||||||
|
dotnet_diagnostic.CA1815.severity = warning
|
||||||
|
# CA1820: Test for empty strings using string length
|
||||||
|
dotnet_diagnostic.CA1820.severity = warning
|
||||||
|
# CA1821: Remove empty finalizers
|
||||||
|
dotnet_diagnostic.CA1821.severity = warning
|
||||||
|
# CA1822: Mark members as static
|
||||||
|
dotnet_diagnostic.CA1822.severity = suggestion
|
||||||
|
dotnet_code_quality.CA1822.api_surface = private, internal
|
||||||
|
# CA1823: Avoid unused private fields
|
||||||
|
dotnet_diagnostic.CA1823.severity = warning
|
||||||
|
# CA1825: Avoid zero-length array allocations
|
||||||
|
dotnet_diagnostic.CA1825.severity = warning
|
||||||
|
# CA1826: Use property instead of Linq Enumerable method
|
||||||
|
dotnet_diagnostic.CA1826.severity = suggestion
|
||||||
|
# CA1827: Do not use Count/LongCount when Any can be used
|
||||||
|
dotnet_diagnostic.CA1827.severity = warning
|
||||||
|
# CA1828: Do not use CountAsync/LongCountAsync when AnyAsync can be used
|
||||||
|
dotnet_diagnostic.CA1828.severity = warning
|
||||||
|
# CA1829: Use Length/Count property instead of Enumerable.Count method
|
||||||
|
dotnet_diagnostic.CA1829.severity = warning
|
||||||
|
#CA1847: Use string.Contains(char) instead of string.Contains(string) with single characters
|
||||||
|
dotnet_diagnostic.CA1847.severity = warning
|
||||||
|
# CA1851: Possible multiple enumerations of IEnumerable collection
|
||||||
|
dotnet_diagnostic.CA1851.severity = warning
|
||||||
|
#CA1854: Prefer the IDictionary.TryGetValue(TKey, out TValue) method
|
||||||
|
dotnet_diagnostic.CA1854.severity = warning
|
||||||
|
#CA2211:Non-constant fields should not be visible
|
||||||
|
dotnet_diagnostic.CA2211.severity = warning
|
||||||
|
|
||||||
|
# Wrapping preferences
|
||||||
|
csharp_wrap_before_ternary_opsigns = false
|
||||||
|
|
||||||
|
# Avalonia DevAnalyzer preferences
|
||||||
|
dotnet_diagnostic.AVADEV2001.severity = warning
|
||||||
|
|
||||||
|
# Avalonia PublicAnalyzer preferences
|
||||||
|
dotnet_diagnostic.AVP1000.severity = warning
|
||||||
|
dotnet_diagnostic.AVP1001.severity = warning
|
||||||
|
dotnet_diagnostic.AVP1002.severity = warning
|
||||||
|
dotnet_diagnostic.AVP1010.severity = warning
|
||||||
|
dotnet_diagnostic.AVP1011.severity = warning
|
||||||
|
dotnet_diagnostic.AVP1012.severity = warning
|
||||||
|
dotnet_diagnostic.AVP1013.severity = warning
|
||||||
|
dotnet_diagnostic.AVP1020.severity = warning
|
||||||
|
dotnet_diagnostic.AVP1021.severity = warning
|
||||||
|
dotnet_diagnostic.AVP1022.severity = warning
|
||||||
|
dotnet_diagnostic.AVP1030.severity = warning
|
||||||
|
dotnet_diagnostic.AVP1031.severity = warning
|
||||||
|
dotnet_diagnostic.AVP1032.severity = warning
|
||||||
|
dotnet_diagnostic.AVP1040.severity = warning
|
||||||
|
dotnet_diagnostic.AVA2001.severity = warning
|
||||||
|
|
||||||
|
# Xaml files
|
||||||
|
[*.{xaml,axaml}]
|
||||||
|
indent_size = 2
|
||||||
|
# DuplicateSetterError
|
||||||
|
avalonia_xaml_diagnostic.AVLN2203.severity = warning
|
||||||
|
# StyleInMergedDictionaries
|
||||||
|
avalonia_xaml_diagnostic.AVLN2204.severity = warning
|
||||||
|
# RequiredTemplatePartMissing
|
||||||
|
avalonia_xaml_diagnostic.AVLN2205.severity = warning
|
||||||
|
# OptionalTemplatePartMissing
|
||||||
|
avalonia_xaml_diagnostic.AVLN2206.severity = info
|
||||||
|
# TemplatePartWrongType
|
||||||
|
avalonia_xaml_diagnostic.AVLN2207.severity = warning
|
||||||
|
# ItemContainerInsideTemplate
|
||||||
|
avalonia_xaml_diagnostic.AVLN2208.severity = warning
|
||||||
|
# Obsolete
|
||||||
|
avalonia_xaml_diagnostic.AVLN5001.severity = warning
|
||||||
|
|
||||||
|
# Xml project files
|
||||||
|
[*.{csproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}]
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
# Xml build files
|
||||||
|
[*.builds]
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
# Xml files
|
||||||
|
[*.{xml,stylecop,resx,ruleset}]
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
# Xml config files
|
||||||
|
[*.{props,targets,config,nuspec}]
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
[*.json]
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
# Shell scripts
|
||||||
|
[*.sh]
|
||||||
|
end_of_line = lf
|
||||||
|
[*.{cmd,bat}]
|
||||||
|
end_of_line = crlf
|
||||||
4
.github/workflows/deploy.yml
vendored
4
.github/workflows/deploy.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Setup dotnet
|
- name: Setup dotnet
|
||||||
uses: actions/setup-dotnet@v5
|
uses: actions/setup-dotnet@v5
|
||||||
@@ -32,7 +32,7 @@ jobs:
|
|||||||
run: touch $OUTPUT_PATH/.nojekyll
|
run: touch $OUTPUT_PATH/.nojekyll
|
||||||
|
|
||||||
- name: Commit wwwroot to GitHub Pages
|
- name: Commit wwwroot to GitHub Pages
|
||||||
uses: JamesIves/github-pages-deploy-action@v4.5.0
|
uses: JamesIves/github-pages-deploy-action@v4
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
branch: gh-pages
|
branch: gh-pages
|
||||||
|
|||||||
4
.github/workflows/pack-nightly.yml
vendored
4
.github/workflows/pack-nightly.yml
vendored
@@ -31,7 +31,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Get Version
|
- name: Get Version
|
||||||
run: |
|
run: |
|
||||||
@@ -62,7 +62,7 @@ jobs:
|
|||||||
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.6.2
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: nugets
|
name: nugets
|
||||||
path: nugets
|
path: nugets
|
||||||
|
|||||||
4
.github/workflows/pack.yml
vendored
4
.github/workflows/pack.yml
vendored
@@ -47,7 +47,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Pack Semi.Avalonia
|
- name: Pack Semi.Avalonia
|
||||||
if: ${{ inputs.Semi_Avalonia }}
|
if: ${{ inputs.Semi_Avalonia }}
|
||||||
@@ -70,7 +70,7 @@ jobs:
|
|||||||
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.6.2
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: nugets
|
name: nugets
|
||||||
path: nugets
|
path: nugets
|
||||||
|
|||||||
36
.github/workflows/publish.yml
vendored
36
.github/workflows/publish.yml
vendored
@@ -75,11 +75,11 @@ jobs:
|
|||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v6
|
||||||
- name: Publish win-x64
|
- name: Publish win-x64
|
||||||
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o publish --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
|
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o publish --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
|
||||||
- name: Upload a Build Artifact
|
- name: Upload a Build Artifact
|
||||||
uses: actions/upload-artifact@v4.6.2
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: Semi.Avalonia.Demo.Desktop.win-x64
|
name: Semi.Avalonia.Demo.Desktop.win-x64
|
||||||
path: |
|
path: |
|
||||||
@@ -91,13 +91,13 @@ jobs:
|
|||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v6
|
||||||
- name: Enable Native AOT in .csproj
|
- name: Enable Native AOT in .csproj
|
||||||
run: sed -i 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
|
run: sed -i 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
|
||||||
- name: Publish win-x64 AOT
|
- name: Publish win-x64 AOT
|
||||||
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o publish
|
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o publish
|
||||||
- name: Upload a Build Artifact
|
- name: Upload a Build Artifact
|
||||||
uses: actions/upload-artifact@v4.6.2
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: Semi.Avalonia.Demo.Desktop.win-x64.NativeAOT
|
name: Semi.Avalonia.Demo.Desktop.win-x64.NativeAOT
|
||||||
path: |
|
path: |
|
||||||
@@ -109,11 +109,11 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v6
|
||||||
- name: Publish linux-x64
|
- name: Publish linux-x64
|
||||||
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r linux-x64 -c Release -o publish --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
|
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r linux-x64 -c Release -o publish --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
|
||||||
- name: Upload a Build Artifact
|
- name: Upload a Build Artifact
|
||||||
uses: actions/upload-artifact@v4.6.2
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: Semi.Avalonia.Demo.Desktop.linux-x64
|
name: Semi.Avalonia.Demo.Desktop.linux-x64
|
||||||
path: |
|
path: |
|
||||||
@@ -125,13 +125,13 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v6
|
||||||
- name: Enable Native AOT in .csproj
|
- name: Enable Native AOT in .csproj
|
||||||
run: sed -i 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
|
run: sed -i 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
|
||||||
- name: Publish linux-x64 AOT
|
- name: Publish linux-x64 AOT
|
||||||
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r linux-x64 -c Release -o publish
|
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r linux-x64 -c Release -o publish
|
||||||
- name: Upload a Build Artifact
|
- name: Upload a Build Artifact
|
||||||
uses: actions/upload-artifact@v4.6.2
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: Semi.Avalonia.Demo.Desktop.linux-x64.NativeAOT
|
name: Semi.Avalonia.Demo.Desktop.linux-x64.NativeAOT
|
||||||
path: |
|
path: |
|
||||||
@@ -143,11 +143,11 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v6
|
||||||
- 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 --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
|
run: dotnet publish demo/Semi.Avalonia.Demo.Drm -r linux-x64 -c Release -o publish --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
|
||||||
- name: Upload a Build Artifact
|
- name: Upload a Build Artifact
|
||||||
uses: actions/upload-artifact@v4.6.2
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: Semi.Avalonia.Demo.Drm.linux-x64
|
name: Semi.Avalonia.Demo.Drm.linux-x64
|
||||||
path: |
|
path: |
|
||||||
@@ -159,13 +159,13 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v6
|
||||||
- name: Enable Native AOT in .csproj
|
- name: Enable Native AOT in .csproj
|
||||||
run: sed -i 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj
|
run: sed -i 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj
|
||||||
- name: Publish linux-x64 AOT
|
- name: Publish linux-x64 AOT
|
||||||
run: dotnet publish demo/Semi.Avalonia.Demo.Drm -r linux-x64 -c Release -o publish
|
run: dotnet publish demo/Semi.Avalonia.Demo.Drm -r linux-x64 -c Release -o publish
|
||||||
- name: Upload a Build Artifact
|
- name: Upload a Build Artifact
|
||||||
uses: actions/upload-artifact@v4.6.2
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: Semi.Avalonia.Demo.Drm.linux-x64.NativeAOT
|
name: Semi.Avalonia.Demo.Drm.linux-x64.NativeAOT
|
||||||
path: |
|
path: |
|
||||||
@@ -177,11 +177,11 @@ jobs:
|
|||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v6
|
||||||
- name: Publish osx-arm64
|
- name: Publish osx-arm64
|
||||||
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r osx-arm64 -c Release -o publish --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
|
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r osx-arm64 -c Release -o publish --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
|
||||||
- name: Upload a Build Artifact
|
- name: Upload a Build Artifact
|
||||||
uses: actions/upload-artifact@v4.6.2
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: Semi.Avalonia.Demo.Desktop.osx-arm64
|
name: Semi.Avalonia.Demo.Desktop.osx-arm64
|
||||||
path: |
|
path: |
|
||||||
@@ -193,13 +193,13 @@ jobs:
|
|||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v6
|
||||||
- name: Enable Native AOT in .csproj
|
- name: Enable Native AOT in .csproj
|
||||||
run: sed -i '' 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
|
run: sed -i '' 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
|
||||||
- name: Publish osx-arm64 AOT
|
- name: Publish osx-arm64 AOT
|
||||||
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r osx-arm64 -c Release -o publish
|
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r osx-arm64 -c Release -o publish
|
||||||
- name: Upload a Build Artifact
|
- name: Upload a Build Artifact
|
||||||
uses: actions/upload-artifact@v4.6.2
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: Semi.Avalonia.Demo.Desktop.osx-arm64.NativeAOT
|
name: Semi.Avalonia.Demo.Desktop.osx-arm64.NativeAOT
|
||||||
path: |
|
path: |
|
||||||
@@ -211,7 +211,7 @@ jobs:
|
|||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v6
|
||||||
- name: Install Android workload
|
- name: Install Android workload
|
||||||
run: dotnet workload install android
|
run: dotnet workload install android
|
||||||
- name: Restore Dependencies
|
- name: Restore Dependencies
|
||||||
@@ -219,7 +219,7 @@ jobs:
|
|||||||
- name: Publish Android
|
- name: Publish Android
|
||||||
run: dotnet publish demo/Semi.Avalonia.Demo.Android -c Release -f net10.0-android --no-restore -o publish /p:RuntimeIdentifier=android-arm64
|
run: dotnet publish demo/Semi.Avalonia.Demo.Android -c Release -f net10.0-android --no-restore -o publish /p:RuntimeIdentifier=android-arm64
|
||||||
- name: Upload a Build Artifact
|
- name: Upload a Build Artifact
|
||||||
uses: actions/upload-artifact@v4.6.2
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: android-arm64
|
name: android-arm64
|
||||||
path: publish/*Signed.apk
|
path: publish/*Signed.apk
|
||||||
|
|||||||
4
.github/workflows/release-tag.yml
vendored
4
.github/workflows/release-tag.yml
vendored
@@ -41,7 +41,7 @@ jobs:
|
|||||||
needs: [ nuget,publish ]
|
needs: [ nuget,publish ]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v4.3.0
|
- uses: actions/download-artifact@v8
|
||||||
|
|
||||||
- name: Display structure of downloaded files
|
- name: Display structure of downloaded files
|
||||||
run: ls -R
|
run: ls -R
|
||||||
@@ -62,7 +62,7 @@ jobs:
|
|||||||
run: ls -R
|
run: ls -R
|
||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v2.3.2
|
uses: softprops/action-gh-release@v2
|
||||||
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
|
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
|
||||||
with:
|
with:
|
||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||||
<AvaloniaVersion>12.0.0-preview2</AvaloniaVersion>
|
<AvaloniaVersion>12.0.0</AvaloniaVersion>
|
||||||
<DataGridVersion>11.3.10</DataGridVersion>
|
<DataGridVersion>12.0.0</DataGridVersion>
|
||||||
<SkiaSharpVersion>3.119.1</SkiaSharpVersion>
|
<SkiaSharpVersion>3.119.3-preview.1.1</SkiaSharpVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageVersion Include="Avalonia" Version="$(AvaloniaVersion)"/>
|
<PackageVersion Include="Avalonia" Version="$(AvaloniaVersion)"/>
|
||||||
<PackageVersion Include="AvaloniaUI.DiagnosticsSupport" Version="2.2.0-beta3"/>
|
|
||||||
<PackageVersion Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
|
<PackageVersion Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
|
||||||
<PackageVersion Include="Avalonia.LinuxFramebuffer" Version="$(AvaloniaVersion)"/>
|
<PackageVersion Include="Avalonia.LinuxFramebuffer" Version="$(AvaloniaVersion)"/>
|
||||||
<PackageVersion Include="Avalonia.iOS" Version="$(AvaloniaVersion)" />
|
<PackageVersion Include="Avalonia.iOS" Version="$(AvaloniaVersion)" />
|
||||||
@@ -15,13 +14,13 @@
|
|||||||
<PackageVersion Include="Avalonia.Android" Version="$(AvaloniaVersion)" />
|
<PackageVersion Include="Avalonia.Android" Version="$(AvaloniaVersion)" />
|
||||||
<PackageVersion Include="Avalonia.Controls.ColorPicker" Version="$(AvaloniaVersion)"/>
|
<PackageVersion Include="Avalonia.Controls.ColorPicker" Version="$(AvaloniaVersion)"/>
|
||||||
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="$(DataGridVersion)"/>
|
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="$(DataGridVersion)"/>
|
||||||
|
<PackageVersion Include="AvaloniaUI.DiagnosticsSupport" Version="2.2.0-beta3"/>
|
||||||
|
|
||||||
<PackageVersion Include="SkiaSharp" Version="$(SkiaSharpVersion)"/>
|
<PackageVersion Include="SkiaSharp" Version="$(SkiaSharpVersion)"/>
|
||||||
<PackageVersion Include="SkiaSharp.NativeAssets.WebAssembly" Version="$(SkiaSharpVersion)"/>
|
<PackageVersion Include="SkiaSharp.NativeAssets.WebAssembly" Version="$(SkiaSharpVersion)"/>
|
||||||
|
|
||||||
<PackageVersion Include="Xamarin.AndroidX.Core.SplashScreen" Version="1.2.0"/>
|
<PackageVersion Include="Xamarin.AndroidX.Core.SplashScreen" Version="1.2.0.2"/>
|
||||||
|
|
||||||
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.0"/>
|
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.2"/>
|
||||||
<PackageVersion Include="Irihi.Avalonia.Shared" Version="0.3.1"/>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
<semi:SemiTheme Locale="zh-CN" />
|
<semi:SemiTheme Locale="zh-CN" />
|
||||||
<semi:SemiPopupAnimations />
|
<semi:SemiPopupAnimations />
|
||||||
<semi:ColorPickerSemiTheme />
|
<semi:ColorPickerSemiTheme />
|
||||||
<!-- <semi:DataGridSemiTheme /> -->
|
<semi:DataGridSemiTheme />
|
||||||
<!-- <semi:TreeDataGridSemiTheme /> -->
|
<!-- <semi:TreeDataGridSemiTheme /> -->
|
||||||
</Application.Styles>
|
</Application.Styles>
|
||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
|
|||||||
@@ -35,5 +35,30 @@
|
|||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Text="A.S.I.A" />
|
Text="A.S.I.A" />
|
||||||
</ButtonSpinner>
|
</ButtonSpinner>
|
||||||
|
<ButtonSpinner
|
||||||
|
Height="30"
|
||||||
|
AllowSpin="{Binding #allowSpinCheck.IsChecked}"
|
||||||
|
BorderThickness="1"
|
||||||
|
ShowButtonSpinner="{Binding #showSpinCheck.IsChecked}"
|
||||||
|
Spin="OnSpin"
|
||||||
|
Theme="{StaticResource SplitButtonSpinner}">
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="A.S.I.A" />
|
||||||
|
</ButtonSpinner>
|
||||||
|
<ButtonSpinner
|
||||||
|
Height="30"
|
||||||
|
AllowSpin="{Binding #allowSpinCheck.IsChecked}"
|
||||||
|
ButtonSpinnerLocation="Left"
|
||||||
|
BorderThickness="1"
|
||||||
|
ShowButtonSpinner="{Binding #showSpinCheck.IsChecked}"
|
||||||
|
Spin="OnSpin"
|
||||||
|
Theme="{StaticResource SplitButtonSpinner}">
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="A.S.I.A" />
|
||||||
|
</ButtonSpinner>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
69
demo/Semi.Avalonia.Demo/Pages/CarouselPageDemo.axaml
Normal file
69
demo/Semi.Avalonia.Demo/Pages/CarouselPageDemo.axaml
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
<UserControl xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
x:Class="Semi.Avalonia.Demo.Pages.CarouselPageDemo">
|
||||||
|
<DockPanel>
|
||||||
|
<ScrollViewer DockPanel.Dock="Right" Width="220">
|
||||||
|
<StackPanel Margin="12" Spacing="8">
|
||||||
|
<TextBlock Text="Configuration" FontWeight="SemiBold" FontSize="16"
|
||||||
|
Foreground="{DynamicResource SystemControlHighlightAccentBrush}" />
|
||||||
|
|
||||||
|
<TextBlock Text="Navigation" FontWeight="SemiBold" FontSize="13" />
|
||||||
|
<StackPanel Spacing="6">
|
||||||
|
<Button Content="Previous" Click="OnPrevious" HorizontalAlignment="Stretch" />
|
||||||
|
<Button Content="Next" Click="OnNext" HorizontalAlignment="Stretch" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<Separator />
|
||||||
|
|
||||||
|
<TextBlock Text="Status" FontWeight="SemiBold" FontSize="13" />
|
||||||
|
<TextBlock Name="StatusText" Text="Page 1 of 3" Opacity="0.7" TextWrapping="Wrap" />
|
||||||
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
|
|
||||||
|
<Border DockPanel.Dock="Right" Width="1"
|
||||||
|
Background="{DynamicResource SystemControlForegroundBaseMediumLowBrush}" />
|
||||||
|
|
||||||
|
<Border Margin="12"
|
||||||
|
BorderBrush="{DynamicResource SystemControlForegroundBaseMediumLowBrush}"
|
||||||
|
BorderThickness="1" CornerRadius="6" ClipToBounds="True">
|
||||||
|
<Panel>
|
||||||
|
<CarouselPage Name="DemoCarousel"
|
||||||
|
SelectionChanged="OnSelectionChanged">
|
||||||
|
<ContentPage Header="Welcome">
|
||||||
|
<StackPanel Margin="24" Spacing="12"
|
||||||
|
HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||||
|
<TextBlock Text="Welcome" FontSize="28" FontWeight="Bold"
|
||||||
|
HorizontalAlignment="Center" />
|
||||||
|
<TextBlock Text="Swipe left or use the buttons to navigate."
|
||||||
|
TextWrapping="Wrap" Opacity="0.7" TextAlignment="Center" MaxWidth="280" />
|
||||||
|
</StackPanel>
|
||||||
|
</ContentPage>
|
||||||
|
<ContentPage Header="Explore">
|
||||||
|
<StackPanel Margin="24" Spacing="12"
|
||||||
|
HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||||
|
<TextBlock Text="Explore" FontSize="28" FontWeight="Bold"
|
||||||
|
HorizontalAlignment="Center" />
|
||||||
|
<TextBlock Text="CarouselPage supports scroll-based and transition-based navigation modes."
|
||||||
|
TextWrapping="Wrap" Opacity="0.7" TextAlignment="Center" MaxWidth="280" />
|
||||||
|
</StackPanel>
|
||||||
|
</ContentPage>
|
||||||
|
<ContentPage Header="Get Started">
|
||||||
|
<StackPanel Margin="24" Spacing="12"
|
||||||
|
HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||||
|
<TextBlock Text="Get Started" FontSize="28" FontWeight="Bold"
|
||||||
|
HorizontalAlignment="Center" />
|
||||||
|
<TextBlock Text="Use SelectedIndex to jump to any page, or assign a PageTransition for animated switching."
|
||||||
|
TextWrapping="Wrap" Opacity="0.7" TextAlignment="Center" MaxWidth="280" />
|
||||||
|
</StackPanel>
|
||||||
|
</ContentPage>
|
||||||
|
</CarouselPage>
|
||||||
|
<PipsPager HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Bottom" Margin="0,0,0,20"
|
||||||
|
NumberOfPages="3"
|
||||||
|
SelectedPageIndex="{Binding #DemoCarousel.SelectedIndex}" />
|
||||||
|
</Panel>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
|
||||||
|
</DockPanel>
|
||||||
|
</UserControl>
|
||||||
34
demo/Semi.Avalonia.Demo/Pages/CarouselPageDemo.axaml.cs
Normal file
34
demo/Semi.Avalonia.Demo/Pages/CarouselPageDemo.axaml.cs
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Interactivity;
|
||||||
|
|
||||||
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
public partial class CarouselPageDemo : UserControl
|
||||||
|
{
|
||||||
|
public CarouselPageDemo()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnPrevious(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (DemoCarousel.SelectedIndex > 0)
|
||||||
|
DemoCarousel.SelectedIndex--;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnNext(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
var pageCount = (DemoCarousel.Pages as IList)?.Count ?? 0;
|
||||||
|
if (DemoCarousel.SelectedIndex < pageCount - 1)
|
||||||
|
DemoCarousel.SelectedIndex++;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnSelectionChanged(object? sender, PageSelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (StatusText == null)
|
||||||
|
return;
|
||||||
|
var pageCount = (DemoCarousel.Pages as IList)?.Count ?? 0;
|
||||||
|
StatusText.Text = $"Page {DemoCarousel.SelectedIndex + 1} of {pageCount}";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,80 +2,90 @@
|
|||||||
x:Class="Semi.Avalonia.Demo.Pages.ColorPickerDemo"
|
x:Class="Semi.Avalonia.Demo.Pages.ColorPickerDemo"
|
||||||
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:semi="https://irihi.tech/semi"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
d:DesignHeight="1450"
|
d:DesignHeight="1450"
|
||||||
d:DesignWidth="800"
|
d:DesignWidth="800"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<ScrollViewer>
|
<DockPanel>
|
||||||
<StackPanel Spacing="20">
|
<ScrollViewer DockPanel.Dock="Right" Width="260">
|
||||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
<StackPanel Margin="12" Spacing="8">
|
||||||
<ColorView Name="Test" ColorSpectrumShape="Ring" />
|
<StackPanel.Styles>
|
||||||
<ColorView ColorSpectrumShape="Box" />
|
<Style Selector="ToggleSwitch">
|
||||||
<ColorView Palette="{DynamicResource SemiColorPalette}" />
|
<Setter Property="OffContent" Value="{Binding $self.OnContent}" />
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<ColorView
|
|
||||||
Name="SimpleColorViewTest"
|
|
||||||
HsvColor="hsv(180,80%,70%)"
|
|
||||||
IsAlphaVisible="True"
|
|
||||||
Theme="{StaticResource SimpleColorView}" />
|
|
||||||
<StackPanel>
|
|
||||||
<TextBlock Text="{Binding #SimpleColorViewTest.HsvColor}" />
|
|
||||||
<TextBlock Text="{Binding #SimpleColorViewTest.Color}" />
|
|
||||||
</StackPanel>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
|
||||||
<ColorPicker ColorSpectrumShape="Ring">
|
|
||||||
<ColorPicker.Palette>
|
|
||||||
<FlatHalfColorPalette />
|
|
||||||
</ColorPicker.Palette>
|
|
||||||
</ColorPicker>
|
|
||||||
<ColorPicker ColorSpectrumShape="Box">
|
|
||||||
<ColorPicker.Palette>
|
|
||||||
<semi:SemiColorLightPalette />
|
|
||||||
</ColorPicker.Palette>
|
|
||||||
</ColorPicker>
|
|
||||||
<ColorPicker
|
|
||||||
Theme="{DynamicResource HexColorPicker}"
|
|
||||||
ColorSpectrumShape="Box">
|
|
||||||
<ColorPicker.Palette>
|
|
||||||
<semi:SemiColorLightPalette />
|
|
||||||
</ColorPicker.Palette>
|
|
||||||
</ColorPicker>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel HorizontalAlignment="Left">
|
|
||||||
<TextBlock Text="Use Style to customize button" />
|
|
||||||
<ColorPicker
|
|
||||||
Margin="8"
|
|
||||||
MinWidth="32"
|
|
||||||
HsvColor="hsv(180,80%,70%)">
|
|
||||||
<ColorPicker.Content>
|
|
||||||
<Border
|
|
||||||
Margin="1"
|
|
||||||
Background="{Binding $parent[ColorPicker].HsvColor, Converter={StaticResource ToBrushConverter}}"
|
|
||||||
CornerRadius="1" />
|
|
||||||
</ColorPicker.Content>
|
|
||||||
<ColorPicker.Styles>
|
|
||||||
<Style Selector="DropDownButton">
|
|
||||||
<Setter Property="Padding" Value="0" />
|
|
||||||
<Style Selector="^ /template/ PathIcon">
|
|
||||||
<Setter Property="IsVisible" Value="False" />
|
|
||||||
</Style>
|
</Style>
|
||||||
</Style>
|
</StackPanel.Styles>
|
||||||
</ColorPicker.Styles>
|
<StackPanel Spacing="8">
|
||||||
</ColorPicker>
|
<ToggleSwitch Name="AccentColors" OnContent="IsAccentColorsVisible" IsChecked="True" />
|
||||||
|
<ToggleSwitch Name="AlphaEnabled" OnContent="IsAlphaEnabled" IsChecked="True" />
|
||||||
|
<ToggleSwitch Name="Alpha" OnContent="IsAlphaVisible" IsChecked="True" />
|
||||||
|
<ToggleSwitch Name="ColorComponents" OnContent="IsColorComponentsVisible" IsChecked="True" />
|
||||||
|
<ToggleSwitch Name="ColorModel" OnContent="IsColorModelVisible" IsChecked="True" />
|
||||||
|
<ToggleSwitch Name="ColorPalette" OnContent="IsColorPaletteVisible" IsChecked="True" />
|
||||||
|
<ToggleSwitch Name="ColorPreview" OnContent="IsColorPreviewVisible" IsChecked="True" />
|
||||||
|
<ToggleSwitch Name="ColorSpectrum" OnContent="IsColorSpectrumVisible" IsChecked="True" />
|
||||||
|
<ToggleSwitch Name="ColorSpectrumSlider" OnContent="IsColorSpectrumSliderVisible" IsChecked="True" />
|
||||||
|
<ToggleSwitch Name="ComponentSlider" OnContent="IsComponentSliderVisible" IsChecked="True" />
|
||||||
|
<ToggleSwitch Name="ComponentTextInput" OnContent="IsComponentTextInputVisible" IsChecked="True" />
|
||||||
|
<ToggleSwitch Name="HexInput" OnContent="IsHexInputVisible" IsChecked="True" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
<Separator />
|
||||||
<ColorPicker
|
|
||||||
Theme="{StaticResource SimpleColorPicker}"
|
<StackPanel Spacing="8">
|
||||||
HsvColor="hsv(180,80%,70%)" />
|
<TextBlock>
|
||||||
<ColorPicker
|
<Run Text="Color: " />
|
||||||
Theme="{StaticResource HexSimpleColorPicker}"
|
<Run Text="{Binding #cv.Color,Mode=OneWay}" />
|
||||||
HsvColor="hsv(180,80%,70%)" />
|
</TextBlock>
|
||||||
|
<TextBlock>
|
||||||
|
<Run Text="HsvColor:" />
|
||||||
|
<Run Text="{Binding #cv.HsvColor,Mode=OneWay}" />
|
||||||
|
</TextBlock>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
|
||||||
|
<Border Margin="12"
|
||||||
|
BorderBrush="{DynamicResource SemiColorBorder}"
|
||||||
|
BorderThickness="1"
|
||||||
|
CornerRadius="6"
|
||||||
|
ClipToBounds="True">
|
||||||
|
<Border.Styles>
|
||||||
|
<Style Selector=":is(ColorView)">
|
||||||
|
<Setter Property="IsAccentColorsVisible" Value="{Binding #AccentColors.IsChecked}" />
|
||||||
|
<Setter Property="IsAlphaEnabled" Value="{Binding #AlphaEnabled.IsChecked}" />
|
||||||
|
<Setter Property="IsAlphaVisible" Value="{Binding #Alpha.IsChecked}" />
|
||||||
|
<Setter Property="IsColorComponentsVisible" Value="{Binding #ColorComponents.IsChecked}" />
|
||||||
|
<Setter Property="IsColorModelVisible" Value="{Binding #ColorModel.IsChecked}" />
|
||||||
|
<Setter Property="IsColorPaletteVisible" Value="{Binding #ColorPalette.IsChecked}" />
|
||||||
|
<Setter Property="IsColorPreviewVisible" Value="{Binding #ColorPreview.IsChecked}" />
|
||||||
|
<Setter Property="IsColorSpectrumVisible" Value="{Binding #ColorSpectrum.IsChecked}" />
|
||||||
|
<Setter Property="IsColorSpectrumSliderVisible" Value="{Binding #ColorSpectrumSlider.IsChecked}" />
|
||||||
|
<Setter Property="IsComponentSliderVisible" Value="{Binding #ComponentSlider.IsChecked}" />
|
||||||
|
<Setter Property="IsComponentTextInputVisible" Value="{Binding #ComponentTextInput.IsChecked}" />
|
||||||
|
<Setter Property="IsHexInputVisible" Value="{Binding #HexInput.IsChecked}" />
|
||||||
|
|
||||||
|
<Setter Property="Color" Value="#39C5BB" />
|
||||||
|
</Style>
|
||||||
|
</Border.Styles>
|
||||||
|
<StackPanel Margin="12" Spacing="12" Orientation="Horizontal">
|
||||||
|
<StackPanel Spacing="12">
|
||||||
|
<TextBlock Text="Default Theme" FontWeight="Bold" FontSize="16" />
|
||||||
|
<ColorView Name="cv" />
|
||||||
|
<StackPanel Spacing="12" Orientation="Horizontal">
|
||||||
|
<ColorPicker />
|
||||||
|
<ColorPicker Theme="{DynamicResource HexColorPicker}" />
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Spacing="12">
|
||||||
|
<TextBlock Text="SimpleColorPicker" FontWeight="Bold" FontSize="16" />
|
||||||
|
<ColorView Theme="{DynamicResource SimpleColorView}" />
|
||||||
|
<StackPanel Spacing="12" Orientation="Horizontal">
|
||||||
|
<ColorPicker Theme="{DynamicResource SimpleColorPicker}" />
|
||||||
|
<ColorPicker Theme="{DynamicResource HexSimpleColorPicker}" />
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
</DockPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -58,18 +58,18 @@
|
|||||||
IsOpen="{Binding #isop.IsChecked}"
|
IsOpen="{Binding #isop.IsChecked}"
|
||||||
IsSticky="{Binding #isst.IsChecked}"
|
IsSticky="{Binding #isst.IsChecked}"
|
||||||
Width="{Binding #ws.Value}">
|
Width="{Binding #ws.Value}">
|
||||||
<AppBarButton Label="New" Icon="{DynamicResource SemiIconPlus}" />
|
<CommandBarButton Label="New" Icon="{DynamicResource SemiIconPlus}" />
|
||||||
<AppBarButton Label="Save" Icon="{DynamicResource SemiIconSave}" />
|
<CommandBarButton Label="Save" Icon="{DynamicResource SemiIconSave}" />
|
||||||
<AppBarSeparator />
|
<CommandBarSeparator />
|
||||||
<AppBarToggleButton Label="Bold" Icon="{DynamicResource SemiIconBold}" />
|
<CommandBarToggleButton Label="Bold" Icon="{DynamicResource SemiIconBold}" />
|
||||||
<AppBarToggleButton Label="Italic" Icon="{DynamicResource SemiIconItalic}" />
|
<CommandBarToggleButton Label="Italic" Icon="{DynamicResource SemiIconItalic}" />
|
||||||
<AppBarToggleButton IsChecked="True" IsEnabled="False" Label="Underline" Icon="{DynamicResource SemiIconUnderline}" />
|
<CommandBarToggleButton IsChecked="True" IsEnabled="False" Label="Underline" Icon="{DynamicResource SemiIconUnderline}" />
|
||||||
<AppBarSeparator />
|
<CommandBarSeparator />
|
||||||
<AppBarButton Label="Share" Icon="{DynamicResource SemiIconShare}" />
|
<CommandBarButton Label="Share" Icon="{DynamicResource SemiIconShare}" />
|
||||||
<AppBarButton Label="Export" Icon="{DynamicResource SemiIconExport}" />
|
<CommandBarButton Label="Export" Icon="{DynamicResource SemiIconExport}" />
|
||||||
<AppBarButton Label="Print" Icon="{DynamicResource SemiIconPrint}" />
|
<CommandBarButton Label="Print" Icon="{DynamicResource SemiIconPrint}" />
|
||||||
<AppBarSeparator />
|
<CommandBarSeparator />
|
||||||
<AppBarButton Label="Delete" Icon="{DynamicResource SemiIconDelete}" />
|
<CommandBarButton Label="Delete" Icon="{DynamicResource SemiIconDelete}" />
|
||||||
</CommandBar>
|
</CommandBar>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
@@ -79,12 +79,12 @@
|
|||||||
<TextBlock Text="CommandBar — With Secondary Commands (overflow)" />
|
<TextBlock Text="CommandBar — With Secondary Commands (overflow)" />
|
||||||
</GroupBox.Header>
|
</GroupBox.Header>
|
||||||
<CommandBar>
|
<CommandBar>
|
||||||
<AppBarButton Label="New" Icon="{DynamicResource SemiIconPlus}" />
|
<CommandBarButton Label="New" Icon="{DynamicResource SemiIconPlus}" />
|
||||||
<AppBarButton Label="Save" Icon="{DynamicResource SemiIconSave}" />
|
<CommandBarButton Label="Save" Icon="{DynamicResource SemiIconSave}" />
|
||||||
<AppBarButton Label="Share" Icon="{DynamicResource SemiIconShare}" />
|
<CommandBarButton Label="Share" Icon="{DynamicResource SemiIconShare}" />
|
||||||
<CommandBar.SecondaryCommands>
|
<CommandBar.SecondaryCommands>
|
||||||
<AppBarButton Label="Export" Icon="{DynamicResource SemiIconExport}" />
|
<CommandBarButton Label="Export" Icon="{DynamicResource SemiIconExport}" />
|
||||||
<AppBarButton Label="Delete" Icon="{DynamicResource SemiIconDelete}" />
|
<CommandBarButton Label="Delete" Icon="{DynamicResource SemiIconDelete}" />
|
||||||
</CommandBar.SecondaryCommands>
|
</CommandBar.SecondaryCommands>
|
||||||
</CommandBar>
|
</CommandBar>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|||||||
179
demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml
Normal file
179
demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml
Normal file
@@ -0,0 +1,179 @@
|
|||||||
|
<UserControl
|
||||||
|
x:Class="Semi.Avalonia.Demo.Pages.DataGridDemo"
|
||||||
|
xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels;assembly=Semi.Avalonia.Demo"
|
||||||
|
d:DesignHeight="450"
|
||||||
|
d:DesignWidth="800"
|
||||||
|
x:DataType="vm:DataGridDemoViewModel"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
<TabControl>
|
||||||
|
<TabItem Header="DataGrid">
|
||||||
|
<Grid RowDefinitions="Auto, *">
|
||||||
|
<StackPanel Grid.Row="0" Orientation="Horizontal">
|
||||||
|
<ToggleSwitch Content="Enable" Name="enable" IsChecked="True" />
|
||||||
|
<ToggleSwitch Content="Inset Content" Name="inset" />
|
||||||
|
<ToggleSwitch Content="ScrollBar Auto Hide" Name="autohide" />
|
||||||
|
</StackPanel>
|
||||||
|
<DataGrid Grid.Row="1"
|
||||||
|
Margin="8"
|
||||||
|
CanUserReorderColumns="True"
|
||||||
|
CanUserResizeColumns="True"
|
||||||
|
CanUserSortColumns="True"
|
||||||
|
HeadersVisibility="All"
|
||||||
|
IsReadOnly="True"
|
||||||
|
Classes.InsetContent="{Binding #inset.IsChecked}"
|
||||||
|
ScrollViewer.AllowAutoHide="{Binding #autohide.IsChecked}"
|
||||||
|
IsEnabled="{Binding #enable.IsChecked}"
|
||||||
|
ItemsSource="{Binding GridData1}">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn
|
||||||
|
Width="6*"
|
||||||
|
x:DataType="vm:Song"
|
||||||
|
Binding="{Binding Title}"
|
||||||
|
Header="Title" />
|
||||||
|
<DataGridTextColumn
|
||||||
|
Width="6*"
|
||||||
|
x:DataType="vm:Song"
|
||||||
|
Binding="{Binding Artist}"
|
||||||
|
Header="Artist" />
|
||||||
|
<DataGridTextColumn
|
||||||
|
Width="6*"
|
||||||
|
x:DataType="vm:Song"
|
||||||
|
Binding="{Binding Album}"
|
||||||
|
Header="Album" />
|
||||||
|
<DataGridTemplateColumn Header="Duration" SortMemberPath="Duration">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock
|
||||||
|
Margin="8,0,0,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding Duration}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
|
||||||
|
</DataGrid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="Grouping">
|
||||||
|
<DataGrid
|
||||||
|
Margin="8"
|
||||||
|
CanUserReorderColumns="True"
|
||||||
|
CanUserResizeColumns="True"
|
||||||
|
CanUserSortColumns="True"
|
||||||
|
HeadersVisibility="All"
|
||||||
|
IsReadOnly="True"
|
||||||
|
ItemsSource="{Binding GridData2}">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn
|
||||||
|
Width="6*"
|
||||||
|
x:DataType="vm:Song"
|
||||||
|
Binding="{Binding Title}"
|
||||||
|
Header="Title" />
|
||||||
|
<DataGridTextColumn
|
||||||
|
Width="6*"
|
||||||
|
x:DataType="vm:Song"
|
||||||
|
Binding="{Binding Artist}"
|
||||||
|
Header="Artist" />
|
||||||
|
<DataGridTextColumn
|
||||||
|
Width="6*"
|
||||||
|
x:DataType="vm:Song"
|
||||||
|
Binding="{Binding Album}"
|
||||||
|
Header="Album" />
|
||||||
|
<DataGridTemplateColumn
|
||||||
|
x:DataType="vm:Song"
|
||||||
|
Header="Duration"
|
||||||
|
SortMemberPath="Duration">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate x:DataType="vm:Song">
|
||||||
|
<TextBlock
|
||||||
|
Margin="8,0,0,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding Duration}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Name="EditableTab" Header="Editable">
|
||||||
|
<Grid Margin="8" RowDefinitions="Auto,*,Auto">
|
||||||
|
<StackPanel
|
||||||
|
Grid.Row="0"
|
||||||
|
Orientation="Horizontal"
|
||||||
|
Spacing="4">
|
||||||
|
<TextBlock VerticalAlignment="Center" Text="FontSize:" />
|
||||||
|
<Slider
|
||||||
|
Name="FontSizeSlider"
|
||||||
|
Width="100"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Maximum="30"
|
||||||
|
Minimum="5"
|
||||||
|
Value="14" />
|
||||||
|
<CheckBox
|
||||||
|
Name="IsThreeStateCheckBox"
|
||||||
|
Content="IsThreeState"
|
||||||
|
IsChecked="False" />
|
||||||
|
</StackPanel>
|
||||||
|
<DataGrid
|
||||||
|
Grid.Row="1"
|
||||||
|
Margin="8"
|
||||||
|
ItemsSource="{Binding GridData3}">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridCheckBoxColumn
|
||||||
|
Width="2*"
|
||||||
|
Binding="{Binding IsSelected}"
|
||||||
|
Header="Select"
|
||||||
|
IsThreeState="{Binding #IsThreeStateCheckBox.IsChecked, Mode=OneWay}" />
|
||||||
|
<DataGridTextColumn
|
||||||
|
Width="6*"
|
||||||
|
x:DataType="vm:SongViewModel"
|
||||||
|
Binding="{Binding Title}"
|
||||||
|
FontSize="{Binding #FontSizeSlider.Value, Mode=OneWay}"
|
||||||
|
Header="Title" />
|
||||||
|
<DataGridTextColumn
|
||||||
|
Width="6*"
|
||||||
|
x:DataType="vm:SongViewModel"
|
||||||
|
Binding="{Binding Artist}"
|
||||||
|
Header="Artist" />
|
||||||
|
<DataGridTextColumn
|
||||||
|
Width="6*"
|
||||||
|
x:DataType="vm:SongViewModel"
|
||||||
|
Binding="{Binding Album}"
|
||||||
|
Header="Album" />
|
||||||
|
<DataGridTemplateColumn Width="2*" Header="Comments">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding CountOfComment}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataGridTemplateColumn.CellEditingTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<NumericUpDown
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
FormatString="N0"
|
||||||
|
Minimum="0"
|
||||||
|
Value="{Binding CountOfComment}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellEditingTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
<Button
|
||||||
|
Grid.Row="2"
|
||||||
|
Margin="12,0,12,12"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Command="{Binding AddCommand}"
|
||||||
|
Content="Add" />
|
||||||
|
</Grid>
|
||||||
|
</TabItem>
|
||||||
|
</TabControl>
|
||||||
|
</UserControl>
|
||||||
15
demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml.cs
Normal file
15
demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml.cs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
using Avalonia;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Markup.Xaml;
|
||||||
|
using Semi.Avalonia.Demo.ViewModels;
|
||||||
|
|
||||||
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
public partial class DataGridDemo : UserControl
|
||||||
|
{
|
||||||
|
public DataGridDemo()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
DataContext = new DataGridDemoViewModel();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -24,6 +24,13 @@
|
|||||||
IsChecked="True"
|
IsChecked="True"
|
||||||
IsCheckedChanged="OnGestureChanged" />
|
IsCheckedChanged="OnGestureChanged" />
|
||||||
|
|
||||||
|
<ComboBox SelectionChanged="OnLayoutChanged" >
|
||||||
|
<ComboBoxItem Content="CompactOverlay" />
|
||||||
|
<ComboBoxItem Content="CompactInline" />
|
||||||
|
<ComboBoxItem Content="Split" />
|
||||||
|
<ComboBoxItem Content="Overlay" />
|
||||||
|
</ComboBox>
|
||||||
|
|
||||||
<Separator />
|
<Separator />
|
||||||
|
|
||||||
<TextBlock Text="Status" FontWeight="SemiBold" FontSize="14" />
|
<TextBlock Text="Status" FontWeight="SemiBold" FontSize="14" />
|
||||||
@@ -36,19 +43,18 @@
|
|||||||
|
|
||||||
<Border DockPanel.Dock="Right" Width="1" Background="{DynamicResource SemiColorBackground0}" />
|
<Border DockPanel.Dock="Right" Width="1" Background="{DynamicResource SemiColorBackground0}" />
|
||||||
|
|
||||||
<Border Margin="12"
|
|
||||||
BorderBrush="{DynamicResource SemiColorBorder}"
|
|
||||||
BorderThickness="1"
|
|
||||||
CornerRadius="6"
|
|
||||||
ClipToBounds="True">
|
|
||||||
<DrawerPage Name="DemoDrawer"
|
<DrawerPage Name="DemoDrawer"
|
||||||
|
Margin="12"
|
||||||
Header="First Look"
|
Header="First Look"
|
||||||
|
DrawerLayoutBehavior="Overlay"
|
||||||
|
CompactDrawerLength="80"
|
||||||
DrawerLength="250">
|
DrawerLength="250">
|
||||||
<DrawerPage.DrawerHeader>
|
<DrawerPage.DrawerHeader>
|
||||||
<Border Padding="16" Background="{DynamicResource SemiColorPrimary}">
|
<TextBlock Text="Menu" Margin="16" FontSize="18" FontWeight="SemiBold" Foreground="{DynamicResource SemiColorPrimary}" />
|
||||||
<TextBlock Text="Menu" FontSize="18" FontWeight="SemiBold" Foreground="{DynamicResource SemiColorText0}" />
|
|
||||||
</Border>
|
|
||||||
</DrawerPage.DrawerHeader>
|
</DrawerPage.DrawerHeader>
|
||||||
|
<DrawerPage.DrawerFooter>
|
||||||
|
<TextBlock HorizontalAlignment="Center" Text="Powered by IRIHI" Margin="8" />
|
||||||
|
</DrawerPage.DrawerFooter>
|
||||||
<DrawerPage.Drawer>
|
<DrawerPage.Drawer>
|
||||||
<ListBox Name="DrawerMenu" SelectionChanged="OnMenuSelectionChanged">
|
<ListBox Name="DrawerMenu" SelectionChanged="OnMenuSelectionChanged">
|
||||||
<ListBoxItem Content="Home" />
|
<ListBoxItem Content="Home" />
|
||||||
@@ -67,6 +73,5 @@
|
|||||||
</ContentPage>
|
</ContentPage>
|
||||||
</DrawerPage.Content>
|
</DrawerPage.Content>
|
||||||
</DrawerPage>
|
</DrawerPage>
|
||||||
</Border>
|
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Input.GestureRecognizers;
|
||||||
using Avalonia.Interactivity;
|
using Avalonia.Interactivity;
|
||||||
using Avalonia.Layout;
|
using Avalonia.Layout;
|
||||||
using Avalonia.Media;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -11,6 +12,7 @@ public partial class DrawerPageDemo : UserControl
|
|||||||
public DrawerPageDemo()
|
public DrawerPageDemo()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
EnableMouseSwipeGesture(DemoDrawer);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnLoaded(RoutedEventArgs e)
|
protected override void OnLoaded(RoutedEventArgs e)
|
||||||
@@ -52,7 +54,6 @@ public partial class DrawerPageDemo : UserControl
|
|||||||
FontSize = 16,
|
FontSize = 16,
|
||||||
HorizontalAlignment = HorizontalAlignment.Center,
|
HorizontalAlignment = HorizontalAlignment.Center,
|
||||||
VerticalAlignment = VerticalAlignment.Center,
|
VerticalAlignment = VerticalAlignment.Center,
|
||||||
Foreground = Brushes.Black,
|
|
||||||
},
|
},
|
||||||
HorizontalContentAlignment = HorizontalAlignment.Stretch,
|
HorizontalContentAlignment = HorizontalAlignment.Stretch,
|
||||||
VerticalContentAlignment = VerticalAlignment.Stretch
|
VerticalContentAlignment = VerticalAlignment.Stretch
|
||||||
@@ -65,4 +66,25 @@ public partial class DrawerPageDemo : UserControl
|
|||||||
{
|
{
|
||||||
StatusText.Text = $"Drawer: {(DemoDrawer.IsOpen ? "Open" : "Closed")}";
|
StatusText.Text = $"Drawer: {(DemoDrawer.IsOpen ? "Open" : "Closed")}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void EnableMouseSwipeGesture(Control control)
|
||||||
|
{
|
||||||
|
var recognizer = control.GestureRecognizers
|
||||||
|
.OfType<SwipeGestureRecognizer>()
|
||||||
|
.FirstOrDefault();
|
||||||
|
|
||||||
|
recognizer?.IsMouseEnabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnLayoutChanged(object? sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
DemoDrawer.DrawerLayoutBehavior = (sender as ComboBox)?.SelectedIndex switch
|
||||||
|
{
|
||||||
|
0 => DrawerLayoutBehavior.CompactOverlay,
|
||||||
|
1 => DrawerLayoutBehavior.CompactInline,
|
||||||
|
2 => DrawerLayoutBehavior.Split,
|
||||||
|
3 => DrawerLayoutBehavior.Overlay,
|
||||||
|
_ => DrawerLayoutBehavior.CompactOverlay
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
327
demo/Semi.Avalonia.Demo/Pages/HighContrastDemo.axaml
Normal file
327
demo/Semi.Avalonia.Demo/Pages/HighContrastDemo.axaml
Normal file
@@ -0,0 +1,327 @@
|
|||||||
|
<UserControl xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
|
||||||
|
xmlns:controls="clr-namespace:Semi.Avalonia.Demo.Controls"
|
||||||
|
xmlns:cvt="clr-namespace:Semi.Avalonia.Demo.Converters"
|
||||||
|
xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
|
||||||
|
mc:Ignorable="d" d:DesignWidth="1000" d:DesignHeight="1450"
|
||||||
|
x:DataType="vm:HighContrastDemoViewModel"
|
||||||
|
x:Class="Semi.Avalonia.Demo.Pages.HighContrastDemo">
|
||||||
|
<Design.DataContext>
|
||||||
|
<vm:HighContrastDemoViewModel />
|
||||||
|
</Design.DataContext>
|
||||||
|
<SplitView
|
||||||
|
Name="splitView"
|
||||||
|
CompactPaneLength="50"
|
||||||
|
DisplayMode="CompactInline"
|
||||||
|
IsPaneOpen="{Binding #toggle.IsChecked, Mode=TwoWay}"
|
||||||
|
OpenPaneLength="300"
|
||||||
|
PanePlacement="Right">
|
||||||
|
<SplitView.Pane>
|
||||||
|
<StackPanel>
|
||||||
|
<ToggleSwitch
|
||||||
|
Name="toggle"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
IsChecked="True"
|
||||||
|
Theme="{DynamicResource IconBorderlessToggleSwitch}"
|
||||||
|
Content="{StaticResource SemiIconSidebar}" />
|
||||||
|
<Border IsVisible="{Binding #splitView.IsPaneOpen}" Theme="{DynamicResource CardBorder}">
|
||||||
|
<Panel>
|
||||||
|
<TextBlock
|
||||||
|
IsVisible="{Binding SelectedColorResource, Converter={x:Static ObjectConverters.IsNull}}"
|
||||||
|
Text="Click on Color to Check Details"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
<controls:ColorDetailControl
|
||||||
|
Background="{Binding SelectedColorResource.Brush}"
|
||||||
|
IsVisible="{Binding SelectedColorResource, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||||
|
ResourceKey="{Binding SelectedColorResource.ResourceKey}"
|
||||||
|
ResourceName="{Binding SelectedColorResource.ResourceKey}" />
|
||||||
|
</Panel>
|
||||||
|
</Border>
|
||||||
|
</StackPanel>
|
||||||
|
</SplitView.Pane>
|
||||||
|
<SplitView.Content>
|
||||||
|
<ScrollViewer>
|
||||||
|
<StackPanel Spacing="10">
|
||||||
|
<TextBlock Text="Theme Preview" FontWeight="SemiBold" />
|
||||||
|
<ListBox
|
||||||
|
Theme="{StaticResource PureCardRadioGroupListBox}"
|
||||||
|
ItemsSource="{Binding ThemeVariants}"
|
||||||
|
SelectedItem="{Binding SelectedThemeVariant}">
|
||||||
|
<ListBox.ItemsPanel>
|
||||||
|
<ItemsPanelTemplate>
|
||||||
|
<WrapPanel Orientation="Horizontal" />
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</ListBox.ItemsPanel>
|
||||||
|
<ListBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<StackPanel HorizontalAlignment="Left" Spacing="5" MinWidth="200">
|
||||||
|
<ThemeVariantScope RequestedThemeVariant="{Binding}">
|
||||||
|
<Border
|
||||||
|
Padding="5 25 5 5"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Background="{DynamicResource WindowColor}"
|
||||||
|
BorderBrush="{DynamicResource WindowTextColor}"
|
||||||
|
BorderThickness="1"
|
||||||
|
CornerRadius="3">
|
||||||
|
<StackPanel Spacing="10">
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="50">
|
||||||
|
<StackPanel Spacing="5">
|
||||||
|
<TextBlock
|
||||||
|
FontSize="50"
|
||||||
|
Text="Aa" />
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="3">
|
||||||
|
<StackPanel.Styles>
|
||||||
|
<Style Selector="Border">
|
||||||
|
<Setter Property="BorderThickness" Value="1" />
|
||||||
|
<Setter Property="BorderBrush" Value="{DynamicResource WindowTextColor}" />
|
||||||
|
<Setter Property="CornerRadius" Value="5" />
|
||||||
|
<Setter Property="Width" Value="10" />
|
||||||
|
<Setter Property="Height" Value="{Binding $self.Width}" />
|
||||||
|
</Style>
|
||||||
|
</StackPanel.Styles>
|
||||||
|
<Border Background="{DynamicResource WindowColor}" />
|
||||||
|
<Border Background="{DynamicResource HotlightColor}" />
|
||||||
|
<Border Background="{DynamicResource GrayTextColor}" />
|
||||||
|
<Border Background="{DynamicResource HighlightTextColor}" />
|
||||||
|
<Border Background="{DynamicResource HighlightColor}" />
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
<Border
|
||||||
|
BorderThickness="1"
|
||||||
|
BorderBrush="{DynamicResource WindowTextColor}"
|
||||||
|
CornerRadius="3"
|
||||||
|
Padding="8">
|
||||||
|
<Panel>
|
||||||
|
<StackPanel Spacing="5">
|
||||||
|
<Border
|
||||||
|
Width="50"
|
||||||
|
Height="1"
|
||||||
|
Background="{DynamicResource WindowTextColor}" />
|
||||||
|
<Border
|
||||||
|
Height="1"
|
||||||
|
Background="{DynamicResource WindowTextColor}" />
|
||||||
|
<Border
|
||||||
|
Height="1"
|
||||||
|
Background="{DynamicResource WindowTextColor}" />
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
VerticalAlignment="Bottom"
|
||||||
|
Orientation="Horizontal"
|
||||||
|
Spacing="2">
|
||||||
|
<Border
|
||||||
|
Width="20"
|
||||||
|
Height="5"
|
||||||
|
Background="{DynamicResource HighlightColor}"
|
||||||
|
CornerRadius="1" />
|
||||||
|
<Border
|
||||||
|
Width="20"
|
||||||
|
Height="5"
|
||||||
|
BorderThickness="1"
|
||||||
|
BorderBrush="{DynamicResource ButtonTextColor}"
|
||||||
|
CornerRadius="1" />
|
||||||
|
</StackPanel>
|
||||||
|
</Panel>
|
||||||
|
</Border>
|
||||||
|
</StackPanel>
|
||||||
|
<Border
|
||||||
|
Height="1"
|
||||||
|
Background="{DynamicResource WindowTextColor}" />
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
</ThemeVariantScope>
|
||||||
|
<TextBlock Text="{Binding}" FontWeight="SemiBold" />
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListBox.ItemTemplate>
|
||||||
|
</ListBox>
|
||||||
|
|
||||||
|
<ThemeVariantScope
|
||||||
|
MinWidth="400"
|
||||||
|
RequestedThemeVariant="{Binding SelectedThemeVariant}">
|
||||||
|
<Border Padding="10" Background="{DynamicResource WindowColor}">
|
||||||
|
<StackPanel Spacing="16">
|
||||||
|
<StackPanel.Styles>
|
||||||
|
<Style Selector="TextBlock">
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center" />
|
||||||
|
<Setter Property="FontWeight" Value="SemiBold" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="controls|ColorItemControl.ColorBlock">
|
||||||
|
<Setter Property="Width" Value="44" />
|
||||||
|
<Setter Property="Height" Value="{Binding $self.Width}" />
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Right" />
|
||||||
|
<Setter Property="BorderThickness" Value="1" />
|
||||||
|
<Setter Property="BorderBrush" Value="{DynamicResource WindowTextColor}" />
|
||||||
|
<Setter Property="CornerRadius" Value="3" />
|
||||||
|
</Style>
|
||||||
|
</StackPanel.Styles>
|
||||||
|
<Panel>
|
||||||
|
<TextBlock
|
||||||
|
Foreground="{DynamicResource WindowTextColor}"
|
||||||
|
Text="Background" />
|
||||||
|
<controls:ColorItemControl
|
||||||
|
Classes="ColorBlock"
|
||||||
|
DataContext="{Binding ColorResources[0]}"
|
||||||
|
Background="{DynamicResource WindowColor}" />
|
||||||
|
</Panel>
|
||||||
|
<Panel>
|
||||||
|
<TextBlock
|
||||||
|
Foreground="{DynamicResource WindowTextColor}"
|
||||||
|
Text="Text" />
|
||||||
|
<controls:ColorItemControl
|
||||||
|
Classes="ColorBlock"
|
||||||
|
DataContext="{Binding ColorResources[1]}"
|
||||||
|
Background="{DynamicResource WindowTextColor}" />
|
||||||
|
</Panel>
|
||||||
|
<Panel>
|
||||||
|
<TextBlock
|
||||||
|
Foreground="{DynamicResource HotlightColor}"
|
||||||
|
TextDecorations="Underline"
|
||||||
|
Text="Hyperlink" />
|
||||||
|
<controls:ColorItemControl
|
||||||
|
Classes="ColorBlock"
|
||||||
|
DataContext="{Binding ColorResources[2]}"
|
||||||
|
Background="{DynamicResource HotlightColor}" />
|
||||||
|
</Panel>
|
||||||
|
<Panel>
|
||||||
|
<TextBlock
|
||||||
|
Foreground="{DynamicResource GrayTextColor}"
|
||||||
|
Text="Inactive Text" />
|
||||||
|
<controls:ColorItemControl
|
||||||
|
Classes="ColorBlock"
|
||||||
|
DataContext="{Binding ColorResources[3]}"
|
||||||
|
Background="{DynamicResource GrayTextColor}" />
|
||||||
|
</Panel>
|
||||||
|
<Panel>
|
||||||
|
<TextBlock
|
||||||
|
Foreground="{DynamicResource HighlightTextColor}"
|
||||||
|
Background="{DynamicResource HighlightColor}"
|
||||||
|
Text="Selected text" />
|
||||||
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Spacing="4">
|
||||||
|
<controls:ColorItemControl
|
||||||
|
Classes="ColorBlock"
|
||||||
|
DataContext="{Binding ColorResources[4]}"
|
||||||
|
Background="{DynamicResource HighlightTextColor}" />
|
||||||
|
<controls:ColorItemControl
|
||||||
|
Classes="ColorBlock"
|
||||||
|
DataContext="{Binding ColorResources[5]}"
|
||||||
|
Background="{DynamicResource HighlightColor}" />
|
||||||
|
</StackPanel>
|
||||||
|
</Panel>
|
||||||
|
<Panel>
|
||||||
|
<Border
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
BorderBrush="{DynamicResource ButtonTextColor}"
|
||||||
|
Background="{DynamicResource ButtonFaceColor}"
|
||||||
|
BorderThickness="2"
|
||||||
|
CornerRadius="3">
|
||||||
|
<TextBlock
|
||||||
|
Foreground="{DynamicResource ButtonTextColor}"
|
||||||
|
Padding="16 6"
|
||||||
|
Text="Button text" />
|
||||||
|
</Border>
|
||||||
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Spacing="4">
|
||||||
|
<controls:ColorItemControl
|
||||||
|
Classes="ColorBlock"
|
||||||
|
DataContext="{Binding ColorResources[6]}"
|
||||||
|
Background="{DynamicResource ButtonTextColor}" />
|
||||||
|
<controls:ColorItemControl
|
||||||
|
Classes="ColorBlock"
|
||||||
|
DataContext="{Binding ColorResources[7]}"
|
||||||
|
Background="{DynamicResource ButtonFaceColor}" />
|
||||||
|
</StackPanel>
|
||||||
|
</Panel>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
</ThemeVariantScope>
|
||||||
|
|
||||||
|
<DataGrid
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
CanUserSortColumns="False"
|
||||||
|
AutoGenerateColumns="False"
|
||||||
|
ItemsSource="{Binding ColorResources}"
|
||||||
|
GridLinesVisibility="All"
|
||||||
|
BorderBrush="{DynamicResource SemiColorBorder}"
|
||||||
|
BorderThickness="1"
|
||||||
|
Padding="5">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTemplateColumn Header="Color">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<controls:ColorItemControl
|
||||||
|
Width="40"
|
||||||
|
Height="20"
|
||||||
|
CornerRadius="3"
|
||||||
|
Background="{Binding Brush}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
|
||||||
|
<DataGridTemplateColumn Header="ResourceKey">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<SelectableTextBlock
|
||||||
|
Margin="12 0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding ResourceKey}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
|
||||||
|
<DataGridTemplateColumn Header="Hex">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<SelectableTextBlock
|
||||||
|
Margin="12 0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding Brush,
|
||||||
|
Converter={x:Static cvt:ColorConverter.ToHex},ConverterParameter={x:False}}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
|
||||||
|
<DataGridTemplateColumn Header="Description">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<SelectableTextBlock
|
||||||
|
Margin="12 0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding Description}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
|
||||||
|
<DataGridTemplateColumn Header="Pair With">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<SelectableTextBlock
|
||||||
|
Margin="12 0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding PairWith}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
|
||||||
|
<DataGridTemplateColumn Width="100" Header="CopyText">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate DataType="vm:ColorResource">
|
||||||
|
<Button
|
||||||
|
Command="{Binding $parent[pages:HighContrastDemo].Copy}"
|
||||||
|
CommandParameter="{Binding CopyText}"
|
||||||
|
Theme="{DynamicResource IconBorderlessButton}"
|
||||||
|
Content="{StaticResource SemiIconCopy}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
|
</SplitView.Content>
|
||||||
|
</SplitView>
|
||||||
|
</UserControl>
|
||||||
25
demo/Semi.Avalonia.Demo/Pages/HighContrastDemo.axaml.cs
Normal file
25
demo/Semi.Avalonia.Demo/Pages/HighContrastDemo.axaml.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
using System.Threading.Tasks;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Input.Platform;
|
||||||
|
using Semi.Avalonia.Demo.ViewModels;
|
||||||
|
|
||||||
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
public partial class HighContrastDemo : UserControl
|
||||||
|
{
|
||||||
|
public HighContrastDemo()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
this.DataContext = new HighContrastDemoViewModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task Copy(object? o)
|
||||||
|
{
|
||||||
|
if (o is null) return;
|
||||||
|
var toplevel = TopLevel.GetTopLevel(this);
|
||||||
|
if (toplevel?.Clipboard is { } c)
|
||||||
|
{
|
||||||
|
await c.SetTextAsync(o.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -48,6 +48,7 @@
|
|||||||
Text="Current: Home"
|
Text="Current: Home"
|
||||||
Opacity="0.7"
|
Opacity="0.7"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
|
<ToggleSwitch Content="Large" Name="large" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
|
||||||
@@ -58,7 +59,9 @@
|
|||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
CornerRadius="6"
|
CornerRadius="6"
|
||||||
ClipToBounds="True">
|
ClipToBounds="True">
|
||||||
<NavigationPage Name="DemoNav" />
|
<NavigationPage
|
||||||
|
Name="DemoNav"
|
||||||
|
Classes.Large="{Binding #large.IsChecked}" />
|
||||||
</Border>
|
</Border>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
|||||||
@@ -52,5 +52,10 @@
|
|||||||
<NumericUpDown Width="100" ButtonSpinnerLocation="Left" />
|
<NumericUpDown Width="100" ButtonSpinnerLocation="Left" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="Split" />
|
||||||
|
<NumericUpDown Classes="Split" Width="300" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
99
demo/Semi.Avalonia.Demo/Pages/PipsPagerDemo.axaml
Normal file
99
demo/Semi.Avalonia.Demo/Pages/PipsPagerDemo.axaml
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
<UserControl
|
||||||
|
x:Class="Semi.Avalonia.Demo.Pages.PipsPagerDemo"
|
||||||
|
xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
d:DesignHeight="600"
|
||||||
|
d:DesignWidth="800"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
<ScrollViewer>
|
||||||
|
<StackPanel HorizontalAlignment="Left" Spacing="16" Margin="0,0,0,20">
|
||||||
|
|
||||||
|
<!-- Horizontal PipsPager -->
|
||||||
|
<TextBlock Classes="H6" Text="Horizontal" />
|
||||||
|
<PipsPager
|
||||||
|
NumberOfPages="8"
|
||||||
|
Orientation="Horizontal" />
|
||||||
|
|
||||||
|
<!-- Vertical PipsPager -->
|
||||||
|
<TextBlock Classes="H6" Text="Vertical" />
|
||||||
|
<PipsPager
|
||||||
|
NumberOfPages="8"
|
||||||
|
Orientation="Vertical" />
|
||||||
|
|
||||||
|
<!-- Linked with Carousel -->
|
||||||
|
<TextBlock Classes="H6" Text="Linked with Carousel" />
|
||||||
|
<Panel>
|
||||||
|
<Carousel
|
||||||
|
Name="DemoCarousel"
|
||||||
|
Height="160">
|
||||||
|
<Border Background="#EAF5FF">
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Foreground="#1C1F23"
|
||||||
|
Text="Page 1" />
|
||||||
|
</Border>
|
||||||
|
<Border Background="#F9F9F9">
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Foreground="#1C1F23"
|
||||||
|
Text="Page 2" />
|
||||||
|
</Border>
|
||||||
|
<Border Background="#FFF8EA">
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Foreground="#1C1F23"
|
||||||
|
Text="Page 3" />
|
||||||
|
</Border>
|
||||||
|
<Border Background="#FEF2ED">
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Foreground="#1C1F23"
|
||||||
|
Text="Page 4" />
|
||||||
|
</Border>
|
||||||
|
<Border Background="#F0F5FF">
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Foreground="#1C1F23"
|
||||||
|
Text="Page 5" />
|
||||||
|
</Border>
|
||||||
|
</Carousel>
|
||||||
|
<ThemeVariantScope RequestedThemeVariant="Light">
|
||||||
|
<PipsPager
|
||||||
|
Name="LinkedPager"
|
||||||
|
NumberOfPages="5"
|
||||||
|
Orientation="Horizontal"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Bottom"
|
||||||
|
Margin="0,0,0,8"
|
||||||
|
SelectedPageIndex="{Binding #DemoCarousel.SelectedIndex}" />
|
||||||
|
</ThemeVariantScope>
|
||||||
|
</Panel>
|
||||||
|
|
||||||
|
<!-- Various page counts -->
|
||||||
|
<TextBlock Classes="H6" Text="Various Page Counts" />
|
||||||
|
<StackPanel Spacing="12">
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||||
|
<TextBlock VerticalAlignment="Center" Width="80" Text="3 pages" />
|
||||||
|
<PipsPager NumberOfPages="3" Orientation="Horizontal" />
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||||
|
<TextBlock VerticalAlignment="Center" Width="80" Text="5 pages" />
|
||||||
|
<PipsPager NumberOfPages="5" Orientation="Horizontal" />
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||||
|
<TextBlock VerticalAlignment="Center" Width="80" Text="10 pages" />
|
||||||
|
<PipsPager NumberOfPages="10" Orientation="Horizontal" />
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
|
</UserControl>
|
||||||
|
|
||||||
12
demo/Semi.Avalonia.Demo/Pages/PipsPagerDemo.axaml.cs
Normal file
12
demo/Semi.Avalonia.Demo/Pages/PipsPagerDemo.axaml.cs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
using Avalonia.Controls;
|
||||||
|
|
||||||
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
public partial class PipsPagerDemo : UserControl
|
||||||
|
{
|
||||||
|
public PipsPagerDemo()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -34,14 +34,10 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
<Border MinHeight="150" Theme="{StaticResource CardBorder}">
|
<Border MinHeight="150" Theme="{StaticResource CardBorder}">
|
||||||
<TabControl Classes.ReverseSeparator="{Binding #reverse.IsChecked}" TabStripPlacement="{Binding #place.SelectedValue}">
|
<TabControl Classes.ReverseSeparator="{Binding #reverse.IsChecked}" TabStripPlacement="{Binding #place.SelectedValue}">
|
||||||
<TabItem Content="Hello 1" Header="Tab 1" />
|
<TabItem Content="Hello 1" Header="文档" Icon="{StaticResource SemiIconFile}" />
|
||||||
<TabItem Content="Hello 2" Header="Tab 2" />
|
<TabItem Content="Hello 2" Header="快速起步" Icon="{StaticResource SemiIconGlobe}" />
|
||||||
<TabItem Content="Hello 3" Header="Tab 3" />
|
<TabItem Content="Hello 4" Header="无效" Icon="{StaticResource SemiIconClear}" IsEnabled="False" />
|
||||||
<TabItem Content="中文内容" Header="中文中文" />
|
<TabItem Content="Hello 3" Header="帮助" Icon="{StaticResource SemiIconHelpCircle}" />
|
||||||
<TabItem
|
|
||||||
Content="Hello 4"
|
|
||||||
Header="Tab 4"
|
|
||||||
IsEnabled="False" />
|
|
||||||
</TabControl>
|
</TabControl>
|
||||||
</Border>
|
</Border>
|
||||||
<Border Height="300" Theme="{StaticResource CardBorder}">
|
<Border Height="300" Theme="{StaticResource CardBorder}">
|
||||||
@@ -57,14 +53,10 @@
|
|||||||
<StackPanel>
|
<StackPanel>
|
||||||
<Border MinHeight="150" Theme="{StaticResource CardBorder}">
|
<Border MinHeight="150" Theme="{StaticResource CardBorder}">
|
||||||
<TabControl TabStripPlacement="{Binding #place.SelectedValue}" Theme="{StaticResource LineTabControl}">
|
<TabControl TabStripPlacement="{Binding #place.SelectedValue}" Theme="{StaticResource LineTabControl}">
|
||||||
<TabItem Content="Hello 1" Header="Tab 1" />
|
<TabItem Content="Hello 1" Header="文档" Icon="{StaticResource SemiIconFile}" />
|
||||||
<TabItem Content="Hello 2" Header="Tab 2" />
|
<TabItem Content="Hello 2" Header="快速起步" Icon="{StaticResource SemiIconGlobe}" />
|
||||||
<TabItem Content="Hello 3" Header="Tab 3" />
|
<TabItem Content="Hello 4" Header="无效" Icon="{StaticResource SemiIconClear}" IsEnabled="False" />
|
||||||
<TabItem Content="中文内容" Header="中文中文" />
|
<TabItem Content="Hello 3" Header="帮助" Icon="{StaticResource SemiIconHelpCircle}" />
|
||||||
<TabItem
|
|
||||||
Content="Hello 4"
|
|
||||||
Header="Tab 4"
|
|
||||||
IsEnabled="False" />
|
|
||||||
</TabControl>
|
</TabControl>
|
||||||
</Border>
|
</Border>
|
||||||
<Border Height="300" Theme="{StaticResource CardBorder}">
|
<Border Height="300" Theme="{StaticResource CardBorder}">
|
||||||
@@ -82,14 +74,10 @@
|
|||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
Theme="{StaticResource CardBorder}">
|
Theme="{StaticResource CardBorder}">
|
||||||
<TabControl TabStripPlacement="{Binding #place.SelectedValue}" Theme="{StaticResource CardTabControl}">
|
<TabControl TabStripPlacement="{Binding #place.SelectedValue}" Theme="{StaticResource CardTabControl}">
|
||||||
<TabItem Content="Hello 1" Header="Tab 1" />
|
<TabItem Content="Hello 1" Header="文档" Icon="{StaticResource SemiIconFile}" />
|
||||||
<TabItem Content="Hello 2" Header="Tab 2" />
|
<TabItem Content="Hello 2" Header="快速起步" Icon="{StaticResource SemiIconGlobe}" />
|
||||||
<TabItem Content="Hello 3" Header="Tab 3" />
|
<TabItem Content="Hello 4" Header="无效" Icon="{StaticResource SemiIconClear}" IsEnabled="False" />
|
||||||
<TabItem Content="中文内容" Header="中文中文" />
|
<TabItem Content="Hello 3" Header="帮助" Icon="{StaticResource SemiIconHelpCircle}" />
|
||||||
<TabItem
|
|
||||||
Content="Hello 4"
|
|
||||||
Header="Tab 4"
|
|
||||||
IsEnabled="False" />
|
|
||||||
</TabControl>
|
</TabControl>
|
||||||
</Border>
|
</Border>
|
||||||
<Border
|
<Border
|
||||||
@@ -107,14 +95,10 @@
|
|||||||
<StackPanel>
|
<StackPanel>
|
||||||
<Border MinHeight="150" Theme="{StaticResource CardBorder}">
|
<Border MinHeight="150" Theme="{StaticResource CardBorder}">
|
||||||
<TabControl TabStripPlacement="{Binding #place.SelectedValue}" Theme="{StaticResource ButtonTabControl}">
|
<TabControl TabStripPlacement="{Binding #place.SelectedValue}" Theme="{StaticResource ButtonTabControl}">
|
||||||
<TabItem Content="Hello 1" Header="Tab 1" />
|
<TabItem Content="Hello 1" Header="文档" Icon="{StaticResource SemiIconFile}" />
|
||||||
<TabItem Content="Hello 2" Header="Tab 2" />
|
<TabItem Content="Hello 2" Header="快速起步" Icon="{StaticResource SemiIconGlobe}" />
|
||||||
<TabItem Content="Hello 3" Header="Tab 3" />
|
<TabItem Content="Hello 4" Header="无效" Icon="{StaticResource SemiIconClear}" IsEnabled="False" />
|
||||||
<TabItem Content="中文内容" Header="中文中文" />
|
<TabItem Content="Hello 3" Header="帮助" Icon="{StaticResource SemiIconHelpCircle}" />
|
||||||
<TabItem
|
|
||||||
Content="Hello 4"
|
|
||||||
Header="Tab 4"
|
|
||||||
IsEnabled="False" />
|
|
||||||
</TabControl>
|
</TabControl>
|
||||||
</Border>
|
</Border>
|
||||||
<Border Height="300" Theme="{StaticResource CardBorder}">
|
<Border Height="300" Theme="{StaticResource CardBorder}">
|
||||||
|
|||||||
103
demo/Semi.Avalonia.Demo/Pages/VariablesDemo.axaml
Normal file
103
demo/Semi.Avalonia.Demo/Pages/VariablesDemo.axaml
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
<UserControl xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
|
||||||
|
xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
|
||||||
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
|
x:Class="Semi.Avalonia.Demo.Pages.VariablesDemo"
|
||||||
|
x:DataType="vm:VariablesDemoViewModel">
|
||||||
|
<Design.DataContext>
|
||||||
|
<vm:VariablesDemoViewModel />
|
||||||
|
</Design.DataContext>
|
||||||
|
<Grid RowDefinitions="Auto, *">
|
||||||
|
<TextBox
|
||||||
|
Grid.Row="0"
|
||||||
|
Width="600"
|
||||||
|
Margin="8"
|
||||||
|
Classes="ClearButton"
|
||||||
|
Text="{Binding SearchText}"
|
||||||
|
PlaceholderText="Input Variable Category/ResourceKey/Type/Value/Description" />
|
||||||
|
|
||||||
|
<DataGrid
|
||||||
|
Grid.Row="1"
|
||||||
|
Margin="8"
|
||||||
|
CanUserReorderColumns="True"
|
||||||
|
CanUserResizeColumns="True"
|
||||||
|
CanUserSortColumns="True"
|
||||||
|
HeadersVisibility="All"
|
||||||
|
IsReadOnly="True"
|
||||||
|
ItemsSource="{Binding GridData}">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTemplateColumn
|
||||||
|
Width="300"
|
||||||
|
x:DataType="vm:VariableItem"
|
||||||
|
Header="ResourceKey">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate DataType="vm:VariableItem">
|
||||||
|
<SelectableTextBlock
|
||||||
|
Margin="12,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding ResourceKey}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTemplateColumn
|
||||||
|
Width="200"
|
||||||
|
x:DataType="vm:VariableItem"
|
||||||
|
Header="Type">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate DataType="vm:VariableItem">
|
||||||
|
<SelectableTextBlock
|
||||||
|
Margin="12,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding Type.Name}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTemplateColumn
|
||||||
|
Width="200"
|
||||||
|
x:DataType="vm:VariableItem"
|
||||||
|
Header="Value">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate DataType="vm:VariableItem">
|
||||||
|
<SelectableTextBlock
|
||||||
|
Margin="12,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding Value}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTemplateColumn
|
||||||
|
Width="*"
|
||||||
|
x:DataType="vm:VariableItem"
|
||||||
|
Header="Description">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate DataType="vm:VariableItem">
|
||||||
|
<SelectableTextBlock
|
||||||
|
Margin="12,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding Description}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTemplateColumn
|
||||||
|
Width="100"
|
||||||
|
x:DataType="vm:VariableItem"
|
||||||
|
Header="CopyText">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate DataType="vm:VariableItem">
|
||||||
|
<Button
|
||||||
|
Command="{Binding $parent[pages:VariablesDemo].Copy}"
|
||||||
|
CommandParameter="{Binding CopyText}"
|
||||||
|
Theme="{DynamicResource IconBorderlessButton}"
|
||||||
|
Content="{StaticResource SemiIconCopy}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
25
demo/Semi.Avalonia.Demo/Pages/VariablesDemo.axaml.cs
Normal file
25
demo/Semi.Avalonia.Demo/Pages/VariablesDemo.axaml.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
using System.Threading.Tasks;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Input.Platform;
|
||||||
|
using Semi.Avalonia.Demo.ViewModels;
|
||||||
|
|
||||||
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
public partial class VariablesDemo : UserControl
|
||||||
|
{
|
||||||
|
public VariablesDemo()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
this.DataContext = new VariablesDemoViewModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task Copy(object? o)
|
||||||
|
{
|
||||||
|
if (o is null) return;
|
||||||
|
var toplevel = TopLevel.GetTopLevel(this);
|
||||||
|
if (toplevel?.Clipboard is { } c)
|
||||||
|
{
|
||||||
|
await c.SetTextAsync(o.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
32
demo/Semi.Avalonia.Demo/Pages/WindowCustomizationsPage.axaml
Normal file
32
demo/Semi.Avalonia.Demo/Pages/WindowCustomizationsPage.axaml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<UserControl xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
|
x:Class="Semi.Avalonia.Demo.Pages.WindowCustomizationsPage"
|
||||||
|
x:CompileBindings="True">
|
||||||
|
|
||||||
|
<StackPanel
|
||||||
|
Spacing="10"
|
||||||
|
IsEnabled="{OnFormFactor False, Desktop=True}">
|
||||||
|
<TextBlock Classes="H2" Text="Desktop properties" />
|
||||||
|
|
||||||
|
<CheckBox Content="Extend Client Area to Decorations"
|
||||||
|
IsChecked="{Binding $parent[Window].ExtendClientAreaToDecorationsHint}" />
|
||||||
|
|
||||||
|
<Slider IsEnabled="{Binding $parent[Window].ExtendClientAreaToDecorationsHint}"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Width="201" Minimum="-1" Maximum="200"
|
||||||
|
Value="{Binding $parent[Window].ExtendClientAreaTitleBarHeightHint}" />
|
||||||
|
|
||||||
|
<CheckBox Content="Can Resize"
|
||||||
|
IsChecked="{Binding $parent[Window].CanResize}" />
|
||||||
|
|
||||||
|
<CheckBox Content="Can Minimize"
|
||||||
|
IsChecked="{Binding $parent[Window].CanMinimize}" />
|
||||||
|
|
||||||
|
<CheckBox Content="Can Maximize"
|
||||||
|
IsChecked="{Binding $parent[Window].CanMaximize}"
|
||||||
|
IsEnabled="{Binding $parent[Window].CanResize}" />
|
||||||
|
</StackPanel>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
using Avalonia.Controls;
|
||||||
|
|
||||||
|
namespace Semi.Avalonia.Demo.Pages
|
||||||
|
{
|
||||||
|
public partial class WindowCustomizationsPage : UserControl
|
||||||
|
{
|
||||||
|
public WindowCustomizationsPage()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,8 +13,8 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Avalonia"/>
|
<PackageReference Include="Avalonia"/>
|
||||||
<PackageReference Include="Avalonia.Controls.ColorPicker"/>
|
<PackageReference Include="Avalonia.Controls.ColorPicker"/>
|
||||||
<!-- <PackageReference Include="Avalonia.Controls.DataGrid"/>-->
|
<PackageReference Include="Avalonia.Controls.DataGrid"/>
|
||||||
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
|
<!--Condition below is needed to remove AvaloniaUI.DiagnosticsSupport package from build output in Release configuration.-->
|
||||||
<PackageReference Include="AvaloniaUI.DiagnosticsSupport">
|
<PackageReference Include="AvaloniaUI.DiagnosticsSupport">
|
||||||
<IncludeAssets Condition="'$(Configuration)' != 'Debug'">None</IncludeAssets>
|
<IncludeAssets Condition="'$(Configuration)' != 'Debug'">None</IncludeAssets>
|
||||||
<PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets>
|
<PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets>
|
||||||
@@ -25,11 +25,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\src\Semi.Avalonia\Semi.Avalonia.csproj"/>
|
<ProjectReference Include="..\..\src\Semi.Avalonia\Semi.Avalonia.csproj"/>
|
||||||
<ProjectReference Include="..\..\src\Semi.Avalonia.ColorPicker\Semi.Avalonia.ColorPicker.csproj"/>
|
<ProjectReference Include="..\..\src\Semi.Avalonia.ColorPicker\Semi.Avalonia.ColorPicker.csproj"/>
|
||||||
<!-- <ProjectReference Include="..\..\src\Semi.Avalonia.DataGrid\Semi.Avalonia.DataGrid.csproj"/>-->
|
<ProjectReference Include="..\..\src\Semi.Avalonia.DataGrid\Semi.Avalonia.DataGrid.csproj"/>
|
||||||
<!-- <ProjectReference Include="..\..\src\Semi.Avalonia.TreeDataGrid\Semi.Avalonia.TreeDataGrid.csproj"/>-->
|
<!-- <ProjectReference Include="..\..\src\Semi.Avalonia.TreeDataGrid\Semi.Avalonia.TreeDataGrid.csproj"/>-->
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<AvaloniaXaml Remove="Pages\VariablesDemo.axaml" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
152
demo/Semi.Avalonia.Demo/Themes/FunctionalColorGroupControl.axaml
Normal file
152
demo/Semi.Avalonia.Demo/Themes/FunctionalColorGroupControl.axaml
Normal file
@@ -0,0 +1,152 @@
|
|||||||
|
<ResourceDictionary
|
||||||
|
xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:controls="clr-namespace:Semi.Avalonia.Demo.Controls"
|
||||||
|
xmlns:viewModels="clr-namespace:Semi.Avalonia.Demo.ViewModels"
|
||||||
|
xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
|
||||||
|
x:DataType="viewModels:FunctionalColorGroupViewModel">
|
||||||
|
<ControlTheme x:Key="{x:Type controls:FunctionalColorGroupControl}" TargetType="controls:FunctionalColorGroupControl">
|
||||||
|
<Setter Property="Template">
|
||||||
|
<ControlTemplate TargetType="controls:FunctionalColorGroupControl">
|
||||||
|
<Grid RowDefinitions="Auto, *">
|
||||||
|
<SelectableTextBlock
|
||||||
|
Grid.Row="0"
|
||||||
|
Margin="0,16,0,0"
|
||||||
|
Classes="H3"
|
||||||
|
Text="{TemplateBinding Title}"
|
||||||
|
Theme="{DynamicResource TitleSelectableTextBlock}" />
|
||||||
|
<TabControl Grid.Row="1">
|
||||||
|
<TabItem Header="Light">
|
||||||
|
<DataGrid IsReadOnly="True" ItemsSource="{TemplateBinding LightColors}">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTemplateColumn Width="70" Header="Color">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate DataType="viewModels:ColorItemViewModel">
|
||||||
|
<controls:ColorItemControl
|
||||||
|
Width="40"
|
||||||
|
Height="20"
|
||||||
|
Background="{Binding Brush}"
|
||||||
|
CornerRadius="3" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTemplateColumn Width="300" Header="ResourceKey">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate DataType="viewModels:ColorItemViewModel">
|
||||||
|
<SelectableTextBlock
|
||||||
|
Margin="12,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding ResourceKey}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTemplateColumn Width="100" Header="Hex">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate DataType="viewModels:ColorItemViewModel">
|
||||||
|
<SelectableTextBlock
|
||||||
|
Margin="12,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding Hex}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTemplateColumn Width="80" Header="Opacity">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate DataType="viewModels:ColorItemViewModel">
|
||||||
|
<SelectableTextBlock
|
||||||
|
Margin="12,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding Brush.Opacity}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTextColumn
|
||||||
|
Width="*"
|
||||||
|
x:DataType="viewModels:ColorItemViewModel"
|
||||||
|
Binding="{Binding ColorDisplayName}"
|
||||||
|
CanUserSort="False"
|
||||||
|
Header="Description" />
|
||||||
|
<DataGridTemplateColumn Width="100" Header="CopyText">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate DataType="viewModels:ColorItemViewModel">
|
||||||
|
<Button
|
||||||
|
Command="{Binding $parent[pages:PaletteDemo].Copy}"
|
||||||
|
CommandParameter="{Binding CopyText}"
|
||||||
|
Theme="{DynamicResource IconBorderlessButton}"
|
||||||
|
Content="{StaticResource SemiIconCopy}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="Dark">
|
||||||
|
<DataGrid IsReadOnly="True" ItemsSource="{TemplateBinding DarkColors}">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTemplateColumn Width="70" Header="Color">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate DataType="viewModels:ColorItemViewModel">
|
||||||
|
<controls:ColorItemControl
|
||||||
|
Width="40"
|
||||||
|
Height="20"
|
||||||
|
Background="{Binding Brush}"
|
||||||
|
CornerRadius="3" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTemplateColumn Width="300" Header="ResourceKey">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate DataType="viewModels:ColorItemViewModel">
|
||||||
|
<SelectableTextBlock
|
||||||
|
Margin="12,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding ResourceKey}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTemplateColumn Width="100" Header="Hex">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate DataType="viewModels:ColorItemViewModel">
|
||||||
|
<SelectableTextBlock
|
||||||
|
Margin="12,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding Hex}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTemplateColumn Width="80" Header="Opacity">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate DataType="viewModels:ColorItemViewModel">
|
||||||
|
<SelectableTextBlock
|
||||||
|
Margin="12,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding Brush.Opacity}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTextColumn
|
||||||
|
Width="*"
|
||||||
|
x:DataType="viewModels:ColorItemViewModel"
|
||||||
|
Binding="{Binding ColorDisplayName}"
|
||||||
|
CanUserSort="False"
|
||||||
|
Header="Description" />
|
||||||
|
<DataGridTemplateColumn Width="100" Header="CopyText">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate DataType="viewModels:ColorItemViewModel">
|
||||||
|
<Button
|
||||||
|
Command="{Binding $parent[pages:PaletteDemo].Copy}"
|
||||||
|
CommandParameter="{Binding CopyText}"
|
||||||
|
Theme="{DynamicResource IconBorderlessButton}"
|
||||||
|
Content="{StaticResource SemiIconCopy}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
</TabItem>
|
||||||
|
</TabControl>
|
||||||
|
</Grid>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter>
|
||||||
|
</ControlTheme>
|
||||||
|
</ResourceDictionary>
|
||||||
110
demo/Semi.Avalonia.Demo/Themes/ShadowGroupControl.axaml
Normal file
110
demo/Semi.Avalonia.Demo/Themes/ShadowGroupControl.axaml
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
<ResourceDictionary
|
||||||
|
xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:controls="clr-namespace:Semi.Avalonia.Demo.Controls"
|
||||||
|
xmlns:viewModels="clr-namespace:Semi.Avalonia.Demo.ViewModels"
|
||||||
|
xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages"
|
||||||
|
x:DataType="viewModels:ShadowGroupViewModel">
|
||||||
|
<ControlTheme x:Key="{x:Type controls:ShadowGroupControl}" TargetType="controls:ShadowGroupControl">
|
||||||
|
<Setter Property="Template">
|
||||||
|
<ControlTemplate TargetType="controls:ShadowGroupControl">
|
||||||
|
<Grid RowDefinitions="Auto, *">
|
||||||
|
<SelectableTextBlock
|
||||||
|
Grid.Row="0"
|
||||||
|
Margin="0,16,0,0"
|
||||||
|
Classes="H3"
|
||||||
|
Text="{TemplateBinding Title}"
|
||||||
|
Theme="{DynamicResource TitleSelectableTextBlock}" />
|
||||||
|
<TabControl Grid.Row="1">
|
||||||
|
<TabItem Header="Light">
|
||||||
|
<DataGrid IsReadOnly="True" ItemsSource="{TemplateBinding LightShadows}">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTemplateColumn Width="300" Header="ResourceKey">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate DataType="viewModels:ShadowItemViewModel">
|
||||||
|
<SelectableTextBlock
|
||||||
|
Margin="12,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding ResourceKey}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTemplateColumn Width="300" Header="BoxShadows">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate DataType="viewModels:ShadowItemViewModel">
|
||||||
|
<SelectableTextBlock
|
||||||
|
Margin="12,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding BoxShadowValue}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTextColumn
|
||||||
|
Width="*"
|
||||||
|
x:DataType="viewModels:ShadowItemViewModel"
|
||||||
|
Binding="{Binding ShadowDisplayName}"
|
||||||
|
CanUserSort="False"
|
||||||
|
Header="Description" />
|
||||||
|
<DataGridTemplateColumn Width="100" Header="CopyText">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate DataType="viewModels:ShadowItemViewModel">
|
||||||
|
<Button
|
||||||
|
Command="{Binding $parent[pages:PaletteDemo].Copy}"
|
||||||
|
CommandParameter="{Binding CopyText}"
|
||||||
|
Theme="{DynamicResource IconBorderlessButton}"
|
||||||
|
Content="{StaticResource SemiIconCopy}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="Dark">
|
||||||
|
<DataGrid IsReadOnly="True" ItemsSource="{TemplateBinding DarkShadows}">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTemplateColumn Width="300" Header="ResourceKey">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate DataType="viewModels:ShadowItemViewModel">
|
||||||
|
<SelectableTextBlock
|
||||||
|
Margin="12,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding ResourceKey}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTemplateColumn Width="300" Header="BoxShadows">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate DataType="viewModels:ShadowItemViewModel">
|
||||||
|
<SelectableTextBlock
|
||||||
|
Margin="12,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding BoxShadowValue}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTextColumn
|
||||||
|
Width="*"
|
||||||
|
x:DataType="viewModels:ShadowItemViewModel"
|
||||||
|
Binding="{Binding ShadowDisplayName}"
|
||||||
|
CanUserSort="False"
|
||||||
|
Header="Description" />
|
||||||
|
<DataGridTemplateColumn Width="100" Header="CopyText">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate DataType="viewModels:ShadowItemViewModel">
|
||||||
|
<Button
|
||||||
|
Command="{Binding $parent[pages:PaletteDemo].Copy}"
|
||||||
|
CommandParameter="{Binding CopyText}"
|
||||||
|
Theme="{DynamicResource IconBorderlessButton}"
|
||||||
|
Content="{StaticResource SemiIconCopy}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
</TabItem>
|
||||||
|
</TabControl>
|
||||||
|
</Grid>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter>
|
||||||
|
</ControlTheme>
|
||||||
|
</ResourceDictionary>
|
||||||
@@ -2,6 +2,8 @@
|
|||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<ResourceInclude Source="ColorDetailControl.axaml" />
|
<ResourceInclude Source="ColorDetailControl.axaml" />
|
||||||
<ResourceInclude Source="ColorItemControl.axaml" />
|
<ResourceInclude Source="ColorItemControl.axaml" />
|
||||||
|
<ResourceInclude Source="FunctionalColorGroupControl.axaml" />
|
||||||
|
<ResourceInclude Source="ShadowGroupControl.axaml" />
|
||||||
<ResourceInclude Source="ToggleSwitch.axaml" />
|
<ResourceInclude Source="ToggleSwitch.axaml" />
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
154
demo/Semi.Avalonia.Demo/ViewModels/DataGridDemoViewModel.cs
Normal file
154
demo/Semi.Avalonia.Demo/ViewModels/DataGridDemoViewModel.cs
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using Avalonia.Collections;
|
||||||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
using CommunityToolkit.Mvvm.Input;
|
||||||
|
|
||||||
|
namespace Semi.Avalonia.Demo.ViewModels;
|
||||||
|
|
||||||
|
public class DataGridDemoViewModel : ObservableObject
|
||||||
|
{
|
||||||
|
public ObservableCollection<Song> GridData1 { get; set; }
|
||||||
|
|
||||||
|
public DataGridCollectionView GridData2 { get; set; }
|
||||||
|
|
||||||
|
public ObservableCollection<SongViewModel> GridData3 { get; set; }
|
||||||
|
|
||||||
|
public RelayCommand AddCommand { get; set; }
|
||||||
|
|
||||||
|
public DataGridDemoViewModel()
|
||||||
|
{
|
||||||
|
GridData1 = new ObservableCollection<Song>(Song.Songs);
|
||||||
|
GridData2 = new DataGridCollectionView(Song.Songs);
|
||||||
|
GridData2.GroupDescriptions.Add(new DataGridPathGroupDescription("Album"));
|
||||||
|
GridData3 = new ObservableCollection<SongViewModel>(Song.Songs.Take(10).Select(a => new SongViewModel()
|
||||||
|
{
|
||||||
|
Title = a.Title,
|
||||||
|
Artist = a.Artist,
|
||||||
|
Album = a.Album,
|
||||||
|
CountOfComment = a.CountOfComment,
|
||||||
|
IsSelected = false
|
||||||
|
}));
|
||||||
|
AddCommand = new RelayCommand(Add);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Add()
|
||||||
|
{
|
||||||
|
GridData3.Add(new SongViewModel());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Song
|
||||||
|
{
|
||||||
|
public string? Title { get; set; }
|
||||||
|
public string? Artist { get; set; }
|
||||||
|
public TimeSpan? Duration { get; set; }
|
||||||
|
public string? Album { get; set; }
|
||||||
|
public int CountOfComment { get; set; }
|
||||||
|
public string Url { get; set; }
|
||||||
|
|
||||||
|
public Song(string title, string artist, int m, int s, string album, int countOfComment, int netEaseId)
|
||||||
|
{
|
||||||
|
Title = title;
|
||||||
|
Artist = artist;
|
||||||
|
Duration = new TimeSpan(0, m, s);
|
||||||
|
Album = album;
|
||||||
|
CountOfComment = countOfComment;
|
||||||
|
Url = $"https://music.163.com/song?id={netEaseId}";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<string> Albums =>
|
||||||
|
[
|
||||||
|
"A.S.I.A",
|
||||||
|
"饕餮人间",
|
||||||
|
"七步咙咚呛",
|
||||||
|
"大惊小怪",
|
||||||
|
"The ONE",
|
||||||
|
"以梦为马 (壮志骄阳版)",
|
||||||
|
"emo了",
|
||||||
|
"一眼万年",
|
||||||
|
"冲刺吧",
|
||||||
|
"爱的赏味期限",
|
||||||
|
"COSMIC ANTHEM / 手紙",
|
||||||
|
"世界晚安",
|
||||||
|
"明年也要好好长大",
|
||||||
|
"320万年前",
|
||||||
|
"W.O.R.L.D."
|
||||||
|
];
|
||||||
|
|
||||||
|
public static List<Song> Songs =>
|
||||||
|
[
|
||||||
|
new("好肚有肚(feat.李玲玉)", "熊猫堂ProducePandas", 2, 50, "A.S.I.A", 730, 1487039339),
|
||||||
|
new("荒诞秀", "熊猫堂ProducePandas", 3, 15, "A.S.I.A", 639, 1487037601),
|
||||||
|
new("长大", "熊猫堂ProducePandas", 4, 6, "A.S.I.A", 1114, 1487037690),
|
||||||
|
new("招财猫(feat.纪粹希(G-Tracy))", "熊猫堂ProducePandas", 3, 37, "A.S.I.A", 361, 1487039632),
|
||||||
|
new("千转", "熊猫堂ProducePandas", 4, 0, "A.S.I.A", 1115, 1477312398),
|
||||||
|
new("辣辣辣", "熊猫堂ProducePandas", 3, 24, "A.S.I.A", 1873, 1465043716),
|
||||||
|
new("碎碎念", "熊猫堂ProducePandas", 3, 25, "A.S.I.A", 676, 1474142064),
|
||||||
|
new("盘他", "熊猫堂ProducePandas", 2, 16, "A.S.I.A", 365, 1481652786),
|
||||||
|
new("Na Na Na", "熊猫堂ProducePandas", 3, 26, "A.S.I.A", 312, 1469022662),
|
||||||
|
new("Indigo", "熊猫堂ProducePandas", 3, 15, "A.S.I.A", 137, 1487039517),
|
||||||
|
new("饕餮人间", "熊猫堂ProducePandas", 3, 20, "饕餮人间", 1295, 1499584605),
|
||||||
|
new("七步咙咚呛", "熊猫堂ProducePandas", 3, 10, "七步咙咚呛", 175, 1809095152),
|
||||||
|
new("大惊小怪", "熊猫堂ProducePandas", 3, 32, "大惊小怪", 10420, 1847477425),
|
||||||
|
new("工具人", "熊猫堂ProducePandas", 2, 46, "大惊小怪", 1135, 1847476499),
|
||||||
|
new("以梦为马", "熊猫堂ProducePandas", 4, 19, "大惊小怪", 18361, 1836034373),
|
||||||
|
new("以梦为马(Piano Version)", "熊猫堂ProducePandas", 3, 4, "大惊小怪", 570, 1847477423),
|
||||||
|
new("The ONE", "熊猫堂ProducePandas", 2, 58, "The ONE", 1508, 1864329424),
|
||||||
|
new("The ONE(日文版)", "熊猫堂ProducePandas", 2, 57, "The ONE", 385, 1864329429),
|
||||||
|
new("以梦为马 (壮志骄阳版)", "熊猫堂ProducePandas", 4, 19, "以梦为马 (壮志骄阳版)", 161, 1865138896),
|
||||||
|
new("New Horse", "熊猫堂ProducePandas", 2, 30, "emo了", 643, 1887021307),
|
||||||
|
new("不例外", "熊猫堂ProducePandas", 3, 31, "emo了", 1818, 1887022665),
|
||||||
|
new("满意", "熊猫堂ProducePandas", 4, 32, "emo了", 1081, 1882433472),
|
||||||
|
new("就算与全世界为敌也要跟你在一起", "熊猫堂ProducePandas", 3, 32, "emo了", 2119, 1881759960),
|
||||||
|
new("The ONE", "熊猫堂ProducePandas", 2, 58, "emo了", 67, 1887022648),
|
||||||
|
new("口香糖", "熊猫堂ProducePandas", 3, 10, "emo了", 2181, 1885502254),
|
||||||
|
new("Suuuuuuper Mario", "熊猫堂ProducePandas", 3, 32, "emo了", 1010, 1887021318),
|
||||||
|
new("饕餮人间", "熊猫堂ProducePandas", 3, 22, "emo了", 109, 1887021320),
|
||||||
|
new("以梦为马 (壮志骄阳版)", "熊猫堂ProducePandas", 4, 21, "emo了", 34, 1887022666),
|
||||||
|
new("The ONE(日文版)", "熊猫堂ProducePandas", 2, 57, "emo了", 27, 1887022646),
|
||||||
|
new("满意(DJheap九天版)", "熊猫堂ProducePandas", 4, 31, "emo了", 31, 1901605941),
|
||||||
|
new("一眼万年", "熊猫堂ProducePandas", 3, 54, "一眼万年", 20, 1922599361),
|
||||||
|
new("冲刺", "熊猫堂ProducePandas", 3, 49, "冲刺吧", 1006, 1932878194),
|
||||||
|
new("滴答滴", "熊猫堂ProducePandas", 2, 30, "爱的赏味期限", 86, 1957515790),
|
||||||
|
new("热带季风", "熊猫堂ProducePandas", 2, 45, "爱的赏味期限", 212, 1957514964),
|
||||||
|
new("渣", "熊猫堂ProducePandas", 3, 28, "爱的赏味期限", 22, 1957514965),
|
||||||
|
new("独特", "熊猫堂ProducePandas", 3, 33, "爱的赏味期限", 62, 1957514966),
|
||||||
|
new("雨后", "熊猫堂ProducePandas", 4, 15, "爱的赏味期限", 23, 1957514967),
|
||||||
|
new("然后然后", "熊猫堂ProducePandas", 3, 50, "爱的赏味期限", 108, 1957514968),
|
||||||
|
new("丢", "熊猫堂ProducePandas", 3, 26, "爱的赏味期限", 30, 1957515792),
|
||||||
|
new("热带疾风(FACEVOID桃心连哥 Remix)", "熊猫堂ProducePandas", 3, 23, "爱的赏味期限", 55, 1957515793),
|
||||||
|
new("COSMIC ANTHEM -Japanese Ver.-", "熊猫堂ProducePandas", 3, 11, "COSMIC ANTHEM / 手紙", 0, 1977171493),
|
||||||
|
new("手紙 (「長大-You Raise Me Up-」-Japanese Ver.-)", "熊猫堂ProducePandas", 4, 11, "COSMIC ANTHEM / 手紙", 0,
|
||||||
|
1977171494),
|
||||||
|
new("COSMIC ANTHEM -Chinese Ver.-", "熊猫堂ProducePandas", 3, 31, "COSMIC ANTHEM / 手紙", 0, 1977172202),
|
||||||
|
new("世界晚安", "熊猫堂ProducePandas", 2, 59, "世界晚安", 652, 1985063377),
|
||||||
|
new("世界晚安(泰文版)", "熊猫堂ProducePandas", 2, 59, "世界晚安", 134, 1987842504),
|
||||||
|
new("世界晚安(钢琴版)", "熊猫堂ProducePandas", 3, 2, "世界晚安", 76, 1990475933),
|
||||||
|
new("世界晚安(泰文钢琴版)", "熊猫堂ProducePandas", 3, 2, "世界晚安", 29, 1990475934),
|
||||||
|
new("世界晚安(DJ沈念版)", "熊猫堂ProducePandas", 3, 9, "世界晚安", 34, 2014263184),
|
||||||
|
new("世界晚安(钢琴配乐)", "熊猫堂ProducePandas", 2, 59, "世界晚安", 11, 2014263185),
|
||||||
|
new("明年也要好好长大", "熊猫堂ProducePandas", 3, 12, "明年也要好好长大", 0, 2010515162),
|
||||||
|
new("320万年前(DJ沈念版)", "熊猫堂ProducePandas", 3, 21, "320万年前", 8, 2055888636),
|
||||||
|
new("320万年前", "熊猫堂ProducePandas", 3, 7, "W.O.R.L.D.", 329, 2049770469),
|
||||||
|
new("隐德来希", "熊猫堂ProducePandas", 3, 3, "W.O.R.L.D.", 594, 2061317924),
|
||||||
|
new("孔明", "熊猫堂ProducePandas", 3, 59, "W.O.R.L.D.", 91, 2063175274),
|
||||||
|
new("锦鲤卟噜噜", "熊猫堂ProducePandas", 3, 5, "W.O.R.L.D.", 67, 2059208262),
|
||||||
|
new("指鹿为马", "熊猫堂ProducePandas", 3, 12, "W.O.R.L.D.", 74, 2063175272),
|
||||||
|
new("热带季风Remix", "熊猫堂ProducePandas", 3, 22, "W.O.R.L.D.", 23, 2063173319),
|
||||||
|
new("加州梦境", "熊猫堂ProducePandas", 2, 56, "W.O.R.L.D.", 1662, 2063173324),
|
||||||
|
new("渐近自由", "熊猫堂ProducePandas", 4, 19, "W.O.R.L.D.", 124, 2063173321),
|
||||||
|
new("世界所有的烂漫", "熊猫堂ProducePandas", 3, 30, "W.O.R.L.D.", 335, 2053388775)
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public partial class SongViewModel : ObservableObject
|
||||||
|
{
|
||||||
|
[ObservableProperty] private string? _title;
|
||||||
|
[ObservableProperty] private string? _artist;
|
||||||
|
[ObservableProperty] private string? _album;
|
||||||
|
[ObservableProperty] private int _countOfComment;
|
||||||
|
[ObservableProperty] private bool? _isSelected;
|
||||||
|
}
|
||||||
151
demo/Semi.Avalonia.Demo/ViewModels/VariablesDemoViewModel.cs
Normal file
151
demo/Semi.Avalonia.Demo/ViewModels/VariablesDemoViewModel.cs
Normal file
@@ -0,0 +1,151 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
|
using Avalonia;
|
||||||
|
using Avalonia.Collections;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Media;
|
||||||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
using Semi.Avalonia.Tokens;
|
||||||
|
|
||||||
|
namespace Semi.Avalonia.Demo.ViewModels;
|
||||||
|
|
||||||
|
public partial class VariablesDemoViewModel : ObservableObject
|
||||||
|
{
|
||||||
|
public DataGridCollectionView GridData { get; set; }
|
||||||
|
[ObservableProperty] private string _searchText = string.Empty;
|
||||||
|
|
||||||
|
public VariablesDemoViewModel()
|
||||||
|
{
|
||||||
|
IResourceDictionary dictionary = new Variables();
|
||||||
|
foreach (var token in Tokens)
|
||||||
|
{
|
||||||
|
if (token.ResourceKey is not null && dictionary.TryGetValue(token.ResourceKey, out var value))
|
||||||
|
{
|
||||||
|
token.Type = value?.GetType();
|
||||||
|
token.Value = GetValueString(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GridData = new DataGridCollectionView(Tokens);
|
||||||
|
GridData.GroupDescriptions.Add(new DataGridPathGroupDescription(nameof(VariableItem.Category)));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string? GetValueString(object? value)
|
||||||
|
{
|
||||||
|
if (value is null) return string.Empty;
|
||||||
|
|
||||||
|
return value switch
|
||||||
|
{
|
||||||
|
double d => d.ToString(CultureInfo.InvariantCulture),
|
||||||
|
CornerRadius c => c.IsUniform ? $"{c.TopLeft}" : c.ToString(),
|
||||||
|
Thickness t => t.IsUniform ? $"{t.Left}" : t.ToString(),
|
||||||
|
FontWeight fontWeight => Convert.ToInt32(fontWeight).ToString(),
|
||||||
|
FontFamily fontFamily => fontFamily.FamilyNames.ToString(),
|
||||||
|
_ => value.ToString()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
partial void OnSearchTextChanged(string value)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(value))
|
||||||
|
{
|
||||||
|
GridData.Filter = _ => true;
|
||||||
|
GridData.Refresh();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var search = value.Trim();
|
||||||
|
GridData.Filter = item =>
|
||||||
|
{
|
||||||
|
if (item is not VariableItem variableItem) return false;
|
||||||
|
return (variableItem.Category?.Contains(search, StringComparison.InvariantCultureIgnoreCase) ?? false) ||
|
||||||
|
(variableItem.ResourceKey?.Contains(search, StringComparison.InvariantCultureIgnoreCase) ?? false) ||
|
||||||
|
(variableItem.Value?.Contains(search, StringComparison.InvariantCultureIgnoreCase) ?? false) ||
|
||||||
|
(variableItem.Type?.Name.Contains(search, StringComparison.InvariantCultureIgnoreCase) ?? false) ||
|
||||||
|
(variableItem.Description?.Contains(search, StringComparison.InvariantCultureIgnoreCase) ?? false);
|
||||||
|
};
|
||||||
|
GridData.Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static List<VariableItem> Tokens { get; set; } =
|
||||||
|
[
|
||||||
|
new("Height", "SemiHeightControlSmall"),
|
||||||
|
new("Height", "SemiHeightControlDefault"),
|
||||||
|
new("Height", "SemiHeightControlLarge"),
|
||||||
|
new("Icon Size", "SemiWidthIconExtraSmall"),
|
||||||
|
new("Icon Size", "SemiWidthIconSmall"),
|
||||||
|
new("Icon Size", "SemiWidthIconMedium"),
|
||||||
|
new("Icon Size", "SemiWidthIconLarge"),
|
||||||
|
new("Icon Size", "SemiWidthIconExtraLarge"),
|
||||||
|
new("Border CornerRadius Spacing", "SemiBorderRadiusSpacingExtraSmall"),
|
||||||
|
new("Border CornerRadius Spacing", "SemiBorderRadiusSpacingSmall"),
|
||||||
|
new("Border CornerRadius Spacing", "SemiBorderRadiusSpacingMedium"),
|
||||||
|
new("Border CornerRadius Spacing", "SemiBorderRadiusSpacingLarge"),
|
||||||
|
new("Border CornerRadius Spacing", "SemiBorderRadiusSpacingFull"),
|
||||||
|
new("Border CornerRadius", "SemiBorderRadiusExtraSmall"),
|
||||||
|
new("Border CornerRadius", "SemiBorderRadiusSmall"),
|
||||||
|
new("Border CornerRadius", "SemiBorderRadiusMedium"),
|
||||||
|
new("Border CornerRadius", "SemiBorderRadiusLarge"),
|
||||||
|
new("Border CornerRadius", "SemiBorderRadiusFull"),
|
||||||
|
new("Border Spacing", "SemiBorderSpacing"),
|
||||||
|
new("Border Spacing", "SemiBorderSpacingControl"),
|
||||||
|
new("Border Spacing", "SemiBorderSpacingControlFocus"),
|
||||||
|
new("Border Thickness", "SemiBorderThickness"),
|
||||||
|
new("Border Thickness", "SemiBorderThicknessControl"),
|
||||||
|
new("Border Thickness", "SemiBorderThicknessControlFocus"),
|
||||||
|
new("Spacing", "SemiSpacingNone"),
|
||||||
|
new("Spacing", "SemiSpacingSuperTight"),
|
||||||
|
new("Spacing", "SemiSpacingExtraTight"),
|
||||||
|
new("Spacing", "SemiSpacingTight"),
|
||||||
|
new("Spacing", "SemiSpacingBaseTight"),
|
||||||
|
new("Spacing", "SemiSpacingBase"),
|
||||||
|
new("Spacing", "SemiSpacingBaseLoose"),
|
||||||
|
new("Spacing", "SemiSpacingLoose"),
|
||||||
|
new("Spacing", "SemiSpacingExtraLoose"),
|
||||||
|
new("Spacing", "SemiSpacingSuperLoose"),
|
||||||
|
new("Thickness", "SemiThicknessNone"),
|
||||||
|
new("Thickness", "SemiThicknessSuperTight"),
|
||||||
|
new("Thickness", "SemiThicknessExtraTight"),
|
||||||
|
new("Thickness", "SemiThicknessTight"),
|
||||||
|
new("Thickness", "SemiThicknessBaseTight"),
|
||||||
|
new("Thickness", "SemiThicknessBase"),
|
||||||
|
new("Thickness", "SemiThicknessBaseLoose"),
|
||||||
|
new("Thickness", "SemiThicknessLoose"),
|
||||||
|
new("Thickness", "SemiThicknessExtraLoose"),
|
||||||
|
new("Thickness", "SemiThicknessSuperLoose"),
|
||||||
|
new("FontSize", "SemiFontSizeSmall"),
|
||||||
|
new("FontSize", "SemiFontSizeRegular"),
|
||||||
|
new("FontSize", "SemiFontSizeHeader6"),
|
||||||
|
new("FontSize", "SemiFontSizeHeader5"),
|
||||||
|
new("FontSize", "SemiFontSizeHeader4"),
|
||||||
|
new("FontSize", "SemiFontSizeHeader3"),
|
||||||
|
new("FontSize", "SemiFontSizeHeader2"),
|
||||||
|
new("FontSize", "SemiFontSizeHeader1"),
|
||||||
|
new("FontWeight", "SemiFontWeightLight"),
|
||||||
|
new("FontWeight", "SemiFontWeightRegular"),
|
||||||
|
new("FontWeight", "SemiFontWeightBold"),
|
||||||
|
new("FontFamily", "SemiFontFamilyRegular"),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public class VariableItem()
|
||||||
|
{
|
||||||
|
public string? Category { get; set; }
|
||||||
|
public string? ResourceKey { get; set; }
|
||||||
|
public Type? Type { get; set; }
|
||||||
|
public string? Value { get; set; }
|
||||||
|
public string? Description { get; set; }
|
||||||
|
|
||||||
|
public VariableItem(string category, string resourceKey, string description = "") : this()
|
||||||
|
{
|
||||||
|
Category = category;
|
||||||
|
ResourceKey = resourceKey;
|
||||||
|
Description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string CopyText =>
|
||||||
|
$"""
|
||||||
|
<StaticResource x:Key="" ResourceKey="{ResourceKey}" />
|
||||||
|
""";
|
||||||
|
}
|
||||||
@@ -16,9 +16,9 @@
|
|||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="TabItem">
|
<ControlTemplate TargetType="TabItem">
|
||||||
<TextBlock
|
<TextBlock
|
||||||
FontWeight="Bold"
|
|
||||||
FontSize="12"
|
|
||||||
Margin="4"
|
Margin="4"
|
||||||
|
FontSize="12"
|
||||||
|
FontWeight="Bold"
|
||||||
Text="{TemplateBinding Header}" />
|
Text="{TemplateBinding Header}" />
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
@@ -37,48 +37,44 @@
|
|||||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||||
<ToggleSwitch
|
<ToggleSwitch
|
||||||
Name="ExpandButton"
|
Name="ExpandButton"
|
||||||
Theme="{DynamicResource IconBorderlessToggleSwitch}"
|
Content="{StaticResource SemiIconSidebar}"
|
||||||
Content="{StaticResource SemiIconSidebar}" />
|
Theme="{DynamicResource IconBorderlessToggleSwitch}" />
|
||||||
<SelectableTextBlock
|
<SelectableTextBlock
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Classes="H6"
|
Classes="H6"
|
||||||
Text="Semi Avalonia"
|
Text="Semi Avalonia"
|
||||||
Theme="{DynamicResource TitleSelectableTextBlock}" />
|
Theme="{DynamicResource TitleSelectableTextBlock}" />
|
||||||
<SelectableTextBlock
|
<SelectableTextBlock VerticalAlignment="Center" Text="/" />
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="/" />
|
|
||||||
<SelectableTextBlock
|
<SelectableTextBlock
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Classes="Secondary"
|
Classes="Secondary"
|
||||||
Text="{ReflectionBinding #tab.SelectedItem.Header}" />
|
Text="{ReflectionBinding #tab.SelectedItem.Header}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
|
||||||
<Button
|
<Button
|
||||||
Theme="{DynamicResource IconBorderlessButton}"
|
|
||||||
Command="{Binding OpenUrlCommand}"
|
Command="{Binding OpenUrlCommand}"
|
||||||
CommandParameter="{Binding DocumentationUrl}"
|
CommandParameter="{Binding DocumentationUrl}"
|
||||||
Content="{StaticResource SemiIconGlobe}" />
|
Content="{StaticResource SemiIconGlobe}"
|
||||||
|
Theme="{DynamicResource IconBorderlessButton}" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
Theme="{DynamicResource IconBorderlessButton}"
|
|
||||||
Command="{Binding OpenUrlCommand}"
|
Command="{Binding OpenUrlCommand}"
|
||||||
CommandParameter="{Binding RepoUrl}"
|
CommandParameter="{Binding RepoUrl}"
|
||||||
Content="{StaticResource SemiIconGithubLogo}" />
|
Content="{StaticResource SemiIconGithubLogo}"
|
||||||
|
Theme="{DynamicResource IconBorderlessButton}" />
|
||||||
|
|
||||||
<ToggleSwitch
|
<ToggleSwitch
|
||||||
Theme="{DynamicResource IconBorderlessToggleSwitch}"
|
|
||||||
Command="{Binding ToggleThemeCommand}"
|
Command="{Binding ToggleThemeCommand}"
|
||||||
|
OffContent="{StaticResource SemiIconSun}"
|
||||||
OnContent="{StaticResource SemiIconMoon}"
|
OnContent="{StaticResource SemiIconMoon}"
|
||||||
OffContent="{StaticResource SemiIconSun}" />
|
Theme="{DynamicResource IconBorderlessToggleSwitch}" />
|
||||||
|
|
||||||
<Button
|
<Button Content="{StaticResource SemiIconMenu}" Theme="{DynamicResource IconBorderlessButton}">
|
||||||
Theme="{DynamicResource IconBorderlessButton}"
|
|
||||||
Content="{StaticResource SemiIconMenu}">
|
|
||||||
<Button.Flyout>
|
<Button.Flyout>
|
||||||
<MenuFlyout Placement="Bottom" ItemsSource="{Binding MenuItems}" />
|
<MenuFlyout ItemsSource="{Binding MenuItems}" Placement="Bottom" />
|
||||||
</Button.Flyout>
|
</Button.Flyout>
|
||||||
<Button.Styles>
|
<Button.Styles>
|
||||||
<Style Selector="MenuItem" x:DataType="views:MenuItemViewModel">
|
<Style x:DataType="views:MenuItemViewModel" Selector="MenuItem">
|
||||||
<Setter Property="Header" Value="{Binding Header}" />
|
<Setter Property="Header" Value="{Binding Header}" />
|
||||||
<Setter Property="ItemsSource" Value="{Binding Items}" />
|
<Setter Property="ItemsSource" Value="{Binding Items}" />
|
||||||
<Setter Property="Command" Value="{Binding Command}" />
|
<Setter Property="Command" Value="{Binding Command}" />
|
||||||
@@ -94,8 +90,8 @@
|
|||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Margin="8"
|
Margin="8"
|
||||||
Padding="20,0,0,0"
|
Padding="20,0,0,0"
|
||||||
TabStripPlacement="Left"
|
|
||||||
Classes.Dismiss="{Binding #ExpandButton.IsChecked}"
|
Classes.Dismiss="{Binding #ExpandButton.IsChecked}"
|
||||||
|
TabStripPlacement="Left"
|
||||||
Theme="{DynamicResource ScrollLineTabControl}">
|
Theme="{DynamicResource ScrollLineTabControl}">
|
||||||
<TabControl.Styles>
|
<TabControl.Styles>
|
||||||
<Style Selector=".Dismiss /template/ ScrollViewer#PART_ScrollViewer">
|
<Style Selector=".Dismiss /template/ ScrollViewer#PART_ScrollViewer">
|
||||||
@@ -113,36 +109,30 @@
|
|||||||
<TabItem Header="About Us">
|
<TabItem Header="About Us">
|
||||||
<pages:AboutUs />
|
<pages:AboutUs />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem
|
<TabItem Header="Resource Browser" Theme="{DynamicResource CategoryTabItem}" />
|
||||||
Theme="{DynamicResource CategoryTabItem}"
|
<TabItem Header="Palette">
|
||||||
Header="Resource Browser" />
|
<pages:PaletteDemo />
|
||||||
<!-- <TabItem Header="Palette"> -->
|
</TabItem>
|
||||||
<!-- <pages:PaletteDemo /> -->
|
<TabItem Header="HighContrastTheme">
|
||||||
<!-- </TabItem> -->
|
<pages:HighContrastDemo />
|
||||||
<!-- <TabItem Header="HighContrastTheme"> -->
|
</TabItem>
|
||||||
<!-- <pages:HighContrastDemo /> -->
|
<TabItem Header="Variables">
|
||||||
<!-- </TabItem> -->
|
<pages:VariablesDemo />
|
||||||
<!-- <TabItem Header="Variables"> -->
|
</TabItem>
|
||||||
<!-- <pages:VariablesDemo /> -->
|
|
||||||
<!-- </TabItem> -->
|
|
||||||
<TabItem Header="Icon">
|
<TabItem Header="Icon">
|
||||||
<pages:IconDemo />
|
<pages:IconDemo />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem
|
<TabItem Header="Separate Pack" Theme="{DynamicResource CategoryTabItem}" />
|
||||||
Theme="{DynamicResource CategoryTabItem}"
|
|
||||||
Header="Separate Pack" />
|
|
||||||
<TabItem Header="ColorPicker">
|
<TabItem Header="ColorPicker">
|
||||||
<pages:ColorPickerDemo />
|
<pages:ColorPickerDemo />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<!-- <TabItem Header="DataGrid"> -->
|
<TabItem Header="DataGrid">
|
||||||
<!-- <pages:DataGridDemo /> -->
|
<pages:DataGridDemo />
|
||||||
<!-- </TabItem> -->
|
</TabItem>
|
||||||
<!-- <TabItem Header="TreeDataGrid"> -->
|
<!-- <TabItem Header="TreeDataGrid"> -->
|
||||||
<!-- <pages:TreeDataGridDemo /> -->
|
<!-- <pages:TreeDataGridDemo /> -->
|
||||||
<!-- </TabItem> -->
|
<!-- </TabItem> -->
|
||||||
<TabItem
|
<TabItem Header="Basic" Theme="{DynamicResource CategoryTabItem}" />
|
||||||
Theme="{DynamicResource CategoryTabItem}"
|
|
||||||
Header="Basic" />
|
|
||||||
<TabItem Header="TextBlock">
|
<TabItem Header="TextBlock">
|
||||||
<pages:TextBlockDemo />
|
<pages:TextBlockDemo />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
@@ -155,9 +145,7 @@
|
|||||||
<TabItem Header="PathIcon">
|
<TabItem Header="PathIcon">
|
||||||
<pages:PathIconDemo />
|
<pages:PathIconDemo />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem
|
<TabItem Header="Button" Theme="{DynamicResource CategoryTabItem}" />
|
||||||
Theme="{DynamicResource CategoryTabItem}"
|
|
||||||
Header="Button" />
|
|
||||||
<TabItem Header="Button">
|
<TabItem Header="Button">
|
||||||
<pages:ButtonDemo />
|
<pages:ButtonDemo />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
@@ -173,9 +161,7 @@
|
|||||||
<TabItem Header="ToggleSwitch">
|
<TabItem Header="ToggleSwitch">
|
||||||
<pages:ToggleSwitchDemo />
|
<pages:ToggleSwitchDemo />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem
|
<TabItem Header="Input" Theme="{DynamicResource CategoryTabItem}" />
|
||||||
Theme="{DynamicResource CategoryTabItem}"
|
|
||||||
Header="Input" />
|
|
||||||
<TabItem Header="TextBox">
|
<TabItem Header="TextBox">
|
||||||
<pages:TextBoxDemo />
|
<pages:TextBoxDemo />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
@@ -197,9 +183,7 @@
|
|||||||
<TabItem Header="ManagedFileChooser">
|
<TabItem Header="ManagedFileChooser">
|
||||||
<pages:ManagedFileChooserDemo />
|
<pages:ManagedFileChooserDemo />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem
|
<TabItem Header="Date/Time" Theme="{DynamicResource CategoryTabItem}" />
|
||||||
Theme="{DynamicResource CategoryTabItem}"
|
|
||||||
Header="Date/Time" />
|
|
||||||
<TabItem Header="Calendar">
|
<TabItem Header="Calendar">
|
||||||
<pages:CalendarDemo />
|
<pages:CalendarDemo />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
@@ -212,12 +196,13 @@
|
|||||||
<TabItem Header="TimePicker">
|
<TabItem Header="TimePicker">
|
||||||
<pages:TimePickerDemo />
|
<pages:TimePickerDemo />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem
|
<TabItem Header="Navigation" Theme="{DynamicResource CategoryTabItem}" />
|
||||||
Theme="{DynamicResource CategoryTabItem}"
|
|
||||||
Header="Navigation" />
|
|
||||||
<TabItem Header="ContentPage">
|
<TabItem Header="ContentPage">
|
||||||
<pages:ContentPageDemo />
|
<pages:ContentPageDemo />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
<TabItem Header="CarouselPage">
|
||||||
|
<pages:CarouselPageDemo />
|
||||||
|
</TabItem>
|
||||||
<TabItem Header="DrawerPage">
|
<TabItem Header="DrawerPage">
|
||||||
<pages:DrawerPageDemo />
|
<pages:DrawerPageDemo />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
@@ -236,12 +221,13 @@
|
|||||||
<TabItem Header="TreeView">
|
<TabItem Header="TreeView">
|
||||||
<pages:TreeViewDemo />
|
<pages:TreeViewDemo />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem
|
<TabItem Header="Show" Theme="{DynamicResource CategoryTabItem}" />
|
||||||
Theme="{DynamicResource CategoryTabItem}"
|
|
||||||
Header="Show" />
|
|
||||||
<TabItem Header="Carousel">
|
<TabItem Header="Carousel">
|
||||||
<pages:CarouselDemo />
|
<pages:CarouselDemo />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
<TabItem Header="PipsPager">
|
||||||
|
<pages:PipsPagerDemo />
|
||||||
|
</TabItem>
|
||||||
<TabItem Header="Expander">
|
<TabItem Header="Expander">
|
||||||
<pages:ExpanderDemo />
|
<pages:ExpanderDemo />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
@@ -263,9 +249,7 @@
|
|||||||
<TabItem Header="ToolTip">
|
<TabItem Header="ToolTip">
|
||||||
<pages:ToolTipDemo />
|
<pages:ToolTipDemo />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem
|
<TabItem Header="Feedback" Theme="{DynamicResource CategoryTabItem}" />
|
||||||
Theme="{DynamicResource CategoryTabItem}"
|
|
||||||
Header="Feedback" />
|
|
||||||
<TabItem Header="DataValidationErrors">
|
<TabItem Header="DataValidationErrors">
|
||||||
<pages:DataValidationErrorsDemo />
|
<pages:DataValidationErrorsDemo />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
@@ -278,9 +262,7 @@
|
|||||||
<TabItem Header="RefreshContainer">
|
<TabItem Header="RefreshContainer">
|
||||||
<pages:RefreshContainerDemo />
|
<pages:RefreshContainerDemo />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem
|
<TabItem Header="Other" Theme="{DynamicResource CategoryTabItem}" />
|
||||||
Theme="{DynamicResource CategoryTabItem}"
|
|
||||||
Header="Other" />
|
|
||||||
<TabItem Header="CommandBar">
|
<TabItem Header="CommandBar">
|
||||||
<pages:CommandBarDemo />
|
<pages:CommandBarDemo />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
@@ -296,6 +278,9 @@
|
|||||||
<TabItem Header="ThemeVariantScope">
|
<TabItem Header="ThemeVariantScope">
|
||||||
<pages:ThemeVariantDemo />
|
<pages:ThemeVariantDemo />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
<TabItem Header="WindowCustomizationsPage">
|
||||||
|
<pages:WindowCustomizationsPage />
|
||||||
|
</TabItem>
|
||||||
</TabControl>
|
</TabControl>
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -9,7 +9,6 @@
|
|||||||
d:DesignHeight="450"
|
d:DesignHeight="450"
|
||||||
d:DesignWidth="800"
|
d:DesignWidth="800"
|
||||||
ExtendClientAreaToDecorationsHint="True"
|
ExtendClientAreaToDecorationsHint="True"
|
||||||
ExtendClientAreaTitleBarHeightHint="40"
|
|
||||||
Icon="/Assets/irihi.ico"
|
Icon="/Assets/irihi.ico"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<views:MainView Margin="{Binding $parent[Window].WindowDecorationMargin}" />
|
<views:MainView Margin="{Binding $parent[Window].WindowDecorationMargin}" />
|
||||||
|
|||||||
@@ -1,11 +1,38 @@
|
|||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Input;
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Views;
|
namespace Semi.Avalonia.Demo.Views;
|
||||||
|
|
||||||
public partial class MainWindow : Window
|
public partial class MainWindow : Window
|
||||||
{
|
{
|
||||||
|
private WindowState _stateBeforeFullScreen = WindowState.Normal;
|
||||||
|
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
KeyDown += FullScreenKeyDown;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FullScreenKeyDown(object? sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Key == Key.F11)
|
||||||
|
{
|
||||||
|
|
||||||
|
ToggleFullScreen();
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ToggleFullScreen()
|
||||||
|
{
|
||||||
|
if (WindowState is not WindowState.FullScreen)
|
||||||
|
{
|
||||||
|
_stateBeforeFullScreen = WindowState;
|
||||||
|
WindowState = WindowState.FullScreen;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
WindowState = _stateBeforeFullScreen;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||||
<AvaloniaVersion>12.0.0-preview2</AvaloniaVersion>
|
<AvaloniaVersion>12.0.0</AvaloniaVersion>
|
||||||
<DataGridVersion>11.3.7</DataGridVersion>
|
<DataGridVersion>12.0.0</DataGridVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageVersion Include="Avalonia" Version="$(AvaloniaVersion)"/>
|
<PackageVersion Include="Avalonia" Version="$(AvaloniaVersion)"/>
|
||||||
<PackageVersion Include="Avalonia.Controls.ColorPicker" Version="$(AvaloniaVersion)"/>
|
<PackageVersion Include="Avalonia.Controls.ColorPicker" Version="$(AvaloniaVersion)"/>
|
||||||
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="$(DataGridVersion)"/>
|
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="$(DataGridVersion)"/>
|
||||||
<PackageVersion Include="Avalonia.Controls.TreeDataGrid" Version="11.1.1"/>
|
<PackageVersion Include="Avalonia.Controls.TreeDataGrid" Version="11.1.1"/>
|
||||||
<PackageVersion Include="Irihi.Avalonia.Shared" Version="0.4.0-preview1"/>
|
<PackageVersion Include="Irihi.Avalonia.Shared" Version="0.4.0"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.ThemeDictionaries>
|
<ResourceDictionary.ThemeDictionaries>
|
||||||
<ResourceInclude x:Key="Default" Source="Light.axaml" />
|
<ResourceInclude x:Key="Default" Source="Light.axaml" />
|
||||||
|
<ResourceInclude x:Key="Light" Source="Light.axaml" />
|
||||||
<ResourceInclude x:Key="Dark" Source="Dark.axaml" />
|
<ResourceInclude x:Key="Dark" Source="Dark.axaml" />
|
||||||
</ResourceDictionary.ThemeDictionaries>
|
</ResourceDictionary.ThemeDictionaries>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
|
|||||||
@@ -2,38 +2,48 @@
|
|||||||
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:iri="https://irihi.tech/shared"
|
xmlns:iri="https://irihi.tech/shared"
|
||||||
xmlns:converters="using:Avalonia.Controls.Converters">
|
xmlns:semi="https://irihi.tech/semi">
|
||||||
<converters:ToBrushConverter x:Key="ToBrushConverter" />
|
<Design.PreviewWith>
|
||||||
|
<StackPanel Width="500" Height="500">
|
||||||
|
<ColorPicker Name="cp" Color="#AAAAAAAA" IsAlphaVisible="True" IsAlphaEnabled="True" />
|
||||||
|
<ColorPicker Theme="{DynamicResource SimpleColorPicker}" Color="{Binding #cp.Color}" IsAlphaEnabled="{Binding #cp.IsAlphaEnabled}" IsAlphaVisible="{Binding #cp.IsAlphaVisible}" />
|
||||||
|
<ColorPicker Theme="{DynamicResource HexSimpleColorPicker}" Color="{Binding #cp.Color}" IsAlphaEnabled="{Binding #cp.IsAlphaEnabled}" IsAlphaVisible="{Binding #cp.IsAlphaVisible}" />
|
||||||
|
<ColorView Color="{Binding #cp.Color}" IsAlphaEnabled="{Binding #cp.IsAlphaEnabled}" IsAlphaVisible="{Binding #cp.IsAlphaVisible}" />
|
||||||
|
</StackPanel>
|
||||||
|
</Design.PreviewWith>
|
||||||
|
|
||||||
<ControlTheme x:Key="{x:Type ColorPicker}" TargetType="ColorPicker">
|
<ControlTheme x:Key="{x:Type ColorPicker}" TargetType="ColorPicker">
|
||||||
<Setter Property="MinWidth" Value="64" />
|
<!-- Alpha position should match CSS (and default slider order) instead of XAML/WinUI -->
|
||||||
|
<Setter Property="HexInputAlphaPosition" Value="Trailing" />
|
||||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||||
|
<Setter Property="Padding" Value="0 0 10 0" />
|
||||||
<Setter Property="MinHeight" Value="{DynamicResource ColorPickerMinHeight}" />
|
<Setter Property="MinHeight" Value="{DynamicResource ColorPickerMinHeight}" />
|
||||||
<Setter Property="CornerRadius" Value="{DynamicResource ColorPickerCornerRadius}" />
|
<Setter Property="CornerRadius" Value="{DynamicResource ColorPickerCornerRadius}" />
|
||||||
|
<Setter Property="Palette" Value="{DynamicResource SemiColorPalette}" />
|
||||||
<Setter Property="Content">
|
<Setter Property="Content">
|
||||||
<Template>
|
<Template>
|
||||||
<Panel>
|
<Panel>
|
||||||
<Border
|
<Border
|
||||||
Margin="1,1,0,1"
|
Margin="1,1,0,1"
|
||||||
|
Width="{Binding $self.Bounds.Height}"
|
||||||
Background="{DynamicResource ColorControlCheckeredBackgroundBrush}"
|
Background="{DynamicResource ColorControlCheckeredBackgroundBrush}"
|
||||||
CornerRadius="{TemplateBinding CornerRadius, Converter={iri:CornerRadiusMixerConverter Left}}" />
|
CornerRadius="{TemplateBinding CornerRadius, Converter={iri:CornerRadiusMixerConverter Left}}" />
|
||||||
<Border
|
<Border
|
||||||
Margin="1,1,0,1"
|
Margin="1,1,0,1"
|
||||||
|
Width="{Binding $self.Bounds.Height}"
|
||||||
Background="{TemplateBinding HsvColor, Converter={StaticResource ToBrushConverter}}"
|
Background="{TemplateBinding HsvColor, Converter={StaticResource ToBrushConverter}}"
|
||||||
CornerRadius="{TemplateBinding CornerRadius, Converter={iri:CornerRadiusMixerConverter Left}}" />
|
CornerRadius="{TemplateBinding CornerRadius, Converter={iri:CornerRadiusMixerConverter Left}}" />
|
||||||
</Panel>
|
</Panel>
|
||||||
</Template>
|
</Template>
|
||||||
</Setter>
|
</Setter>
|
||||||
<Setter Property="Palette">
|
|
||||||
<FluentColorPalette />
|
|
||||||
</Setter>
|
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="{x:Type ColorPicker}">
|
<ControlTemplate TargetType="ColorPicker">
|
||||||
<DropDownButton
|
<DropDownButton
|
||||||
Width="{TemplateBinding Width}"
|
Width="{TemplateBinding Width}"
|
||||||
Height="{TemplateBinding Height}"
|
Height="{TemplateBinding Height}"
|
||||||
MinWidth="{TemplateBinding MinWidth}"
|
MinWidth="{TemplateBinding MinWidth}"
|
||||||
MinHeight="{TemplateBinding MinHeight}"
|
MinHeight="{TemplateBinding MinHeight}"
|
||||||
|
Padding="{TemplateBinding Padding}"
|
||||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||||
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
@@ -49,7 +59,9 @@
|
|||||||
</Style>
|
</Style>
|
||||||
</DropDownButton.Styles>
|
</DropDownButton.Styles>
|
||||||
<DropDownButton.Flyout>
|
<DropDownButton.Flyout>
|
||||||
<Flyout FlyoutPresenterClasses="nopadding" Placement="{DynamicResource ColorPickerFlyoutPlacement}">
|
<Flyout
|
||||||
|
FlyoutPresenterClasses="nopadding"
|
||||||
|
Placement="{DynamicResource ColorPickerFlyoutPlacement}">
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
The following is copy-pasted from the ColorView's control template.
|
The following is copy-pasted from the ColorView's control template.
|
||||||
@@ -57,7 +69,6 @@
|
|||||||
Note the only changes are resources specific to the ColorPicker.
|
Note the only changes are resources specific to the ColorPicker.
|
||||||
-->
|
-->
|
||||||
<Grid
|
<Grid
|
||||||
Name="RootGrid"
|
|
||||||
Width="300"
|
Width="300"
|
||||||
Height="300"
|
Height="300"
|
||||||
RowDefinitions="*,Auto">
|
RowDefinitions="*,Auto">
|
||||||
@@ -81,7 +92,7 @@
|
|||||||
Padding="0"
|
Padding="0"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
HorizontalContentAlignment="Stretch"
|
HorizontalContentAlignment="Stretch"
|
||||||
SelectedIndex="{Binding SelectedIndex, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}">
|
SelectedIndex="{TemplateBinding SelectedIndex, Mode=TwoWay}">
|
||||||
<TabControl.Styles>
|
<TabControl.Styles>
|
||||||
<Style Selector="TabItem">
|
<Style Selector="TabItem">
|
||||||
<Setter Property="MinHeight" Value="32" />
|
<Setter Property="MinHeight" Value="32" />
|
||||||
@@ -116,11 +127,11 @@
|
|||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
AutomationProperties.Name="Third Component"
|
AutomationProperties.Name="Third Component"
|
||||||
ColorComponent="{Binding ThirdComponent, ElementName=ColorSpectrum}"
|
ColorComponent="{Binding #ColorSpectrum.ThirdComponent}"
|
||||||
ColorModel="Hsva"
|
ColorModel="Hsva"
|
||||||
HsvColor="{Binding HsvColor, ElementName=ColorSpectrum}"
|
HsvColor="{Binding #ColorSpectrum.HsvColor}"
|
||||||
IsAlphaVisible="True"
|
IsAlphaVisible="False"
|
||||||
IsPerceptive="False"
|
IsPerceptive="True"
|
||||||
IsVisible="{TemplateBinding IsColorSpectrumSliderVisible}"
|
IsVisible="{TemplateBinding IsColorSpectrumSliderVisible}"
|
||||||
Orientation="Vertical" />
|
Orientation="Vertical" />
|
||||||
<ColorSpectrum
|
<ColorSpectrum
|
||||||
@@ -129,7 +140,7 @@
|
|||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
Components="{TemplateBinding ColorSpectrumComponents}"
|
Components="{TemplateBinding ColorSpectrumComponents}"
|
||||||
HsvColor="{Binding HsvColor, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
|
HsvColor="{TemplateBinding HsvColor, Mode=TwoWay}"
|
||||||
MaxHue="{TemplateBinding MaxHue}"
|
MaxHue="{TemplateBinding MaxHue}"
|
||||||
MaxSaturation="{TemplateBinding MaxSaturation}"
|
MaxSaturation="{TemplateBinding MaxSaturation}"
|
||||||
MaxValue="{TemplateBinding MaxValue}"
|
MaxValue="{TemplateBinding MaxValue}"
|
||||||
@@ -146,14 +157,10 @@
|
|||||||
AutomationProperties.Name="Alpha Component"
|
AutomationProperties.Name="Alpha Component"
|
||||||
ColorComponent="Alpha"
|
ColorComponent="Alpha"
|
||||||
ColorModel="Hsva"
|
ColorModel="Hsva"
|
||||||
HsvColor="{Binding HsvColor, ElementName=ColorSpectrum}"
|
HsvColor="{Binding #ColorSpectrum.HsvColor}"
|
||||||
|
IsVisible="{TemplateBinding IsAlphaVisible}"
|
||||||
IsEnabled="{TemplateBinding IsAlphaEnabled}"
|
IsEnabled="{TemplateBinding IsAlphaEnabled}"
|
||||||
Orientation="Vertical">
|
Orientation="Vertical">
|
||||||
<ColorSlider.IsVisible>
|
|
||||||
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
||||||
<Binding Path="IsAlphaVisible" RelativeSource="{RelativeSource TemplatedParent}" />
|
|
||||||
</MultiBinding>
|
|
||||||
</ColorSlider.IsVisible>
|
|
||||||
</ColorSlider>
|
</ColorSlider>
|
||||||
</Grid>
|
</Grid>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
@@ -168,13 +175,13 @@
|
|||||||
<ListBox
|
<ListBox
|
||||||
Margin="12"
|
Margin="12"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
ItemContainerTheme="{DynamicResource ColorViewPaletteListBoxItemTheme}"
|
ItemContainerTheme="{StaticResource ColorViewPaletteListBoxItemTheme}"
|
||||||
ItemsSource="{TemplateBinding PaletteColors}"
|
ItemsSource="{TemplateBinding PaletteColors}"
|
||||||
SelectedItem="{Binding Color, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource DoNothingForNullConverter}, Mode=TwoWay}"
|
SelectedItem="{TemplateBinding Color, Mode=TwoWay, Converter={StaticResource DoNothingForNullConverter}}"
|
||||||
Theme="{DynamicResource ColorViewPaletteListBoxTheme}"
|
Theme="{StaticResource ColorViewPaletteListBoxTheme}"
|
||||||
UseLayoutRounding="False">
|
UseLayoutRounding="False">
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate DataType="{x:Type Color}">
|
<DataTemplate DataType="Color">
|
||||||
<Border
|
<Border
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
@@ -205,7 +212,11 @@
|
|||||||
Margin="12"
|
Margin="12"
|
||||||
ColumnDefinitions="Auto,*"
|
ColumnDefinitions="Auto,*"
|
||||||
RowDefinitions="Auto,24,*,*,*,*,12"
|
RowDefinitions="Auto,24,*,*,*,*,12"
|
||||||
Tag="{TemplateBinding ColorModel}">
|
UseLayoutRounding="False">
|
||||||
|
<Grid.Resources>
|
||||||
|
<Thickness x:Key="TextBoxContentPadding">8 0</Thickness>
|
||||||
|
<Thickness x:Key="TextBoxInnerLeftContentPadding">0 0 8 0</Thickness>
|
||||||
|
</Grid.Resources>
|
||||||
<Grid.Styles>
|
<Grid.Styles>
|
||||||
<Style Selector="NumericUpDown">
|
<Style Selector="NumericUpDown">
|
||||||
<Setter Property="InnerLeftContent">
|
<Setter Property="InnerLeftContent">
|
||||||
@@ -214,34 +225,6 @@
|
|||||||
</Template>
|
</Template>
|
||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="Grid[Tag=Rgba]">
|
|
||||||
<Style Selector="^ NumericUpDown#Component1NumericUpDown">
|
|
||||||
<Setter Property="Tag" Value="R" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^ NumericUpDown#Component2NumericUpDown">
|
|
||||||
<Setter Property="Tag" Value="G" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^ NumericUpDown#Component3NumericUpDown">
|
|
||||||
<Setter Property="Tag" Value="B" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^ NumericUpDown#AlphaComponentNumericUpDown">
|
|
||||||
<Setter Property="Tag" Value="A" />
|
|
||||||
</Style>
|
|
||||||
</Style>
|
|
||||||
<Style Selector="Grid[Tag=Hsva]">
|
|
||||||
<Style Selector="^ NumericUpDown#Component1NumericUpDown">
|
|
||||||
<Setter Property="Tag" Value="H" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^ NumericUpDown#Component2NumericUpDown">
|
|
||||||
<Setter Property="Tag" Value="S" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^ NumericUpDown#Component3NumericUpDown">
|
|
||||||
<Setter Property="Tag" Value="V" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^ NumericUpDown#AlphaComponentNumericUpDown">
|
|
||||||
<Setter Property="Tag" Value="A" />
|
|
||||||
</Style>
|
|
||||||
</Style>
|
|
||||||
</Grid.Styles>
|
</Grid.Styles>
|
||||||
<!-- Top color model & Hex input -->
|
<!-- Top color model & Hex input -->
|
||||||
<Grid
|
<Grid
|
||||||
@@ -302,11 +285,11 @@
|
|||||||
AllowSpin="True"
|
AllowSpin="True"
|
||||||
Classes="Small"
|
Classes="Small"
|
||||||
IsVisible="{TemplateBinding IsComponentTextInputVisible}"
|
IsVisible="{TemplateBinding IsComponentTextInputVisible}"
|
||||||
Maximum="{Binding Maximum, ElementName=Component1Slider}"
|
Maximum="{Binding #Component1Slider.Maximum}"
|
||||||
Minimum="{Binding Minimum, ElementName=Component1Slider}"
|
Minimum="{Binding #Component1Slider.Minimum}"
|
||||||
NumberFormat="{StaticResource ColorViewComponentNumberFormat}"
|
NumberFormat="{StaticResource ColorViewComponentNumberFormat}"
|
||||||
ShowButtonSpinner="False"
|
ShowButtonSpinner="False"
|
||||||
Value="{Binding Value, ElementName=Component1Slider}" />
|
Value="{Binding #Component1Slider.Value,Converter={StaticResource DoNothingForNullConverter}}" />
|
||||||
<ColorSlider
|
<ColorSlider
|
||||||
Name="Component1Slider"
|
Name="Component1Slider"
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
@@ -315,7 +298,7 @@
|
|||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
ColorComponent="Component1"
|
ColorComponent="Component1"
|
||||||
ColorModel="{TemplateBinding ColorModel,Mode=OneWay}"
|
ColorModel="{TemplateBinding ColorModel,Mode=OneWay}"
|
||||||
HsvColor="{Binding HsvColor, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
|
HsvColor="{TemplateBinding HsvColor, Mode=TwoWay}"
|
||||||
IsRoundingEnabled="True"
|
IsRoundingEnabled="True"
|
||||||
IsSnapToTickEnabled="True"
|
IsSnapToTickEnabled="True"
|
||||||
IsVisible="{TemplateBinding IsComponentSliderVisible}"
|
IsVisible="{TemplateBinding IsComponentSliderVisible}"
|
||||||
@@ -332,11 +315,11 @@
|
|||||||
AllowSpin="True"
|
AllowSpin="True"
|
||||||
Classes="Small"
|
Classes="Small"
|
||||||
IsVisible="{TemplateBinding IsComponentTextInputVisible}"
|
IsVisible="{TemplateBinding IsComponentTextInputVisible}"
|
||||||
Maximum="{Binding Maximum, ElementName=Component2Slider}"
|
Maximum="{Binding #Component2Slider.Maximum}"
|
||||||
Minimum="{Binding Minimum, ElementName=Component2Slider}"
|
Minimum="{Binding #Component2Slider.Minimum}"
|
||||||
NumberFormat="{StaticResource ColorViewComponentNumberFormat}"
|
NumberFormat="{StaticResource ColorViewComponentNumberFormat}"
|
||||||
ShowButtonSpinner="False"
|
ShowButtonSpinner="False"
|
||||||
Value="{Binding Value, ElementName=Component2Slider}" />
|
Value="{Binding #Component2Slider.Value,Converter={StaticResource DoNothingForNullConverter}}" />
|
||||||
<ColorSlider
|
<ColorSlider
|
||||||
Name="Component2Slider"
|
Name="Component2Slider"
|
||||||
Grid.Row="3"
|
Grid.Row="3"
|
||||||
@@ -345,7 +328,7 @@
|
|||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
ColorComponent="Component2"
|
ColorComponent="Component2"
|
||||||
ColorModel="{TemplateBinding ColorModel,Mode=OneWay}"
|
ColorModel="{TemplateBinding ColorModel,Mode=OneWay}"
|
||||||
HsvColor="{Binding HsvColor, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
|
HsvColor="{TemplateBinding HsvColor, Mode=TwoWay}"
|
||||||
IsRoundingEnabled="True"
|
IsRoundingEnabled="True"
|
||||||
IsSnapToTickEnabled="True"
|
IsSnapToTickEnabled="True"
|
||||||
IsVisible="{TemplateBinding IsComponentSliderVisible}"
|
IsVisible="{TemplateBinding IsComponentSliderVisible}"
|
||||||
@@ -362,11 +345,11 @@
|
|||||||
AllowSpin="True"
|
AllowSpin="True"
|
||||||
Classes="Small"
|
Classes="Small"
|
||||||
IsVisible="{TemplateBinding IsComponentTextInputVisible}"
|
IsVisible="{TemplateBinding IsComponentTextInputVisible}"
|
||||||
Maximum="{Binding Maximum, ElementName=Component3Slider}"
|
Maximum="{Binding #Component3Slider.Maximum}"
|
||||||
Minimum="{Binding Minimum, ElementName=Component3Slider}"
|
Minimum="{Binding #Component3Slider.Minimum}"
|
||||||
NumberFormat="{StaticResource ColorViewComponentNumberFormat}"
|
NumberFormat="{StaticResource ColorViewComponentNumberFormat}"
|
||||||
ShowButtonSpinner="False"
|
ShowButtonSpinner="False"
|
||||||
Value="{Binding Value, ElementName=Component3Slider}" />
|
Value="{Binding #Component3Slider.Value,Converter={StaticResource DoNothingForNullConverter}}" />
|
||||||
<ColorSlider
|
<ColorSlider
|
||||||
Name="Component3Slider"
|
Name="Component3Slider"
|
||||||
Grid.Row="4"
|
Grid.Row="4"
|
||||||
@@ -375,7 +358,7 @@
|
|||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
ColorComponent="Component3"
|
ColorComponent="Component3"
|
||||||
ColorModel="{TemplateBinding ColorModel,Mode=OneWay}"
|
ColorModel="{TemplateBinding ColorModel,Mode=OneWay}"
|
||||||
HsvColor="{Binding HsvColor, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
|
HsvColor="{TemplateBinding HsvColor, Mode=TwoWay}"
|
||||||
IsRoundingEnabled="True"
|
IsRoundingEnabled="True"
|
||||||
IsSnapToTickEnabled="True"
|
IsSnapToTickEnabled="True"
|
||||||
IsVisible="{TemplateBinding IsComponentSliderVisible}"
|
IsVisible="{TemplateBinding IsComponentSliderVisible}"
|
||||||
@@ -392,15 +375,15 @@
|
|||||||
AllowSpin="True"
|
AllowSpin="True"
|
||||||
Classes="Small"
|
Classes="Small"
|
||||||
IsEnabled="{TemplateBinding IsAlphaEnabled}"
|
IsEnabled="{TemplateBinding IsAlphaEnabled}"
|
||||||
Maximum="{Binding Maximum, ElementName=AlphaComponentSlider}"
|
Maximum="{Binding #AlphaComponentSlider.Maximum}"
|
||||||
Minimum="{Binding Minimum, ElementName=AlphaComponentSlider}"
|
Minimum="{Binding #AlphaComponentSlider.Minimum}"
|
||||||
NumberFormat="{StaticResource ColorViewComponentNumberFormat}"
|
NumberFormat="{StaticResource ColorViewComponentNumberFormat}"
|
||||||
ShowButtonSpinner="False"
|
ShowButtonSpinner="False"
|
||||||
Value="{Binding Value, ElementName=AlphaComponentSlider}">
|
Value="{Binding #AlphaComponentSlider.Value,Converter={StaticResource DoNothingForNullConverter}}">
|
||||||
<NumericUpDown.IsVisible>
|
<NumericUpDown.IsVisible>
|
||||||
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
||||||
<Binding Path="IsAlphaVisible" RelativeSource="{RelativeSource TemplatedParent}" />
|
<TemplateBinding Property="IsAlphaVisible" />
|
||||||
<Binding Path="IsComponentTextInputVisible" RelativeSource="{RelativeSource TemplatedParent}" />
|
<TemplateBinding Property="IsComponentTextInputVisible" />
|
||||||
</MultiBinding>
|
</MultiBinding>
|
||||||
</NumericUpDown.IsVisible>
|
</NumericUpDown.IsVisible>
|
||||||
</NumericUpDown>
|
</NumericUpDown>
|
||||||
@@ -412,7 +395,7 @@
|
|||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
ColorComponent="Alpha"
|
ColorComponent="Alpha"
|
||||||
ColorModel="{TemplateBinding ColorModel,Mode=OneWay}"
|
ColorModel="{TemplateBinding ColorModel,Mode=OneWay}"
|
||||||
HsvColor="{Binding HsvColor, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
|
HsvColor="{TemplateBinding HsvColor, Mode=TwoWay}"
|
||||||
IsEnabled="{TemplateBinding IsAlphaEnabled}"
|
IsEnabled="{TemplateBinding IsAlphaEnabled}"
|
||||||
IsRoundingEnabled="True"
|
IsRoundingEnabled="True"
|
||||||
IsSnapToTickEnabled="True"
|
IsSnapToTickEnabled="True"
|
||||||
@@ -420,8 +403,8 @@
|
|||||||
TickFrequency="1">
|
TickFrequency="1">
|
||||||
<ColorSlider.IsVisible>
|
<ColorSlider.IsVisible>
|
||||||
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
||||||
<Binding Path="IsAlphaVisible" RelativeSource="{RelativeSource TemplatedParent}" />
|
<TemplateBinding Property="IsAlphaVisible" />
|
||||||
<Binding Path="IsComponentSliderVisible" RelativeSource="{RelativeSource TemplatedParent}" />
|
<TemplateBinding Property="IsComponentSliderVisible" />
|
||||||
</MultiBinding>
|
</MultiBinding>
|
||||||
</ColorSlider.IsVisible>
|
</ColorSlider.IsVisible>
|
||||||
</ColorSlider>
|
</ColorSlider>
|
||||||
@@ -429,11 +412,11 @@
|
|||||||
</TabItem>
|
</TabItem>
|
||||||
</TabControl>
|
</TabControl>
|
||||||
<!-- Previewer -->
|
<!-- Previewer -->
|
||||||
<!-- Note that top/bottom margins have -5 to remove for drop shadow padding -->
|
<!-- Note that the drop shadow is allowed to extend past the control bounds -->
|
||||||
<ColorPreviewer
|
<ColorPreviewer
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Margin="12,-5,12,7"
|
Margin="12,0,12,12"
|
||||||
HsvColor="{Binding HsvColor, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
|
HsvColor="{TemplateBinding HsvColor, Mode=TwoWay}"
|
||||||
IsAccentColorsVisible="{TemplateBinding IsAccentColorsVisible}"
|
IsAccentColorsVisible="{TemplateBinding IsAccentColorsVisible}"
|
||||||
IsVisible="{TemplateBinding IsColorPreviewVisible}" />
|
IsVisible="{TemplateBinding IsColorPreviewVisible}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -442,9 +425,33 @@
|
|||||||
</DropDownButton>
|
</DropDownButton>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
|
<Style Selector="^[ColorModel=Rgba]">
|
||||||
<Style Selector="^ /template/ DropDownButton">
|
<Style Selector="^ /template/ NumericUpDown#Component1NumericUpDown">
|
||||||
<Setter Property="Padding" Value="0 0 10 0" />
|
<Setter Property="Tag" Value="R" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^ /template/ NumericUpDown#Component2NumericUpDown">
|
||||||
|
<Setter Property="Tag" Value="G" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^ /template/ NumericUpDown#Component3NumericUpDown">
|
||||||
|
<Setter Property="Tag" Value="B" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^ /template/ NumericUpDown#AlphaComponentNumericUpDown">
|
||||||
|
<Setter Property="Tag" Value="A" />
|
||||||
|
</Style>
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^[ColorModel=Hsva]">
|
||||||
|
<Style Selector="^ /template/ NumericUpDown#Component1NumericUpDown">
|
||||||
|
<Setter Property="Tag" Value="H" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^ /template/ NumericUpDown#Component2NumericUpDown">
|
||||||
|
<Setter Property="Tag" Value="S" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^ /template/ NumericUpDown#Component3NumericUpDown">
|
||||||
|
<Setter Property="Tag" Value="V" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^ /template/ NumericUpDown#AlphaComponentNumericUpDown">
|
||||||
|
<Setter Property="Tag" Value="A" />
|
||||||
|
</Style>
|
||||||
</Style>
|
</Style>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|
||||||
@@ -452,38 +459,34 @@
|
|||||||
x:Key="HexColorPicker"
|
x:Key="HexColorPicker"
|
||||||
BasedOn="{StaticResource {x:Type ColorPicker}}"
|
BasedOn="{StaticResource {x:Type ColorPicker}}"
|
||||||
TargetType="ColorPicker">
|
TargetType="ColorPicker">
|
||||||
<Setter Property="MinWidth" Value="200" />
|
<Setter Property="MinWidth" Value="180" />
|
||||||
<Setter Property="Content">
|
<Setter Property="Content" Value="{StaticResource HexColorPickerTemplate}" />
|
||||||
<Template>
|
</ControlTheme>
|
||||||
|
<Template x:Key="HexColorPickerTemplate">
|
||||||
<Grid ColumnDefinitions="Auto, *">
|
<Grid ColumnDefinitions="Auto, *">
|
||||||
<Border
|
<Border
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Width="{Binding $self.Bounds.Height}"
|
Width="{Binding $self.Bounds.Height}"
|
||||||
Margin="1,1,0,1"
|
Margin="1,1,0,1"
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
VerticalAlignment="Stretch"
|
|
||||||
Background="{DynamicResource ColorControlCheckeredBackgroundBrush}"
|
Background="{DynamicResource ColorControlCheckeredBackgroundBrush}"
|
||||||
CornerRadius="{TemplateBinding CornerRadius}" />
|
CornerRadius="{Binding $parent[ColorPicker].CornerRadius}" />
|
||||||
<Border
|
<Border
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Width="{Binding $self.Bounds.Height}"
|
Width="{Binding $self.Bounds.Height}"
|
||||||
Margin="1,1,0,1"
|
Margin="1,1,0,1"
|
||||||
HorizontalAlignment="Stretch"
|
Background="{Binding $parent[ColorPicker].HsvColor,Converter={StaticResource ToBrushConverter}}"
|
||||||
VerticalAlignment="Stretch"
|
CornerRadius="{Binding $parent[ColorPicker].CornerRadius}" />
|
||||||
Background="{TemplateBinding HsvColor,Converter={StaticResource ToBrushConverter}}"
|
|
||||||
CornerRadius="{TemplateBinding CornerRadius}" />
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Margin="8,0,0,0"
|
Margin="8,0,0,0"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
FontWeight="Regular"
|
Foreground="{DynamicResource TextBlockDefaultForeground}">
|
||||||
Foreground="{DynamicResource TextBlockDefaultForeground}"
|
<Run Text="#" />
|
||||||
Text="{Binding $parent[ColorPicker].Color}" />
|
<Run Text="{Binding $parent[ColorPicker].Color, Converter={StaticResource ColorToHexConverter}}" />
|
||||||
|
</TextBlock>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Template>
|
</Template>
|
||||||
</Setter>
|
|
||||||
</ControlTheme>
|
|
||||||
|
|
||||||
<ControlTheme
|
<ControlTheme
|
||||||
x:Key="SimpleColorPicker"
|
x:Key="SimpleColorPicker"
|
||||||
@@ -491,12 +494,13 @@
|
|||||||
TargetType="ColorPicker">
|
TargetType="ColorPicker">
|
||||||
<Setter Property="ColorSpectrumComponents" Value="SaturationValue" />
|
<Setter Property="ColorSpectrumComponents" Value="SaturationValue" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="{x:Type ColorPicker}">
|
<ControlTemplate TargetType="ColorPicker">
|
||||||
<DropDownButton
|
<DropDownButton
|
||||||
Width="{TemplateBinding Width}"
|
Width="{TemplateBinding Width}"
|
||||||
Height="{TemplateBinding Height}"
|
Height="{TemplateBinding Height}"
|
||||||
MinWidth="{TemplateBinding MinWidth}"
|
MinWidth="{TemplateBinding MinWidth}"
|
||||||
MinHeight="{TemplateBinding MinHeight}"
|
MinHeight="{TemplateBinding MinHeight}"
|
||||||
|
Padding="{TemplateBinding Padding}"
|
||||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||||
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
@@ -511,14 +515,16 @@
|
|||||||
</Style>
|
</Style>
|
||||||
</DropDownButton.Styles>
|
</DropDownButton.Styles>
|
||||||
<DropDownButton.Flyout>
|
<DropDownButton.Flyout>
|
||||||
<Flyout FlyoutPresenterClasses="nopadding" Placement="{DynamicResource SimpleColorPickerFlyoutPlacement}">
|
<Flyout
|
||||||
|
FlyoutPresenterClasses="nopadding"
|
||||||
|
Placement="{DynamicResource SimpleColorPickerFlyoutPlacement}">
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
The following is copy-pasted from the ColorView's control template.
|
The following is copy-pasted from the ColorView's control template.
|
||||||
It MUST always be kept in sync with the ColorView (which is master).
|
It MUST always be kept in sync with the ColorView (which is master).
|
||||||
Note the only changes are resources specific to the ColorPicker.
|
Note the only changes are resources specific to the ColorPicker.
|
||||||
-->
|
-->
|
||||||
<Grid Width="280">
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="*" MinHeight="280" />
|
<RowDefinition Height="*" MinHeight="280" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
@@ -534,6 +540,7 @@
|
|||||||
Name="ColorSpectrum"
|
Name="ColorSpectrum"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
|
CornerRadius="8 8 0 0"
|
||||||
Components="{TemplateBinding ColorSpectrumComponents}"
|
Components="{TemplateBinding ColorSpectrumComponents}"
|
||||||
HsvColor="{TemplateBinding HsvColor, Mode=TwoWay}"
|
HsvColor="{TemplateBinding HsvColor, Mode=TwoWay}"
|
||||||
MaxHue="{TemplateBinding MaxHue}"
|
MaxHue="{TemplateBinding MaxHue}"
|
||||||
@@ -584,35 +591,43 @@
|
|||||||
CornerRadius="4" />
|
CornerRadius="4" />
|
||||||
<Panel
|
<Panel
|
||||||
Name="PART_TextBoxPanel"
|
Name="PART_TextBoxPanel"
|
||||||
Width="106"
|
Width="116"
|
||||||
Margin="4 0 0 0"
|
Margin="4 0 0 0"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Center">
|
VerticalAlignment="Center">
|
||||||
<TextBox
|
<TextBox
|
||||||
Name="PART_HexTextBox"
|
Name="PART_HexTextBox"
|
||||||
|
AutomationProperties.Name="Hexadecimal Color"
|
||||||
Classes="Small"
|
Classes="Small"
|
||||||
|
CornerRadius="3 0 0 3"
|
||||||
InnerLeftContent="#"
|
InnerLeftContent="#"
|
||||||
IsVisible="{Binding #ColorModelComboBox.SelectedValue, Converter={StaticResource ToColorModel}, ConverterParameter=Hex}"
|
IsVisible="{Binding #ColorModelComboBox.SelectedValue, Converter={x:Static ObjectConverters.Equal}, ConverterParameter=Hex}"
|
||||||
Text="{TemplateBinding Color, Converter={StaticResource ColorToHexConverter}, Mode=TwoWay}"
|
MaxLength="8">
|
||||||
MaxLength="8" />
|
<TextBox.Resources>
|
||||||
|
<Thickness x:Key="TextBoxInnerLeftContentPadding">0 0 4 0</Thickness>
|
||||||
|
</TextBox.Resources>
|
||||||
|
</TextBox>
|
||||||
<TextBox
|
<TextBox
|
||||||
Name="PART_RgbaTextBox"
|
Name="PART_RgbaTextBox"
|
||||||
Classes="Small"
|
Classes="Small"
|
||||||
IsVisible="{Binding #ColorModelComboBox.SelectedValue, Converter={StaticResource ToColorModel}, ConverterParameter=Rgba}"
|
CornerRadius="3 0 0 3"
|
||||||
Text="{TemplateBinding Color, Converter={StaticResource ColorToTextConverter}, Mode=TwoWay}" />
|
IsVisible="{Binding #ColorModelComboBox.SelectedValue, Converter={x:Static ObjectConverters.Equal}, ConverterParameter={x:Static ColorModel.Rgba}}"
|
||||||
|
Text="{TemplateBinding Color, Converter={semi:ColorToTextConverter}, Mode=TwoWay}" />
|
||||||
<TextBox
|
<TextBox
|
||||||
Name="PART_HsvaTextBox"
|
Name="PART_HsvaTextBox"
|
||||||
Classes="Small"
|
Classes="Small"
|
||||||
IsVisible="{Binding #ColorModelComboBox.SelectedValue, Converter={StaticResource ToColorModel}, ConverterParameter=Hsva}"
|
CornerRadius="3 0 0 3"
|
||||||
Text="{TemplateBinding HsvColor, Converter={StaticResource HsvColorToTextConverter}, Mode=TwoWay}" />
|
IsVisible="{Binding #ColorModelComboBox.SelectedValue, Converter={x:Static ObjectConverters.Equal}, ConverterParameter={x:Static ColorModel.Hsva}}"
|
||||||
|
Text="{TemplateBinding HsvColor, Converter={semi:HsvColorToTextConverter}, Mode=TwoWay}" />
|
||||||
</Panel>
|
</Panel>
|
||||||
|
|
||||||
<NumericUpDown
|
<NumericUpDown
|
||||||
Name="AlphaComponentNumericUpDown"
|
Name="AlphaComponentNumericUpDown"
|
||||||
Width="70"
|
Width="60"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
AllowSpin="True"
|
AllowSpin="True"
|
||||||
|
CornerRadius="0"
|
||||||
Classes="Small"
|
Classes="Small"
|
||||||
IsEnabled="{TemplateBinding IsAlphaEnabled}"
|
IsEnabled="{TemplateBinding IsAlphaEnabled}"
|
||||||
Maximum="{Binding #ColorSpectrumAlphaSlider.Maximum}"
|
Maximum="{Binding #ColorSpectrumAlphaSlider.Maximum}"
|
||||||
@@ -621,14 +636,21 @@
|
|||||||
ShowButtonSpinner="False"
|
ShowButtonSpinner="False"
|
||||||
InnerRightContent="%"
|
InnerRightContent="%"
|
||||||
IsVisible="{TemplateBinding IsAlphaVisible}"
|
IsVisible="{TemplateBinding IsAlphaVisible}"
|
||||||
Value="{Binding #ColorSpectrumAlphaSlider.Value}" />
|
Value="{Binding #ColorSpectrumAlphaSlider.Value,Converter={StaticResource DoNothingForNullConverter}}">
|
||||||
|
<NumericUpDown.Resources>
|
||||||
|
<Thickness x:Key="TextBoxContentPadding">12 0 4 0</Thickness>
|
||||||
|
<Thickness x:Key="TextBoxInnerRightContentPadding">4 0 0 0</Thickness>
|
||||||
|
</NumericUpDown.Resources>
|
||||||
|
</NumericUpDown>
|
||||||
<ComboBox
|
<ComboBox
|
||||||
Name="ColorModelComboBox"
|
Name="ColorModelComboBox"
|
||||||
Width="80"
|
Width="80"
|
||||||
|
CornerRadius="0 3 3 0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Classes="Small"
|
Classes="Small"
|
||||||
SelectedValue="Hex">
|
SelectedValue="Hex">
|
||||||
Hex<ColorModel>Rgba</ColorModel>
|
<x:String>Hex</x:String>
|
||||||
|
<ColorModel>Rgba</ColorModel>
|
||||||
<ColorModel>Hsva</ColorModel>
|
<ColorModel>Hsva</ColorModel>
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
@@ -647,37 +669,8 @@
|
|||||||
x:Key="HexSimpleColorPicker"
|
x:Key="HexSimpleColorPicker"
|
||||||
BasedOn="{StaticResource SimpleColorPicker}"
|
BasedOn="{StaticResource SimpleColorPicker}"
|
||||||
TargetType="ColorPicker">
|
TargetType="ColorPicker">
|
||||||
<Setter Property="MinWidth" Value="200" />
|
<Setter Property="MinWidth" Value="180" />
|
||||||
<Setter Property="Content">
|
<Setter Property="Content" Value="{StaticResource HexColorPickerTemplate}" />
|
||||||
<Template>
|
|
||||||
<Grid ColumnDefinitions="Auto, *">
|
|
||||||
<Border
|
|
||||||
Grid.Column="0"
|
|
||||||
Width="{Binding $self.Bounds.Height}"
|
|
||||||
Margin="1,1,0,1"
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
VerticalAlignment="Stretch"
|
|
||||||
Background="{DynamicResource ColorControlCheckeredBackgroundBrush}"
|
|
||||||
CornerRadius="{TemplateBinding CornerRadius}" />
|
|
||||||
<Border
|
|
||||||
Grid.Column="0"
|
|
||||||
Width="{Binding $self.Bounds.Height}"
|
|
||||||
Margin="1,1,0,1"
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
VerticalAlignment="Stretch"
|
|
||||||
Background="{TemplateBinding HsvColor,Converter={StaticResource ToBrushConverter}}"
|
|
||||||
CornerRadius="{TemplateBinding CornerRadius}" />
|
|
||||||
<TextBlock
|
|
||||||
Grid.Column="1"
|
|
||||||
Margin="8,0,0,0"
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
FontWeight="Regular"
|
|
||||||
Foreground="{DynamicResource TextBlockDefaultForeground}"
|
|
||||||
Text="{Binding $parent[ColorPicker].Color}" />
|
|
||||||
</Grid>
|
|
||||||
</Template>
|
|
||||||
</Setter>
|
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -1,15 +1,13 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
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:iri="https://irihi.tech/shared"
|
xmlns:iri="https://irihi.tech/shared">
|
||||||
xmlns:pc="using:Avalonia.Controls.Primitives.Converters">
|
|
||||||
<pc:AccentColorConverter x:Key="AccentColorConverter" />
|
|
||||||
|
|
||||||
<ControlTheme x:Key="{x:Type ColorPreviewer}" TargetType="ColorPreviewer">
|
<ControlTheme x:Key="{x:Type ColorPreviewer}" TargetType="ColorPreviewer">
|
||||||
<Setter Property="Height" Value="{DynamicResource ColorPreviewerHeight}" />
|
<Setter Property="Height" Value="{DynamicResource ColorPreviewerHeight}" />
|
||||||
<Setter Property="CornerRadius" Value="{DynamicResource ColorPreviewerCornerRadius}" />
|
<Setter Property="CornerRadius" Value="{DynamicResource ColorPreviewerCornerRadius}" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="{x:Type ColorPreviewer}">
|
<ControlTemplate TargetType="ColorPreviewer">
|
||||||
<Panel>
|
<Panel>
|
||||||
<!-- Preview color with accents to the left and right -->
|
<!-- Preview color with accents to the left and right -->
|
||||||
<Grid ColumnDefinitions="Auto,*,Auto" IsVisible="{TemplateBinding IsAccentColorsVisible}">
|
<Grid ColumnDefinitions="Auto,*,Auto" IsVisible="{TemplateBinding IsAccentColorsVisible}">
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
xmlns:converters="using:Avalonia.Controls.Converters">
|
|
||||||
<converters:CornerRadiusToDoubleConverter x:Key="TopLeftCornerRadiusConverter" Corner="TopLeft" />
|
|
||||||
<converters:CornerRadiusToDoubleConverter x:Key="BottomRightCornerRadiusConverter" Corner="BottomRight" />
|
|
||||||
|
|
||||||
<ControlTheme x:Key="ColorSliderThumbTheme" TargetType="Thumb">
|
<ControlTheme x:Key="ColorSliderThumbTheme" TargetType="Thumb">
|
||||||
<Setter Property="Background" Value="Transparent" />
|
<Setter Property="Background" Value="Transparent" />
|
||||||
@@ -12,7 +9,7 @@
|
|||||||
<Setter Property="BorderThickness" Value="{DynamicResource ColorSliderThumbBorderBrush}" />
|
<Setter Property="BorderThickness" Value="{DynamicResource ColorSliderThumbBorderBrush}" />
|
||||||
<Setter Property="CornerRadius" Value="{DynamicResource ColorSliderThumbCornerRadius}" />
|
<Setter Property="CornerRadius" Value="{DynamicResource ColorSliderThumbCornerRadius}" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate>
|
<ControlTemplate TargetType="Thumb">
|
||||||
<Border
|
<Border
|
||||||
Margin="1"
|
Margin="1"
|
||||||
Background="{TemplateBinding Background}"
|
Background="{TemplateBinding Background}"
|
||||||
@@ -30,33 +27,30 @@
|
|||||||
<Setter Property="CornerRadius" Value="{DynamicResource ColorSliderCornerRadius}" />
|
<Setter Property="CornerRadius" Value="{DynamicResource ColorSliderCornerRadius}" />
|
||||||
<Setter Property="Height" Value="{DynamicResource ColorSliderWidth}" />
|
<Setter Property="Height" Value="{DynamicResource ColorSliderWidth}" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="{x:Type ColorSlider}">
|
<ControlTemplate TargetType="ColorSlider">
|
||||||
<Border
|
<Border
|
||||||
BorderBrush="{TemplateBinding BorderBrush}"
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
BorderThickness="{TemplateBinding BorderThickness}"
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
CornerRadius="{TemplateBinding CornerRadius}">
|
CornerRadius="{TemplateBinding CornerRadius}">
|
||||||
<Grid Margin="{TemplateBinding Padding}">
|
<Grid Margin="{TemplateBinding Padding}">
|
||||||
<Rectangle
|
<Border
|
||||||
Width="{Binding #PART_Track.Bounds.Width}"
|
|
||||||
Height="{Binding #PART_Track.Bounds.Height}"
|
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Center"
|
||||||
Fill="{DynamicResource ColorControlCheckeredBackgroundBrush}"
|
|
||||||
RadiusX="{TemplateBinding CornerRadius,Converter={StaticResource TopLeftCornerRadiusConverter}}"
|
|
||||||
RadiusY="{TemplateBinding CornerRadius,Converter={StaticResource BottomRightCornerRadiusConverter}}" />
|
|
||||||
<Rectangle
|
|
||||||
Width="{Binding #PART_Track.Bounds.Width}"
|
|
||||||
Height="{Binding #PART_Track.Bounds.Height}"
|
Height="{Binding #PART_Track.Bounds.Height}"
|
||||||
|
Background="{StaticResource ColorControlCheckeredBackgroundBrush}"
|
||||||
|
CornerRadius="{DynamicResource ColorSliderCornerRadius}" />
|
||||||
|
<Border
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Center"
|
||||||
Fill="{TemplateBinding Background}"
|
Height="{Binding #PART_Track.Bounds.Height}"
|
||||||
RadiusX="{TemplateBinding CornerRadius,Converter={StaticResource TopLeftCornerRadiusConverter}}"
|
Background="{TemplateBinding Background}"
|
||||||
RadiusY="{TemplateBinding CornerRadius,Converter={StaticResource BottomRightCornerRadiusConverter}}" />
|
CornerRadius="{DynamicResource ColorSliderCornerRadius}" />
|
||||||
|
|
||||||
<Track
|
<Track
|
||||||
Name="PART_Track"
|
Name="PART_Track"
|
||||||
Height="12"
|
Height="12"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Center"
|
||||||
IsDirectionReversed="{TemplateBinding IsDirectionReversed}"
|
IsDirectionReversed="{TemplateBinding IsDirectionReversed}"
|
||||||
Maximum="{TemplateBinding Maximum}"
|
Maximum="{TemplateBinding Maximum}"
|
||||||
Minimum="{TemplateBinding Minimum}"
|
Minimum="{TemplateBinding Minimum}"
|
||||||
@@ -101,7 +95,7 @@
|
|||||||
Width="{TemplateBinding Height}"
|
Width="{TemplateBinding Height}"
|
||||||
Height="{TemplateBinding Height}"
|
Height="{TemplateBinding Height}"
|
||||||
DataContext="{TemplateBinding Value}"
|
DataContext="{TemplateBinding Value}"
|
||||||
Theme="{StaticResource ColorSliderThumbTheme}" />
|
Theme="{DynamicResource ColorSliderThumbTheme}" />
|
||||||
</Track>
|
</Track>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
@@ -114,32 +108,28 @@
|
|||||||
<Setter Property="CornerRadius" Value="{DynamicResource ColorSliderCornerRadius}" />
|
<Setter Property="CornerRadius" Value="{DynamicResource ColorSliderCornerRadius}" />
|
||||||
<Setter Property="Width" Value="{DynamicResource ColorSliderWidth}" />
|
<Setter Property="Width" Value="{DynamicResource ColorSliderWidth}" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="{x:Type ColorSlider}">
|
<ControlTemplate TargetType="ColorSlider">
|
||||||
<Border
|
<Border
|
||||||
BorderBrush="{TemplateBinding BorderBrush}"
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
BorderThickness="{TemplateBinding BorderThickness}"
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
CornerRadius="{TemplateBinding CornerRadius}">
|
CornerRadius="{TemplateBinding CornerRadius}">
|
||||||
<Grid Margin="{TemplateBinding Padding}">
|
<Grid Margin="{TemplateBinding Padding}">
|
||||||
<Rectangle
|
<Border
|
||||||
Width="{Binding #PART_Track.Bounds.Width}"
|
HorizontalAlignment="Center"
|
||||||
Height="{Binding #PART_Track.Bounds.Height}"
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
Fill="{DynamicResource ColorControlCheckeredBackgroundBrush}"
|
|
||||||
RadiusX="{TemplateBinding CornerRadius,Converter={StaticResource TopLeftCornerRadiusConverter}}"
|
|
||||||
RadiusY="{TemplateBinding CornerRadius,Converter={StaticResource BottomRightCornerRadiusConverter}}" />
|
|
||||||
<Rectangle
|
|
||||||
Width="{Binding #PART_Track.Bounds.Width}"
|
Width="{Binding #PART_Track.Bounds.Width}"
|
||||||
Height="{Binding #PART_Track.Bounds.Height}"
|
Background="{StaticResource ColorControlCheckeredBackgroundBrush}"
|
||||||
HorizontalAlignment="Stretch"
|
CornerRadius="{DynamicResource ColorSliderCornerRadius}" />
|
||||||
|
<Border
|
||||||
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
Fill="{TemplateBinding Background}"
|
Width="{Binding #PART_Track.Bounds.Width}"
|
||||||
RadiusX="{TemplateBinding CornerRadius,Converter={StaticResource TopLeftCornerRadiusConverter}}"
|
Background="{TemplateBinding Background}"
|
||||||
RadiusY="{TemplateBinding CornerRadius,Converter={StaticResource BottomRightCornerRadiusConverter}}" />
|
CornerRadius="{DynamicResource ColorSliderCornerRadius}" />
|
||||||
<Track
|
<Track
|
||||||
Name="PART_Track"
|
Name="PART_Track"
|
||||||
Width="12"
|
Width="12"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
IsDirectionReversed="{TemplateBinding IsDirectionReversed}"
|
IsDirectionReversed="{TemplateBinding IsDirectionReversed}"
|
||||||
Maximum="{TemplateBinding Maximum}"
|
Maximum="{TemplateBinding Maximum}"
|
||||||
@@ -185,7 +175,7 @@
|
|||||||
Width="{TemplateBinding Width}"
|
Width="{TemplateBinding Width}"
|
||||||
Height="{TemplateBinding Width}"
|
Height="{TemplateBinding Width}"
|
||||||
DataContext="{TemplateBinding Value}"
|
DataContext="{TemplateBinding Value}"
|
||||||
Theme="{StaticResource ColorSliderThumbTheme}" />
|
Theme="{DynamicResource ColorSliderThumbTheme}" />
|
||||||
</Track>
|
</Track>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
|||||||
@@ -1,15 +1,11 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
xmlns:converters="using:Avalonia.Controls.Converters">
|
|
||||||
<converters:EnumToBoolConverter x:Key="EnumToBoolConverter" />
|
|
||||||
<converters:CornerRadiusToDoubleConverter x:Key="TopLeftCornerRadiusConverter" Corner="TopLeft" />
|
|
||||||
<converters:CornerRadiusToDoubleConverter x:Key="BottomRightCornerRadiusConverter" Corner="BottomRight" />
|
|
||||||
|
|
||||||
<ControlTheme x:Key="{x:Type ColorSpectrum}" TargetType="ColorSpectrum">
|
<ControlTheme x:Key="{x:Type ColorSpectrum}" TargetType="ColorSpectrum">
|
||||||
<Setter Property="CornerRadius" Value="{DynamicResource ColorSpectrumCornerRadius}" />
|
<Setter Property="CornerRadius" Value="{DynamicResource ColorSpectrumCornerRadius}" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="{x:Type ColorSpectrum}">
|
<ControlTemplate TargetType="ColorSpectrum">
|
||||||
<Panel
|
<Panel
|
||||||
Name="PART_LayoutRoot"
|
Name="PART_LayoutRoot"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
@@ -25,27 +21,27 @@
|
|||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
IsHitTestVisible="False"
|
IsHitTestVisible="False"
|
||||||
IsVisible="{TemplateBinding Shape,
|
IsVisible="{TemplateBinding Shape,
|
||||||
Converter={StaticResource EnumToBoolConverter},
|
Converter={x:Static ObjectConverters.Equal},
|
||||||
ConverterParameter={x:Static ColorSpectrumShape.Box}}"
|
ConverterParameter={x:Static ColorSpectrumShape.Box}}"
|
||||||
RadiusX="{TemplateBinding CornerRadius,Converter={StaticResource TopLeftCornerRadiusConverter}}"
|
RadiusX="{Binding CornerRadius.TopLeft,RelativeSource={RelativeSource TemplatedParent}}"
|
||||||
RadiusY="{TemplateBinding CornerRadius,Converter={StaticResource BottomRightCornerRadiusConverter}}" />
|
RadiusY="{Binding CornerRadius.BottomRight,RelativeSource={RelativeSource TemplatedParent}}" />
|
||||||
<Rectangle
|
<Rectangle
|
||||||
Name="PART_SpectrumOverlayRectangle"
|
Name="PART_SpectrumOverlayRectangle"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
IsHitTestVisible="False"
|
IsHitTestVisible="False"
|
||||||
IsVisible="{TemplateBinding Shape,
|
IsVisible="{TemplateBinding Shape,
|
||||||
Converter={StaticResource EnumToBoolConverter},
|
Converter={x:Static ObjectConverters.Equal},
|
||||||
ConverterParameter={x:Static ColorSpectrumShape.Box}}"
|
ConverterParameter={x:Static ColorSpectrumShape.Box}}"
|
||||||
RadiusX="{TemplateBinding CornerRadius,Converter={StaticResource TopLeftCornerRadiusConverter}}"
|
RadiusX="{Binding CornerRadius.TopLeft,RelativeSource={RelativeSource TemplatedParent}}"
|
||||||
RadiusY="{TemplateBinding CornerRadius,Converter={StaticResource BottomRightCornerRadiusConverter}}" />
|
RadiusY="{Binding CornerRadius.BottomRight,RelativeSource={RelativeSource TemplatedParent}}" />
|
||||||
<Ellipse
|
<Ellipse
|
||||||
Name="PART_SpectrumEllipse"
|
Name="PART_SpectrumEllipse"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
IsHitTestVisible="False"
|
IsHitTestVisible="False"
|
||||||
IsVisible="{TemplateBinding Shape,
|
IsVisible="{TemplateBinding Shape,
|
||||||
Converter={StaticResource EnumToBoolConverter},
|
Converter={x:Static ObjectConverters.Equal},
|
||||||
ConverterParameter={x:Static ColorSpectrumShape.Ring}}" />
|
ConverterParameter={x:Static ColorSpectrumShape.Ring}}" />
|
||||||
<Ellipse
|
<Ellipse
|
||||||
Name="PART_SpectrumOverlayEllipse"
|
Name="PART_SpectrumOverlayEllipse"
|
||||||
@@ -53,7 +49,7 @@
|
|||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
IsHitTestVisible="False"
|
IsHitTestVisible="False"
|
||||||
IsVisible="{TemplateBinding Shape,
|
IsVisible="{TemplateBinding Shape,
|
||||||
Converter={StaticResource EnumToBoolConverter},
|
Converter={x:Static ObjectConverters.Equal},
|
||||||
ConverterParameter={x:Static ColorSpectrumShape.Ring}}" />
|
ConverterParameter={x:Static ColorSpectrumShape.Ring}}" />
|
||||||
<Canvas
|
<Canvas
|
||||||
Name="PART_InputTarget"
|
Name="PART_InputTarget"
|
||||||
@@ -89,17 +85,17 @@
|
|||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
IsHitTestVisible="False"
|
IsHitTestVisible="False"
|
||||||
IsVisible="{TemplateBinding Shape,
|
IsVisible="{TemplateBinding Shape,
|
||||||
Converter={StaticResource EnumToBoolConverter},
|
Converter={x:Static ObjectConverters.Equal},
|
||||||
ConverterParameter={x:Static ColorSpectrumShape.Box}}"
|
ConverterParameter={x:Static ColorSpectrumShape.Box}}"
|
||||||
RadiusX="{TemplateBinding CornerRadius,Converter={StaticResource TopLeftCornerRadiusConverter}}"
|
RadiusX="{Binding CornerRadius.TopLeft,RelativeSource={RelativeSource TemplatedParent}}"
|
||||||
RadiusY="{TemplateBinding CornerRadius,Converter={StaticResource BottomRightCornerRadiusConverter}}" />
|
RadiusY="{Binding CornerRadius.BottomRight,RelativeSource={RelativeSource TemplatedParent}}" />
|
||||||
<Ellipse
|
<Ellipse
|
||||||
Name="BorderEllipse"
|
Name="BorderEllipse"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
IsHitTestVisible="False"
|
IsHitTestVisible="False"
|
||||||
IsVisible="{TemplateBinding Shape,
|
IsVisible="{TemplateBinding Shape,
|
||||||
Converter={StaticResource EnumToBoolConverter},
|
Converter={x:Static ObjectConverters.Equal},
|
||||||
ConverterParameter={x:Static ColorSpectrumShape.Ring}}" />
|
ConverterParameter={x:Static ColorSpectrumShape.Ring}}" />
|
||||||
</Panel>
|
</Panel>
|
||||||
</Panel>
|
</Panel>
|
||||||
|
|||||||
@@ -1,28 +1,23 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:converters="using:Avalonia.Controls.Converters"
|
xmlns:semi="https://irihi.tech/semi">
|
||||||
xmlns:globalization="using:System.Globalization"
|
|
||||||
xmlns:pc="using:Avalonia.Controls.Primitives.Converters"
|
|
||||||
xmlns:cvts="clr-namespace:Semi.Avalonia.ColorPicker.Converters">
|
|
||||||
<pc:ContrastBrushConverter x:Key="ContrastBrushConverter" />
|
|
||||||
<converters:ColorToDisplayNameConverter x:Key="ColorToDisplayNameConverter" />
|
|
||||||
<converters:ColorToHexConverter x:Key="ColorToHexConverter" />
|
|
||||||
<converters:DoNothingForNullConverter x:Key="DoNothingForNullConverter" />
|
|
||||||
<converters:EnumToBoolConverter x:Key="EnumToBoolConverter" />
|
|
||||||
<converters:ToBrushConverter x:Key="ToBrushConverter" />
|
|
||||||
<cvts:HsvColorToTextConverter x:Key="HsvColorToTextConverter" />
|
|
||||||
<cvts:ColorToTextConverter x:Key="ColorToTextConverter" />
|
|
||||||
<cvts:ToColorModel x:Key="ToColorModel" />
|
|
||||||
<globalization:NumberFormatInfo x:Key="ColorViewComponentNumberFormat" NumberDecimalDigits="0" />
|
|
||||||
|
|
||||||
<Design.PreviewWith>
|
<Design.PreviewWith>
|
||||||
|
<StackPanel>
|
||||||
<ColorView
|
<ColorView
|
||||||
Theme="{StaticResource SimpleColorView}"
|
SelectedIndex="2"
|
||||||
IsAlphaVisible="True"
|
IsAlphaVisible="True"
|
||||||
IsAlphaEnabled="True"
|
IsAlphaEnabled="True"
|
||||||
ColorModel="Hsva"
|
ColorModel="Hsva"
|
||||||
HsvColor="hsv(120,7%,90%)" />
|
HsvColor="hsv(120,7%,90%)" />
|
||||||
|
<ColorView
|
||||||
|
Theme="{DynamicResource SimpleColorView}"
|
||||||
|
IsAlphaVisible="True"
|
||||||
|
IsAlphaEnabled="True"
|
||||||
|
ColorModel="Hsva"
|
||||||
|
HsvColor="hsv(120,7%,90%)" />
|
||||||
|
</StackPanel>
|
||||||
</Design.PreviewWith>
|
</Design.PreviewWith>
|
||||||
|
|
||||||
<VisualBrush
|
<VisualBrush
|
||||||
@@ -32,16 +27,12 @@
|
|||||||
TileMode="Tile">
|
TileMode="Tile">
|
||||||
<VisualBrush.Visual>
|
<VisualBrush.Visual>
|
||||||
<Image Width="8" Height="8">
|
<Image Width="8" Height="8">
|
||||||
<Image.Source>
|
|
||||||
<DrawingImage>
|
<DrawingImage>
|
||||||
<DrawingImage.Drawing>
|
|
||||||
<DrawingGroup>
|
<DrawingGroup>
|
||||||
<GeometryDrawing Brush="Transparent" Geometry="M0,0 L2,0 2,2, 0,2Z" />
|
<GeometryDrawing Brush="Transparent" Geometry="M0 0H2V2H0Z" />
|
||||||
<GeometryDrawing Brush="#19808080" Geometry="M0,1 L2,1 2,2, 1,2 1,0 0,0Z" />
|
<GeometryDrawing Brush="#19808080" Geometry="M0 1H2V2H1V0H0Z" />
|
||||||
</DrawingGroup>
|
</DrawingGroup>
|
||||||
</DrawingImage.Drawing>
|
|
||||||
</DrawingImage>
|
</DrawingImage>
|
||||||
</Image.Source>
|
|
||||||
</Image>
|
</Image>
|
||||||
</VisualBrush.Visual>
|
</VisualBrush.Visual>
|
||||||
</VisualBrush>
|
</VisualBrush>
|
||||||
@@ -61,11 +52,11 @@
|
|||||||
CornerRadius="{TemplateBinding CornerRadius}">
|
CornerRadius="{TemplateBinding CornerRadius}">
|
||||||
<ScrollViewer
|
<ScrollViewer
|
||||||
Name="PART_ScrollViewer"
|
Name="PART_ScrollViewer"
|
||||||
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}"
|
AllowAutoHide="{TemplateBinding ScrollViewer.AllowAutoHide}"
|
||||||
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
|
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
||||||
IsScrollChainingEnabled="{TemplateBinding (ScrollViewer.IsScrollChainingEnabled)}"
|
IsScrollChainingEnabled="{TemplateBinding ScrollViewer.IsScrollChainingEnabled}"
|
||||||
IsDeferredScrollingEnabled="{TemplateBinding (ScrollViewer.IsDeferredScrollingEnabled)}"
|
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
|
||||||
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}">
|
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
|
||||||
<ItemsPresenter
|
<ItemsPresenter
|
||||||
Name="PART_ItemsPresenter"
|
Name="PART_ItemsPresenter"
|
||||||
Margin="{TemplateBinding Padding}"
|
Margin="{TemplateBinding Padding}"
|
||||||
@@ -82,8 +73,8 @@
|
|||||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||||
<Setter Property="VerticalContentAlignment" Value="Stretch" />
|
<Setter Property="VerticalContentAlignment" Value="Stretch" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="{x:Type ListBoxItem}">
|
<ControlTemplate TargetType="ListBoxItem">
|
||||||
<Grid UseLayoutRounding="False">
|
<Panel UseLayoutRounding="False">
|
||||||
<ContentPresenter
|
<ContentPresenter
|
||||||
Name="PART_ContentPresenter"
|
Name="PART_ContentPresenter"
|
||||||
Padding="{TemplateBinding Padding}"
|
Padding="{TemplateBinding Padding}"
|
||||||
@@ -101,7 +92,7 @@
|
|||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
IsHitTestVisible="False"
|
IsHitTestVisible="False"
|
||||||
StrokeThickness="1" />
|
StrokeThickness="1" />
|
||||||
</Grid>
|
</Panel>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
|
|
||||||
@@ -141,12 +132,14 @@
|
|||||||
Content="{TemplateBinding Content}"
|
Content="{TemplateBinding Content}"
|
||||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||||
CornerRadius="{TemplateBinding CornerRadius}"
|
CornerRadius="{TemplateBinding CornerRadius}"
|
||||||
RecognizesAccessKey="True"
|
|
||||||
TextElement.FontSize="{TemplateBinding FontSize}"
|
TextElement.FontSize="{TemplateBinding FontSize}"
|
||||||
TextElement.FontWeight="{TemplateBinding FontWeight}"
|
TextElement.FontWeight="{TemplateBinding FontWeight}"
|
||||||
UseLayoutRounding="False" />
|
UseLayoutRounding="False" />
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
|
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||||
|
<Setter Property="RecognizesAccessKey" Value="True" />
|
||||||
|
</Style>
|
||||||
<Style Selector="^:checked">
|
<Style Selector="^:checked">
|
||||||
<Setter Property="Background" Value="{DynamicResource ColorViewRadioButtonCheckedBackground}" />
|
<Setter Property="Background" Value="{DynamicResource ColorViewRadioButtonCheckedBackground}" />
|
||||||
<Setter Property="Foreground" Value="{DynamicResource ColorViewRadioButtonCheckedForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource ColorViewRadioButtonCheckedForeground}" />
|
||||||
@@ -168,14 +161,14 @@
|
|||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|
||||||
<ControlTheme x:Key="{x:Type ColorView}" TargetType="ColorView">
|
<ControlTheme x:Key="{x:Type ColorView}" TargetType="ColorView">
|
||||||
|
<!-- Alpha position should match CSS (and default slider order) instead of XAML/WinUI -->
|
||||||
|
<Setter Property="HexInputAlphaPosition" Value="Trailing" />
|
||||||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
|
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
|
||||||
<Setter Property="Width" Value="300" />
|
<Setter Property="Width" Value="300" />
|
||||||
<Setter Property="Height" Value="300" />
|
<Setter Property="Height" Value="300" />
|
||||||
<Setter Property="Palette">
|
<Setter Property="Palette" Value="{DynamicResource SemiColorPalette}" />
|
||||||
<FluentColorPalette />
|
|
||||||
</Setter>
|
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="{x:Type ColorView}">
|
<ControlTemplate TargetType="ColorView">
|
||||||
<Grid RowDefinitions="*,Auto">
|
<Grid RowDefinitions="*,Auto">
|
||||||
<!-- Backgrounds -->
|
<!-- Backgrounds -->
|
||||||
<!-- TODO: Background="{DynamicResource ColorViewTabBackgroundBrush}" -->
|
<!-- TODO: Background="{DynamicResource ColorViewTabBackgroundBrush}" -->
|
||||||
@@ -197,7 +190,7 @@
|
|||||||
Padding="0"
|
Padding="0"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
HorizontalContentAlignment="Stretch"
|
HorizontalContentAlignment="Stretch"
|
||||||
SelectedIndex="{Binding SelectedIndex, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}">
|
SelectedIndex="{TemplateBinding SelectedIndex, Mode=TwoWay}">
|
||||||
<TabControl.Styles>
|
<TabControl.Styles>
|
||||||
<Style Selector="TabItem">
|
<Style Selector="TabItem">
|
||||||
<Setter Property="MinHeight" Value="32" />
|
<Setter Property="MinHeight" Value="32" />
|
||||||
@@ -232,11 +225,11 @@
|
|||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
AutomationProperties.Name="Third Component"
|
AutomationProperties.Name="Third Component"
|
||||||
ColorComponent="{Binding ThirdComponent, ElementName=ColorSpectrum}"
|
ColorComponent="{Binding #ColorSpectrum.ThirdComponent}"
|
||||||
ColorModel="Hsva"
|
ColorModel="Hsva"
|
||||||
HsvColor="{Binding HsvColor, ElementName=ColorSpectrum}"
|
HsvColor="{Binding #ColorSpectrum.HsvColor}"
|
||||||
IsAlphaVisible="True"
|
IsAlphaVisible="False"
|
||||||
IsPerceptive="False"
|
IsPerceptive="True"
|
||||||
IsVisible="{TemplateBinding IsColorSpectrumSliderVisible}"
|
IsVisible="{TemplateBinding IsColorSpectrumSliderVisible}"
|
||||||
Orientation="Vertical" />
|
Orientation="Vertical" />
|
||||||
<ColorSpectrum
|
<ColorSpectrum
|
||||||
@@ -245,7 +238,7 @@
|
|||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
Components="{TemplateBinding ColorSpectrumComponents}"
|
Components="{TemplateBinding ColorSpectrumComponents}"
|
||||||
HsvColor="{Binding HsvColor, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
|
HsvColor="{TemplateBinding HsvColor, Mode=TwoWay}"
|
||||||
MaxHue="{TemplateBinding MaxHue}"
|
MaxHue="{TemplateBinding MaxHue}"
|
||||||
MaxSaturation="{TemplateBinding MaxSaturation}"
|
MaxSaturation="{TemplateBinding MaxSaturation}"
|
||||||
MaxValue="{TemplateBinding MaxValue}"
|
MaxValue="{TemplateBinding MaxValue}"
|
||||||
@@ -262,14 +255,10 @@
|
|||||||
AutomationProperties.Name="Alpha Component"
|
AutomationProperties.Name="Alpha Component"
|
||||||
ColorComponent="Alpha"
|
ColorComponent="Alpha"
|
||||||
ColorModel="Hsva"
|
ColorModel="Hsva"
|
||||||
HsvColor="{Binding HsvColor, ElementName=ColorSpectrum}"
|
HsvColor="{Binding #ColorSpectrum.HsvColor}"
|
||||||
|
IsVisible="{TemplateBinding IsAlphaVisible}"
|
||||||
IsEnabled="{TemplateBinding IsAlphaEnabled}"
|
IsEnabled="{TemplateBinding IsAlphaEnabled}"
|
||||||
Orientation="Vertical">
|
Orientation="Vertical">
|
||||||
<ColorSlider.IsVisible>
|
|
||||||
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
||||||
<Binding Path="IsAlphaVisible" RelativeSource="{RelativeSource TemplatedParent}" />
|
|
||||||
</MultiBinding>
|
|
||||||
</ColorSlider.IsVisible>
|
|
||||||
</ColorSlider>
|
</ColorSlider>
|
||||||
</Grid>
|
</Grid>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
@@ -286,11 +275,11 @@
|
|||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
ItemContainerTheme="{StaticResource ColorViewPaletteListBoxItemTheme}"
|
ItemContainerTheme="{StaticResource ColorViewPaletteListBoxItemTheme}"
|
||||||
ItemsSource="{TemplateBinding PaletteColors}"
|
ItemsSource="{TemplateBinding PaletteColors}"
|
||||||
SelectedItem="{Binding Color, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource DoNothingForNullConverter}, Mode=TwoWay}"
|
SelectedItem="{TemplateBinding Color, Mode=TwoWay, Converter={StaticResource DoNothingForNullConverter}}"
|
||||||
Theme="{StaticResource ColorViewPaletteListBoxTheme}"
|
Theme="{StaticResource ColorViewPaletteListBoxTheme}"
|
||||||
UseLayoutRounding="False">
|
UseLayoutRounding="False">
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate DataType="{x:Type Color}">
|
<DataTemplate DataType="Color">
|
||||||
<Border
|
<Border
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
@@ -322,6 +311,10 @@
|
|||||||
ColumnDefinitions="Auto,*"
|
ColumnDefinitions="Auto,*"
|
||||||
RowDefinitions="Auto,24,*,*,*,*,12"
|
RowDefinitions="Auto,24,*,*,*,*,12"
|
||||||
UseLayoutRounding="False">
|
UseLayoutRounding="False">
|
||||||
|
<Grid.Resources>
|
||||||
|
<Thickness x:Key="TextBoxContentPadding">8 0</Thickness>
|
||||||
|
<Thickness x:Key="TextBoxInnerLeftContentPadding">0 0 8 0</Thickness>
|
||||||
|
</Grid.Resources>
|
||||||
<Grid.Styles>
|
<Grid.Styles>
|
||||||
<Style Selector="NumericUpDown">
|
<Style Selector="NumericUpDown">
|
||||||
<Setter Property="InnerLeftContent">
|
<Setter Property="InnerLeftContent">
|
||||||
@@ -390,11 +383,11 @@
|
|||||||
AllowSpin="True"
|
AllowSpin="True"
|
||||||
Classes="Small"
|
Classes="Small"
|
||||||
IsVisible="{TemplateBinding IsComponentTextInputVisible}"
|
IsVisible="{TemplateBinding IsComponentTextInputVisible}"
|
||||||
Maximum="{Binding Maximum, ElementName=Component1Slider}"
|
Maximum="{Binding #Component1Slider.Maximum}"
|
||||||
Minimum="{Binding Minimum, ElementName=Component1Slider}"
|
Minimum="{Binding #Component1Slider.Minimum}"
|
||||||
NumberFormat="{StaticResource ColorViewComponentNumberFormat}"
|
NumberFormat="{StaticResource ColorViewComponentNumberFormat}"
|
||||||
ShowButtonSpinner="False"
|
ShowButtonSpinner="False"
|
||||||
Value="{Binding Value, ElementName=Component1Slider}" />
|
Value="{Binding #Component1Slider.Value,Converter={StaticResource DoNothingForNullConverter}}" />
|
||||||
<ColorSlider
|
<ColorSlider
|
||||||
Name="Component1Slider"
|
Name="Component1Slider"
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
@@ -403,7 +396,7 @@
|
|||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
ColorComponent="Component1"
|
ColorComponent="Component1"
|
||||||
ColorModel="{TemplateBinding ColorModel,Mode=OneWay}"
|
ColorModel="{TemplateBinding ColorModel,Mode=OneWay}"
|
||||||
HsvColor="{Binding HsvColor, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
|
HsvColor="{TemplateBinding HsvColor, Mode=TwoWay}"
|
||||||
IsRoundingEnabled="True"
|
IsRoundingEnabled="True"
|
||||||
IsSnapToTickEnabled="True"
|
IsSnapToTickEnabled="True"
|
||||||
IsVisible="{TemplateBinding IsComponentSliderVisible}"
|
IsVisible="{TemplateBinding IsComponentSliderVisible}"
|
||||||
@@ -420,11 +413,11 @@
|
|||||||
AllowSpin="True"
|
AllowSpin="True"
|
||||||
Classes="Small"
|
Classes="Small"
|
||||||
IsVisible="{TemplateBinding IsComponentTextInputVisible}"
|
IsVisible="{TemplateBinding IsComponentTextInputVisible}"
|
||||||
Maximum="{Binding Maximum, ElementName=Component2Slider}"
|
Maximum="{Binding #Component2Slider.Maximum}"
|
||||||
Minimum="{Binding Minimum, ElementName=Component2Slider}"
|
Minimum="{Binding #Component2Slider.Minimum}"
|
||||||
NumberFormat="{StaticResource ColorViewComponentNumberFormat}"
|
NumberFormat="{StaticResource ColorViewComponentNumberFormat}"
|
||||||
ShowButtonSpinner="False"
|
ShowButtonSpinner="False"
|
||||||
Value="{Binding Value, ElementName=Component2Slider}" />
|
Value="{Binding #Component2Slider.Value,Converter={StaticResource DoNothingForNullConverter}}" />
|
||||||
<ColorSlider
|
<ColorSlider
|
||||||
Name="Component2Slider"
|
Name="Component2Slider"
|
||||||
Grid.Row="3"
|
Grid.Row="3"
|
||||||
@@ -433,7 +426,7 @@
|
|||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
ColorComponent="Component2"
|
ColorComponent="Component2"
|
||||||
ColorModel="{TemplateBinding ColorModel,Mode=OneWay}"
|
ColorModel="{TemplateBinding ColorModel,Mode=OneWay}"
|
||||||
HsvColor="{Binding HsvColor, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
|
HsvColor="{TemplateBinding HsvColor, Mode=TwoWay}"
|
||||||
IsRoundingEnabled="True"
|
IsRoundingEnabled="True"
|
||||||
IsSnapToTickEnabled="True"
|
IsSnapToTickEnabled="True"
|
||||||
IsVisible="{TemplateBinding IsComponentSliderVisible}"
|
IsVisible="{TemplateBinding IsComponentSliderVisible}"
|
||||||
@@ -450,11 +443,11 @@
|
|||||||
AllowSpin="True"
|
AllowSpin="True"
|
||||||
Classes="Small"
|
Classes="Small"
|
||||||
IsVisible="{TemplateBinding IsComponentTextInputVisible}"
|
IsVisible="{TemplateBinding IsComponentTextInputVisible}"
|
||||||
Maximum="{Binding Maximum, ElementName=Component3Slider}"
|
Maximum="{Binding #Component3Slider.Maximum}"
|
||||||
Minimum="{Binding Minimum, ElementName=Component3Slider}"
|
Minimum="{Binding #Component3Slider.Minimum}"
|
||||||
NumberFormat="{StaticResource ColorViewComponentNumberFormat}"
|
NumberFormat="{StaticResource ColorViewComponentNumberFormat}"
|
||||||
ShowButtonSpinner="False"
|
ShowButtonSpinner="False"
|
||||||
Value="{Binding Value, ElementName=Component3Slider}" />
|
Value="{Binding #Component3Slider.Value,Converter={StaticResource DoNothingForNullConverter}}" />
|
||||||
<ColorSlider
|
<ColorSlider
|
||||||
Name="Component3Slider"
|
Name="Component3Slider"
|
||||||
Grid.Row="4"
|
Grid.Row="4"
|
||||||
@@ -463,7 +456,7 @@
|
|||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
ColorComponent="Component3"
|
ColorComponent="Component3"
|
||||||
ColorModel="{TemplateBinding ColorModel,Mode=OneWay}"
|
ColorModel="{TemplateBinding ColorModel,Mode=OneWay}"
|
||||||
HsvColor="{Binding HsvColor, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
|
HsvColor="{TemplateBinding HsvColor, Mode=TwoWay}"
|
||||||
IsRoundingEnabled="True"
|
IsRoundingEnabled="True"
|
||||||
IsSnapToTickEnabled="True"
|
IsSnapToTickEnabled="True"
|
||||||
IsVisible="{TemplateBinding IsComponentSliderVisible}"
|
IsVisible="{TemplateBinding IsComponentSliderVisible}"
|
||||||
@@ -480,15 +473,15 @@
|
|||||||
AllowSpin="True"
|
AllowSpin="True"
|
||||||
Classes="Small"
|
Classes="Small"
|
||||||
IsEnabled="{TemplateBinding IsAlphaEnabled}"
|
IsEnabled="{TemplateBinding IsAlphaEnabled}"
|
||||||
Maximum="{Binding Maximum, ElementName=AlphaComponentSlider}"
|
Maximum="{Binding #AlphaComponentSlider.Maximum}"
|
||||||
Minimum="{Binding Minimum, ElementName=AlphaComponentSlider}"
|
Minimum="{Binding #AlphaComponentSlider.Minimum}"
|
||||||
NumberFormat="{StaticResource ColorViewComponentNumberFormat}"
|
NumberFormat="{StaticResource ColorViewComponentNumberFormat}"
|
||||||
ShowButtonSpinner="False"
|
ShowButtonSpinner="False"
|
||||||
Value="{Binding Value, ElementName=AlphaComponentSlider}">
|
Value="{Binding #AlphaComponentSlider.Value,Converter={StaticResource DoNothingForNullConverter}}">
|
||||||
<NumericUpDown.IsVisible>
|
<NumericUpDown.IsVisible>
|
||||||
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
||||||
<Binding Path="IsAlphaVisible" RelativeSource="{RelativeSource TemplatedParent}" />
|
<TemplateBinding Property="IsAlphaVisible" />
|
||||||
<Binding Path="IsComponentTextInputVisible" RelativeSource="{RelativeSource TemplatedParent}" />
|
<TemplateBinding Property="IsComponentTextInputVisible" />
|
||||||
</MultiBinding>
|
</MultiBinding>
|
||||||
</NumericUpDown.IsVisible>
|
</NumericUpDown.IsVisible>
|
||||||
</NumericUpDown>
|
</NumericUpDown>
|
||||||
@@ -500,7 +493,7 @@
|
|||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
ColorComponent="Alpha"
|
ColorComponent="Alpha"
|
||||||
ColorModel="{TemplateBinding ColorModel,Mode=OneWay}"
|
ColorModel="{TemplateBinding ColorModel,Mode=OneWay}"
|
||||||
HsvColor="{Binding HsvColor, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
|
HsvColor="{TemplateBinding HsvColor, Mode=TwoWay}"
|
||||||
IsEnabled="{TemplateBinding IsAlphaEnabled}"
|
IsEnabled="{TemplateBinding IsAlphaEnabled}"
|
||||||
IsRoundingEnabled="True"
|
IsRoundingEnabled="True"
|
||||||
IsSnapToTickEnabled="True"
|
IsSnapToTickEnabled="True"
|
||||||
@@ -508,8 +501,8 @@
|
|||||||
TickFrequency="1">
|
TickFrequency="1">
|
||||||
<ColorSlider.IsVisible>
|
<ColorSlider.IsVisible>
|
||||||
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
||||||
<Binding Path="IsAlphaVisible" RelativeSource="{RelativeSource TemplatedParent}" />
|
<TemplateBinding Property="IsAlphaVisible" />
|
||||||
<Binding Path="IsComponentSliderVisible" RelativeSource="{RelativeSource TemplatedParent}" />
|
<TemplateBinding Property="IsComponentSliderVisible" />
|
||||||
</MultiBinding>
|
</MultiBinding>
|
||||||
</ColorSlider.IsVisible>
|
</ColorSlider.IsVisible>
|
||||||
</ColorSlider>
|
</ColorSlider>
|
||||||
@@ -517,11 +510,11 @@
|
|||||||
</TabItem>
|
</TabItem>
|
||||||
</TabControl>
|
</TabControl>
|
||||||
<!-- Previewer -->
|
<!-- Previewer -->
|
||||||
<!-- Note that top/bottom margins have -5 to remove for drop shadow padding -->
|
<!-- Note that the drop shadow is allowed to extend past the control bounds -->
|
||||||
<ColorPreviewer
|
<ColorPreviewer
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Margin="12,-5,12,7"
|
Margin="12,0,12,12"
|
||||||
HsvColor="{Binding HsvColor, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
|
HsvColor="{TemplateBinding HsvColor, Mode=TwoWay}"
|
||||||
IsAccentColorsVisible="{TemplateBinding IsAccentColorsVisible}"
|
IsAccentColorsVisible="{TemplateBinding IsAccentColorsVisible}"
|
||||||
IsVisible="{TemplateBinding IsColorPreviewVisible}" />
|
IsVisible="{TemplateBinding IsColorPreviewVisible}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -558,11 +551,12 @@
|
|||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|
||||||
<ControlTheme x:Key="SimpleColorView" TargetType="ColorView">
|
<ControlTheme x:Key="SimpleColorView" TargetType="ColorView">
|
||||||
|
<Setter Property="HexInputAlphaPosition" Value="Trailing" />
|
||||||
<Setter Property="Width" Value="280" />
|
<Setter Property="Width" Value="280" />
|
||||||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
|
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
|
||||||
<Setter Property="ColorSpectrumComponents" Value="SaturationValue" />
|
<Setter Property="ColorSpectrumComponents" Value="SaturationValue" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="{x:Type ColorView}">
|
<ControlTemplate TargetType="ColorView">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="*" MinHeight="280" />
|
<RowDefinition Height="*" MinHeight="280" />
|
||||||
@@ -579,6 +573,7 @@
|
|||||||
Name="ColorSpectrum"
|
Name="ColorSpectrum"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
|
CornerRadius="8 8 0 0"
|
||||||
Components="{TemplateBinding ColorSpectrumComponents}"
|
Components="{TemplateBinding ColorSpectrumComponents}"
|
||||||
HsvColor="{TemplateBinding HsvColor, Mode=TwoWay}"
|
HsvColor="{TemplateBinding HsvColor, Mode=TwoWay}"
|
||||||
MaxHue="{TemplateBinding MaxHue}"
|
MaxHue="{TemplateBinding MaxHue}"
|
||||||
@@ -602,7 +597,7 @@
|
|||||||
Orientation="Horizontal" />
|
Orientation="Horizontal" />
|
||||||
|
|
||||||
<ColorSlider
|
<ColorSlider
|
||||||
x:Name="ColorSpectrumAlphaSlider"
|
Name="ColorSpectrumAlphaSlider"
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
@@ -629,35 +624,43 @@
|
|||||||
CornerRadius="4" />
|
CornerRadius="4" />
|
||||||
<Panel
|
<Panel
|
||||||
Name="PART_TextBoxPanel"
|
Name="PART_TextBoxPanel"
|
||||||
Width="106"
|
Width="116"
|
||||||
Margin="4 0 0 0"
|
Margin="4 0 0 0"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Center">
|
VerticalAlignment="Center">
|
||||||
<TextBox
|
<TextBox
|
||||||
Name="PART_HexTextBox"
|
Name="PART_HexTextBox"
|
||||||
|
AutomationProperties.Name="Hexadecimal Color"
|
||||||
Classes="Small"
|
Classes="Small"
|
||||||
|
CornerRadius="3 0 0 3"
|
||||||
InnerLeftContent="#"
|
InnerLeftContent="#"
|
||||||
IsVisible="{Binding #ColorModelComboBox.SelectedValue, Converter={StaticResource ToColorModel}, ConverterParameter=Hex}"
|
IsVisible="{Binding #ColorModelComboBox.SelectedValue, Converter={x:Static ObjectConverters.Equal}, ConverterParameter=Hex}"
|
||||||
Text="{TemplateBinding Color, Converter={StaticResource ColorToHexConverter}, Mode=TwoWay}"
|
MaxLength="8">
|
||||||
MaxLength="8" />
|
<TextBox.Resources>
|
||||||
|
<Thickness x:Key="TextBoxInnerLeftContentPadding">0 0 4 0</Thickness>
|
||||||
|
</TextBox.Resources>
|
||||||
|
</TextBox>
|
||||||
<TextBox
|
<TextBox
|
||||||
Name="PART_RgbaTextBox"
|
Name="PART_RgbaTextBox"
|
||||||
Classes="Small"
|
Classes="Small"
|
||||||
IsVisible="{Binding #ColorModelComboBox.SelectedValue, Converter={StaticResource ToColorModel}, ConverterParameter=Rgba}"
|
CornerRadius="3 0 0 3"
|
||||||
Text="{TemplateBinding Color, Converter={StaticResource ColorToTextConverter}, Mode=TwoWay}" />
|
IsVisible="{Binding #ColorModelComboBox.SelectedValue, Converter={x:Static ObjectConverters.Equal}, ConverterParameter={x:Static ColorModel.Rgba}}"
|
||||||
|
Text="{TemplateBinding Color, Converter={semi:ColorToTextConverter}, Mode=TwoWay}" />
|
||||||
<TextBox
|
<TextBox
|
||||||
Name="PART_HsvaTextBox"
|
Name="PART_HsvaTextBox"
|
||||||
Classes="Small"
|
Classes="Small"
|
||||||
IsVisible="{Binding #ColorModelComboBox.SelectedValue, Converter={StaticResource ToColorModel}, ConverterParameter=Hsva}"
|
CornerRadius="3 0 0 3"
|
||||||
Text="{TemplateBinding HsvColor, Converter={StaticResource HsvColorToTextConverter}, Mode=TwoWay}" />
|
IsVisible="{Binding #ColorModelComboBox.SelectedValue, Converter={x:Static ObjectConverters.Equal}, ConverterParameter={x:Static ColorModel.Hsva}}"
|
||||||
|
Text="{TemplateBinding HsvColor, Converter={semi:HsvColorToTextConverter}, Mode=TwoWay}" />
|
||||||
</Panel>
|
</Panel>
|
||||||
|
|
||||||
<NumericUpDown
|
<NumericUpDown
|
||||||
Name="AlphaComponentNumericUpDown"
|
Name="AlphaComponentNumericUpDown"
|
||||||
Width="70"
|
Width="60"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
AllowSpin="True"
|
AllowSpin="True"
|
||||||
|
CornerRadius="0"
|
||||||
Classes="Small"
|
Classes="Small"
|
||||||
IsEnabled="{TemplateBinding IsAlphaEnabled}"
|
IsEnabled="{TemplateBinding IsAlphaEnabled}"
|
||||||
Maximum="{Binding #ColorSpectrumAlphaSlider.Maximum}"
|
Maximum="{Binding #ColorSpectrumAlphaSlider.Maximum}"
|
||||||
@@ -666,14 +669,21 @@
|
|||||||
ShowButtonSpinner="False"
|
ShowButtonSpinner="False"
|
||||||
InnerRightContent="%"
|
InnerRightContent="%"
|
||||||
IsVisible="{TemplateBinding IsAlphaVisible}"
|
IsVisible="{TemplateBinding IsAlphaVisible}"
|
||||||
Value="{Binding #ColorSpectrumAlphaSlider.Value}" />
|
Value="{Binding #ColorSpectrumAlphaSlider.Value,Converter={StaticResource DoNothingForNullConverter}}">
|
||||||
|
<NumericUpDown.Resources>
|
||||||
|
<Thickness x:Key="TextBoxContentPadding">12 0 4 0</Thickness>
|
||||||
|
<Thickness x:Key="TextBoxInnerRightContentPadding">4 0 0 0</Thickness>
|
||||||
|
</NumericUpDown.Resources>
|
||||||
|
</NumericUpDown>
|
||||||
<ComboBox
|
<ComboBox
|
||||||
Name="ColorModelComboBox"
|
Name="ColorModelComboBox"
|
||||||
Width="80"
|
Width="80"
|
||||||
|
CornerRadius="0 3 3 0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Classes="Small"
|
Classes="Small"
|
||||||
SelectedValue="Hex">
|
SelectedValue="Hex">
|
||||||
Hex<ColorModel>Rgba</ColorModel>
|
<x:String>Hex</x:String>
|
||||||
|
<ColorModel>Rgba</ColorModel>
|
||||||
<ColorModel>Hsva</ColorModel>
|
<ColorModel>Hsva</ColorModel>
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|||||||
17
src/Semi.Avalonia.ColorPicker/Controls/Converters.axaml
Normal file
17
src/Semi.Avalonia.ColorPicker/Controls/Converters.axaml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:converters="using:Avalonia.Controls.Converters"
|
||||||
|
xmlns:pc="using:Avalonia.Controls.Primitives.Converters"
|
||||||
|
xmlns:globalization="using:System.Globalization">
|
||||||
|
<pc:ContrastBrushConverter x:Key="ContrastBrushConverter" />
|
||||||
|
<pc:AccentColorConverter x:Key="AccentColorConverter" />
|
||||||
|
|
||||||
|
<converters:ColorToDisplayNameConverter x:Key="ColorToDisplayNameConverter" />
|
||||||
|
<converters:DoNothingForNullConverter x:Key="DoNothingForNullConverter" />
|
||||||
|
<converters:ToBrushConverter x:Key="ToBrushConverter" />
|
||||||
|
<converters:ColorToHexConverter x:Key="ColorToHexConverter" AlphaPosition="Trailing" IsAlphaVisible="True" />
|
||||||
|
|
||||||
|
<converters:EnumToBoolConverter x:Key="EnumToBoolConverter" />
|
||||||
|
|
||||||
|
<globalization:NumberFormatInfo x:Key="ColorViewComponentNumberFormat" NumberDecimalDigits="0" />
|
||||||
|
</ResourceDictionary>
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
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="Converters.axaml" />
|
||||||
<ResourceInclude Source="ColorPicker.axaml" />
|
<ResourceInclude Source="ColorPicker.axaml" />
|
||||||
<ResourceInclude Source="ColorPreviewer.axaml" />
|
<ResourceInclude Source="ColorPreviewer.axaml" />
|
||||||
<ResourceInclude Source="ColorSlider.axaml" />
|
<ResourceInclude Source="ColorSlider.axaml" />
|
||||||
|
|||||||
@@ -3,19 +3,19 @@ using System.Globalization;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Data;
|
using Avalonia.Data;
|
||||||
using Avalonia.Data.Converters;
|
|
||||||
using Avalonia.Media;
|
using Avalonia.Media;
|
||||||
|
using Irihi.Avalonia.Shared.Converters;
|
||||||
|
|
||||||
namespace Semi.Avalonia.ColorPicker.Converters;
|
namespace Semi.Avalonia.ColorPicker.Converters;
|
||||||
|
|
||||||
public class ColorToTextConverter : IValueConverter
|
public class ColorToTextConverter : MarkupValueConverter
|
||||||
{
|
{
|
||||||
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
public override object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
return value is Color color ? $"{color.R},{color.G},{color.B},{color.A}" : AvaloniaProperty.UnsetValue;
|
return value is Color color ? $"{color.R},{color.G},{color.B},{color.A}" : AvaloniaProperty.UnsetValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
public override object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
if (value is not string str) return BindingOperations.DoNothing;
|
if (value is not string str) return BindingOperations.DoNothing;
|
||||||
var parts = str.Split(',');
|
var parts = str.Split(',');
|
||||||
|
|||||||
@@ -3,21 +3,21 @@ using System.Globalization;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Data;
|
using Avalonia.Data;
|
||||||
using Avalonia.Data.Converters;
|
|
||||||
using Avalonia.Media;
|
using Avalonia.Media;
|
||||||
|
using Irihi.Avalonia.Shared.Converters;
|
||||||
|
|
||||||
namespace Semi.Avalonia.ColorPicker.Converters;
|
namespace Semi.Avalonia.ColorPicker.Converters;
|
||||||
|
|
||||||
public class HsvColorToTextConverter : IValueConverter
|
public class HsvColorToTextConverter : MarkupValueConverter
|
||||||
{
|
{
|
||||||
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
public override object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
return value is HsvColor hsvColor
|
return value is HsvColor hsvColor
|
||||||
? $"{Math.Round(hsvColor.H)},{Math.Round(hsvColor.S * 100)},{Math.Round(hsvColor.V * 100)},{Math.Round(hsvColor.A * 100)}"
|
? $"{Math.Round(hsvColor.H)},{Math.Round(hsvColor.S * 100)},{Math.Round(hsvColor.V * 100)},{Math.Round(hsvColor.A * 100)}"
|
||||||
: AvaloniaProperty.UnsetValue;
|
: AvaloniaProperty.UnsetValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
public override object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
if (value is not string str) return BindingOperations.DoNothing;
|
if (value is not string str) return BindingOperations.DoNothing;
|
||||||
var parts = str.Split(',');
|
var parts = str.Split(',');
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Globalization;
|
|
||||||
using Avalonia.Controls;
|
|
||||||
using Avalonia.Data.Converters;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.ColorPicker.Converters;
|
|
||||||
|
|
||||||
public class ToColorModel : IValueConverter
|
|
||||||
{
|
|
||||||
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
||||||
{
|
|
||||||
return parameter is "Hex" && value is "Hex" ||
|
|
||||||
parameter is "Rgba" && value is ColorModel.Rgba ||
|
|
||||||
parameter is "Hsva" && value is ColorModel.Hsva;
|
|
||||||
}
|
|
||||||
|
|
||||||
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.ThemeDictionaries>
|
<ResourceDictionary.ThemeDictionaries>
|
||||||
<ResourceInclude x:Key="Default" Source="Light.axaml" />
|
<ResourceInclude x:Key="Default" Source="Light.axaml" />
|
||||||
|
<ResourceInclude x:Key="Light" Source="Light.axaml" />
|
||||||
<ResourceInclude x:Key="Dark" Source="Dark.axaml" />
|
<ResourceInclude x:Key="Dark" Source="Dark.axaml" />
|
||||||
</ResourceDictionary.ThemeDictionaries>
|
</ResourceDictionary.ThemeDictionaries>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
using Avalonia.Metadata;
|
using Avalonia.Metadata;
|
||||||
|
|
||||||
|
[assembly: XmlnsPrefix("https://irihi.tech/semi", "semi")]
|
||||||
[assembly: XmlnsDefinition("https://irihi.tech/semi", "Semi.Avalonia.ColorPicker")]
|
[assembly: XmlnsDefinition("https://irihi.tech/semi", "Semi.Avalonia.ColorPicker")]
|
||||||
|
[assembly: XmlnsDefinition("https://irihi.tech/semi", "Semi.Avalonia.ColorPicker.Converters")]
|
||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
|
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
|
||||||
<Version>12.0.0-preview2</Version>
|
<Version>12.0.0</Version>
|
||||||
<PackageReleaseNotes>Update to Semi.Avalonia.ColorPicker 12.0.0-preview2</PackageReleaseNotes>
|
<PackageReleaseNotes>Update to Semi.Avalonia.ColorPicker 12.0.0</PackageReleaseNotes>
|
||||||
<Title>Semi.Avalonia.ColorPicker</Title>
|
<Title>Semi.Avalonia.ColorPicker</Title>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Media;
|
using Avalonia.Media;
|
||||||
using Avalonia.Utilities;
|
|
||||||
using Irihi.Avalonia.Shared.Helpers;
|
using Irihi.Avalonia.Shared.Helpers;
|
||||||
|
|
||||||
namespace Semi.Avalonia.ColorPicker;
|
namespace Semi.Avalonia.ColorPicker;
|
||||||
|
|
||||||
public class SemiColorDarkPalette: IColorPalette
|
public class SemiColorDarkPalette : IColorPalette
|
||||||
{
|
{
|
||||||
private static readonly Color[,] Colors = new Color[,]
|
private static readonly Color[,] Colors = new[,]
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
//Red
|
//Red
|
||||||
@@ -217,7 +216,21 @@ public class SemiColorDarkPalette: IColorPalette
|
|||||||
Color.FromUInt32(0xFFE6E8EA),
|
Color.FromUInt32(0xFFE6E8EA),
|
||||||
Color.FromUInt32(0xFFF9F9F9),
|
Color.FromUInt32(0xFFF9F9F9),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
//AIPurple
|
||||||
|
Color.FromUInt32(0xFF3A1770),
|
||||||
|
Color.FromUInt32(0xFF532394),
|
||||||
|
Color.FromUInt32(0xFF6F31B8),
|
||||||
|
Color.FromUInt32(0xFF8D41DB),
|
||||||
|
Color.FromUInt32(0xFFA744FF),
|
||||||
|
Color.FromUInt32(0xFFC375FF),
|
||||||
|
Color.FromUInt32(0xFFD598FF),
|
||||||
|
Color.FromUInt32(0xFFE5BAFF),
|
||||||
|
Color.FromUInt32(0xFFF3DDFF),
|
||||||
|
Color.FromUInt32(0xFFFBF3FF),
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
public Color GetColor(int colorIndex, int shadeIndex)
|
public Color GetColor(int colorIndex, int shadeIndex)
|
||||||
{
|
{
|
||||||
return Colors[
|
return Colors[
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Media;
|
using Avalonia.Media;
|
||||||
using Avalonia.Utilities;
|
|
||||||
using Irihi.Avalonia.Shared.Helpers;
|
using Irihi.Avalonia.Shared.Helpers;
|
||||||
|
|
||||||
namespace Semi.Avalonia.ColorPicker;
|
namespace Semi.Avalonia.ColorPicker;
|
||||||
|
|
||||||
public class SemiColorLightPalette: IColorPalette
|
public class SemiColorLightPalette : IColorPalette
|
||||||
{
|
{
|
||||||
private static readonly Color[,] Colors = new Color[,]
|
private static readonly Color[,] Colors = new[,]
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
//Red
|
//Red
|
||||||
@@ -217,7 +216,21 @@ public class SemiColorLightPalette: IColorPalette
|
|||||||
Color.FromUInt32(0xFF2E3238),
|
Color.FromUInt32(0xFF2E3238),
|
||||||
Color.FromUInt32(0xFF1C1F23),
|
Color.FromUInt32(0xFF1C1F23),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
//AIPurple
|
||||||
|
Color.FromUInt32(0xFFF8EDFF),
|
||||||
|
Color.FromUInt32(0xFFF2DAFF),
|
||||||
|
Color.FromUInt32(0xFFE3B5FF),
|
||||||
|
Color.FromUInt32(0xFFD191FF),
|
||||||
|
Color.FromUInt32(0xFFBD6CFF),
|
||||||
|
Color.FromUInt32(0xFFA647FF),
|
||||||
|
Color.FromUInt32(0xFF8636DB),
|
||||||
|
Color.FromUInt32(0xFF6928B8),
|
||||||
|
Color.FromUInt32(0xFF4E1C94),
|
||||||
|
Color.FromUInt32(0xFF361270),
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
public Color GetColor(int colorIndex, int shadeIndex)
|
public Color GetColor(int colorIndex, int shadeIndex)
|
||||||
{
|
{
|
||||||
return Colors[
|
return Colors[
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.ThemeDictionaries>
|
<ResourceDictionary.ThemeDictionaries>
|
||||||
<ResourceInclude x:Key="Default" Source="Light.axaml" />
|
<ResourceInclude x:Key="Default" Source="Light.axaml" />
|
||||||
|
<ResourceInclude x:Key="Light" Source="Light.axaml" />
|
||||||
<ResourceInclude x:Key="Dark" Source="Dark.axaml" />
|
<ResourceInclude x:Key="Dark" Source="Dark.axaml" />
|
||||||
</ResourceDictionary.ThemeDictionaries>
|
</ResourceDictionary.ThemeDictionaries>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.ThemeDictionaries>
|
<ResourceDictionary.ThemeDictionaries>
|
||||||
<ResourceInclude x:Key="Default" Source="Light.axaml" />
|
<ResourceInclude x:Key="Default" Source="Light.axaml" />
|
||||||
|
<ResourceInclude x:Key="Light" Source="Light.axaml" />
|
||||||
<ResourceInclude x:Key="Dark" Source="Dark.axaml" />
|
<ResourceInclude x:Key="Dark" Source="Dark.axaml" />
|
||||||
</ResourceDictionary.ThemeDictionaries>
|
</ResourceDictionary.ThemeDictionaries>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
|
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
|
||||||
<Version>11.3.7.3</Version>
|
<Version>12.0.0</Version>
|
||||||
<PackageReleaseNotes>Update to Semi.Avalonia.DataGrid 11.3.7.3</PackageReleaseNotes>
|
<PackageReleaseNotes>Update to Semi.Avalonia.DataGrid 12.0.0</PackageReleaseNotes>
|
||||||
<Title>Semi.Avalonia.DataGrid</Title>
|
<Title>Semi.Avalonia.DataGrid</Title>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
BorderBrush="{TemplateBinding BorderBrush}"
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
BorderThickness="{TemplateBinding BorderThickness}"
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
Content="{TemplateBinding Content}"
|
Content="{TemplateBinding Content}"
|
||||||
|
CornerRadius="{TemplateBinding CornerRadius}"
|
||||||
ContentTemplate="{TemplateBinding ContentTemplate}" />
|
ContentTemplate="{TemplateBinding ContentTemplate}" />
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
@@ -92,7 +93,7 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
<Style Selector="^[ButtonSpinnerLocation=Left] /template/ Border#ButtonGroup">
|
<Style Selector="^:left /template/ Border#ButtonGroup">
|
||||||
<Setter Property="Grid.Column" Value="0" />
|
<Setter Property="Grid.Column" Value="0" />
|
||||||
<Setter Property="Margin" Value="0 0 4 0" />
|
<Setter Property="Margin" Value="0 0 4 0" />
|
||||||
</Style>
|
</Style>
|
||||||
@@ -100,4 +101,70 @@
|
|||||||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSpinnerRepeatButtonPointeroverBorderBrush}" />
|
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSpinnerRepeatButtonPointeroverBorderBrush}" />
|
||||||
</Style>
|
</Style>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|
||||||
|
<ControlTheme x:Key="SplitButtonSpinner" TargetType="ButtonSpinner">
|
||||||
|
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSpinnerRepeatButtonBorderBrush}" />
|
||||||
|
<Setter Property="BorderThickness" Value="0" />
|
||||||
|
<Setter Property="MinWidth" Value="200" />
|
||||||
|
<Setter Property="Template">
|
||||||
|
<ControlTemplate TargetType="ButtonSpinner">
|
||||||
|
<Grid ColumnDefinitions="Auto, *, Auto">
|
||||||
|
<RepeatButton
|
||||||
|
Name="PART_DecreaseButton"
|
||||||
|
Grid.Column="0"
|
||||||
|
VerticalAlignment="Stretch"
|
||||||
|
Padding="{DynamicResource SplitButtonSpinnerButtonPadding}"
|
||||||
|
BorderBrush="{DynamicResource ButtonSpinnerRepeatButtonBorderBrush}"
|
||||||
|
BorderThickness="{DynamicResource ButtonSpinnerButtonGroupBorderThickness}"
|
||||||
|
CornerRadius="{DynamicResource SplitButtonSpinnerLeftButtonCornerRadius}"
|
||||||
|
IsVisible="{TemplateBinding ShowButtonSpinner}"
|
||||||
|
Theme="{StaticResource ButtonSpinnerRepeatButton}">
|
||||||
|
<PathIcon
|
||||||
|
Theme="{DynamicResource InnerPathIcon}"
|
||||||
|
Classes="Small"
|
||||||
|
Data="{DynamicResource SplitButtonSpinnerDecreaseButtonGlyph}"
|
||||||
|
Foreground="{DynamicResource ButtonSpinnerRepeatButtonForeground}" />
|
||||||
|
</RepeatButton>
|
||||||
|
<Border
|
||||||
|
Grid.Column="1"
|
||||||
|
Margin="2 0"
|
||||||
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
|
CornerRadius="{TemplateBinding CornerRadius}">
|
||||||
|
<ContentPresenter
|
||||||
|
Name="PART_ContentPresenter"
|
||||||
|
Padding="{TemplateBinding Padding}"
|
||||||
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
|
Content="{TemplateBinding Content}"
|
||||||
|
ContentTemplate="{TemplateBinding ContentTemplate}" />
|
||||||
|
</Border>
|
||||||
|
<RepeatButton
|
||||||
|
Name="PART_IncreaseButton"
|
||||||
|
Grid.Column="2"
|
||||||
|
VerticalAlignment="Stretch"
|
||||||
|
Padding="{DynamicResource SplitButtonSpinnerButtonPadding}"
|
||||||
|
BorderBrush="{DynamicResource ButtonSpinnerRepeatButtonBorderBrush}"
|
||||||
|
BorderThickness="{DynamicResource ButtonSpinnerButtonGroupBorderThickness}"
|
||||||
|
CornerRadius="{DynamicResource SplitButtonSpinnerRightButtonCornerRadius}"
|
||||||
|
IsVisible="{TemplateBinding ShowButtonSpinner}"
|
||||||
|
Theme="{StaticResource ButtonSpinnerRepeatButton}">
|
||||||
|
<PathIcon
|
||||||
|
Theme="{DynamicResource InnerPathIcon}"
|
||||||
|
Classes="Small"
|
||||||
|
Data="{DynamicResource SplitButtonSpinnerIncreaseButtonGlyph}"
|
||||||
|
Foreground="{DynamicResource ButtonSpinnerRepeatButtonForeground}" />
|
||||||
|
</RepeatButton>
|
||||||
|
</Grid>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter>
|
||||||
|
<Style Selector="^:left /template/ RepeatButton#PART_DecreaseButton">
|
||||||
|
<Setter Property="Grid.Column" Value="2" />
|
||||||
|
<Setter Property="CornerRadius" Value="{DynamicResource SplitButtonSpinnerRightButtonCornerRadius}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:left /template/ RepeatButton#PART_IncreaseButton">
|
||||||
|
<Setter Property="Grid.Column" Value="0" />
|
||||||
|
<Setter Property="CornerRadius" Value="{DynamicResource SplitButtonSpinnerLeftButtonCornerRadius}" />
|
||||||
|
</Style>
|
||||||
|
</ControlTheme>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -156,7 +156,7 @@
|
|||||||
Theme="{DynamicResource InnerPathIcon}"
|
Theme="{DynamicResource InnerPathIcon}"
|
||||||
Width="{TemplateBinding Width}"
|
Width="{TemplateBinding Width}"
|
||||||
Height="{TemplateBinding Height}"
|
Height="{TemplateBinding Height}"
|
||||||
Data="{DynamicResource CarouselButtonGlyph}"
|
Data="{TemplateBinding Content}"
|
||||||
Foreground="{TemplateBinding Foreground}" />
|
Foreground="{TemplateBinding Foreground}" />
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
@@ -213,6 +213,7 @@
|
|||||||
Theme="{DynamicResource CarouselButton}"
|
Theme="{DynamicResource CarouselButton}"
|
||||||
Margin="{DynamicResource CarouselButtonMargin}"
|
Margin="{DynamicResource CarouselButtonMargin}"
|
||||||
Foreground="{DynamicResource CarouselButtonForeground}"
|
Foreground="{DynamicResource CarouselButtonForeground}"
|
||||||
|
Content="{StaticResource SemiIconChevronLeft}"
|
||||||
IsVisible="{TemplateBinding ItemCount, Converter={x:Static semi:ItemConverter.ItemVisibleConverter}}"
|
IsVisible="{TemplateBinding ItemCount, Converter={x:Static semi:ItemConverter.ItemVisibleConverter}}"
|
||||||
Command="{Binding $parent[Carousel].Previous}" />
|
Command="{Binding $parent[Carousel].Previous}" />
|
||||||
<Button
|
<Button
|
||||||
@@ -222,9 +223,9 @@
|
|||||||
Theme="{DynamicResource CarouselButton}"
|
Theme="{DynamicResource CarouselButton}"
|
||||||
Margin="{DynamicResource CarouselButtonMargin}"
|
Margin="{DynamicResource CarouselButtonMargin}"
|
||||||
Foreground="{DynamicResource CarouselButtonForeground}"
|
Foreground="{DynamicResource CarouselButtonForeground}"
|
||||||
|
Content="{StaticResource SemiIconChevronRight}"
|
||||||
IsVisible="{TemplateBinding ItemCount, Converter={x:Static semi:ItemConverter.ItemVisibleConverter}}"
|
IsVisible="{TemplateBinding ItemCount, Converter={x:Static semi:ItemConverter.ItemVisibleConverter}}"
|
||||||
Command="{Binding $parent[Carousel].Next}"
|
Command="{Binding $parent[Carousel].Next}" />
|
||||||
RenderTransform="rotate(180deg)" />
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
|
|||||||
19
src/Semi.Avalonia/Controls/CarouselPage.axaml
Normal file
19
src/Semi.Avalonia/Controls/CarouselPage.axaml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<ResourceDictionary
|
||||||
|
xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
<ControlTheme x:Key="{x:Type CarouselPage}" TargetType="CarouselPage">
|
||||||
|
<Setter Property="Background" Value="Transparent" />
|
||||||
|
<Setter Property="Template">
|
||||||
|
<ControlTemplate TargetType="CarouselPage">
|
||||||
|
<Carousel
|
||||||
|
Name="PART_Carousel"
|
||||||
|
Background="{TemplateBinding Background}"
|
||||||
|
ItemTemplate="{TemplateBinding PageTemplate}"
|
||||||
|
PageTransition="{TemplateBinding PageTransition}"
|
||||||
|
ItemsPanel="{TemplateBinding ItemsPanel}"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
VerticalAlignment="Stretch" />
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter>
|
||||||
|
</ControlTheme>
|
||||||
|
</ResourceDictionary>
|
||||||
@@ -28,24 +28,24 @@
|
|||||||
DefaultLabelPosition="{Binding #lc.SelectedValue}"
|
DefaultLabelPosition="{Binding #lc.SelectedValue}"
|
||||||
IsDynamicOverflowEnabled="{Binding #idfe.IsChecked}"
|
IsDynamicOverflowEnabled="{Binding #idfe.IsChecked}"
|
||||||
Width="{Binding #ws.Value}">
|
Width="{Binding #ws.Value}">
|
||||||
<AppBarButton Label="New" Icon="{DynamicResource SemiIconPlus}" />
|
<CommandBarButton Label="New" Icon="{DynamicResource SemiIconPlus}" />
|
||||||
<AppBarButton Label="Save" Icon="{DynamicResource SemiIconSave}" />
|
<CommandBarButton Label="Save" Icon="{DynamicResource SemiIconSave}" />
|
||||||
<AppBarSeparator />
|
<CommandBarSeparator />
|
||||||
<AppBarToggleButton Label="Bold" Icon="{DynamicResource SemiIconBold}" />
|
<CommandBarToggleButton Label="Bold" Icon="{DynamicResource SemiIconBold}" />
|
||||||
<AppBarToggleButton Label="Italic" Icon="{DynamicResource SemiIconItalic}" />
|
<CommandBarToggleButton Label="Italic" Icon="{DynamicResource SemiIconItalic}" />
|
||||||
<AppBarToggleButton IsEnabled="False" IsChecked="True" Label="Underline" Icon="{DynamicResource SemiIconUnderline}" />
|
<CommandBarToggleButton IsEnabled="False" IsChecked="True" Label="Underline" Icon="{DynamicResource SemiIconUnderline}" />
|
||||||
<AppBarSeparator />
|
<CommandBarSeparator />
|
||||||
<AppBarButton Label="Share" Icon="{DynamicResource SemiIconShare}" />
|
<CommandBarButton Label="Share" Icon="{DynamicResource SemiIconShare}" />
|
||||||
<AppBarButton Label="Export" Icon="{DynamicResource SemiIconExport}" />
|
<CommandBarButton Label="Export" Icon="{DynamicResource SemiIconExport}" />
|
||||||
<AppBarButton Label="Print" Icon="{DynamicResource SemiIconPrint}" />
|
<CommandBarButton Label="Print" Icon="{DynamicResource SemiIconPrint}" />
|
||||||
<AppBarSeparator />
|
<CommandBarSeparator />
|
||||||
<AppBarButton Label="Delete" Icon="{DynamicResource SemiIconDelete}" />
|
<CommandBarButton Label="Delete" Icon="{DynamicResource SemiIconDelete}" />
|
||||||
</CommandBar>
|
</CommandBar>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
</Design.PreviewWith>
|
</Design.PreviewWith>
|
||||||
|
|
||||||
<ControlTheme x:Key="AppBarButtonBaseTheme" TargetType="Button">
|
<ControlTheme x:Key="CommandBarButtonBaseTheme" TargetType="Button">
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="Button">
|
<ControlTemplate TargetType="Button">
|
||||||
<Border
|
<Border
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
Padding="{TemplateBinding Padding}">
|
Padding="{TemplateBinding Padding}">
|
||||||
<StackPanel
|
<StackPanel
|
||||||
Name="PART_LayoutRoot"
|
Name="PART_LayoutRoot"
|
||||||
Spacing="{DynamicResource AppBarButtonPanelSpacing}"
|
Spacing="{DynamicResource CommandBarButtonPanelSpacing}"
|
||||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
|
||||||
<ContentPresenter
|
<ContentPresenter
|
||||||
@@ -73,50 +73,51 @@
|
|||||||
</ContentPresenter>
|
</ContentPresenter>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Name="PART_Label"
|
Name="PART_Label"
|
||||||
|
MaxLines="1"
|
||||||
Foreground="{TemplateBinding Foreground}"
|
Foreground="{TemplateBinding Foreground}"
|
||||||
FontSize="{DynamicResource AppBarButtonLabelFontSize}"
|
FontSize="{DynamicResource CommandBarButtonLabelFontSize}"
|
||||||
TextTrimming="CharacterEllipsis" />
|
TextTrimming="CharacterEllipsis" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
|
|
||||||
<Setter Property="Background" Value="{DynamicResource AppBarButtonBackground}" />
|
<Setter Property="Background" Value="{DynamicResource CommandBarButtonBackground}" />
|
||||||
<Setter Property="Foreground" Value="{DynamicResource AppBarButtonForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource CommandBarButtonForeground}" />
|
||||||
<Setter Property="BorderBrush" Value="Transparent" />
|
<Setter Property="BorderBrush" Value="Transparent" />
|
||||||
<Setter Property="BorderThickness" Value="0" />
|
<Setter Property="BorderThickness" Value="0" />
|
||||||
<Setter Property="Padding" Value="{DynamicResource AppBarButtonPadding}" />
|
<Setter Property="Padding" Value="{DynamicResource CommandBarButtonPadding}" />
|
||||||
<Setter Property="Width" Value="{DynamicResource AppBarButtonWidth}" />
|
<Setter Property="Width" Value="{DynamicResource CommandBarButtonWidth}" />
|
||||||
<Setter Property="MinHeight" Value="{DynamicResource AppBarButtonMinHeight}" />
|
<Setter Property="MinHeight" Value="{DynamicResource CommandBarButtonMinHeight}" />
|
||||||
|
|
||||||
<Setter Property="CornerRadius" Value="{DynamicResource AppBarButtonCornerRadius}" />
|
<Setter Property="CornerRadius" Value="{DynamicResource CommandBarButtonCornerRadius}" />
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||||
<Setter Property="Cursor" Value="Hand" />
|
<Setter Property="Cursor" Value="Hand" />
|
||||||
|
|
||||||
<Style Selector="^:pointerover /template/ Border#PART_Border">
|
<Style Selector="^:pointerover /template/ Border#PART_Border">
|
||||||
<Setter Property="Background" Value="{DynamicResource AppBarButtonPointeroverBackground}" />
|
<Setter Property="Background" Value="{DynamicResource CommandBarButtonPointeroverBackground}" />
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style Selector="^:pressed /template/ Border#PART_Border">
|
<Style Selector="^:pressed /template/ Border#PART_Border">
|
||||||
<Setter Property="Background" Value="{DynamicResource AppBarButtonPressedBackground}" />
|
<Setter Property="Background" Value="{DynamicResource CommandBarButtonPressedBackground}" />
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style Selector="^:disabled">
|
<Style Selector="^:disabled">
|
||||||
<Style Selector="^ /template/ ContentPresenter#PART_IconPresenter">
|
<Style Selector="^ /template/ ContentPresenter#PART_IconPresenter">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource AppBarButtonDisabledForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource CommandBarButtonDisabledForeground}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^ /template/ TextBlock#PART_Label">
|
<Style Selector="^ /template/ TextBlock#PART_Label">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource AppBarButtonDisabledForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource CommandBarButtonDisabledForeground}" />
|
||||||
</Style>
|
</Style>
|
||||||
</Style>
|
</Style>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|
||||||
<!-- AppBarButton -->
|
<!-- CommandBarButton -->
|
||||||
<ControlTheme
|
<ControlTheme
|
||||||
x:Key="{x:Type AppBarButton}"
|
x:Key="{x:Type CommandBarButton}"
|
||||||
BasedOn="{StaticResource AppBarButtonBaseTheme}"
|
BasedOn="{StaticResource CommandBarButtonBaseTheme}"
|
||||||
TargetType="AppBarButton">
|
TargetType="CommandBarButton">
|
||||||
|
|
||||||
<Style Selector="^ /template/ TextBlock#PART_Label">
|
<Style Selector="^ /template/ TextBlock#PART_Label">
|
||||||
<Setter Property="Text" Value="{TemplateBinding Label}" />
|
<Setter Property="Text" Value="{TemplateBinding Label}" />
|
||||||
@@ -127,7 +128,7 @@
|
|||||||
|
|
||||||
<!-- IsCompact: hide label, use compact width -->
|
<!-- IsCompact: hide label, use compact width -->
|
||||||
<Style Selector="^[IsCompact=True]">
|
<Style Selector="^[IsCompact=True]">
|
||||||
<Setter Property="Width" Value="{DynamicResource AppBarButtonCompactWidth}" />
|
<Setter Property="Width" Value="{DynamicResource CommandBarButtonCompactWidth}" />
|
||||||
<Style Selector="^ /template/ TextBlock#PART_Label">
|
<Style Selector="^ /template/ TextBlock#PART_Label">
|
||||||
<Setter Property="IsVisible" Value="False" />
|
<Setter Property="IsVisible" Value="False" />
|
||||||
</Style>
|
</Style>
|
||||||
@@ -135,7 +136,7 @@
|
|||||||
|
|
||||||
<!-- LabelPosition=Collapsed: hide label, use compact width -->
|
<!-- LabelPosition=Collapsed: hide label, use compact width -->
|
||||||
<Style Selector="^[LabelPosition=Collapsed]">
|
<Style Selector="^[LabelPosition=Collapsed]">
|
||||||
<Setter Property="Width" Value="{DynamicResource AppBarButtonCompactWidth}" />
|
<Setter Property="Width" Value="{DynamicResource CommandBarButtonCompactWidth}" />
|
||||||
<Style Selector="^ /template/ TextBlock#PART_Label">
|
<Style Selector="^ /template/ TextBlock#PART_Label">
|
||||||
<Setter Property="IsVisible" Value="False" />
|
<Setter Property="IsVisible" Value="False" />
|
||||||
</Style>
|
</Style>
|
||||||
@@ -144,7 +145,7 @@
|
|||||||
<!-- LabelPosition=Right: horizontal layout, auto-width -->
|
<!-- LabelPosition=Right: horizontal layout, auto-width -->
|
||||||
<Style Selector="^[LabelPosition=Right]">
|
<Style Selector="^[LabelPosition=Right]">
|
||||||
<Setter Property="Width" Value="{x:Static x:Double.NaN}" />
|
<Setter Property="Width" Value="{x:Static x:Double.NaN}" />
|
||||||
<Setter Property="MinWidth" Value="{DynamicResource AppBarButtonCompactWidth}" />
|
<Setter Property="MinWidth" Value="{DynamicResource CommandBarButtonCompactWidth}" />
|
||||||
<Style Selector="^ /template/ StackPanel#PART_LayoutRoot">
|
<Style Selector="^ /template/ StackPanel#PART_LayoutRoot">
|
||||||
<Setter Property="Orientation" Value="Horizontal" />
|
<Setter Property="Orientation" Value="Horizontal" />
|
||||||
</Style>
|
</Style>
|
||||||
@@ -160,8 +161,8 @@
|
|||||||
<Style Selector="^[IsInOverflow=True]">
|
<Style Selector="^[IsInOverflow=True]">
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||||
<Setter Property="Width" Value="{x:Static x:Double.NaN}" />
|
<Setter Property="Width" Value="{x:Static x:Double.NaN}" />
|
||||||
<Setter Property="MinHeight" Value="{DynamicResource AppBarButtonOverflowMinHeight}" />
|
<Setter Property="MinHeight" Value="{DynamicResource CommandBarButtonOverflowMinHeight}" />
|
||||||
<Setter Property="Padding" Value="{DynamicResource AppBarButtonOverflowPadding}" />
|
<Setter Property="Padding" Value="{DynamicResource CommandBarButtonOverflowPadding}" />
|
||||||
<Style Selector="^ /template/ StackPanel#PART_LayoutRoot">
|
<Style Selector="^ /template/ StackPanel#PART_LayoutRoot">
|
||||||
<Setter Property="Orientation" Value="Horizontal" />
|
<Setter Property="Orientation" Value="Horizontal" />
|
||||||
</Style>
|
</Style>
|
||||||
@@ -174,11 +175,11 @@
|
|||||||
</Style>
|
</Style>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|
||||||
<!-- AppBarToggleButton -->
|
<!-- CommandBarToggleButton -->
|
||||||
<ControlTheme
|
<ControlTheme
|
||||||
x:Key="{x:Type AppBarToggleButton}"
|
x:Key="{x:Type CommandBarToggleButton}"
|
||||||
BasedOn="{StaticResource AppBarButtonBaseTheme}"
|
BasedOn="{StaticResource CommandBarButtonBaseTheme}"
|
||||||
TargetType="AppBarToggleButton">
|
TargetType="CommandBarToggleButton">
|
||||||
|
|
||||||
<Style Selector="^ /template/ TextBlock#PART_Label">
|
<Style Selector="^ /template/ TextBlock#PART_Label">
|
||||||
<Setter Property="Text" Value="{TemplateBinding Label}" />
|
<Setter Property="Text" Value="{TemplateBinding Label}" />
|
||||||
@@ -189,25 +190,25 @@
|
|||||||
|
|
||||||
<Style Selector="^:checked">
|
<Style Selector="^:checked">
|
||||||
<Style Selector="^ /template/ Border#PART_Border">
|
<Style Selector="^ /template/ Border#PART_Border">
|
||||||
<Setter Property="Background" Value="{DynamicResource AppBarToggleButtonCheckedBackground}" />
|
<Setter Property="Background" Value="{DynamicResource CommandBarToggleButtonCheckedBackground}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^ /template/ ContentPresenter#PART_IconPresenter">
|
<Style Selector="^ /template/ ContentPresenter#PART_IconPresenter">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource AppBarToggleButtonCheckedForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource CommandBarToggleButtonCheckedForeground}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^:pointerover /template/ Border#PART_Border">
|
<Style Selector="^:pointerover /template/ Border#PART_Border">
|
||||||
<Setter Property="Background" Value="{DynamicResource AppBarToggleButtonCheckedPointeroverBackground}" />
|
<Setter Property="Background" Value="{DynamicResource CommandBarToggleButtonCheckedPointeroverBackground}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^:pressed /template/ Border#PART_Border">
|
<Style Selector="^:pressed /template/ Border#PART_Border">
|
||||||
<Setter Property="Background" Value="{DynamicResource AppBarToggleButtonCheckedPressedBackground}" />
|
<Setter Property="Background" Value="{DynamicResource CommandBarToggleButtonCheckedPressedBackground}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^:disabled /template/ ContentPresenter#PART_IconPresenter">
|
<Style Selector="^:disabled /template/ ContentPresenter#PART_IconPresenter">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource AppBarToggleButtonCheckedDisabledForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource CommandBarToggleButtonCheckedDisabledForeground}" />
|
||||||
</Style>
|
</Style>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<!-- IsCompact: hide label, use compact width -->
|
<!-- IsCompact: hide label, use compact width -->
|
||||||
<Style Selector="^[IsCompact=True]">
|
<Style Selector="^[IsCompact=True]">
|
||||||
<Setter Property="Width" Value="{DynamicResource AppBarButtonCompactWidth}" />
|
<Setter Property="Width" Value="{DynamicResource CommandBarButtonCompactWidth}" />
|
||||||
<Style Selector="^ /template/ TextBlock#PART_Label">
|
<Style Selector="^ /template/ TextBlock#PART_Label">
|
||||||
<Setter Property="IsVisible" Value="False" />
|
<Setter Property="IsVisible" Value="False" />
|
||||||
</Style>
|
</Style>
|
||||||
@@ -215,7 +216,7 @@
|
|||||||
|
|
||||||
<!-- LabelPosition=Collapsed: hide label, use compact width -->
|
<!-- LabelPosition=Collapsed: hide label, use compact width -->
|
||||||
<Style Selector="^[LabelPosition=Collapsed]">
|
<Style Selector="^[LabelPosition=Collapsed]">
|
||||||
<Setter Property="Width" Value="{DynamicResource AppBarButtonCompactWidth}" />
|
<Setter Property="Width" Value="{DynamicResource CommandBarButtonCompactWidth}" />
|
||||||
<Style Selector="^ /template/ TextBlock#PART_Label">
|
<Style Selector="^ /template/ TextBlock#PART_Label">
|
||||||
<Setter Property="IsVisible" Value="False" />
|
<Setter Property="IsVisible" Value="False" />
|
||||||
</Style>
|
</Style>
|
||||||
@@ -224,7 +225,7 @@
|
|||||||
<!-- LabelPosition=Right: horizontal layout, auto-width -->
|
<!-- LabelPosition=Right: horizontal layout, auto-width -->
|
||||||
<Style Selector="^[LabelPosition=Right]">
|
<Style Selector="^[LabelPosition=Right]">
|
||||||
<Setter Property="Width" Value="{x:Static x:Double.NaN}" />
|
<Setter Property="Width" Value="{x:Static x:Double.NaN}" />
|
||||||
<Setter Property="MinWidth" Value="{DynamicResource AppBarButtonCompactWidth}" />
|
<Setter Property="MinWidth" Value="{DynamicResource CommandBarButtonCompactWidth}" />
|
||||||
<Style Selector="^ /template/ StackPanel#PART_LayoutRoot">
|
<Style Selector="^ /template/ StackPanel#PART_LayoutRoot">
|
||||||
<Setter Property="Orientation" Value="Horizontal" />
|
<Setter Property="Orientation" Value="Horizontal" />
|
||||||
</Style>
|
</Style>
|
||||||
@@ -240,8 +241,8 @@
|
|||||||
<Style Selector="^[IsInOverflow=True]">
|
<Style Selector="^[IsInOverflow=True]">
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||||
<Setter Property="Width" Value="{x:Static x:Double.NaN}" />
|
<Setter Property="Width" Value="{x:Static x:Double.NaN}" />
|
||||||
<Setter Property="MinHeight" Value="{DynamicResource AppBarButtonOverflowMinHeight}" />
|
<Setter Property="MinHeight" Value="{DynamicResource CommandBarButtonOverflowMinHeight}" />
|
||||||
<Setter Property="Padding" Value="{DynamicResource AppBarButtonOverflowPadding}" />
|
<Setter Property="Padding" Value="{DynamicResource CommandBarButtonOverflowPadding}" />
|
||||||
<Style Selector="^ /template/ StackPanel#PART_LayoutRoot">
|
<Style Selector="^ /template/ StackPanel#PART_LayoutRoot">
|
||||||
<Setter Property="Orientation" Value="Horizontal" />
|
<Setter Property="Orientation" Value="Horizontal" />
|
||||||
</Style>
|
</Style>
|
||||||
@@ -254,14 +255,14 @@
|
|||||||
</Style>
|
</Style>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|
||||||
<!-- AppBarSeparator -->
|
<!-- CommandBarSeparator -->
|
||||||
<ControlTheme x:Key="{x:Type AppBarSeparator}" TargetType="AppBarSeparator">
|
<ControlTheme x:Key="{x:Type CommandBarSeparator}" TargetType="CommandBarSeparator">
|
||||||
<Setter Property="Background" Value="{DynamicResource AppBarSeparatorBackground}" />
|
<Setter Property="Background" Value="{DynamicResource CommandBarSeparatorBackground}" />
|
||||||
<Setter Property="Width" Value="{DynamicResource AppBarSeparatorWidth}" />
|
<Setter Property="Width" Value="{DynamicResource CommandBarSeparatorWidth}" />
|
||||||
<Setter Property="MinHeight" Value="{DynamicResource AppBarSeparatorMinHeight}" />
|
<Setter Property="MinHeight" Value="{DynamicResource CommandBarSeparatorMinHeight}" />
|
||||||
<Setter Property="Margin" Value="{DynamicResource AppBarSeparatorMargin}" />
|
<Setter Property="Margin" Value="{DynamicResource CommandBarSeparatorMargin}" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="AppBarSeparator">
|
<ControlTemplate TargetType="CommandBarSeparator">
|
||||||
<Border
|
<Border
|
||||||
Background="{TemplateBinding Background}"
|
Background="{TemplateBinding Background}"
|
||||||
Width="{TemplateBinding Width}"
|
Width="{TemplateBinding Width}"
|
||||||
@@ -273,9 +274,9 @@
|
|||||||
<Style Selector="^[IsInOverflow=True]">
|
<Style Selector="^[IsInOverflow=True]">
|
||||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||||
<Setter Property="Width" Value="{x:Static x:Double.NaN}" />
|
<Setter Property="Width" Value="{x:Static x:Double.NaN}" />
|
||||||
<Setter Property="Height" Value="{DynamicResource AppBarSeparatorOverflowHeight}" />
|
<Setter Property="Height" Value="{DynamicResource CommandBarSeparatorOverflowHeight}" />
|
||||||
<Setter Property="MinHeight" Value="0" />
|
<Setter Property="MinHeight" Value="0" />
|
||||||
<Setter Property="Margin" Value="{DynamicResource AppBarSeparatorOverflowMargin}" />
|
<Setter Property="Margin" Value="{DynamicResource CommandBarSeparatorOverflowMargin}" />
|
||||||
</Style>
|
</Style>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|
||||||
@@ -299,9 +300,9 @@
|
|||||||
MinHeight="{TemplateBinding MinHeight}"
|
MinHeight="{TemplateBinding MinHeight}"
|
||||||
Padding="{TemplateBinding Padding}">
|
Padding="{TemplateBinding Padding}">
|
||||||
<Panel>
|
<Panel>
|
||||||
<DockPanel>
|
<DockPanel KeyboardNavigation.TabNavigation="Cycle">
|
||||||
<!-- Overflow button (docked right) -->
|
<!-- Overflow button (docked right) -->
|
||||||
<AppBarButton
|
<CommandBarButton
|
||||||
Name="PART_OverflowButton"
|
Name="PART_OverflowButton"
|
||||||
DockPanel.Dock="Right"
|
DockPanel.Dock="Right"
|
||||||
Icon="{DynamicResource CommandBarOverflowButtonGlyph}"
|
Icon="{DynamicResource CommandBarOverflowButtonGlyph}"
|
||||||
@@ -351,6 +352,7 @@
|
|||||||
CornerRadius="{DynamicResource CommandBarOverflowCornerRadius}">
|
CornerRadius="{DynamicResource CommandBarOverflowCornerRadius}">
|
||||||
|
|
||||||
<ItemsControl
|
<ItemsControl
|
||||||
|
Name="PART_OverflowPresenter"
|
||||||
ItemsSource="{Binding OverflowItems, RelativeSource={RelativeSource TemplatedParent}}">
|
ItemsSource="{Binding OverflowItems, RelativeSource={RelativeSource TemplatedParent}}">
|
||||||
<ItemsControl.ItemsPanel>
|
<ItemsControl.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
|
|||||||
@@ -16,27 +16,26 @@
|
|||||||
<ControlTheme x:Key="{x:Type ContentPage}" TargetType="ContentPage">
|
<ControlTheme x:Key="{x:Type ContentPage}" TargetType="ContentPage">
|
||||||
<Setter Property="Background" Value="{DynamicResource ContentPageBackground}" />
|
<Setter Property="Background" Value="{DynamicResource ContentPageBackground}" />
|
||||||
<Setter Property="Foreground" Value="{DynamicResource ContentPageForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource ContentPageForeground}" />
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
|
||||||
<Setter Property="VerticalContentAlignment" Value="Stretch" />
|
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="ContentPage">
|
<ControlTemplate TargetType="ContentPage">
|
||||||
<Grid RowDefinitions="Auto,*,Auto" Background="{TemplateBinding Background}">
|
<DockPanel>
|
||||||
<ContentPresenter
|
<ContentPresenter
|
||||||
Name="PART_TopCommandBar"
|
Name="PART_TopCommandBar"
|
||||||
Grid.Row="0"
|
DockPanel.Dock="Top" />
|
||||||
Content="{TemplateBinding TopCommandBar}" />
|
|
||||||
<ContentPresenter
|
|
||||||
Name="PART_ContentPresenter"
|
|
||||||
Grid.Row="1"
|
|
||||||
Content="{TemplateBinding Content}"
|
|
||||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
|
||||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
||||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
|
|
||||||
<ContentPresenter
|
<ContentPresenter
|
||||||
Name="PART_BottomCommandBar"
|
Name="PART_BottomCommandBar"
|
||||||
Grid.Row="2"
|
DockPanel.Dock="Bottom" />
|
||||||
Content="{TemplateBinding BottomCommandBar}" />
|
<ContentPresenter
|
||||||
</Grid>
|
Name="PART_ContentPresenter"
|
||||||
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
|
Background="{TemplateBinding Background}"
|
||||||
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
|
CornerRadius="{TemplateBinding CornerRadius}"
|
||||||
|
Content="{TemplateBinding Content}"
|
||||||
|
ContentTemplate="{TemplateBinding ContentTemplate}" />
|
||||||
|
</DockPanel>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
xmlns="https://github.com/avaloniaui"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
||||||
<Design.PreviewWith>
|
<Design.PreviewWith>
|
||||||
<DrawerPage Width="400" Height="300" />
|
<DrawerPage Width="400" Height="300" />
|
||||||
</Design.PreviewWith>
|
</Design.PreviewWith>
|
||||||
@@ -8,136 +6,247 @@
|
|||||||
<ControlTheme x:Key="{x:Type DrawerPage}" TargetType="DrawerPage">
|
<ControlTheme x:Key="{x:Type DrawerPage}" TargetType="DrawerPage">
|
||||||
<Setter Property="Background" Value="{DynamicResource DrawerPageBackground}" />
|
<Setter Property="Background" Value="{DynamicResource DrawerPageBackground}" />
|
||||||
<Setter Property="Foreground" Value="{DynamicResource DrawerPageForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource DrawerPageForeground}" />
|
||||||
<Setter Property="DrawerBackground" Value="{DynamicResource DrawerPageDrawerBackground}" />
|
|
||||||
<Setter Property="DrawerLength" Value="{DynamicResource DrawerPageDrawerLength}" />
|
|
||||||
<Setter Property="CompactDrawerLength" Value="{DynamicResource DrawerPageCompactDrawerLength}" />
|
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
|
||||||
<Setter Property="VerticalContentAlignment" Value="Stretch" />
|
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="DrawerPage">
|
<ControlTemplate TargetType="DrawerPage">
|
||||||
<Grid RowDefinitions="Auto,*" Background="{TemplateBinding Background}">
|
|
||||||
|
|
||||||
<!-- Top bar with pane toggle button -->
|
|
||||||
<Border
|
|
||||||
Name="PART_TopBar"
|
|
||||||
Grid.Row="0"
|
|
||||||
MinHeight="{DynamicResource DrawerPageTopBarMinHeight}"
|
|
||||||
Padding="{DynamicResource DrawerPageTopBarPadding}"
|
|
||||||
Background="{DynamicResource DrawerPageTopBarBackground}"
|
|
||||||
BorderBrush="{DynamicResource DrawerPageTopBarBorderBrush}"
|
|
||||||
BorderThickness="{DynamicResource DrawerPageTopBarBorderThickness}">
|
|
||||||
<Grid ColumnDefinitions="Auto,Auto,*">
|
|
||||||
<!-- Pane toggle button (hamburger) -->
|
|
||||||
<ToggleButton
|
|
||||||
Name="PART_PaneButton"
|
|
||||||
Grid.Column="0"
|
|
||||||
Width="{DynamicResource DrawerPagePaneButtonSize}"
|
|
||||||
Height="{DynamicResource DrawerPagePaneButtonSize}"
|
|
||||||
Margin="{DynamicResource DrawerPagePaneButtonMargin}"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Background="{DynamicResource DrawerPagePaneButtonBackground}"
|
|
||||||
Foreground="{DynamicResource DrawerPagePaneButtonForeground}"
|
|
||||||
IsChecked="{TemplateBinding IsOpen, Mode=TwoWay}">
|
|
||||||
<PathIcon
|
|
||||||
Width="16"
|
|
||||||
Height="16"
|
|
||||||
Data="{DynamicResource DrawerPageMenuGlyph}"
|
|
||||||
Foreground="{DynamicResource DrawerPagePaneButtonForeground}" />
|
|
||||||
</ToggleButton>
|
|
||||||
|
|
||||||
<!-- Drawer icon (shown in top bar) -->
|
|
||||||
<ContentPresenter
|
|
||||||
Name="PART_PaneIconPresenter"
|
|
||||||
Grid.Column="1"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Content="{TemplateBinding DrawerIcon}" />
|
|
||||||
</Grid>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Main area: SplitView + Backdrop -->
|
|
||||||
<Panel Grid.Row="1">
|
|
||||||
<SplitView
|
<SplitView
|
||||||
Name="PART_SplitView"
|
Name="PART_SplitView"
|
||||||
CompactPaneLength="{TemplateBinding CompactDrawerLength}"
|
CompactPaneLength="{TemplateBinding CompactDrawerLength}"
|
||||||
DisplayMode="{TemplateBinding DisplayMode}"
|
DisplayMode="{TemplateBinding DisplayMode}"
|
||||||
IsPaneOpen="{TemplateBinding IsOpen, Mode=TwoWay}"
|
IsPaneOpen="{Binding IsOpen, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
|
||||||
OpenPaneLength="{TemplateBinding DrawerLength}"
|
OpenPaneLength="{TemplateBinding DrawerLength}"
|
||||||
PaneBackground="{TemplateBinding DrawerBackground}">
|
PaneBackground="{Binding DrawerBackground, RelativeSource={RelativeSource TemplatedParent}}">
|
||||||
<SplitView.Pane>
|
<SplitView.Pane>
|
||||||
<DockPanel>
|
<DockPanel Background="{TemplateBinding DrawerBackground}">
|
||||||
<!-- Drawer header -->
|
<!-- Compact-mode toggle: visible only in CompactOverlay/CompactInline. -->
|
||||||
<ContentPresenter
|
<ToggleButton
|
||||||
Name="PART_DrawerHeader"
|
Name="PART_CompactPaneToggle"
|
||||||
|
Width="{DynamicResource ButtonDefaultHeight}"
|
||||||
|
Height="{DynamicResource ButtonDefaultHeight}"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
AutomationProperties.Name="Toggle navigation drawer"
|
||||||
|
Background="Transparent"
|
||||||
DockPanel.Dock="Top"
|
DockPanel.Dock="Top"
|
||||||
Background="{TemplateBinding DrawerHeaderBackground}"
|
IsChecked="{Binding #PART_SplitView.IsPaneOpen, Mode=TwoWay}"
|
||||||
Content="{TemplateBinding DrawerHeader}" />
|
IsVisible="False"
|
||||||
|
ToolTip.Tip="Toggle navigation drawer">
|
||||||
<!-- Drawer footer -->
|
<Panel>
|
||||||
<ContentPresenter
|
<PathIcon
|
||||||
Name="PART_DrawerFooter"
|
HorizontalAlignment="Center"
|
||||||
DockPanel.Dock="Bottom"
|
VerticalAlignment="Center"
|
||||||
Background="{TemplateBinding DrawerFooterBackground}"
|
Data="{DynamicResource DrawerPageMenuGlyph}"
|
||||||
Content="{TemplateBinding DrawerFooter}" />
|
Foreground="{DynamicResource DrawerPagePaneButtonForeground}"
|
||||||
|
IsVisible="{TemplateBinding DrawerIcon, Converter={x:Static ObjectConverters.IsNull}}"
|
||||||
<!-- Compact pane icon (compact mode) -->
|
Theme="{DynamicResource InnerPathIcon}" />
|
||||||
<ContentPresenter
|
<ContentPresenter
|
||||||
Name="PART_CompactPaneIconPresenter"
|
Name="PART_CompactPaneIconPresenter"
|
||||||
DockPanel.Dock="Top"
|
HorizontalAlignment="Center"
|
||||||
IsVisible="False"
|
VerticalAlignment="Center"
|
||||||
Content="{TemplateBinding DrawerIcon}" />
|
Content="{TemplateBinding DrawerIcon}"
|
||||||
|
ContentTemplate="{TemplateBinding DrawerIconTemplate}"
|
||||||
<!-- Bottom pane icon -->
|
Foreground="{DynamicResource DrawerPagePaneButtonForeground}"
|
||||||
|
IsVisible="{TemplateBinding DrawerIcon, Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||||
|
</Panel>
|
||||||
|
</ToggleButton>
|
||||||
<ContentPresenter
|
<ContentPresenter
|
||||||
Name="PART_BottomPaneIconPresenter"
|
Name="PART_DrawerHeader"
|
||||||
|
Background="{TemplateBinding DrawerHeaderBackground}"
|
||||||
|
Content="{TemplateBinding DrawerHeader}"
|
||||||
|
ContentTemplate="{TemplateBinding DrawerHeaderTemplate}"
|
||||||
|
DockPanel.Dock="Top"
|
||||||
|
IsVisible="{TemplateBinding DrawerHeader,
|
||||||
|
Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||||
|
<ContentPresenter
|
||||||
|
Name="PART_DrawerFooter"
|
||||||
|
Background="{TemplateBinding DrawerFooterBackground}"
|
||||||
|
Content="{TemplateBinding DrawerFooter}"
|
||||||
|
ContentTemplate="{TemplateBinding DrawerFooterTemplate}"
|
||||||
DockPanel.Dock="Bottom"
|
DockPanel.Dock="Bottom"
|
||||||
IsVisible="False" />
|
IsVisible="{TemplateBinding DrawerFooter,
|
||||||
|
Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||||
<!-- Drawer main content -->
|
|
||||||
<ContentPresenter
|
<ContentPresenter
|
||||||
Name="PART_DrawerPresenter"
|
Name="PART_DrawerPresenter"
|
||||||
|
HorizontalContentAlignment="Stretch"
|
||||||
|
VerticalContentAlignment="Stretch"
|
||||||
Content="{TemplateBinding Drawer}"
|
Content="{TemplateBinding Drawer}"
|
||||||
ContentTemplate="{TemplateBinding DrawerTemplate}" />
|
ContentTemplate="{TemplateBinding DrawerTemplate}" />
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
</SplitView.Pane>
|
</SplitView.Pane>
|
||||||
|
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||||
<!-- Main page content -->
|
<DockPanel Name="PART_ContentDock">
|
||||||
|
<Border
|
||||||
|
Name="PART_TopBar"
|
||||||
|
Height="{DynamicResource DrawerPageTopBarMinHeight}"
|
||||||
|
Padding="5"
|
||||||
|
Background="{DynamicResource DrawerPageTopBarBackground}"
|
||||||
|
DockPanel.Dock="Top">
|
||||||
|
<DockPanel HorizontalAlignment="Stretch">
|
||||||
|
<ToggleButton
|
||||||
|
Name="PART_PaneButton"
|
||||||
|
Width="{DynamicResource ButtonDefaultHeight}"
|
||||||
|
Height="{DynamicResource ButtonDefaultHeight}"
|
||||||
|
AutomationProperties.Name="Toggle navigation drawer"
|
||||||
|
Background="Transparent"
|
||||||
|
DockPanel.Dock="Left"
|
||||||
|
IsChecked="{Binding #PART_SplitView.IsPaneOpen, Mode=TwoWay}"
|
||||||
|
ToolTip.Tip="Toggle navigation drawer">
|
||||||
|
<Panel>
|
||||||
|
<PathIcon
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Data="{DynamicResource DrawerPageMenuGlyph}"
|
||||||
|
Foreground="{DynamicResource DrawerPagePaneButtonForeground}"
|
||||||
|
IsVisible="{TemplateBinding DrawerIcon, Converter={x:Static ObjectConverters.IsNull}}"
|
||||||
|
Theme="{DynamicResource InnerPathIcon}" />
|
||||||
|
<ContentPresenter
|
||||||
|
Name="PART_PaneIconPresenter"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Content="{TemplateBinding DrawerIcon}"
|
||||||
|
ContentTemplate="{TemplateBinding DrawerIconTemplate}"
|
||||||
|
Foreground="{DynamicResource DrawerPagePaneButtonForeground}"
|
||||||
|
IsVisible="{TemplateBinding DrawerIcon, Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||||
|
</Panel>
|
||||||
|
</ToggleButton>
|
||||||
|
<ContentControl
|
||||||
|
Name="PART_TitlePresenter"
|
||||||
|
Margin="8,0,0,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
VerticalContentAlignment="Center"
|
||||||
|
Content="{TemplateBinding Header}"
|
||||||
|
FontSize="16"
|
||||||
|
FontWeight="SemiBold"
|
||||||
|
IsVisible="{TemplateBinding Header,
|
||||||
|
Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||||
|
</DockPanel>
|
||||||
|
</Border>
|
||||||
|
<Border
|
||||||
|
Name="PART_BottomBar"
|
||||||
|
Height="{DynamicResource DrawerPageTopBarMinHeight}"
|
||||||
|
Padding="5"
|
||||||
|
Background="{DynamicResource DrawerPageTopBarBackground}"
|
||||||
|
DockPanel.Dock="Bottom"
|
||||||
|
IsVisible="False">
|
||||||
|
<DockPanel HorizontalAlignment="Stretch">
|
||||||
|
<ToggleButton
|
||||||
|
Name="PART_BottomPaneButton"
|
||||||
|
AutomationProperties.Name="Toggle navigation drawer"
|
||||||
|
Background="Transparent"
|
||||||
|
DockPanel.Dock="Left"
|
||||||
|
IsChecked="{Binding #PART_SplitView.IsPaneOpen, Mode=TwoWay}"
|
||||||
|
ToolTip.Tip="Toggle navigation drawer">
|
||||||
|
<Panel>
|
||||||
|
<PathIcon
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Data="{DynamicResource DrawerPaneButtonIcon}"
|
||||||
|
IsVisible="{TemplateBinding DrawerIcon, Converter={x:Static ObjectConverters.IsNull}}"
|
||||||
|
Theme="{DynamicResource InnerPathIcon}" />
|
||||||
|
<ContentPresenter
|
||||||
|
Name="PART_BottomPaneIconPresenter"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Content="{TemplateBinding DrawerIcon}"
|
||||||
|
ContentTemplate="{TemplateBinding DrawerIconTemplate}"
|
||||||
|
IsVisible="{TemplateBinding DrawerIcon, Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||||
|
</Panel>
|
||||||
|
</ToggleButton>
|
||||||
|
<ContentControl
|
||||||
|
Name="PART_BottomTitlePresenter"
|
||||||
|
Margin="8,0,0,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
VerticalContentAlignment="Center"
|
||||||
|
Content="{TemplateBinding Header}"
|
||||||
|
FontSize="16"
|
||||||
|
FontWeight="SemiBold"
|
||||||
|
IsVisible="{TemplateBinding Header,
|
||||||
|
Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||||
|
</DockPanel>
|
||||||
|
</Border>
|
||||||
<ContentPresenter
|
<ContentPresenter
|
||||||
Name="PART_ContentPresenter"
|
Name="PART_ContentPresenter"
|
||||||
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
|
Background="{TemplateBinding Background}"
|
||||||
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
Content="{TemplateBinding Content}"
|
Content="{TemplateBinding Content}"
|
||||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
CornerRadius="{TemplateBinding CornerRadius}" />
|
||||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
|
</DockPanel>
|
||||||
</SplitView>
|
|
||||||
|
|
||||||
<!-- Backdrop overlay (shown in overlay/flyout modes) -->
|
|
||||||
<Border
|
<Border
|
||||||
Name="PART_Backdrop"
|
Name="PART_Backdrop"
|
||||||
Background="{TemplateBinding BackdropBrush}"
|
Background="{TemplateBinding BackdropBrush}"
|
||||||
IsHitTestVisible="False"
|
IsHitTestVisible="False"
|
||||||
IsVisible="False" />
|
IsVisible="False" />
|
||||||
|
|
||||||
<!-- Compact pane toggle -->
|
|
||||||
<ToggleButton
|
|
||||||
Name="PART_CompactPaneToggle"
|
|
||||||
IsVisible="False" />
|
|
||||||
</Panel>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
</SplitView>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
|
|
||||||
<!-- Pseudo-class: right-side drawer -->
|
<Style Selector="^:placement-right /template/ ToggleButton#PART_PaneButton">
|
||||||
<Style Selector="^:placement-right /template/ SplitView#PART_SplitView">
|
<Setter Property="DockPanel.Dock" Value="Right" />
|
||||||
<Setter Property="PanePlacement" Value="Right" />
|
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<!-- Pseudo-class: top drawer -->
|
<!-- Bottom placement: swap top bar for bottom bar -->
|
||||||
<Style Selector="^:placement-top /template/ SplitView#PART_SplitView">
|
<Style Selector="^:placement-bottom /template/ Border#PART_TopBar">
|
||||||
<Setter Property="PanePlacement" Value="Top" />
|
<Setter Property="IsVisible" Value="False" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:placement-bottom /template/ Border#PART_BottomBar">
|
||||||
|
<Setter Property="IsVisible" Value="True" />
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<!-- Pseudo-class: bottom drawer -->
|
<!-- Bottom placement + compact modes: pane compact strip provides toggle, hide bottom bar -->
|
||||||
<Style Selector="^:placement-bottom /template/ SplitView#PART_SplitView">
|
<Style Selector="^:placement-bottom[DisplayMode=CompactOverlay] /template/ Border#PART_BottomBar">
|
||||||
<Setter Property="PanePlacement" Value="Bottom" />
|
<Setter Property="IsVisible" Value="False" />
|
||||||
</Style>
|
</Style>
|
||||||
|
<Style Selector="^:placement-bottom[DisplayMode=CompactInline] /template/ Border#PART_BottomBar">
|
||||||
|
<Setter Property="IsVisible" Value="False" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!-- Horizontal pane (Bottom/Top): compact toggle must dock Left so drawer content can fill the rest -->
|
||||||
|
<Style Selector="^:placement-bottom /template/ ToggleButton#PART_CompactPaneToggle">
|
||||||
|
<Setter Property="DockPanel.Dock" Value="Left" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:placement-top /template/ ToggleButton#PART_CompactPaneToggle">
|
||||||
|
<Setter Property="DockPanel.Dock" Value="Left" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style Selector="^[DrawerBehavior=Locked] /template/ Border#PART_TopBar">
|
||||||
|
<Setter Property="IsVisible" Value="False" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style Selector="^[DrawerBehavior=Disabled] /template/ Border#PART_TopBar">
|
||||||
|
<Setter Property="IsVisible" Value="False" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style Selector="^:detail-is-navpage /template/ Border#PART_TopBar">
|
||||||
|
<Setter Property="IsVisible" Value="False" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style Selector="^[DisplayMode=CompactOverlay] /template/ Border#PART_TopBar">
|
||||||
|
<Setter Property="IsVisible" Value="False" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style Selector="^[DisplayMode=CompactOverlay] /template/ ToggleButton#PART_CompactPaneToggle">
|
||||||
|
<Setter Property="IsVisible" Value="True" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style Selector="^[DisplayMode=CompactInline] /template/ Border#PART_TopBar">
|
||||||
|
<Setter Property="IsVisible" Value="False" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style Selector="^[DisplayMode=CompactInline] /template/ ToggleButton#PART_CompactPaneToggle">
|
||||||
|
<Setter Property="IsVisible" Value="True" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style Selector="^[IsInNavigationPage=True] /template/ Border#PART_TopBar">
|
||||||
|
<Setter Property="IsVisible" Value="False" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!-- NavigationPage already hosts a hamburger toggle — suppress the compact pane toggle. -->
|
||||||
|
<Style Selector="^:detail-is-navpage /template/ ToggleButton#PART_CompactPaneToggle">
|
||||||
|
<Setter Property="IsVisible" Value="False" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
<Panel>
|
<Panel>
|
||||||
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" />
|
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" />
|
||||||
<Border Background="{TemplateBinding Background}">
|
<Border Background="{TemplateBinding Background}">
|
||||||
<VisualLayerManager>
|
<VisualLayerManager Name="PART_VisualLayerManager">
|
||||||
<ContentPresenter
|
<ContentPresenter
|
||||||
Name="PART_ContentPresenter"
|
Name="PART_ContentPresenter"
|
||||||
Margin="{TemplateBinding Padding}"
|
Margin="{TemplateBinding Padding}"
|
||||||
|
|||||||
@@ -116,5 +116,13 @@
|
|||||||
</Border>
|
</Border>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
|
|
||||||
|
<Style Selector="^ /template/ ContentPresenter#PART_HeaderPresenter">
|
||||||
|
<Setter Property="RecognizesAccessKey" Value="True" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||||
|
<Setter Property="RecognizesAccessKey" Value="True" />
|
||||||
|
</Style>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -54,4 +54,17 @@
|
|||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|
||||||
|
<ControlTheme
|
||||||
|
x:Key="HorizontalMenuFlyoutPresenter"
|
||||||
|
TargetType="MenuFlyoutPresenter"
|
||||||
|
BasedOn="{StaticResource {x:Type MenuFlyoutPresenter}}">
|
||||||
|
<Setter Property="Padding" Value="0" />
|
||||||
|
<Setter Property="MinWidth" Value="{DynamicResource HorizontalMenuFlyoutThemeMinWidth}" />
|
||||||
|
<Setter Property="ItemsPanel">
|
||||||
|
<ItemsPanelTemplate>
|
||||||
|
<StackPanel Orientation="Horizontal" />
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</Setter>
|
||||||
|
</ControlTheme>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -6,37 +6,36 @@
|
|||||||
</Design.PreviewWith>
|
</Design.PreviewWith>
|
||||||
|
|
||||||
<ControlTheme x:Key="{x:Type NavigationPage}" TargetType="NavigationPage">
|
<ControlTheme x:Key="{x:Type NavigationPage}" TargetType="NavigationPage">
|
||||||
<Setter Property="Background" Value="{DynamicResource NavigationPageBackground}" />
|
<Setter Property="Background" Value="Transparent" />
|
||||||
<Setter Property="Foreground" Value="{DynamicResource NavigationPageForeground}" />
|
|
||||||
<Setter Property="BarHeight" Value="{DynamicResource NavigationPageBarMinHeight}" />
|
<Setter Property="BarHeight" Value="{DynamicResource NavigationPageBarMinHeight}" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="NavigationPage">
|
<ControlTemplate TargetType="NavigationPage">
|
||||||
<Grid RowDefinitions="Auto,*,Auto" Background="{TemplateBinding Background}">
|
<Panel ClipToBounds="True">
|
||||||
<!-- Top command bar -->
|
<DockPanel>
|
||||||
|
<Border
|
||||||
|
Name="PART_NavBarSpacer"
|
||||||
|
Height="{TemplateBinding EffectiveBarHeight}"
|
||||||
|
IsVisible="False"
|
||||||
|
DockPanel.Dock="Top" />
|
||||||
<ContentPresenter
|
<ContentPresenter
|
||||||
Name="PART_TopCommandBar"
|
Name="PART_BottomCommandBar"
|
||||||
Grid.Row="0" />
|
DockPanel.Dock="Bottom"
|
||||||
|
Background="{TemplateBinding Background}"
|
||||||
<!-- Content host (pages + navigation bar) -->
|
Content="{Binding CurrentPage.(NavigationPage.BottomCommandBar), RelativeSource={RelativeSource TemplatedParent}, FallbackValue={x:Null}}" />
|
||||||
<Panel Name="PART_ContentHost" Grid.Row="1">
|
<Panel
|
||||||
<!-- Previous page (back animation target) -->
|
Name="PART_ContentHost"
|
||||||
|
Background="{TemplateBinding Background}"
|
||||||
|
ClipToBounds="True">
|
||||||
<ContentPresenter Name="PART_PageBackPresenter" />
|
<ContentPresenter Name="PART_PageBackPresenter" />
|
||||||
|
|
||||||
<!-- Current page -->
|
|
||||||
<ContentPresenter Name="PART_PagePresenter" />
|
<ContentPresenter Name="PART_PagePresenter" />
|
||||||
|
</Panel>
|
||||||
|
</DockPanel>
|
||||||
|
|
||||||
<!-- Modal back page -->
|
|
||||||
<ContentPresenter Name="PART_ModalBackPresenter" />
|
|
||||||
|
|
||||||
<!-- Modal page -->
|
|
||||||
<ContentPresenter Name="PART_ModalPresenter" />
|
|
||||||
|
|
||||||
<!-- Navigation bar (overlaid on content by default) -->
|
|
||||||
<Border
|
<Border
|
||||||
Name="PART_NavigationBar"
|
Name="PART_NavigationBar"
|
||||||
MinHeight="{TemplateBinding BarHeight}"
|
|
||||||
Padding="{DynamicResource NavigationPageBarPadding}"
|
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
|
MinHeight="{TemplateBinding EffectiveBarHeight}"
|
||||||
|
Padding="{DynamicResource NavigationPageBarPadding}"
|
||||||
Background="{DynamicResource NavigationPageBarBackground}"
|
Background="{DynamicResource NavigationPageBarBackground}"
|
||||||
BorderBrush="{DynamicResource NavigationPageBarBorderBrush}"
|
BorderBrush="{DynamicResource NavigationPageBarBorderBrush}"
|
||||||
BorderThickness="{DynamicResource NavigationPageBarBorderThickness}">
|
BorderThickness="{DynamicResource NavigationPageBarBorderThickness}">
|
||||||
@@ -44,51 +43,81 @@
|
|||||||
<Button
|
<Button
|
||||||
Name="PART_BackButton"
|
Name="PART_BackButton"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
MinHeight="{DynamicResource NavigationPageBarMinHeight}"
|
Classes="Tertiary"
|
||||||
MinWidth="{DynamicResource NavigationPageBarMinHeight}"
|
Height="{TemplateBinding BarHeight}"
|
||||||
|
Width="{TemplateBinding BarHeight}"
|
||||||
Padding="8"
|
Padding="8"
|
||||||
VerticalAlignment="Center"
|
|
||||||
IsVisible="{TemplateBinding IsBackButtonEffectivelyVisible}"
|
IsVisible="{TemplateBinding IsBackButtonEffectivelyVisible}"
|
||||||
Background="{DynamicResource NavigationPageBackButtonBackground}"
|
|
||||||
Theme="{StaticResource BorderlessButton}">
|
Theme="{StaticResource BorderlessButton}">
|
||||||
<Panel Background="Transparent">
|
<Panel Background="Transparent">
|
||||||
<PathIcon
|
<PathIcon
|
||||||
|
Name="PART_BackButtonDefaultIcon"
|
||||||
Theme="{StaticResource InnerPathIcon}"
|
Theme="{StaticResource InnerPathIcon}"
|
||||||
Classes="Large"
|
Data="{DynamicResource NavigationPageBackButtonGlyph}" />
|
||||||
Data="{DynamicResource NavigationPageBackButtonGlyph}"
|
|
||||||
Foreground="{DynamicResource NavigationPageBackButtonForeground}"
|
|
||||||
IsVisible="{Binding CurrentPage?.(NavigationPage.BackButtonContent), RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNull}, FallbackValue=False}" />
|
|
||||||
<ContentPresenter
|
<ContentPresenter
|
||||||
Content="{Binding CurrentPage?.(NavigationPage.BackButtonContent), RelativeSource={RelativeSource TemplatedParent}, FallbackValue={x:Null}}"
|
Name="PART_BackButtonContentPresenter"
|
||||||
IsVisible="{Binding CurrentPage?.(NavigationPage.BackButtonContent), RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}, FallbackValue=False}"
|
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
HorizontalAlignment="Center" />
|
HorizontalAlignment="Center" />
|
||||||
</Panel>
|
</Panel>
|
||||||
</Button>
|
</Button>
|
||||||
<ContentPresenter
|
<ContentPresenter
|
||||||
|
Name="PART_Header"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
HorizontalAlignment="Center"
|
FontWeight="SemiBold"
|
||||||
VerticalAlignment="Center" />
|
Content="{Binding CurrentPage?.Header, RelativeSource={RelativeSource TemplatedParent}, FallbackValue={x:Null}}"
|
||||||
|
ContentTemplate="{Binding CurrentPage?.HeaderTemplate, RelativeSource={RelativeSource TemplatedParent}, FallbackValue={x:Null}}"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Margin="12,0" />
|
||||||
|
<ContentPresenter
|
||||||
|
Name="PART_TopCommandBar"
|
||||||
|
Grid.Column="2"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Content="{Binding CurrentPage?.(NavigationPage.TopCommandBar), RelativeSource={RelativeSource TemplatedParent}, FallbackValue={x:Null}}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
</Panel>
|
|
||||||
|
|
||||||
<!-- Bottom command bar -->
|
<Border
|
||||||
|
Name="PART_NavBarShadow"
|
||||||
|
ZIndex="1"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
IsVisible="False"
|
||||||
|
Height="4"
|
||||||
|
IsHitTestVisible="False">
|
||||||
|
<Border.Background>
|
||||||
|
<LinearGradientBrush StartPoint="0%,0%" EndPoint="0%,100%">
|
||||||
|
<GradientStop Color="#0C000000" Offset="0" />
|
||||||
|
<GradientStop Color="#00000000" Offset="1" />
|
||||||
|
</LinearGradientBrush>
|
||||||
|
</Border.Background>
|
||||||
|
</Border>
|
||||||
<ContentPresenter
|
<ContentPresenter
|
||||||
Name="PART_BottomCommandBar"
|
Name="PART_ModalBackPresenter"
|
||||||
Grid.Row="2" />
|
ZIndex="99"
|
||||||
</Grid>
|
IsVisible="False"
|
||||||
|
Background="{TemplateBinding Background}" />
|
||||||
|
<ContentPresenter
|
||||||
|
Name="PART_ModalPresenter"
|
||||||
|
ZIndex="100"
|
||||||
|
IsVisible="False"
|
||||||
|
Background="{TemplateBinding Background}" />
|
||||||
|
</Panel>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
|
|
||||||
<!-- Navigation bar is inset (content flows under the bar) -->
|
<Style Selector="^ /template/ Border#PART_NavigationBar">
|
||||||
<Style Selector="^:nav-bar-inset /template/ Border#PART_NavigationBar">
|
<Setter Property="Background" Value="{DynamicResource NavigationBarBackground}" />
|
||||||
<Setter Property="BorderThickness" Value="0" />
|
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<!-- Compact navigation bar -->
|
<Style Selector="^:nav-bar-inset /template/ Border#PART_NavBarSpacer">
|
||||||
<Style Selector="^:nav-bar-compact /template/ Border#PART_NavigationBar">
|
<Setter Property="IsVisible" Value="True" />
|
||||||
<Setter Property="MinHeight" Value="0" />
|
</Style>
|
||||||
|
|
||||||
|
<Style Selector="^:nav-bar-compact /template/ ContentPresenter#PART_TopCommandBar CommandBar">
|
||||||
|
<Setter Property="DefaultLabelPosition" Value="Collapsed" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style Selector="^.Large">
|
||||||
|
<Setter Property="BarHeight" Value="{DynamicResource NavigationPageBarLargeMinHeight}" />
|
||||||
</Style>
|
</Style>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -53,6 +53,15 @@
|
|||||||
<Setter Property="MinHeight" Value="{DynamicResource NumericUpDownSmallHeight}" />
|
<Setter Property="MinHeight" Value="{DynamicResource NumericUpDownSmallHeight}" />
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
<Style Selector="^.Split">
|
||||||
|
<Style Selector="^ /template/ ButtonSpinner#PART_Spinner">
|
||||||
|
<Setter Property="Theme" Value="{DynamicResource SplitButtonSpinner}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^ /template/ TextBox#PART_TextBox">
|
||||||
|
<Setter Property="CornerRadius" Value="0" />
|
||||||
|
</Style>
|
||||||
|
</Style>
|
||||||
|
|
||||||
<Style Selector="^:error">
|
<Style Selector="^:error">
|
||||||
<Style Selector="^ /template/ TextBox#PART_TextBox">
|
<Style Selector="^ /template/ TextBox#PART_TextBox">
|
||||||
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsBackground}" />
|
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsBackground}" />
|
||||||
|
|||||||
130
src/Semi.Avalonia/Controls/PipsPager.axaml
Normal file
130
src/Semi.Avalonia/Controls/PipsPager.axaml
Normal file
@@ -0,0 +1,130 @@
|
|||||||
|
<ResourceDictionary
|
||||||
|
xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
|
||||||
|
<Design.PreviewWith>
|
||||||
|
<StackPanel Margin="20" >
|
||||||
|
<PipsPager NumberOfPages="10" />
|
||||||
|
</StackPanel>
|
||||||
|
</Design.PreviewWith>
|
||||||
|
|
||||||
|
<ControlTheme x:Key="PipsPagerButton" TargetType="Button">
|
||||||
|
<Setter Property="Width" Value="24" />
|
||||||
|
<Setter Property="Height" Value="24" />
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource PipsPagerButtonForeground}" />
|
||||||
|
<Setter Property="Cursor" Value="Hand" />
|
||||||
|
<Setter Property="Template">
|
||||||
|
<ControlTemplate TargetType="Button">
|
||||||
|
<PathIcon
|
||||||
|
Theme="{DynamicResource InnerPathIcon}"
|
||||||
|
Width="{TemplateBinding Width}"
|
||||||
|
Height="{TemplateBinding Height}"
|
||||||
|
Data="{TemplateBinding Content}"
|
||||||
|
Foreground="{TemplateBinding Foreground}" />
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter>
|
||||||
|
<Style Selector="^:pointerover /template/ PathIcon">
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource PipsPagerButtonPointeroverForeground}" />
|
||||||
|
</Style>
|
||||||
|
</ControlTheme>
|
||||||
|
|
||||||
|
<ControlTheme x:Key="PipsPagerIndicatorDotListBoxItem" TargetType="ListBoxItem">
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource PipsPagerIndicatorForeground}" />
|
||||||
|
<Setter Property="Margin" Value="4" />
|
||||||
|
<Setter Property="Cursor" Value="Hand" />
|
||||||
|
<Setter Property="Template">
|
||||||
|
<ControlTemplate TargetType="ListBoxItem">
|
||||||
|
<Ellipse
|
||||||
|
Name="Container"
|
||||||
|
Width="{DynamicResource CarouselIndicatorDotWidth}"
|
||||||
|
Height="{DynamicResource CarouselIndicatorDotHeight}"
|
||||||
|
Fill="{TemplateBinding Foreground}" />
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter>
|
||||||
|
<Style Selector="^:pointerover">
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource PipsPagerIndicatorPointeroverForeground}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:pressed">
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource PipsPagerIndicatorPressedForeground}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:selected">
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource PipsPagerIndicatorSelectedForeground}" />
|
||||||
|
</Style>
|
||||||
|
</ControlTheme>
|
||||||
|
|
||||||
|
<ControlTheme x:Key="{x:Type PipsPager}" TargetType="PipsPager">
|
||||||
|
<Setter Property="IsTabStop" Value="False" />
|
||||||
|
<Setter Property="PreviousButtonTheme" Value="{StaticResource PipsPagerButton}" />
|
||||||
|
<Setter Property="NextButtonTheme" Value="{StaticResource PipsPagerButton}" />
|
||||||
|
<Setter Property="Template">
|
||||||
|
<ControlTemplate>
|
||||||
|
<StackPanel
|
||||||
|
Name="PART_RootPanel"
|
||||||
|
Orientation="{TemplateBinding Orientation}"
|
||||||
|
Background="{TemplateBinding Background}"
|
||||||
|
ClipToBounds="False">
|
||||||
|
<Button
|
||||||
|
Name="PART_PreviousButton"
|
||||||
|
Theme="{TemplateBinding PreviousButtonTheme}"
|
||||||
|
IsVisible="{TemplateBinding IsPreviousButtonVisible}"
|
||||||
|
Foreground="{DynamicResource PipsPagerButtonForeground}"
|
||||||
|
Content="{StaticResource SemiIconSmallTriangleLeft}" />
|
||||||
|
|
||||||
|
<ListBox
|
||||||
|
Name="PART_PipsPagerList"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||||
|
ScrollViewer.VerticalScrollBarVisibility="Hidden"
|
||||||
|
ItemsSource="{Binding TemplateSettings.Pips, RelativeSource={RelativeSource TemplatedParent}}"
|
||||||
|
SelectedIndex="{TemplateBinding SelectedPageIndex, Mode=TwoWay}"
|
||||||
|
AutoScrollToSelectedItem="False"
|
||||||
|
ItemContainerTheme="{StaticResource PipsPagerIndicatorDotListBoxItem}">
|
||||||
|
<ListBox.ItemsPanel>
|
||||||
|
<ItemsPanelTemplate>
|
||||||
|
<StackPanel Orientation="{Binding $parent[PipsPager].Orientation}" />
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</ListBox.ItemsPanel>
|
||||||
|
</ListBox>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
Name="PART_NextButton"
|
||||||
|
Theme="{TemplateBinding NextButtonTheme}"
|
||||||
|
Foreground="{DynamicResource PipsPagerButtonForeground}"
|
||||||
|
Content="{StaticResource SemiIconSmallTriangleRight}"
|
||||||
|
IsVisible="{TemplateBinding IsNextButtonVisible}" />
|
||||||
|
</StackPanel>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter>
|
||||||
|
|
||||||
|
<Style Selector="^:horizontal /template/ StackPanel#PART_RootPanel">
|
||||||
|
<Setter Property="Orientation" Value="Horizontal" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style Selector="^:vertical">
|
||||||
|
|
||||||
|
<Style Selector="^ /template/ StackPanel#PART_RootPanel">
|
||||||
|
<Setter Property="Orientation" Value="Vertical" />
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style Selector="^ /template/ Button#PART_PreviousButton">
|
||||||
|
<Setter Property="Content" Value="{DynamicResource SemiIconSmallTriangleTop}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^ /template/ Button#PART_NextButton">
|
||||||
|
<Setter Property="Content" Value="{DynamicResource SemiIconSmallTriangleDown}" />
|
||||||
|
</Style>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style Selector="^:first-page /template/ Button#PART_PreviousButton">
|
||||||
|
<Setter Property="Opacity" Value="0" />
|
||||||
|
<Setter Property="IsHitTestVisible" Value="False" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style Selector="^:last-page /template/ Button#PART_NextButton">
|
||||||
|
<Setter Property="Opacity" Value="0" />
|
||||||
|
<Setter Property="IsHitTestVisible" Value="False" />
|
||||||
|
</Style>
|
||||||
|
</ControlTheme>
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
<LayoutTransformControl LayoutTransform="{TemplateBinding Transform}">
|
<LayoutTransformControl LayoutTransform="{TemplateBinding Transform}">
|
||||||
<Panel>
|
<Panel>
|
||||||
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" />
|
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" />
|
||||||
<VisualLayerManager IsPopup="True">
|
<VisualLayerManager Name="PART_VisualLayerManager">
|
||||||
<LayoutTransformControl Name="PART_LayoutTransform">
|
<LayoutTransformControl Name="PART_LayoutTransform">
|
||||||
<ContentPresenter
|
<ContentPresenter
|
||||||
Name="PART_ContentPresenter"
|
Name="PART_ContentPresenter"
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate>
|
<ControlTemplate>
|
||||||
<LayoutTransformControl LayoutTransform="{TemplateBinding Transform}">
|
<LayoutTransformControl LayoutTransform="{TemplateBinding Transform}">
|
||||||
<VisualLayerManager IsPopup="True">
|
<VisualLayerManager Name="PART_VisualLayerManager">
|
||||||
<LayoutTransformControl Name="PART_LayoutTransform">
|
<LayoutTransformControl Name="PART_LayoutTransform">
|
||||||
<ContentPresenter
|
<ContentPresenter
|
||||||
Name="PART_ContentPresenter"
|
Name="PART_ContentPresenter"
|
||||||
|
|||||||
@@ -4,87 +4,54 @@
|
|||||||
xmlns:semi="https://irihi.tech/semi"
|
xmlns:semi="https://irihi.tech/semi"
|
||||||
xmlns:converters="using:Avalonia.Controls.Converters">
|
xmlns:converters="using:Avalonia.Controls.Converters">
|
||||||
<Design.PreviewWith>
|
<Design.PreviewWith>
|
||||||
<StackPanel Margin="20" Spacing="20">
|
<StackPanel Width="400" Margin="20">
|
||||||
<ProgressBar
|
<ProgressBar />
|
||||||
Width="200"
|
<ProgressBar Value="20" />
|
||||||
Maximum="100"
|
<ProgressBar Value="50" Classes="Success" />
|
||||||
Minimum="0"
|
<ProgressBar Value="80" Classes="Warning" />
|
||||||
ShowProgressText="True"
|
<ProgressBar Value="100" Classes="Error" />
|
||||||
Value="20" />
|
<ProgressBar ShowProgressText="True" />
|
||||||
<ProgressBar
|
<ProgressBar Value="20" ShowProgressText="True" />
|
||||||
Width="200"
|
<ProgressBar Value="50" Classes="Success" ShowProgressText="True" />
|
||||||
IsIndeterminate="True"
|
<ProgressBar Value="80" Classes="Warning" ShowProgressText="True" />
|
||||||
Maximum="100"
|
<ProgressBar Value="100" Classes="Error" ShowProgressText="True" />
|
||||||
Minimum="0"
|
<ProgressBar Classes="Left" ShowProgressText="True" />
|
||||||
ShowProgressText="True"
|
<ProgressBar Value="20" Classes="Left" ShowProgressText="True" />
|
||||||
Value="20" />
|
<ProgressBar Value="50" Classes="Left Success" ShowProgressText="True" />
|
||||||
<ProgressBar
|
<ProgressBar Value="80" Classes="Left Warning" ShowProgressText="True" />
|
||||||
Width="200"
|
<ProgressBar Value="100" Classes="Left Error" ShowProgressText="True" />
|
||||||
Classes="Left"
|
<ProgressBar Classes="Right" ShowProgressText="True" />
|
||||||
IsIndeterminate="True"
|
<ProgressBar Value="20" Classes="Right" ShowProgressText="True" />
|
||||||
Maximum="100"
|
<ProgressBar Value="50" Classes="Right Success" ShowProgressText="True" />
|
||||||
Minimum="0"
|
<ProgressBar Value="80" Classes="Right Warning" ShowProgressText="True" />
|
||||||
ShowProgressText="True"
|
<ProgressBar Value="100" Classes="Right Error" ShowProgressText="True" />
|
||||||
Value="20" />
|
|
||||||
<ProgressBar
|
<StackPanel Orientation="Horizontal">
|
||||||
Width="200"
|
<StackPanel.Styles>
|
||||||
Classes="Left"
|
<Style Selector="ProgressBar">
|
||||||
Maximum="100"
|
<Setter Property="Orientation" Value="Vertical" />
|
||||||
Minimum="0"
|
</Style>
|
||||||
ShowProgressText="True"
|
</StackPanel.Styles>
|
||||||
Value="20" />
|
<ProgressBar />
|
||||||
<ProgressBar
|
<ProgressBar Value="20" />
|
||||||
Width="200"
|
<ProgressBar Value="50" Classes="Success" />
|
||||||
Classes="Right"
|
<ProgressBar Value="80" Classes="Warning" />
|
||||||
Maximum="100"
|
<ProgressBar Value="100" Classes="Error" />
|
||||||
Minimum="0"
|
<ProgressBar ShowProgressText="True" />
|
||||||
ShowProgressText="True"
|
<ProgressBar Value="20" ShowProgressText="True" />
|
||||||
Value="20" />
|
<ProgressBar Value="50" Classes="Success" ShowProgressText="True" />
|
||||||
<StackPanel
|
<ProgressBar Value="80" Classes="Warning" ShowProgressText="True" />
|
||||||
HorizontalAlignment="Left"
|
<ProgressBar Value="100" Classes="Error" ShowProgressText="True" />
|
||||||
Orientation="Horizontal"
|
<ProgressBar Classes="Top" ShowProgressText="True" />
|
||||||
Spacing="20">
|
<ProgressBar Value="20" Classes="Top" ShowProgressText="True" />
|
||||||
<ProgressBar
|
<ProgressBar Value="50" Classes="Top Success" ShowProgressText="True" />
|
||||||
Classes="Left"
|
<ProgressBar Value="80" Classes="Top Warning" ShowProgressText="True" />
|
||||||
Maximum="100"
|
<ProgressBar Value="100" Classes="Top Error" ShowProgressText="True" />
|
||||||
Minimum="0"
|
<ProgressBar Classes="Bottom" ShowProgressText="True" />
|
||||||
Orientation="Vertical"
|
<ProgressBar Value="20" Classes="Bottom" ShowProgressText="True" />
|
||||||
ShowProgressText="True"
|
<ProgressBar Value="50" Classes="Bottom Success" ShowProgressText="True" />
|
||||||
Value="20" />
|
<ProgressBar Value="80" Classes="Bottom Warning" ShowProgressText="True" />
|
||||||
<ProgressBar
|
<ProgressBar Value="100" Classes="Bottom Error" ShowProgressText="True" />
|
||||||
Classes="Right"
|
|
||||||
Maximum="100"
|
|
||||||
Minimum="0"
|
|
||||||
Orientation="Vertical"
|
|
||||||
ShowProgressText="True"
|
|
||||||
Value="20" />
|
|
||||||
<ProgressBar
|
|
||||||
Maximum="100"
|
|
||||||
Minimum="0"
|
|
||||||
Orientation="Vertical"
|
|
||||||
ShowProgressText="True"
|
|
||||||
Value="20" />
|
|
||||||
<ProgressBar
|
|
||||||
Classes="Left"
|
|
||||||
Maximum="100"
|
|
||||||
Minimum="0"
|
|
||||||
Orientation="Vertical"
|
|
||||||
ShowProgressText="False"
|
|
||||||
Value="20" />
|
|
||||||
<ProgressBar
|
|
||||||
IsIndeterminate="True"
|
|
||||||
Maximum="100"
|
|
||||||
Minimum="0"
|
|
||||||
Orientation="Vertical"
|
|
||||||
ShowProgressText="True"
|
|
||||||
Value="20" />
|
|
||||||
<ProgressBar
|
|
||||||
IsIndeterminate="True"
|
|
||||||
Maximum="100"
|
|
||||||
Minimum="0"
|
|
||||||
Orientation="Vertical"
|
|
||||||
ShowProgressText="False"
|
|
||||||
Value="20" />
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Design.PreviewWith>
|
</Design.PreviewWith>
|
||||||
@@ -115,7 +82,7 @@
|
|||||||
<Panel Name="DeterminateRoot" Opacity="1">
|
<Panel Name="DeterminateRoot" Opacity="1">
|
||||||
<Panel.Transitions>
|
<Panel.Transitions>
|
||||||
<Transitions>
|
<Transitions>
|
||||||
<DoubleTransition Property="Opacity" Duration="0:0:0.197" />
|
<DoubleTransition Property="Opacity" Duration="0:0:0.2" />
|
||||||
</Transitions>
|
</Transitions>
|
||||||
</Panel.Transitions>
|
</Panel.Transitions>
|
||||||
<Border
|
<Border
|
||||||
@@ -127,7 +94,7 @@
|
|||||||
<Panel Name="IndeterminateRoot" Opacity="0">
|
<Panel Name="IndeterminateRoot" Opacity="0">
|
||||||
<Panel.Transitions>
|
<Panel.Transitions>
|
||||||
<Transitions>
|
<Transitions>
|
||||||
<DoubleTransition Property="Opacity" Duration="0:0:0.197" />
|
<DoubleTransition Property="Opacity" Duration="0:0:0.2" />
|
||||||
</Transitions>
|
</Transitions>
|
||||||
</Panel.Transitions>
|
</Panel.Transitions>
|
||||||
<Border
|
<Border
|
||||||
@@ -158,7 +125,7 @@
|
|||||||
<TextBlock.Text>
|
<TextBlock.Text>
|
||||||
<MultiBinding Converter="{StaticResource StringFormatConverter}">
|
<MultiBinding Converter="{StaticResource StringFormatConverter}">
|
||||||
<TemplateBinding Property="ProgressTextFormat" />
|
<TemplateBinding Property="ProgressTextFormat" />
|
||||||
<Binding Path="Value" RelativeSource="{RelativeSource TemplatedParent}" />
|
<TemplateBinding Property="Value" />
|
||||||
<TemplateBinding Property="Percentage" />
|
<TemplateBinding Property="Percentage" />
|
||||||
<TemplateBinding Property="Minimum" />
|
<TemplateBinding Property="Minimum" />
|
||||||
<TemplateBinding Property="Maximum" />
|
<TemplateBinding Property="Maximum" />
|
||||||
@@ -187,38 +154,97 @@
|
|||||||
<Style Selector="^.Danger">
|
<Style Selector="^.Danger">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource ProgressBarDangerForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource ProgressBarDangerForeground}" />
|
||||||
</Style>
|
</Style>
|
||||||
<!-- Error style is obsolete, use Danger instead -->
|
|
||||||
<Style Selector="^.Error">
|
|
||||||
<Setter Property="Foreground" Value="{DynamicResource ProgressBarErrorForeground}" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^:horizontal /template/ Border#PART_Indicator">
|
|
||||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
|
||||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^:vertical /template/ Border#PART_Indicator">
|
|
||||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
|
||||||
<Setter Property="VerticalAlignment" Value="Top" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^:horizontal">
|
<Style Selector="^:horizontal">
|
||||||
<Setter Property="MinWidth" Value="200" />
|
<Setter Property="MinWidth" Value="200" />
|
||||||
<Setter Property="MinHeight" Value="4" />
|
<Setter Property="MinHeight" Value="4" />
|
||||||
|
<Style Selector="^ /template/ Border#PART_Indicator">
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||||
</Style>
|
</Style>
|
||||||
|
<Style Selector="^ /template/ Border#IndeterminateProgressBarIndicator">
|
||||||
|
<Setter Property="Width" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerWidth}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^ /template/ Border#IndeterminateProgressBarIndicator2">
|
||||||
|
<Setter Property="Width" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2Width}" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style Selector="^.Left,^.Top">
|
||||||
|
<Style Selector="^ /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
||||||
|
<Setter Property="Grid.Column" Value="0" />
|
||||||
|
<Setter Property="Grid.Row" Value="1" />
|
||||||
|
<Setter Property="Margin" Value="0 0 16 0" />
|
||||||
|
<Setter Property="MinWidth" Value="45" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^ /template/ Border#ProgressBarRoot">
|
||||||
|
<Setter Property="MinHeight" Value="4" />
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center" />
|
||||||
|
</Style>
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^.Right,^.Bottom">
|
||||||
|
<Style Selector="^ /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
||||||
|
<Setter Property="Grid.Column" Value="2" />
|
||||||
|
<Setter Property="Grid.Row" Value="1" />
|
||||||
|
<Setter Property="Margin" Value="16 0 0 0" />
|
||||||
|
<Setter Property="MinWidth" Value="45" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^ /template/ Border#ProgressBarRoot">
|
||||||
|
<Setter Property="MinHeight" Value="4" />
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center" />
|
||||||
|
</Style>
|
||||||
|
</Style>
|
||||||
|
</Style>
|
||||||
|
|
||||||
<Style Selector="^:vertical">
|
<Style Selector="^:vertical">
|
||||||
<Setter Property="MinWidth" Value="4" />
|
<Style Selector="^ /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
||||||
<Setter Property="MinHeight" Value="200" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^:vertical /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
|
||||||
<Setter Property="LayoutTransform">
|
<Setter Property="LayoutTransform">
|
||||||
<RotateTransform Angle="90" />
|
<RotateTransform Angle="90" />
|
||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^:indeterminate /template/ Panel#DeterminateRoot">
|
<Setter Property="MinWidth" Value="4" />
|
||||||
|
<Setter Property="MinHeight" Value="200" />
|
||||||
|
<Style Selector="^ /template/ Border#PART_Indicator">
|
||||||
|
<Setter Property="VerticalAlignment" Value="Top" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^ /template/ Border#IndeterminateProgressBarIndicator">
|
||||||
|
<Setter Property="Height" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerWidth}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^ /template/ Border#IndeterminateProgressBarIndicator2">
|
||||||
|
<Setter Property="Height" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2Width}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^.Left,^.Top">
|
||||||
|
<Style Selector="^ /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
||||||
|
<Setter Property="Grid.Column" Value="1" />
|
||||||
|
<Setter Property="Grid.Row" Value="0" />
|
||||||
|
<Setter Property="Margin" Value="0 0 0 16" />
|
||||||
|
<Setter Property="MinHeight" Value="45" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^ /template/ Border#ProgressBarRoot">
|
||||||
|
<Setter Property="MinWidth" Value="4" />
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||||
|
</Style>
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^.Right,^.Bottom">
|
||||||
|
<Style Selector="^ /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
||||||
|
<Setter Property="Grid.Column" Value="1" />
|
||||||
|
<Setter Property="Grid.Row" Value="2" />
|
||||||
|
<Setter Property="Margin" Value="0 16 0 0" />
|
||||||
|
<Setter Property="MinHeight" Value="45" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^ /template/ Border#ProgressBarRoot">
|
||||||
|
<Setter Property="MinWidth" Value="4" />
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||||
|
</Style>
|
||||||
|
</Style>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style Selector="^:indeterminate">
|
||||||
|
<Style Selector="^ /template/ Panel#DeterminateRoot">
|
||||||
<Setter Property="Opacity" Value="0" />
|
<Setter Property="Opacity" Value="0" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^:indeterminate /template/ Panel#IndeterminateRoot">
|
<Style Selector="^ /template/ Panel#IndeterminateRoot">
|
||||||
<Setter Property="Opacity" Value="1" />
|
<Setter Property="Opacity" Value="1" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^:horizontal:indeterminate /template/ Border#IndeterminateProgressBarIndicator">
|
<Style Selector="^:horizontal /template/ Border#IndeterminateProgressBarIndicator">
|
||||||
<Style.Animations>
|
<Style.Animations>
|
||||||
<Animation IterationCount="Infinite" Duration="0:0:2">
|
<Animation IterationCount="Infinite" Duration="0:0:2">
|
||||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0">
|
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0">
|
||||||
@@ -233,7 +259,7 @@
|
|||||||
</Animation>
|
</Animation>
|
||||||
</Style.Animations>
|
</Style.Animations>
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^:horizontal:indeterminate /template/ Border#IndeterminateProgressBarIndicator2">
|
<Style Selector="^:horizontal /template/ Border#IndeterminateProgressBarIndicator2">
|
||||||
<Style.Animations>
|
<Style.Animations>
|
||||||
<Animation IterationCount="Infinite" Duration="0:0:2">
|
<Animation IterationCount="Infinite" Duration="0:0:2">
|
||||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0">
|
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0">
|
||||||
@@ -248,7 +274,7 @@
|
|||||||
</Animation>
|
</Animation>
|
||||||
</Style.Animations>
|
</Style.Animations>
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^:vertical:indeterminate /template/ Border#IndeterminateProgressBarIndicator">
|
<Style Selector="^:vertical /template/ Border#IndeterminateProgressBarIndicator">
|
||||||
<Style.Animations>
|
<Style.Animations>
|
||||||
<Animation IterationCount="Infinite" Duration="0:0:2">
|
<Animation IterationCount="Infinite" Duration="0:0:2">
|
||||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0">
|
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0">
|
||||||
@@ -263,7 +289,7 @@
|
|||||||
</Animation>
|
</Animation>
|
||||||
</Style.Animations>
|
</Style.Animations>
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^:vertical:indeterminate /template/ Border#IndeterminateProgressBarIndicator2">
|
<Style Selector="^:vertical /template/ Border#IndeterminateProgressBarIndicator2">
|
||||||
<Style.Animations>
|
<Style.Animations>
|
||||||
<Animation IterationCount="Infinite" Duration="0:0:2">
|
<Animation IterationCount="Infinite" Duration="0:0:2">
|
||||||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0">
|
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0">
|
||||||
@@ -278,63 +304,6 @@
|
|||||||
</Animation>
|
</Animation>
|
||||||
</Style.Animations>
|
</Style.Animations>
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^:horizontal /template/ Border#IndeterminateProgressBarIndicator">
|
|
||||||
<Setter Property="Width" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerWidth}" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^:horizontal /template/ Border#IndeterminateProgressBarIndicator2">
|
|
||||||
<Setter Property="Width" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2Width}" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^:vertical /template/ Border#IndeterminateProgressBarIndicator">
|
|
||||||
<Setter Property="Height" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerWidth}" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^:vertical /template/ Border#IndeterminateProgressBarIndicator2">
|
|
||||||
<Setter Property="Height" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2Width}" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^.Left">
|
|
||||||
<Style Selector="^:horizontal /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
|
||||||
<Setter Property="Grid.Column" Value="0" />
|
|
||||||
<Setter Property="Grid.Row" Value="1" />
|
|
||||||
<Setter Property="Margin" Value="4 0" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^:vertical /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
|
||||||
<Setter Property="Grid.Column" Value="1" />
|
|
||||||
<Setter Property="Grid.Row" Value="0" />
|
|
||||||
<Setter Property="Margin" Value="0 4" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^:horizontal /template/ Border#ProgressBarRoot">
|
|
||||||
<Setter Property="MinHeight" Value="4" />
|
|
||||||
<Setter Property="VerticalAlignment" Value="Center" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^:vertical /template/ Border#ProgressBarRoot">
|
|
||||||
<Setter Property="MinWidth" Value="4" />
|
|
||||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^ /template/ TextBlock#PART_ProgressText">
|
|
||||||
<Setter Property="Foreground" Value="{DynamicResource ProgressBarOuterTextForeground}" />
|
|
||||||
</Style>
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^.Right">
|
|
||||||
<Style Selector="^:horizontal /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
|
||||||
<Setter Property="Grid.Column" Value="2" />
|
|
||||||
<Setter Property="Grid.Row" Value="1" />
|
|
||||||
<Setter Property="Margin" Value="4 0" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^:vertical /template/ LayoutTransformControl#PART_LayoutTransformControl">
|
|
||||||
<Setter Property="Grid.Column" Value="1" />
|
|
||||||
<Setter Property="Grid.Row" Value="2" />
|
|
||||||
<Setter Property="Margin" Value="0 4" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^:horizontal /template/ Border#ProgressBarRoot">
|
|
||||||
<Setter Property="MinHeight" Value="4" />
|
|
||||||
<Setter Property="VerticalAlignment" Value="Center" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^:vertical /template/ Border#ProgressBarRoot">
|
|
||||||
<Setter Property="MinWidth" Value="4" />
|
|
||||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^ /template/ TextBlock#PART_ProgressText">
|
|
||||||
<Setter Property="Foreground" Value="{DynamicResource ProgressBarOuterTextForeground}" />
|
|
||||||
</Style>
|
|
||||||
</Style>
|
</Style>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|
||||||
@@ -412,10 +381,6 @@
|
|||||||
<Style Selector="^.Danger">
|
<Style Selector="^.Danger">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource ProgressBarDangerForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource ProgressBarDangerForeground}" />
|
||||||
</Style>
|
</Style>
|
||||||
<!-- Error style is obsolete, use Danger instead -->
|
|
||||||
<Style Selector="^.Error">
|
|
||||||
<Setter Property="Foreground" Value="{DynamicResource ProgressBarErrorForeground}" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^:indeterminate /template/ Arc#Indicator">
|
<Style Selector="^:indeterminate /template/ Arc#Indicator">
|
||||||
<Setter Property="Opacity" Value="0" />
|
<Setter Property="Opacity" Value="0" />
|
||||||
</Style>
|
</Style>
|
||||||
|
|||||||
@@ -493,250 +493,4 @@
|
|||||||
<Setter Property="IsVisible" Value="True" />
|
<Setter Property="IsVisible" Value="True" />
|
||||||
</Style>
|
</Style>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|
||||||
<!-- Obsolete after Avalonia 11.3.7 -->
|
|
||||||
<ControlTheme x:Key="VerticalSplitView" TargetType="SplitView">
|
|
||||||
<Setter Property="OpenPaneLength" Value="{DynamicResource SplitViewOpenPaneThemeLength}" />
|
|
||||||
<Setter Property="CompactPaneLength" Value="{DynamicResource SplitViewCompactPaneThemeLength}" />
|
|
||||||
<Setter Property="PaneBackground" Value="{DynamicResource SplitViewPaneBackground}" />
|
|
||||||
|
|
||||||
<Style Selector="^:left">
|
|
||||||
<Setter Property="Template">
|
|
||||||
<ControlTemplate TargetType="SplitView">
|
|
||||||
<Grid Name="Container" Background="{TemplateBinding Background}">
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<!-- why is this throwing a binding error? -->
|
|
||||||
<RowDefinition Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.PaneColumnGridLength}" />
|
|
||||||
<RowDefinition Height="*" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
|
|
||||||
<Panel
|
|
||||||
Name="PART_PaneRoot"
|
|
||||||
VerticalAlignment="Top"
|
|
||||||
Background="{TemplateBinding PaneBackground}"
|
|
||||||
ClipToBounds="True"
|
|
||||||
ZIndex="100">
|
|
||||||
<ContentPresenter
|
|
||||||
Name="PART_PanePresenter"
|
|
||||||
Content="{TemplateBinding Pane}"
|
|
||||||
ContentTemplate="{TemplateBinding PaneTemplate}" />
|
|
||||||
<Rectangle
|
|
||||||
Name="HCPaneBorder"
|
|
||||||
Height="1"
|
|
||||||
VerticalAlignment="Bottom"
|
|
||||||
Fill="{DynamicResource SplitViewSeparatorBackground}" />
|
|
||||||
</Panel>
|
|
||||||
|
|
||||||
<Panel Name="ContentRoot">
|
|
||||||
<ContentPresenter
|
|
||||||
Name="PART_ContentPresenter"
|
|
||||||
Content="{TemplateBinding Content}"
|
|
||||||
ContentTemplate="{TemplateBinding ContentTemplate}" />
|
|
||||||
<Rectangle
|
|
||||||
Name="LightDismissLayer"
|
|
||||||
Fill="Transparent"
|
|
||||||
IsVisible="False" />
|
|
||||||
</Panel>
|
|
||||||
|
|
||||||
</Grid>
|
|
||||||
</ControlTemplate>
|
|
||||||
</Setter>
|
|
||||||
|
|
||||||
<Style Selector="^:overlay">
|
|
||||||
<Style Selector="^ /template/ Panel#PART_PaneRoot">
|
|
||||||
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
|
|
||||||
<Setter Property="Grid.RowSpan" Value="1" />
|
|
||||||
<Setter Property="Grid.Row" Value="0" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^ /template/ Panel#ContentRoot">
|
|
||||||
<Setter Property="Grid.Row" Value="1" />
|
|
||||||
<Setter Property="Grid.RowSpan" Value="2" />
|
|
||||||
</Style>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Style Selector="^:compactinline">
|
|
||||||
<Style Selector="^ /template/ Panel#PART_PaneRoot">
|
|
||||||
<Setter Property="Grid.RowSpan" Value="1" />
|
|
||||||
<Setter Property="Grid.Row" Value="0" />
|
|
||||||
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^ /template/ Panel#ContentRoot">
|
|
||||||
<Setter Property="Grid.Row" Value="1" />
|
|
||||||
<Setter Property="Grid.RowSpan" Value="1" />
|
|
||||||
</Style>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Style Selector="^:compactoverlay">
|
|
||||||
<Style Selector="^ /template/ Panel#PART_PaneRoot">
|
|
||||||
<!-- RowSpan should be 2 -->
|
|
||||||
<Setter Property="Grid.RowSpan" Value="1" />
|
|
||||||
<Setter Property="Grid.Row" Value="0" />
|
|
||||||
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^ /template/ Panel#ContentRoot">
|
|
||||||
<Setter Property="Grid.Row" Value="1" />
|
|
||||||
<Setter Property="Grid.RowSpan" Value="1" />
|
|
||||||
</Style>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Style Selector="^:inline">
|
|
||||||
<Style Selector="^ /template/ Panel#PART_PaneRoot">
|
|
||||||
<Setter Property="Grid.RowSpan" Value="1" />
|
|
||||||
<Setter Property="Grid.Row" Value="0" />
|
|
||||||
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^ /template/ Panel#ContentRoot">
|
|
||||||
<Setter Property="Grid.Row" Value="1" />
|
|
||||||
<Setter Property="Grid.RowSpan" Value="1" />
|
|
||||||
</Style>
|
|
||||||
</Style>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Style Selector="^:right">
|
|
||||||
<Setter Property="Template">
|
|
||||||
<ControlTemplate>
|
|
||||||
<Grid Name="Container" Background="{TemplateBinding Background}">
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="*" />
|
|
||||||
<RowDefinition Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.PaneColumnGridLength}" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
|
|
||||||
<Panel
|
|
||||||
Name="PART_PaneRoot"
|
|
||||||
VerticalAlignment="Bottom"
|
|
||||||
Background="{TemplateBinding PaneBackground}"
|
|
||||||
ClipToBounds="True"
|
|
||||||
ZIndex="100">
|
|
||||||
<ContentPresenter
|
|
||||||
Name="PART_PanePresenter"
|
|
||||||
Content="{TemplateBinding Pane}"
|
|
||||||
ContentTemplate="{TemplateBinding PaneTemplate}" />
|
|
||||||
<Rectangle
|
|
||||||
Name="HCPaneBorder"
|
|
||||||
Height="1"
|
|
||||||
VerticalAlignment="Top"
|
|
||||||
Fill="{DynamicResource SplitViewSeparatorBackground}" />
|
|
||||||
</Panel>
|
|
||||||
|
|
||||||
<Panel Name="ContentRoot">
|
|
||||||
<ContentPresenter
|
|
||||||
Name="PART_ContentPresenter"
|
|
||||||
Content="{TemplateBinding Content}"
|
|
||||||
ContentTemplate="{TemplateBinding ContentTemplate}" />
|
|
||||||
<Rectangle Name="LightDismissLayer" IsVisible="False" />
|
|
||||||
</Panel>
|
|
||||||
|
|
||||||
</Grid>
|
|
||||||
</ControlTemplate>
|
|
||||||
</Setter>
|
|
||||||
|
|
||||||
<Style Selector="^:overlay">
|
|
||||||
<Style Selector="^ /template/ Panel#PART_PaneRoot">
|
|
||||||
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
|
|
||||||
<Setter Property="Grid.RowSpan" Value="2" />
|
|
||||||
<Setter Property="Grid.Row" Value="1" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^ /template/ Panel#ContentRoot">
|
|
||||||
<Setter Property="Grid.Row" Value="0" />
|
|
||||||
<Setter Property="Grid.RowSpan" Value="2" />
|
|
||||||
</Style>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Style Selector="^:compactinline">
|
|
||||||
<Style Selector="^ /template/ Panel#PART_PaneRoot">
|
|
||||||
<Setter Property="Grid.RowSpan" Value="1" />
|
|
||||||
<Setter Property="Grid.Row" Value="1" />
|
|
||||||
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^ /template/ Panel#ContentRoot">
|
|
||||||
<Setter Property="Grid.Row" Value="0" />
|
|
||||||
<Setter Property="Grid.RowSpan" Value="1" />
|
|
||||||
</Style>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Style Selector="^:compactoverlay">
|
|
||||||
<Style Selector="^ /template/ Panel#PART_PaneRoot">
|
|
||||||
<Setter Property="Grid.RowSpan" Value="2" />
|
|
||||||
<Setter Property="Grid.Row" Value="1" />
|
|
||||||
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^ /template/ Panel#ContentRoot">
|
|
||||||
<Setter Property="Grid.Row" Value="0" />
|
|
||||||
<Setter Property="Grid.RowSpan" Value="1" />
|
|
||||||
</Style>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Style Selector="^:inline">
|
|
||||||
<Style Selector="^ /template/ Panel#PART_PaneRoot">
|
|
||||||
<Setter Property="Grid.RowSpan" Value="1" />
|
|
||||||
<Setter Property="Grid.Row" Value="1" />
|
|
||||||
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^ /template/ Panel#ContentRoot">
|
|
||||||
<Setter Property="Grid.Row" Value="0" />
|
|
||||||
<Setter Property="Grid.RowSpan" Value="1" />
|
|
||||||
</Style>
|
|
||||||
</Style>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Style Selector="^:open">
|
|
||||||
<Style Selector="^ /template/ Panel#PART_PaneRoot">
|
|
||||||
<Setter Property="Transitions">
|
|
||||||
<Transitions>
|
|
||||||
<DoubleTransition
|
|
||||||
Easing="{StaticResource SplitViewPaneAnimationEasing}"
|
|
||||||
Property="Height"
|
|
||||||
Duration="{StaticResource SplitViewPaneAnimationOpenDuration}" />
|
|
||||||
</Transitions>
|
|
||||||
</Setter>
|
|
||||||
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=OpenPaneLength}" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^ /template/ Rectangle#LightDismissLayer">
|
|
||||||
<Setter Property="Transitions">
|
|
||||||
<Transitions>
|
|
||||||
<DoubleTransition
|
|
||||||
Easing="{StaticResource SplitViewPaneAnimationEasing}"
|
|
||||||
Property="Opacity"
|
|
||||||
Duration="{StaticResource SplitViewPaneAnimationOpenDuration}" />
|
|
||||||
</Transitions>
|
|
||||||
</Setter>
|
|
||||||
<Setter Property="Opacity" Value="1.0" />
|
|
||||||
</Style>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Style Selector="^:closed">
|
|
||||||
<Style Selector="^ /template/ Panel#PART_PaneRoot">
|
|
||||||
<Setter Property="Transitions">
|
|
||||||
<Transitions>
|
|
||||||
<DoubleTransition
|
|
||||||
Easing="{StaticResource SplitViewPaneAnimationEasing}"
|
|
||||||
Property="Height"
|
|
||||||
Duration="{StaticResource SplitViewPaneAnimationCloseDuration}" />
|
|
||||||
</Transitions>
|
|
||||||
</Setter>
|
|
||||||
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^ /template/ Rectangle#LightDismissLayer">
|
|
||||||
<Setter Property="Transitions">
|
|
||||||
<Transitions>
|
|
||||||
<DoubleTransition
|
|
||||||
Easing="{StaticResource SplitViewPaneAnimationEasing}"
|
|
||||||
Property="Opacity"
|
|
||||||
Duration="{StaticResource SplitViewPaneAnimationCloseDuration}" />
|
|
||||||
</Transitions>
|
|
||||||
</Setter>
|
|
||||||
<Setter Property="Opacity" Value="0.0" />
|
|
||||||
</Style>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Style Selector="^:lightDismiss /template/ Rectangle#LightDismissLayer">
|
|
||||||
<Setter Property="Fill" Value="{DynamicResource SplitViewMaskBrush}" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^:overlay:open /template/ Rectangle#LightDismissLayer">
|
|
||||||
<Setter Property="IsVisible" Value="True" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^:compactoverlay:open /template/ Rectangle#LightDismissLayer">
|
|
||||||
<Setter Property="IsVisible" Value="True" />
|
|
||||||
</Style>
|
|
||||||
</ControlTheme>
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -6,16 +6,12 @@
|
|||||||
Width="400"
|
Width="400"
|
||||||
Height="400"
|
Height="400"
|
||||||
Margin="20">
|
Margin="20">
|
||||||
|
<TabItem Theme="{DynamicResource CardTabItem}" Header="文档" Icon="{StaticResource SemiIconFile}" />
|
||||||
<TabControl TabStripPlacement="Top" Theme="{DynamicResource LineTabControl}">
|
<TabControl TabStripPlacement="Top" Theme="{DynamicResource LineTabControl}">
|
||||||
<TabItem Header="文档">
|
<TabItem Content="Hello 1" Header="文档" Icon="{StaticResource SemiIconFile}" />
|
||||||
<TextBlock Text="Content1" />
|
<TabItem Content="Hello 2" Header="快速起步" Icon="{StaticResource SemiIconGlobe}" />
|
||||||
</TabItem>
|
<TabItem Content="Hello 4" Header="无效" Icon="{StaticResource SemiIconClear}" IsEnabled="False" />
|
||||||
<TabItem Header="快速起步">
|
<TabItem Content="Hello 3" Header="帮助" Icon="{StaticResource SemiIconHelpCircle}" />
|
||||||
<TextBlock Text="Content2" />
|
|
||||||
</TabItem>
|
|
||||||
<TabItem Header="帮助" IsSelected="True">
|
|
||||||
<TextBlock Text="Content3" />
|
|
||||||
</TabItem>
|
|
||||||
</TabControl>
|
</TabControl>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Design.PreviewWith>
|
</Design.PreviewWith>
|
||||||
@@ -25,20 +21,39 @@
|
|||||||
<Setter Property="Background" Value="{DynamicResource TabItemLinePipeBackground}" />
|
<Setter Property="Background" Value="{DynamicResource TabItemLinePipeBackground}" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="TabItem">
|
<ControlTemplate TargetType="TabItem">
|
||||||
<ContentPresenter
|
<Border
|
||||||
Name="PART_HeaderPresenter"
|
Name="PART_RootBorder"
|
||||||
Padding="{TemplateBinding Padding}"
|
Padding="{TemplateBinding Padding}"
|
||||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
||||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
||||||
Background="{TemplateBinding Background}"
|
Background="{TemplateBinding Background}"
|
||||||
BorderBrush="{TemplateBinding BorderBrush}"
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
BorderThickness="{TemplateBinding BorderThickness}"
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
|
CornerRadius="{TemplateBinding CornerRadius}">
|
||||||
|
<DockPanel HorizontalSpacing="{DynamicResource TabItemIconHeaderSpacing}">
|
||||||
|
<ContentPresenter
|
||||||
|
Name="PART_IconPresenter"
|
||||||
|
DockPanel.Dock="Left"
|
||||||
|
Content="{TemplateBinding Icon}"
|
||||||
|
ContentTemplate="{TemplateBinding IconTemplate}"
|
||||||
|
IsVisible="{Binding $self.Content, Converter={x:Static ObjectConverters.IsNotNull}}">
|
||||||
|
<ContentPresenter.DataTemplates>
|
||||||
|
<DataTemplate DataType="Geometry">
|
||||||
|
<PathIcon
|
||||||
|
Theme="{StaticResource InnerPathIcon}"
|
||||||
|
Data="{Binding}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</ContentPresenter.DataTemplates>
|
||||||
|
</ContentPresenter>
|
||||||
|
<ContentPresenter
|
||||||
|
Name="PART_HeaderPresenter"
|
||||||
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
Content="{TemplateBinding Header}"
|
Content="{TemplateBinding Header}"
|
||||||
ContentTemplate="{TemplateBinding HeaderTemplate}"
|
ContentTemplate="{TemplateBinding HeaderTemplate}"
|
||||||
CornerRadius="{TemplateBinding CornerRadius}"
|
|
||||||
FontFamily="{TemplateBinding FontFamily}"
|
FontFamily="{TemplateBinding FontFamily}"
|
||||||
FontWeight="{TemplateBinding FontWeight}"
|
FontWeight="{TemplateBinding FontWeight}"
|
||||||
Foreground="{TemplateBinding Foreground}" />
|
Foreground="{TemplateBinding Foreground}" />
|
||||||
|
</DockPanel>
|
||||||
|
</Border>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
|
|
||||||
@@ -46,17 +61,31 @@
|
|||||||
<Setter Property="RecognizesAccessKey" Value="True" />
|
<Setter Property="RecognizesAccessKey" Value="True" />
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style Selector="^:selected /template/ ContentPresenter#PART_HeaderPresenter">
|
<Style Selector="^:selected">
|
||||||
|
<Style Selector="^ /template/ ContentPresenter#PART_HeaderPresenter">
|
||||||
<Setter Property="FontWeight" Value="{DynamicResource TabItemSelectedFontWeight}" />
|
<Setter Property="FontWeight" Value="{DynamicResource TabItemSelectedFontWeight}" />
|
||||||
<Setter Property="Foreground" Value="{DynamicResource TabItemLineHeaderSelectedForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource TabItemLineHeaderSelectedForeground}" />
|
||||||
</Style>
|
</Style>
|
||||||
|
<Style Selector="^ /template/ ContentPresenter#PART_IconPresenter">
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource TabItemIconSelectedForeground}" />
|
||||||
|
</Style>
|
||||||
|
</Style>
|
||||||
|
|
||||||
<Style Selector="^:not(:selected)">
|
<Style Selector="^:not(:selected)">
|
||||||
<Setter Property="Cursor" Value="Hand" />
|
<Setter Property="Cursor" Value="Hand" />
|
||||||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_HeaderPresenter">
|
<Style Selector="^:pointerover">
|
||||||
|
<Style Selector="^ /template/ ContentPresenter#PART_HeaderPresenter,^ /template/ ContentPresenter#PART_IconPresenter">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource TabItemLineHeaderPointeroverForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource TabItemLineHeaderPointeroverForeground}" />
|
||||||
</Style>
|
</Style>
|
||||||
</Style>
|
</Style>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style Selector="^:disabled">
|
||||||
|
<Style Selector="^ /template/ ContentPresenter#PART_HeaderPresenter,^ /template/ ContentPresenter#PART_IconPresenter">
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource TabItemHeaderDisabledForeground}" />
|
||||||
|
</Style>
|
||||||
|
</Style>
|
||||||
|
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|
||||||
<ControlTheme
|
<ControlTheme
|
||||||
@@ -65,15 +94,15 @@
|
|||||||
TargetType="TabItem">
|
TargetType="TabItem">
|
||||||
<Setter Property="Padding" Value="8 4" />
|
<Setter Property="Padding" Value="8 4" />
|
||||||
|
|
||||||
<Style Selector="^:selected /template/ ContentPresenter#PART_HeaderPresenter">
|
<Style Selector="^:selected /template/ Border#PART_RootBorder">
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource TabItemLinePipeSelectedBackground}" />
|
<Setter Property="BorderBrush" Value="{DynamicResource TabItemLinePipeSelectedBackground}" />
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style Selector="^:not(:selected)">
|
<Style Selector="^:not(:selected)">
|
||||||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_HeaderPresenter">
|
<Style Selector="^:pointerover /template/ Border#PART_RootBorder">
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource TabItemLinePipePointeroverBorderBrush}" />
|
<Setter Property="BorderBrush" Value="{DynamicResource TabItemLinePipePointeroverBorderBrush}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^:pressed /template/ ContentPresenter#PART_HeaderPresenter">
|
<Style Selector="^:pressed /template/ Border#PART_RootBorder">
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource TabItemLinePipePressedBorderBrush}" />
|
<Setter Property="BorderBrush" Value="{DynamicResource TabItemLinePipePressedBorderBrush}" />
|
||||||
</Style>
|
</Style>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -98,27 +127,27 @@
|
|||||||
x:Key="LineTabItem"
|
x:Key="LineTabItem"
|
||||||
BasedOn="{StaticResource BaseTabItem}"
|
BasedOn="{StaticResource BaseTabItem}"
|
||||||
TargetType="TabItem">
|
TargetType="TabItem">
|
||||||
<Style Selector="^:selected /template/ ContentPresenter#PART_HeaderPresenter">
|
<Style Selector="^:selected /template/ Border#PART_RootBorder">
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource TabItemLinePipeSelectedBackground}" />
|
<Setter Property="BorderBrush" Value="{DynamicResource TabItemLinePipeSelectedBackground}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^[TabStripPlacement=Left], ^[TabStripPlacement=Right]">
|
<Style Selector="^[TabStripPlacement=Left], ^[TabStripPlacement=Right]">
|
||||||
<Style Selector="^:selected /template/ ContentPresenter#PART_HeaderPresenter">
|
<Style Selector="^:selected /template/ Border#PART_RootBorder">
|
||||||
<Setter Property="Background" Value="{DynamicResource TabItemLineHeaderSelectedBackground}" />
|
<Setter Property="Background" Value="{DynamicResource TabItemLineHeaderSelectedBackground}" />
|
||||||
</Style>
|
</Style>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style Selector="^:not(:selected)">
|
<Style Selector="^:not(:selected)">
|
||||||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_HeaderPresenter">
|
<Style Selector="^:pointerover /template/ Border#PART_RootBorder">
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource TabItemLinePipePointeroverBorderBrush}" />
|
<Setter Property="BorderBrush" Value="{DynamicResource TabItemLinePipePointeroverBorderBrush}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^:pressed /template/ ContentPresenter#PART_HeaderPresenter">
|
<Style Selector="^:pressed /template/ Border#PART_RootBorder">
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource TabItemLinePipePressedBorderBrush}" />
|
<Setter Property="BorderBrush" Value="{DynamicResource TabItemLinePipePressedBorderBrush}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^[TabStripPlacement=Left], ^[TabStripPlacement=Right]">
|
<Style Selector="^[TabStripPlacement=Left], ^[TabStripPlacement=Right]">
|
||||||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_HeaderPresenter">
|
<Style Selector="^:pointerover /template/ Border#PART_RootBorder">
|
||||||
<Setter Property="Background" Value="{DynamicResource TabItemLineHeaderPointeroverBackground}" />
|
<Setter Property="Background" Value="{DynamicResource TabItemLineHeaderPointeroverBackground}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^:pressed /template/ ContentPresenter#PART_HeaderPresenter">
|
<Style Selector="^:pressed /template/ Border#PART_RootBorder">
|
||||||
<Setter Property="Background" Value="{DynamicResource TabItemLineHeaderPressedBackground}" />
|
<Setter Property="Background" Value="{DynamicResource TabItemLineHeaderPressedBackground}" />
|
||||||
</Style>
|
</Style>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -150,15 +179,15 @@
|
|||||||
TargetType="TabItem">
|
TargetType="TabItem">
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource TabControlSeparatorBorderBrush}" />
|
<Setter Property="BorderBrush" Value="{DynamicResource TabControlSeparatorBorderBrush}" />
|
||||||
|
|
||||||
<Style Selector="^:selected /template/ ContentPresenter#PART_HeaderPresenter">
|
<Style Selector="^:selected /template/ Border#PART_RootBorder">
|
||||||
<Setter Property="Background" Value="{DynamicResource TabItemCardHeaderSelectedBackground}" />
|
<Setter Property="Background" Value="{DynamicResource TabItemCardHeaderSelectedBackground}" />
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style Selector="^:not(:selected)">
|
<Style Selector="^:not(:selected)">
|
||||||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_HeaderPresenter">
|
<Style Selector="^:pointerover /template/ Border#PART_RootBorder">
|
||||||
<Setter Property="Background" Value="{DynamicResource TabItemCardHeaderPointeroverBackground}" />
|
<Setter Property="Background" Value="{DynamicResource TabItemCardHeaderPointeroverBackground}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^:pressed /template/ ContentPresenter#PART_HeaderPresenter">
|
<Style Selector="^:pressed /template/ Border#PART_RootBorder">
|
||||||
<Setter Property="Background" Value="{DynamicResource TabItemCardHeaderPressedBackground}" />
|
<Setter Property="Background" Value="{DynamicResource TabItemCardHeaderPressedBackground}" />
|
||||||
</Style>
|
</Style>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -207,16 +236,20 @@
|
|||||||
TargetType="TabItem">
|
TargetType="TabItem">
|
||||||
<Setter Property="CornerRadius" Value="{DynamicResource SemiBorderRadiusSmall}" />
|
<Setter Property="CornerRadius" Value="{DynamicResource SemiBorderRadiusSmall}" />
|
||||||
|
|
||||||
<Style Selector="^:selected /template/ ContentPresenter#PART_HeaderPresenter">
|
<Style Selector="^:selected">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource TabItemButtonHeaderSelectedForeground}" />
|
<Style Selector="^ /template/ Border#PART_RootBorder">
|
||||||
<Setter Property="Background" Value="{DynamicResource TabItemButtonHeaderSelectedBackground}" />
|
<Setter Property="Background" Value="{DynamicResource TabItemButtonHeaderSelectedBackground}" />
|
||||||
</Style>
|
</Style>
|
||||||
|
<Style Selector="^ /template/ ContentPresenter#PART_HeaderPresenter">
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource TabItemButtonHeaderSelectedForeground}" />
|
||||||
|
</Style>
|
||||||
|
</Style>
|
||||||
|
|
||||||
<Style Selector="^:not(:selected)">
|
<Style Selector="^:not(:selected)">
|
||||||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_HeaderPresenter">
|
<Style Selector="^:pointerover /template/ Border#PART_RootBorder">
|
||||||
<Setter Property="Background" Value="{DynamicResource TabItemButtonHeaderPointeroverBackground}" />
|
<Setter Property="Background" Value="{DynamicResource TabItemButtonHeaderPointeroverBackground}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^:pressed /template/ ContentPresenter#PART_HeaderPresenter">
|
<Style Selector="^:pressed /template/ Border#PART_RootBorder">
|
||||||
<Setter Property="Background" Value="{DynamicResource TabItemButtonHeaderPressedBackground}" />
|
<Setter Property="Background" Value="{DynamicResource TabItemButtonHeaderPressedBackground}" />
|
||||||
</Style>
|
</Style>
|
||||||
</Style>
|
</Style>
|
||||||
|
|||||||
@@ -11,8 +11,7 @@
|
|||||||
<TabControl
|
<TabControl
|
||||||
Name="PART_TabControl"
|
Name="PART_TabControl"
|
||||||
Background="{TemplateBinding Background}"
|
Background="{TemplateBinding Background}"
|
||||||
Theme="{StaticResource LineTabControl}"
|
Theme="{StaticResource LineTabControl}" />
|
||||||
ItemsSource="{TemplateBinding Pages}" />
|
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
@@ -22,8 +21,7 @@
|
|||||||
<TabControl
|
<TabControl
|
||||||
Name="PART_TabControl"
|
Name="PART_TabControl"
|
||||||
Background="{TemplateBinding Background}"
|
Background="{TemplateBinding Background}"
|
||||||
Theme="{StaticResource CardTabControl}"
|
Theme="{StaticResource CardTabControl}" />
|
||||||
ItemsSource="{TemplateBinding Pages}" />
|
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
@@ -33,8 +31,7 @@
|
|||||||
<TabControl
|
<TabControl
|
||||||
Name="PART_TabControl"
|
Name="PART_TabControl"
|
||||||
Background="{TemplateBinding Background}"
|
Background="{TemplateBinding Background}"
|
||||||
Theme="{StaticResource ButtonTabControl}"
|
Theme="{StaticResource ButtonTabControl}" />
|
||||||
ItemsSource="{TemplateBinding Pages}" />
|
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|||||||
@@ -22,6 +22,27 @@
|
|||||||
IsEnabled="{Binding $parent[TextBox].CanPaste}" />
|
IsEnabled="{Binding $parent[TextBox].CanPaste}" />
|
||||||
</MenuFlyout>
|
</MenuFlyout>
|
||||||
|
|
||||||
|
<MenuFlyout
|
||||||
|
x:Key="HorizontalTextBoxContextFlyout"
|
||||||
|
ShowMode="{OnFormFactor Desktop=Standard, Mobile=Transient}"
|
||||||
|
FlyoutPresenterTheme="{StaticResource HorizontalMenuFlyoutPresenter}"
|
||||||
|
ItemContainerTheme="{StaticResource TopLevelMenuItem}">
|
||||||
|
<MenuItem
|
||||||
|
Command="{Binding $parent[TextBox].Cut}"
|
||||||
|
Header="{DynamicResource STRING_MENU_CUT}"
|
||||||
|
IsEnabled="{Binding $parent[TextBox].CanCut}"
|
||||||
|
IsVisible="{Binding $parent[TextBox].CanCut}" />
|
||||||
|
<MenuItem
|
||||||
|
Command="{Binding $parent[TextBox].Copy}"
|
||||||
|
Header="{DynamicResource STRING_MENU_COPY}"
|
||||||
|
IsEnabled="{Binding $parent[TextBox].CanCopy}"
|
||||||
|
IsVisible="{Binding $parent[TextBox].CanCopy}" />
|
||||||
|
<MenuItem
|
||||||
|
Command="{Binding $parent[TextBox].Paste}"
|
||||||
|
Header="{DynamicResource STRING_MENU_PASTE}"
|
||||||
|
IsEnabled="{Binding $parent[TextBox].CanPaste}" />
|
||||||
|
</MenuFlyout>
|
||||||
|
|
||||||
<ControlTheme x:Key="{x:Type TextBox}" TargetType="TextBox">
|
<ControlTheme x:Key="{x:Type TextBox}" TargetType="TextBox">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource TextBoxForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource TextBoxForeground}" />
|
||||||
<Setter Property="PlaceholderForeground" Value="{DynamicResource TextBoxPlaceholderForeground}" />
|
<Setter Property="PlaceholderForeground" Value="{DynamicResource TextBoxPlaceholderForeground}" />
|
||||||
@@ -60,6 +81,7 @@
|
|||||||
Foreground="{DynamicResource TextBoxInnerForeground}"
|
Foreground="{DynamicResource TextBoxInnerForeground}"
|
||||||
IsVisible="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=InnerLeftContent, Converter={x:Static ObjectConverters.IsNotNull}}" />
|
IsVisible="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=InnerLeftContent, Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||||
<ScrollViewer
|
<ScrollViewer
|
||||||
|
Name="PART_ScrollViewer"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}"
|
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}"
|
||||||
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
|
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
|
||||||
@@ -133,6 +155,10 @@
|
|||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
|
|
||||||
|
<Style Selector="^:touch-mode">
|
||||||
|
<Setter Property="ContextFlyout" Value="{StaticResource HorizontalTextBoxContextFlyout}" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
<Style Selector="^:pointerover /template/ Border#PART_ContentPresenterBorder">
|
<Style Selector="^:pointerover /template/ Border#PART_ContentPresenterBorder">
|
||||||
<Setter Property="Background" Value="{DynamicResource TextBoxPointeroverBackground}" />
|
<Setter Property="Background" Value="{DynamicResource TextBoxPointeroverBackground}" />
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource TextBoxPointeroverBorderBrush}" />
|
<Setter Property="BorderBrush" Value="{DynamicResource TextBoxPointeroverBorderBrush}" />
|
||||||
@@ -294,6 +320,7 @@
|
|||||||
Foreground="{DynamicResource TextBoxInnerForeground}"
|
Foreground="{DynamicResource TextBoxInnerForeground}"
|
||||||
IsVisible="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=InnerLeftContent, Converter={x:Static ObjectConverters.IsNotNull}}" />
|
IsVisible="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=InnerLeftContent, Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||||
<ScrollViewer
|
<ScrollViewer
|
||||||
|
Name="PART_ScrollViewer"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}"
|
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}"
|
||||||
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
|
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
|
||||||
@@ -304,7 +331,6 @@
|
|||||||
Name="PART_Placeholder"
|
Name="PART_Placeholder"
|
||||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
Opacity="0.5"
|
|
||||||
Foreground="{TemplateBinding PlaceholderForeground}"
|
Foreground="{TemplateBinding PlaceholderForeground}"
|
||||||
Text="{TemplateBinding PlaceholderText}"
|
Text="{TemplateBinding PlaceholderText}"
|
||||||
TextAlignment="{TemplateBinding TextAlignment}"
|
TextAlignment="{TemplateBinding TextAlignment}"
|
||||||
@@ -368,6 +394,10 @@
|
|||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
|
|
||||||
|
<Style Selector="^:touch-mode">
|
||||||
|
<Setter Property="ContextFlyout" Value="{StaticResource HorizontalTextBoxContextFlyout}" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
<Style Selector="^:pointerover /template/ Border#PART_ContentPresenterBorder">
|
<Style Selector="^:pointerover /template/ Border#PART_ContentPresenterBorder">
|
||||||
<Setter Property="Background" Value="{DynamicResource TextBoxPointeroverBackground}" />
|
<Setter Property="Background" Value="{DynamicResource TextBoxPointeroverBackground}" />
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource TextBoxPointeroverBorderBrush}" />
|
<Setter Property="BorderBrush" Value="{DynamicResource TextBoxPointeroverBorderBrush}" />
|
||||||
@@ -516,6 +546,7 @@
|
|||||||
Foreground="{DynamicResource TextBoxInnerForeground}"
|
Foreground="{DynamicResource TextBoxInnerForeground}"
|
||||||
IsVisible="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=InnerLeftContent, Converter={x:Static ObjectConverters.IsNotNull}}" />
|
IsVisible="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=InnerLeftContent, Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||||
<ScrollViewer
|
<ScrollViewer
|
||||||
|
Name="PART_ScrollViewer"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}"
|
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}"
|
||||||
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
|
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
|
||||||
@@ -526,7 +557,6 @@
|
|||||||
Name="PART_Placeholder"
|
Name="PART_Placeholder"
|
||||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
Opacity="0.5"
|
|
||||||
Foreground="{TemplateBinding PlaceholderForeground}"
|
Foreground="{TemplateBinding PlaceholderForeground}"
|
||||||
Text="{TemplateBinding PlaceholderText}"
|
Text="{TemplateBinding PlaceholderText}"
|
||||||
TextAlignment="{TemplateBinding TextAlignment}"
|
TextAlignment="{TemplateBinding TextAlignment}"
|
||||||
@@ -573,6 +603,10 @@
|
|||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
|
|
||||||
|
<Style Selector="^:touch-mode">
|
||||||
|
<Setter Property="ContextFlyout" Value="{StaticResource HorizontalTextBoxContextFlyout}" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
<Style Selector="^:disabled">
|
<Style Selector="^:disabled">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource TextBoxDisabledForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource TextBoxDisabledForeground}" />
|
||||||
</Style>
|
</Style>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" />
|
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" />
|
||||||
<Border Background="{TemplateBinding Background}" IsHitTestVisible="False" />
|
<Border Background="{TemplateBinding Background}" IsHitTestVisible="False" />
|
||||||
<Panel Margin="{TemplateBinding WindowDecorationMargin}" Background="Transparent" />
|
<Panel Margin="{TemplateBinding WindowDecorationMargin}" Background="Transparent" />
|
||||||
<VisualLayerManager>
|
<VisualLayerManager Name="PART_VisualLayerManager">
|
||||||
<ContentPresenter
|
<ContentPresenter
|
||||||
Name="PART_ContentPresenter"
|
Name="PART_ContentPresenter"
|
||||||
Margin="{TemplateBinding Padding}"
|
Margin="{TemplateBinding Padding}"
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
<Setter Property="Padding" Value="{StaticResource CaptionButtonPadding}" />
|
<Setter Property="Padding" Value="{StaticResource CaptionButtonPadding}" />
|
||||||
<Setter Property="Width" Value="{StaticResource CaptionButtonWidth}" />
|
<Setter Property="Width" Value="{StaticResource CaptionButtonWidth}" />
|
||||||
<Setter Property="Height" Value="{StaticResource CaptionButtonHeight}" />
|
<Setter Property="Height" Value="{StaticResource CaptionButtonHeight}" />
|
||||||
<Setter Property="Cursor" Value="Hand" />
|
|
||||||
<Setter Property="WindowDecorationProperties.ElementRole" Value="DecorationsElement" />
|
<Setter Property="WindowDecorationProperties.ElementRole" Value="DecorationsElement" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="Button">
|
<ControlTemplate TargetType="Button">
|
||||||
@@ -39,6 +38,10 @@
|
|||||||
<Style Selector="^:pressed">
|
<Style Selector="^:pressed">
|
||||||
<Setter Property="Background" Value="{DynamicResource CaptionButtonPressedBackground}" />
|
<Setter Property="Background" Value="{DynamicResource CaptionButtonPressedBackground}" />
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
<Style Selector="^:disabled">
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource CaptionButtonDisabledForeground}" />
|
||||||
|
</Style>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|
||||||
<ControlTheme x:Key="{x:Type WindowDrawnDecorations}" TargetType="WindowDrawnDecorations">
|
<ControlTheme x:Key="{x:Type WindowDrawnDecorations}" TargetType="WindowDrawnDecorations">
|
||||||
@@ -50,14 +53,13 @@
|
|||||||
<WindowDrawnDecorationsContent>
|
<WindowDrawnDecorationsContent>
|
||||||
<WindowDrawnDecorationsContent.Underlay>
|
<WindowDrawnDecorationsContent.Underlay>
|
||||||
<!-- Full-size: covers shadow area + frame + behind client area -->
|
<!-- Full-size: covers shadow area + frame + behind client area -->
|
||||||
<Panel>
|
<Panel Name="PART_UnderlayWrapper">
|
||||||
<Border
|
<Border
|
||||||
Name="PART_WindowBorder"
|
Name="PART_WindowBorder"
|
||||||
Margin="{TemplateBinding ShadowThickness}"
|
|
||||||
Background="{DynamicResource WindowBackground}"
|
Background="{DynamicResource WindowBackground}"
|
||||||
BorderBrush="{DynamicResource WindowBorderBrush}"
|
BorderBrush="{DynamicResource WindowBorderBrush}"
|
||||||
BorderThickness="1"
|
BorderThickness="{TemplateBinding FrameThickness}"
|
||||||
BoxShadow="{DynamicResource WindowBorderShadow}" />
|
IsHitTestVisible="False" />
|
||||||
<!-- Titlebar: background, title text, and drag area live in underlay -->
|
<!-- Titlebar: background, title text, and drag area live in underlay -->
|
||||||
<Panel Name="PART_TitleBar"
|
<Panel Name="PART_TitleBar"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
@@ -81,7 +83,6 @@
|
|||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="12,0,0,0"
|
Margin="12,0,0,0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
FontSize="12"
|
|
||||||
Text="{TemplateBinding Title}" />
|
Text="{TemplateBinding Title}" />
|
||||||
</Panel>
|
</Panel>
|
||||||
<StackPanel
|
<StackPanel
|
||||||
@@ -90,9 +91,7 @@
|
|||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
IsVisible="{TemplateBinding HasTitleBar}"
|
IsVisible="{TemplateBinding HasTitleBar}"
|
||||||
Orientation="Horizontal"
|
Orientation="Horizontal">
|
||||||
Spacing="2"
|
|
||||||
TextElement.FontSize="10">
|
|
||||||
<Button
|
<Button
|
||||||
Name="PART_FullScreenButton"
|
Name="PART_FullScreenButton"
|
||||||
Theme="{StaticResource CaptionButton}"
|
Theme="{StaticResource CaptionButton}"
|
||||||
@@ -120,8 +119,9 @@
|
|||||||
<WindowDrawnDecorationsContent.FullscreenPopover>
|
<WindowDrawnDecorationsContent.FullscreenPopover>
|
||||||
<!-- Shown on hover at top edge in fullscreen -->
|
<!-- Shown on hover at top edge in fullscreen -->
|
||||||
<DockPanel
|
<DockPanel
|
||||||
Height="{TemplateBinding TitleBarHeight}"
|
Height="{TemplateBinding DefaultTitleBarHeight}"
|
||||||
Background="{DynamicResource TitleBarBackground}"
|
Background="{DynamicResource TitleBarBackground}"
|
||||||
|
VerticalAlignment="Top"
|
||||||
WindowDecorationProperties.ElementRole="TitleBar">
|
WindowDecorationProperties.ElementRole="TitleBar">
|
||||||
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal">
|
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal">
|
||||||
<Button
|
<Button
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
WindowDecorationProperties.ElementRole="CloseButton" />
|
WindowDecorationProperties.ElementRole="CloseButton" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="12,0"
|
Margin="12,0,0,0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Text="{TemplateBinding Title}" />
|
Text="{TemplateBinding Title}" />
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
@@ -187,6 +187,20 @@
|
|||||||
</Style>
|
</Style>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
<!-- Hide caption buttons when the platform does not support the action -->
|
||||||
|
<Style Selector="^:not(:has-minimize) /template/ Button#PART_MinimizeButton">
|
||||||
|
<Setter Property="IsVisible" Value="False"/>
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:not(:has-maximize) /template/ Button#PART_MaximizeButton">
|
||||||
|
<Setter Property="IsVisible" Value="False"/>
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:not(:has-fullscreen) /template/ Button#PART_FullScreenButton">
|
||||||
|
<Setter Property="IsVisible" Value="False"/>
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:not(:has-fullscreen) /template/ Button#PART_PopoverFullScreenButton">
|
||||||
|
<Setter Property="IsVisible" Value="False"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
<!-- Fullscreen: hide overlay and titlebar (popover takes over) -->
|
<!-- Fullscreen: hide overlay and titlebar (popover takes over) -->
|
||||||
<Style Selector="^:fullscreen">
|
<Style Selector="^:fullscreen">
|
||||||
<Style Selector="^ /template/ Panel#PART_TitleTextPanel">
|
<Style Selector="^ /template/ Panel#PART_TitleTextPanel">
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
<ResourceInclude Source="Calendar.axaml" />
|
<ResourceInclude Source="Calendar.axaml" />
|
||||||
<ResourceInclude Source="CalendarDatePicker.axaml" />
|
<ResourceInclude Source="CalendarDatePicker.axaml" />
|
||||||
<ResourceInclude Source="Carousel.axaml" />
|
<ResourceInclude Source="Carousel.axaml" />
|
||||||
|
<ResourceInclude Source="CarouselPage.axaml" />
|
||||||
<ResourceInclude Source="CheckBox.axaml" />
|
<ResourceInclude Source="CheckBox.axaml" />
|
||||||
<ResourceInclude Source="ComboBox.axaml" />
|
<ResourceInclude Source="ComboBox.axaml" />
|
||||||
<ResourceInclude Source="CommandBar.axaml" />
|
<ResourceInclude Source="CommandBar.axaml" />
|
||||||
@@ -37,6 +38,7 @@
|
|||||||
<ResourceInclude Source="NumericUpDown.axaml" />
|
<ResourceInclude Source="NumericUpDown.axaml" />
|
||||||
<ResourceInclude Source="NavigationPage.axaml" />
|
<ResourceInclude Source="NavigationPage.axaml" />
|
||||||
<ResourceInclude Source="PathIcon.axaml" />
|
<ResourceInclude Source="PathIcon.axaml" />
|
||||||
|
<ResourceInclude Source="PipsPager.axaml" />
|
||||||
<ResourceInclude Source="Popup.axaml" />
|
<ResourceInclude Source="Popup.axaml" />
|
||||||
<ResourceInclude Source="ProgressBar.axaml" />
|
<ResourceInclude Source="ProgressBar.axaml" />
|
||||||
<ResourceInclude Source="RadioButton.axaml" />
|
<ResourceInclude Source="RadioButton.axaml" />
|
||||||
|
|||||||
@@ -610,6 +610,9 @@
|
|||||||
<StreamGeometry x:Key="SemiIconMaximize">
|
<StreamGeometry x:Key="SemiIconMaximize">
|
||||||
M14 3.5c0-.83.67-1.5 1.5-1.5h3A3.5 3.5 0 0 1 22 5.5v3a1.5 1.5 0 0 1-3 0v-3a.5.5 0 0 0-.5-.5h-3A1.5 1.5 0 0 1 14 3.5Zm-12 2A3.5 3.5 0 0 1 5.5 2h3a1.5 1.5 0 1 1 0 3h-3a.5.5 0 0 0-.5.5v3a1.5 1.5 0 1 1-3 0v-3ZM3.5 14c.83 0 1.5.67 1.5 1.5v3c0 .28.22.5.5.5h3a1.5 1.5 0 0 1 0 3h-3A3.5 3.5 0 0 1 2 18.5v-3c0-.83.67-1.5 1.5-1.5Zm17 0c.83 0 1.5.67 1.5 1.5v3a3.5 3.5 0 0 1-3.5 3.5h-3a1.5 1.5 0 0 1 0-3h3a.5.5 0 0 0 .5-.5v-3c0-.83.67-1.5 1.5-1.5Z
|
M14 3.5c0-.83.67-1.5 1.5-1.5h3A3.5 3.5 0 0 1 22 5.5v3a1.5 1.5 0 0 1-3 0v-3a.5.5 0 0 0-.5-.5h-3A1.5 1.5 0 0 1 14 3.5Zm-12 2A3.5 3.5 0 0 1 5.5 2h3a1.5 1.5 0 1 1 0 3h-3a.5.5 0 0 0-.5.5v3a1.5 1.5 0 1 1-3 0v-3ZM3.5 14c.83 0 1.5.67 1.5 1.5v3c0 .28.22.5.5.5h3a1.5 1.5 0 0 1 0 3h-3A3.5 3.5 0 0 1 2 18.5v-3c0-.83.67-1.5 1.5-1.5Zm17 0c.83 0 1.5.67 1.5 1.5v3a3.5 3.5 0 0 1-3.5 3.5h-3a1.5 1.5 0 0 1 0-3h3a.5.5 0 0 0 .5-.5v-3c0-.83.67-1.5 1.5-1.5Z
|
||||||
</StreamGeometry>
|
</StreamGeometry>
|
||||||
|
<StreamGeometry x:Key="SemiIconMaximize2">
|
||||||
|
M5 5.5A.5.5 0 015.5 5h13a.5.5 0 01.5.5v13a.5.5 0 01-.5.5H5.5A.5.5 0 015 18.5V5.5Zm-3 0v13A3.5 3.5 0 005.5 22h13A3.5 3.5 0 0022 18.5V5A3.5 3.5 0 0018.5 2H5.5A3.5 3.5 0 002 5.5Z
|
||||||
|
</StreamGeometry>
|
||||||
<StreamGeometry x:Key="SemiIconMember">
|
<StreamGeometry x:Key="SemiIconMember">
|
||||||
M.83 7.66c-.24-.77.67-1.37 1.28-.85l1.86 1.6a3 3 0 0 0 4.68-1.04L11.1 2a1 1 0 0 1 1.82 0l2.44 5.37a3 3 0 0 0 4.68 1.03l1.86-1.59c.6-.52 1.52.08 1.28.85L19.44 19.6a2 2 0 0 1-1.91 1.4H6.47a2 2 0 0 1-1.9-1.4L.82 7.66Z
|
M.83 7.66c-.24-.77.67-1.37 1.28-.85l1.86 1.6a3 3 0 0 0 4.68-1.04L11.1 2a1 1 0 0 1 1.82 0l2.44 5.37a3 3 0 0 0 4.68 1.03l1.86-1.59c.6-.52 1.52.08 1.28.85L19.44 19.6a2 2 0 0 1-1.91 1.4H6.47a2 2 0 0 1-1.9-1.4L.82 7.66Z
|
||||||
</StreamGeometry>
|
</StreamGeometry>
|
||||||
@@ -750,6 +753,9 @@
|
|||||||
M4.5 2C3.67 2 3 2.67 3 3.5v17a1.5 1.5 0 0 0 3 0v-17C6 2.67 5.33 2 4.5 2Z
|
M4.5 2C3.67 2 3 2.67 3 3.5v17a1.5 1.5 0 0 0 3 0v-17C6 2.67 5.33 2 4.5 2Z
|
||||||
M8 11.21l 11.38-8.94a1 1 0 0 1 1.62.79v17.88a1 1 0 0 1-1.62.79L8 12.79a1 1 0 0 1 0-1.58Z
|
M8 11.21l 11.38-8.94a1 1 0 0 1 1.62.79v17.88a1 1 0 0 1-1.62.79L8 12.79a1 1 0 0 1 0-1.58Z
|
||||||
</StreamGeometry>
|
</StreamGeometry>
|
||||||
|
<StreamGeometry x:Key="SemiIconRestore">
|
||||||
|
M3 9A2 2 0 015 7H15a2 2 0 012 2V19a2 2 0 01-2 2H5A2 2 0 013 19V9Zm3 1v8h8V10H6ZM7 4c0-1.1.9-2 2-2h11a2 2 0 012 2v11a2 2 0 01-2 2h-1V5H7V4Z
|
||||||
|
</StreamGeometry>
|
||||||
<StreamGeometry x:Key="SemiIconRotate">
|
<StreamGeometry x:Key="SemiIconRotate">
|
||||||
M14.2 2.2A1 1 0 0 0 12.8.8l-2.5 2.5a1 1 0 0 0 0 1.4l2.5 2.5a1 1 0 1 0 1.4-1.4l-.79-.8H16a5 5 0 0 1 5 5v2a1 1 0 1 0 2 0v-2a7 7 0 0 0-7-7h-2.59l.8-.8Z
|
M14.2 2.2A1 1 0 0 0 12.8.8l-2.5 2.5a1 1 0 0 0 0 1.4l2.5 2.5a1 1 0 1 0 1.4-1.4l-.79-.8H16a5 5 0 0 1 5 5v2a1 1 0 1 0 2 0v-2a7 7 0 0 0-7-7h-2.59l.8-.8Z
|
||||||
M3 10c0-1.1.9-2 2-2h12a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V10Z
|
M3 10c0-1.1.9-2 2-2h12a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V10Z
|
||||||
|
|||||||
@@ -325,6 +325,9 @@
|
|||||||
<StreamGeometry x:Key="SemiIconMarginStroked">
|
<StreamGeometry x:Key="SemiIconMarginStroked">
|
||||||
M4 2a2 2 0 0 0-2 2v16c0 1.1.9 2 2 2h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H4Zm9 2h7v7h-2a1 1 0 1 0 0 2h2v7h-7v-2a1 1 0 1 0-2 0v2H4v-7h2a1 1 0 1 0 0-2H4V4h7v2a1 1 0 1 0 2 0V4ZM9 8a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V9a1 1 0 0 0-1-1H9Zm1 6v-4h4v4h-4Z
|
M4 2a2 2 0 0 0-2 2v16c0 1.1.9 2 2 2h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H4Zm9 2h7v7h-2a1 1 0 1 0 0 2h2v7h-7v-2a1 1 0 1 0-2 0v2H4v-7h2a1 1 0 1 0 0-2H4V4h7v2a1 1 0 1 0 2 0V4ZM9 8a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V9a1 1 0 0 0-1-1H9Zm1 6v-4h4v4h-4Z
|
||||||
</StreamGeometry>
|
</StreamGeometry>
|
||||||
|
<StreamGeometry x:Key="SemiIconMaximize2Stroked">
|
||||||
|
M4 4H21V20H4V4ZM2 3V21a1 1 0 001 1H22a1 1 0 001-1V3A1 1 0 0022 2H3A1 1 0 002 3Z
|
||||||
|
</StreamGeometry>
|
||||||
<StreamGeometry x:Key="SemiIconMicrophoneStroked">
|
<StreamGeometry x:Key="SemiIconMicrophoneStroked">
|
||||||
M16 21a1 1 0 1 1 0 2H8a1 1 0 1 1 0-2h8Zm3-10.5a1 1 0 0 1 1 1 8 8 1 1 1-16 0 1 1 0 1 1 2 0 6 6 0 0 0 12 0 1 1 0 0 1 1-1ZM12 1a4.5 4.5 0 0 1 4.5 4.5v6a4.5 4.5 1 1 1-9 0v-6A4.5 4.5 0 0 1 12 1Zm0 2a2.5 2.5 0 0 0-2.5 2.5v6a2.5 2.5 0 0 0 5 0v-6A2.5 2.5 0 0 0 12 3Z
|
M16 21a1 1 0 1 1 0 2H8a1 1 0 1 1 0-2h8Zm3-10.5a1 1 0 0 1 1 1 8 8 1 1 1-16 0 1 1 0 1 1 2 0 6 6 0 0 0 12 0 1 1 0 0 1 1-1ZM12 1a4.5 4.5 0 0 1 4.5 4.5v6a4.5 4.5 1 1 1-9 0v-6A4.5 4.5 0 0 1 12 1Zm0 2a2.5 2.5 0 0 0-2.5 2.5v6a2.5 2.5 0 0 0 5 0v-6A2.5 2.5 0 0 0 12 3Z
|
||||||
</StreamGeometry>
|
</StreamGeometry>
|
||||||
@@ -408,6 +411,9 @@
|
|||||||
<StreamGeometry x:Key="SemiIconReplyStroked">
|
<StreamGeometry x:Key="SemiIconReplyStroked">
|
||||||
m3.88 12 5.68 5.98V16.5a3 3 0 0 1 3.01-3c2.3 0 4.44.06 6.26.85.45.2.86.42 1.24.69a7.63 7.63 0 0 0-1.64-2.9c-1.3-1.43-3.27-2.43-6-2.6A3.05 3.05 0 0 1 9.56 6.5v-.48L3.88 12Zm16.6 6.25c-1.81-2.53-3.94-2.73-7.92-2.75a1 1 0 0 0-1 1v4a1 1 0 0 1-1.71.69l-8.07-8.5a1 1 0 0 1 0-1.38l8.07-8.5a1 1 0 0 1 1.71.7v3c0 .55.45.99 1 1.02 6.22.4 9.8 4.6 9.94 10.14a13.2 13.2 0 0 1-.03.77c-.04.35-.1.8-.2 1.18-.1.35-.2.64-.33.7-.13.05-.28-.02-.43-.33a14.18 14.18 0 0 0-1.03-1.74Z
|
m3.88 12 5.68 5.98V16.5a3 3 0 0 1 3.01-3c2.3 0 4.44.06 6.26.85.45.2.86.42 1.24.69a7.63 7.63 0 0 0-1.64-2.9c-1.3-1.43-3.27-2.43-6-2.6A3.05 3.05 0 0 1 9.56 6.5v-.48L3.88 12Zm16.6 6.25c-1.81-2.53-3.94-2.73-7.92-2.75a1 1 0 0 0-1 1v4a1 1 0 0 1-1.71.69l-8.07-8.5a1 1 0 0 1 0-1.38l8.07-8.5a1 1 0 0 1 1.71.7v3c0 .55.45.99 1 1.02 6.22.4 9.8 4.6 9.94 10.14a13.2 13.2 0 0 1-.03.77c-.04.35-.1.8-.2 1.18-.1.35-.2.64-.33.7-.13.05-.28-.02-.43-.33a14.18 14.18 0 0 0-1.03-1.74Z
|
||||||
</StreamGeometry>
|
</StreamGeometry>
|
||||||
|
<StreamGeometry x:Key="SemiIconRestoreStroked">
|
||||||
|
M22 16a2 2 0 01-2 2V4H6c0-1.1.9-2 2-2h12a2 2 0 012 2v12ZM2 8c0-1.1.9-2 2-2h12a2 2 0 012 2v12a2 2 0 01-2 2H4a2 2 0 01-2-2V8ZM4 8V20H16V8H4Z
|
||||||
|
</StreamGeometry>
|
||||||
<StreamGeometry x:Key="SemiIconRingChartStroked">
|
<StreamGeometry x:Key="SemiIconRingChartStroked">
|
||||||
M20.95 13A9 9 0 1 1 11 3.05V7.1a5 5 0 1 0 5.9 5.9h4.05Zm0-2H16.9A5 5 0 0 0 13 7.1V3.05A9 9 0 0 1 20.95 11ZM23 12a11 11 0 1 1-22 0 11 11 0 0 1 22 0Zm-8 0a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z
|
M20.95 13A9 9 0 1 1 11 3.05V7.1a5 5 0 1 0 5.9 5.9h4.05Zm0-2H16.9A5 5 0 0 0 13 7.1V3.05A9 9 0 0 1 20.95 11ZM23 12a11 11 0 1 1-22 0 11 11 0 0 1 22 0Zm-8 0a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z
|
||||||
</StreamGeometry>
|
</StreamGeometry>
|
||||||
|
|||||||
@@ -4,17 +4,18 @@
|
|||||||
<Styles.Resources>
|
<Styles.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.ThemeDictionaries>
|
<ResourceDictionary.ThemeDictionaries>
|
||||||
<ResourceInclude x:Key="Default" Source="/Schemes/LightScheme.axaml" />
|
<ResourceInclude x:Key="Default" Source="/Themes/Light/_index.axaml" />
|
||||||
<ResourceInclude x:Key="Dark" Source="/Schemes/DarkScheme.axaml" />
|
<ResourceInclude x:Key="Light" Source="/Themes/Light/_index.axaml" />
|
||||||
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Aquatic}" Source="/Schemes/AquaticScheme.axaml" />
|
<ResourceInclude x:Key="Dark" Source="/Themes/Dark/_index.axaml" />
|
||||||
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Desert}" Source="/Schemes/DesertScheme.axaml" />
|
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Aquatic}" Source="/Themes/HighContrast/_index.axaml" />
|
||||||
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Dusk}" Source="/Schemes/DuskScheme.axaml" />
|
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Desert}" Source="/Themes/HighContrast/_index.axaml" />
|
||||||
<ResourceInclude x:Key="{x:Static semi:SemiTheme.NightSky}" Source="/Schemes/NightSkyScheme.axaml" />
|
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Dusk}" Source="/Themes/HighContrast/_index.axaml" />
|
||||||
|
<ResourceInclude x:Key="{x:Static semi:SemiTheme.NightSky}" Source="/Themes/HighContrast/_index.axaml" />
|
||||||
</ResourceDictionary.ThemeDictionaries>
|
</ResourceDictionary.ThemeDictionaries>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<ResourceInclude Source="/Controls/_index.axaml" />
|
<ResourceInclude Source="/Controls/_index.axaml" />
|
||||||
<ResourceInclude Source="/Themes/Shared/_index.axaml" />
|
<ResourceInclude Source="/Themes/Shared/_index.axaml" />
|
||||||
<ResourceInclude Source="/Tokens/Variables.axaml" />
|
<ResourceInclude Source="/Tokens/_index.axaml" />
|
||||||
<ResourceInclude Source="/Locale/zh-cn.axaml" />
|
<ResourceInclude Source="/Locale/zh-cn.axaml" />
|
||||||
<semi:Icons />
|
<semi:Icons />
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
|||||||
@@ -3,3 +3,5 @@
|
|||||||
[assembly: XmlnsPrefix("https://irihi.tech/semi", "semi")]
|
[assembly: XmlnsPrefix("https://irihi.tech/semi", "semi")]
|
||||||
[assembly: XmlnsDefinition("https://irihi.tech/semi", "Semi.Avalonia")]
|
[assembly: XmlnsDefinition("https://irihi.tech/semi", "Semi.Avalonia")]
|
||||||
[assembly: XmlnsDefinition("https://irihi.tech/semi", "Semi.Avalonia.Converters")]
|
[assembly: XmlnsDefinition("https://irihi.tech/semi", "Semi.Avalonia.Converters")]
|
||||||
|
[assembly: XmlnsDefinition("https://irihi.tech/semi", "Semi.Avalonia.Tokens")]
|
||||||
|
[assembly: XmlnsDefinition("https://irihi.tech/semi", "Semi.Avalonia.Tokens.Palette")]
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
||||||
<ResourceDictionary.MergedDictionaries>
|
|
||||||
<ResourceInclude Source="/Tokens/HighContrast/Aquatic.axaml" />
|
|
||||||
<ResourceInclude Source="/Themes/HighContrast/_index.axaml" />
|
|
||||||
</ResourceDictionary.MergedDictionaries>
|
|
||||||
</ResourceDictionary>
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
||||||
<ResourceDictionary.MergedDictionaries>
|
|
||||||
<ResourceInclude Source="/Tokens/Palette/Dark.axaml" />
|
|
||||||
<ResourceInclude Source="/Themes/Dark/_index.axaml" />
|
|
||||||
</ResourceDictionary.MergedDictionaries>
|
|
||||||
</ResourceDictionary>
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
||||||
<ResourceDictionary.MergedDictionaries>
|
|
||||||
<ResourceInclude Source="/Tokens/HighContrast/Desert.axaml" />
|
|
||||||
<ResourceInclude Source="/Themes/HighContrast/_index.axaml" />
|
|
||||||
</ResourceDictionary.MergedDictionaries>
|
|
||||||
</ResourceDictionary>
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
||||||
<ResourceDictionary.MergedDictionaries>
|
|
||||||
<ResourceInclude Source="/Tokens/HighContrast/Dusk.axaml" />
|
|
||||||
<ResourceInclude Source="/Themes/HighContrast/_index.axaml" />
|
|
||||||
</ResourceDictionary.MergedDictionaries>
|
|
||||||
</ResourceDictionary>
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
||||||
<ResourceDictionary.MergedDictionaries>
|
|
||||||
<ResourceInclude Source="/Tokens/Palette/Light.axaml" />
|
|
||||||
<ResourceInclude Source="/Themes/Light/_index.axaml" />
|
|
||||||
</ResourceDictionary.MergedDictionaries>
|
|
||||||
</ResourceDictionary>
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
||||||
<ResourceDictionary.MergedDictionaries>
|
|
||||||
<ResourceInclude Source="/Tokens/HighContrast/NightSky.axaml" />
|
|
||||||
<ResourceInclude Source="/Themes/HighContrast/_index.axaml" />
|
|
||||||
</ResourceDictionary.MergedDictionaries>
|
|
||||||
</ResourceDictionary>
|
|
||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
|
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
|
||||||
<Version>12.0.0-preview2</Version>
|
<Version>12.0.0</Version>
|
||||||
<PackageReleaseNotes>Update to Semi.Avalonia 12.0.0-preview2</PackageReleaseNotes>
|
<PackageReleaseNotes>Update to Semi.Avalonia 12.0.0</PackageReleaseNotes>
|
||||||
<Title>Semi.Avalonia</Title>
|
<Title>Semi.Avalonia</Title>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -5,19 +5,20 @@
|
|||||||
<Styles.Resources>
|
<Styles.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.ThemeDictionaries>
|
<ResourceDictionary.ThemeDictionaries>
|
||||||
<ResourceInclude x:Key="Default" Source="/Schemes/LightScheme.axaml" />
|
<ResourceInclude x:Key="Default" Source="/Themes/Light/_index.axaml" />
|
||||||
<ResourceInclude x:Key="Dark" Source="/Schemes/DarkScheme.axaml" />
|
<ResourceInclude x:Key="Light" Source="/Themes/Light/_index.axaml" />
|
||||||
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Aquatic}" Source="/Schemes/AquaticScheme.axaml" />
|
<ResourceInclude x:Key="Dark" Source="/Themes/Dark/_index.axaml" />
|
||||||
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Desert}" Source="/Schemes/DesertScheme.axaml" />
|
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Aquatic}" Source="/Themes/HighContrast/_index.axaml" />
|
||||||
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Dusk}" Source="/Schemes/DuskScheme.axaml" />
|
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Desert}" Source="/Themes/HighContrast/_index.axaml" />
|
||||||
<ResourceInclude x:Key="{x:Static semi:SemiTheme.NightSky}" Source="/Schemes/NightSkyScheme.axaml" />
|
<ResourceInclude x:Key="{x:Static semi:SemiTheme.Dusk}" Source="/Themes/HighContrast/_index.axaml" />
|
||||||
|
<ResourceInclude x:Key="{x:Static semi:SemiTheme.NightSky}" Source="/Themes/HighContrast/_index.axaml" />
|
||||||
</ResourceDictionary.ThemeDictionaries>
|
</ResourceDictionary.ThemeDictionaries>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<ResourceInclude Source="/Controls/_index.axaml" />
|
<ResourceInclude Source="/Controls/_index.axaml" />
|
||||||
<ResourceInclude Source="/Themes/Shared/_index.axaml" />
|
<ResourceInclude Source="/Themes/Shared/_index.axaml" />
|
||||||
<ResourceInclude Source="/Tokens/Variables.axaml" />
|
<ResourceInclude Source="/Tokens/_index.axaml" />
|
||||||
<ResourceInclude Source="/Locale/zh-cn.axaml" />
|
<ResourceInclude Source="/Locale/zh-cn.axaml" />
|
||||||
<ResourceInclude Source="/Icons/_index.axaml" />
|
<semi:Icons />
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</Styles.Resources>
|
</Styles.Resources>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Globalization;
|
|||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Styling;
|
using Avalonia.Styling;
|
||||||
|
using Irihi.Avalonia.Shared.Helpers;
|
||||||
using Semi.Avalonia.Locale;
|
using Semi.Avalonia.Locale;
|
||||||
|
|
||||||
namespace Semi.Avalonia;
|
namespace Semi.Avalonia;
|
||||||
@@ -36,43 +37,27 @@ public class SemiTheme : Styles
|
|||||||
|
|
||||||
private static readonly ResourceDictionary DefaultResource = new zh_cn();
|
private static readonly ResourceDictionary DefaultResource = new zh_cn();
|
||||||
|
|
||||||
private CultureInfo? _locale;
|
|
||||||
|
|
||||||
public CultureInfo? Locale
|
public CultureInfo? Locale
|
||||||
{
|
{
|
||||||
get => _locale;
|
get;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (TryGetLocaleResource(value, out var resource) && resource is not null)
|
if (TryGetLocaleResource(value, out var resource) && resource is not null)
|
||||||
{
|
{
|
||||||
_locale = value;
|
field = value;
|
||||||
if (Resources is ResourceDictionary rd)
|
Resources.BulkSetResources(resource);
|
||||||
{
|
|
||||||
rd.SetItems(resource);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach (var kv in resource) Resources[kv.Key] = kv.Value;
|
field = new CultureInfo("zh-CN");
|
||||||
}
|
Resources.BulkSetResources(DefaultResource);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_locale = new CultureInfo("zh-CN");
|
|
||||||
if (Resources is ResourceDictionary rd)
|
|
||||||
{
|
|
||||||
rd.SetItems(DefaultResource);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
foreach (var kv in DefaultResource) Resources[kv.Key] = kv.Value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
_locale = CultureInfo.InvariantCulture;
|
field = CultureInfo.InvariantCulture;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -105,28 +90,13 @@ public class SemiTheme : Styles
|
|||||||
{
|
{
|
||||||
if (culture is null) return;
|
if (culture is null) return;
|
||||||
if (!LocaleToResource.TryGetValue(culture, out var resources)) return;
|
if (!LocaleToResource.TryGetValue(culture, out var resources)) return;
|
||||||
|
application.Resources.BulkSetResources(resources);
|
||||||
if (application.Resources is ResourceDictionary rd)
|
|
||||||
{
|
|
||||||
rd.SetItems(resources);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
foreach (var kv in resources) application.Resources[kv.Key] = kv.Value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void OverrideLocaleResources(StyledElement element, CultureInfo? culture)
|
public static void OverrideLocaleResources(StyledElement element, CultureInfo? culture)
|
||||||
{
|
{
|
||||||
if (culture is null) return;
|
if (culture is null) return;
|
||||||
if (!LocaleToResource.TryGetValue(culture, out var resources)) return;
|
if (!LocaleToResource.TryGetValue(culture, out var resources)) return;
|
||||||
if (element.Resources is ResourceDictionary rd)
|
element.Resources.BulkSetResources(resources);
|
||||||
{
|
|
||||||
rd.SetItems(resources);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
foreach (var kv in resources) element.Resources[kv.Key] = kv.Value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -25,7 +25,4 @@
|
|||||||
<StaticResource x:Key="CheckBoxCardPressedBackground" ResourceKey="SemiColorFill1" />
|
<StaticResource x:Key="CheckBoxCardPressedBackground" ResourceKey="SemiColorFill1" />
|
||||||
<StaticResource x:Key="CheckBoxCardCheckedPointeroverBorderBrush" ResourceKey="SemiColorPrimaryPointerover" />
|
<StaticResource x:Key="CheckBoxCardCheckedPointeroverBorderBrush" ResourceKey="SemiColorPrimaryPointerover" />
|
||||||
<StaticResource x:Key="CheckBoxCardCheckedPressedBorderBrush" ResourceKey="SemiColorPrimaryActive" />
|
<StaticResource x:Key="CheckBoxCardCheckedPressedBorderBrush" ResourceKey="SemiColorPrimaryActive" />
|
||||||
|
|
||||||
<!-- Obsolete -->
|
|
||||||
<StaticResource x:Key="CheckBoxGlyphDisabledFill" ResourceKey="SemiColorWhite" />
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
<!-- AppBarButton / AppBarToggleButton -->
|
<!-- CommandBarButton / CommandBarToggleButton -->
|
||||||
<SolidColorBrush x:Key="AppBarButtonBackground" Color="Transparent" />
|
<SolidColorBrush x:Key="CommandBarButtonBackground" Color="Transparent" />
|
||||||
<StaticResource x:Key="AppBarButtonForeground" ResourceKey="SemiColorText0" />
|
<StaticResource x:Key="CommandBarButtonForeground" ResourceKey="SemiColorText0" />
|
||||||
<StaticResource x:Key="AppBarButtonPointeroverBackground" ResourceKey="SemiColorFill0" />
|
<StaticResource x:Key="CommandBarButtonPointeroverBackground" ResourceKey="SemiColorFill0" />
|
||||||
<StaticResource x:Key="AppBarButtonPressedBackground" ResourceKey="SemiColorFill1" />
|
<StaticResource x:Key="CommandBarButtonPressedBackground" ResourceKey="SemiColorFill1" />
|
||||||
<StaticResource x:Key="AppBarButtonDisabledForeground" ResourceKey="SemiColorDisabledText" />
|
<StaticResource x:Key="CommandBarButtonDisabledForeground" ResourceKey="SemiColorDisabledText" />
|
||||||
<!-- AppBarToggleButton checked state -->
|
<!-- CommandBarToggleButton checked state -->
|
||||||
<StaticResource x:Key="AppBarToggleButtonCheckedForeground" ResourceKey="SemiColorPrimary" />
|
<StaticResource x:Key="CommandBarToggleButtonCheckedForeground" ResourceKey="SemiColorPrimary" />
|
||||||
<StaticResource x:Key="AppBarToggleButtonCheckedBackground" ResourceKey="SemiColorPrimaryLight" />
|
<StaticResource x:Key="CommandBarToggleButtonCheckedBackground" ResourceKey="SemiColorPrimaryLight" />
|
||||||
<StaticResource x:Key="AppBarToggleButtonCheckedPointeroverBackground" ResourceKey="SemiColorPrimaryLightPointerover" />
|
<StaticResource x:Key="CommandBarToggleButtonCheckedPointeroverBackground" ResourceKey="SemiColorPrimaryLightPointerover" />
|
||||||
<StaticResource x:Key="AppBarToggleButtonCheckedPressedBackground" ResourceKey="SemiColorPrimaryLightActive" />
|
<StaticResource x:Key="CommandBarToggleButtonCheckedPressedBackground" ResourceKey="SemiColorPrimaryLightActive" />
|
||||||
<StaticResource x:Key="AppBarToggleButtonCheckedDisabledForeground" ResourceKey="SemiColorPrimaryDisabled" />
|
<StaticResource x:Key="CommandBarToggleButtonCheckedDisabledForeground" ResourceKey="SemiColorPrimaryDisabled" />
|
||||||
<!-- AppBarSeparator -->
|
<!-- CommandBarSeparator -->
|
||||||
<StaticResource x:Key="AppBarSeparatorBackground" ResourceKey="SemiColorBorder" />
|
<StaticResource x:Key="CommandBarSeparatorBackground" ResourceKey="SemiColorBorder" />
|
||||||
<!-- CommandBar -->
|
<!-- CommandBar -->
|
||||||
<StaticResource x:Key="CommandBarBackground" ResourceKey="SemiColorBackground1" />
|
<StaticResource x:Key="CommandBarBackground" ResourceKey="SemiColorBackground1" />
|
||||||
<StaticResource x:Key="CommandBarForeground" ResourceKey="SemiColorText0" />
|
<StaticResource x:Key="CommandBarForeground" ResourceKey="SemiColorText0" />
|
||||||
|
|||||||
@@ -4,10 +4,6 @@
|
|||||||
<StaticResource x:Key="DrawerPageForeground" ResourceKey="SemiColorText0" />
|
<StaticResource x:Key="DrawerPageForeground" ResourceKey="SemiColorText0" />
|
||||||
<!-- Top bar -->
|
<!-- Top bar -->
|
||||||
<StaticResource x:Key="DrawerPageTopBarBackground" ResourceKey="SemiColorBackground1" />
|
<StaticResource x:Key="DrawerPageTopBarBackground" ResourceKey="SemiColorBackground1" />
|
||||||
<StaticResource x:Key="DrawerPageTopBarBorderBrush" ResourceKey="SemiColorBorder" />
|
|
||||||
<!-- Drawer pane -->
|
|
||||||
<StaticResource x:Key="DrawerPageDrawerBackground" ResourceKey="SemiColorNavBackground" />
|
|
||||||
<!-- Pane button -->
|
<!-- Pane button -->
|
||||||
<SolidColorBrush x:Key="DrawerPagePaneButtonBackground" Color="Transparent" />
|
|
||||||
<StaticResource x:Key="DrawerPagePaneButtonForeground" ResourceKey="SemiColorText0" />
|
<StaticResource x:Key="DrawerPagePaneButtonForeground" ResourceKey="SemiColorText0" />
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
|||||||
@@ -102,12 +102,4 @@
|
|||||||
<StaticResource x:Key="LabelTagColorfulGradientGhostBorderBrush" ResourceKey="SemiColorAIGeneral" />
|
<StaticResource x:Key="LabelTagColorfulGradientGhostBorderBrush" ResourceKey="SemiColorAIGeneral" />
|
||||||
<StaticResource x:Key="LabelTagColorfulGradientSolidForeground" ResourceKey="SemiColorWhite" />
|
<StaticResource x:Key="LabelTagColorfulGradientSolidForeground" ResourceKey="SemiColorWhite" />
|
||||||
<StaticResource x:Key="LabelTagColorfulGradientSolidBackground" ResourceKey="SemiColorAIGeneral" />
|
<StaticResource x:Key="LabelTagColorfulGradientSolidBackground" ResourceKey="SemiColorAIGeneral" />
|
||||||
|
|
||||||
<!-- Obsolete -->
|
|
||||||
<StaticResource x:Key="LabelTagLightWhiteForeground" ResourceKey="LabelTagSolidWhiteForeground" />
|
|
||||||
<StaticResource x:Key="LabelTagLightWhiteBackground" ResourceKey="LabelTagSolidWhiteBackground" />
|
|
||||||
<StaticResource x:Key="LabelTagLightWhiteBorderBrush" ResourceKey="LabelTagSolidWhiteBorderBrush" />
|
|
||||||
<StaticResource x:Key="LabelTagGhostWhiteForeground" ResourceKey="LabelTagSolidWhiteForeground" />
|
|
||||||
<StaticResource x:Key="LabelTagGhostWhiteBackground" ResourceKey="LabelTagSolidWhiteBackground" />
|
|
||||||
<StaticResource x:Key="LabelTagGhostWhiteBorderBrush" ResourceKey="LabelTagSolidWhiteBorderBrush" />
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -1,14 +1,5 @@
|
|||||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
<!-- NavigationPage -->
|
|
||||||
<StaticResource x:Key="NavigationPageBackground" ResourceKey="SemiColorBackground0" />
|
|
||||||
<StaticResource x:Key="NavigationPageForeground" ResourceKey="SemiColorText0" />
|
|
||||||
<!-- Navigation bar -->
|
<!-- Navigation bar -->
|
||||||
<StaticResource x:Key="NavigationPageBarBackground" ResourceKey="SemiColorBackground1" />
|
<StaticResource x:Key="NavigationPageBarBackground" ResourceKey="SemiColorBackground1" />
|
||||||
<StaticResource x:Key="NavigationPageBarForeground" ResourceKey="SemiColorText0" />
|
|
||||||
<StaticResource x:Key="NavigationPageBarBorderBrush" ResourceKey="SemiColorBorder" />
|
<StaticResource x:Key="NavigationPageBarBorderBrush" ResourceKey="SemiColorBorder" />
|
||||||
<!-- Back button -->
|
|
||||||
<SolidColorBrush x:Key="NavigationPageBackButtonBackground" Color="Transparent" />
|
|
||||||
<StaticResource x:Key="NavigationPageBackButtonForeground" ResourceKey="SemiColorText0" />
|
|
||||||
<StaticResource x:Key="NavigationPageBackButtonPointeroverBackground" ResourceKey="SemiColorFill0" />
|
|
||||||
<StaticResource x:Key="NavigationPageBackButtonPressedBackground" ResourceKey="SemiColorFill1" />
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
|||||||
9
src/Semi.Avalonia/Themes/Dark/PipsPager.axaml
Normal file
9
src/Semi.Avalonia/Themes/Dark/PipsPager.axaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
<SolidColorBrush x:Key="PipsPagerButtonForeground" Opacity="0.5" Color="{StaticResource SemiWhiteColor}" />
|
||||||
|
<SolidColorBrush x:Key="PipsPagerButtonPointeroverForeground" Color="{StaticResource SemiWhiteColor}" />
|
||||||
|
<SolidColorBrush x:Key="PipsPagerIndicatorForeground" Opacity="0.5" Color="{StaticResource SemiWhiteColor}" />
|
||||||
|
<SolidColorBrush x:Key="PipsPagerIndicatorPointeroverForeground" Opacity="0.7" Color="{StaticResource SemiWhiteColor}" />
|
||||||
|
<SolidColorBrush x:Key="PipsPagerIndicatorPressedForeground" Color="{StaticResource SemiWhiteColor}" />
|
||||||
|
<SolidColorBrush x:Key="PipsPagerIndicatorSelectedForeground" Color="{StaticResource SemiWhiteColor}" />
|
||||||
|
</ResourceDictionary>
|
||||||
@@ -2,7 +2,6 @@
|
|||||||
<StaticResource x:Key="ProgressBarIndicatorBrush" ResourceKey="SemiColorPrimary" />
|
<StaticResource x:Key="ProgressBarIndicatorBrush" ResourceKey="SemiColorPrimary" />
|
||||||
<StaticResource x:Key="ProgressBarBackground" ResourceKey="SemiColorFill0" />
|
<StaticResource x:Key="ProgressBarBackground" ResourceKey="SemiColorFill0" />
|
||||||
<StaticResource x:Key="ProgressBarTextForeground" ResourceKey="SemiColorText0" />
|
<StaticResource x:Key="ProgressBarTextForeground" ResourceKey="SemiColorText0" />
|
||||||
<StaticResource x:Key="ProgressBarOuterTextForeground" ResourceKey="SemiColorText0" />
|
|
||||||
<SolidColorBrush x:Key="ProgressBarRootBorderBrush" Color="Transparent" />
|
<SolidColorBrush x:Key="ProgressBarRootBorderBrush" Color="Transparent" />
|
||||||
<StaticResource x:Key="ProgressBarPrimaryForeground" ResourceKey="SemiColorPrimary" />
|
<StaticResource x:Key="ProgressBarPrimaryForeground" ResourceKey="SemiColorPrimary" />
|
||||||
<StaticResource x:Key="ProgressBarSecondaryForeground" ResourceKey="SemiColorSecondary" />
|
<StaticResource x:Key="ProgressBarSecondaryForeground" ResourceKey="SemiColorSecondary" />
|
||||||
@@ -10,6 +9,4 @@
|
|||||||
<StaticResource x:Key="ProgressBarSuccessForeground" ResourceKey="SemiColorSuccess" />
|
<StaticResource x:Key="ProgressBarSuccessForeground" ResourceKey="SemiColorSuccess" />
|
||||||
<StaticResource x:Key="ProgressBarWarningForeground" ResourceKey="SemiColorWarning" />
|
<StaticResource x:Key="ProgressBarWarningForeground" ResourceKey="SemiColorWarning" />
|
||||||
<StaticResource x:Key="ProgressBarDangerForeground" ResourceKey="SemiColorDanger" />
|
<StaticResource x:Key="ProgressBarDangerForeground" ResourceKey="SemiColorDanger" />
|
||||||
<!-- Error style is obsolete, use Danger instead -->
|
|
||||||
<StaticResource x:Key="ProgressBarErrorForeground" ResourceKey="SemiColorDanger" />
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -19,4 +19,7 @@
|
|||||||
<StaticResource x:Key="TabItemButtonHeaderSelectedBackground" ResourceKey="SemiColorPrimaryLight" />
|
<StaticResource x:Key="TabItemButtonHeaderSelectedBackground" ResourceKey="SemiColorPrimaryLight" />
|
||||||
<StaticResource x:Key="TabItemButtonHeaderPointeroverBackground" ResourceKey="SemiColorFill0" />
|
<StaticResource x:Key="TabItemButtonHeaderPointeroverBackground" ResourceKey="SemiColorFill0" />
|
||||||
<StaticResource x:Key="TabItemButtonHeaderPressedBackground" ResourceKey="SemiColorFill1" />
|
<StaticResource x:Key="TabItemButtonHeaderPressedBackground" ResourceKey="SemiColorFill1" />
|
||||||
|
|
||||||
|
<StaticResource x:Key="TabItemIconSelectedForeground" ResourceKey="SemiColorPrimary" />
|
||||||
|
<StaticResource x:Key="TabItemHeaderDisabledForeground" ResourceKey="SemiColorDisabledText" />
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -7,5 +7,6 @@
|
|||||||
<StaticResource x:Key="CaptionButtonCloseForeground" ResourceKey="SemiColorWhite" />
|
<StaticResource x:Key="CaptionButtonCloseForeground" ResourceKey="SemiColorWhite" />
|
||||||
<StaticResource x:Key="CaptionButtonClosePointeroverBackground" ResourceKey="SemiColorDangerPointerover" />
|
<StaticResource x:Key="CaptionButtonClosePointeroverBackground" ResourceKey="SemiColorDangerPointerover" />
|
||||||
<StaticResource x:Key="CaptionButtonClosePressedBackground" ResourceKey="SemiColorDangerActive" />
|
<StaticResource x:Key="CaptionButtonClosePressedBackground" ResourceKey="SemiColorDangerActive" />
|
||||||
<StaticResource x:Key="CaptionButtonForeground" ResourceKey="SemiColorText2" />
|
<StaticResource x:Key="CaptionButtonForeground" ResourceKey="SemiColorText1" />
|
||||||
|
<StaticResource x:Key="CaptionButtonDisabledForeground" ResourceKey="SemiColorDisabledText" />
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user