Skip to content

Expander in SettingsExpander ignores CornerRadius when Expanded #499

@naumenkoff

Description

@naumenkoff

Describe the bug

I noticed that the SettingsExpander becomes square when expanded, even though I have set the CornerRadius to 8. I subscribed to the Expanded event and confirmed that the CornerRadius never changes, i.e., it always stays 8. However, the Expander becomes square. If I try to change the CornerRadius in the Expanded event handler, due to what might be a race condition, the changes are not applied. But if I apply the change with a delay of about 50 ms, the changes are applied, and the Expander remains rounded when expanded.
image
image

Steps to reproduce

1. Add a `SettingsExpander` to the layout.
2. Set the `CornerRadius` to 8 or any other value.
3. Run the application.
4. Notice that the `SettingsExpander` is rounded when collapsed.
5. Expand the `SettingsExpander`.
6. Notice that the `SettingsExpander` becomes square when expanded.

Expected behavior

A) There should be a way to customize the CornerRadius for both the collapsed and expanded states (e.g., CornerRadius="16 16 16 16" when collapsed, ExpandedCornerRadius="8 8 0 0" when expanded, but this would require a new property - ExpandedCornerRadius).
B) The Expander.CornerRadius should match the SettingsExpander.CornerRadius, applying a converter that only affects TopLeft and TopRight (i.e., setting BottomLeft and BottomRight to 0). As I understand, if the expansion happens downward, ExpandDown -> TopCornerRadiusFilterConverter should be applied, but something goes wrong, and Expander.CornerRadius is set to [0, 0, 0, 0].

Screenshots

No response

Code Platform

  • UWP
  • WinAppSDK / WinUI 3
  • Web Assembly (WASM)
  • Android
  • iOS
  • MacOS
  • Linux / GTK

Windows Build Number

  • Windows 10 1809 (Build 17763)
  • Windows 10 1903 (Build 18362)
  • Windows 10 1909 (Build 18363)
  • Windows 10 2004 (Build 19041)
  • Windows 10 20H2 (Build 19042)
  • Windows 10 21H1 (Build 19043)
  • Windows 10 21H2 (Build 19044)
  • Windows 10 22H2 (Build 19045)
  • Windows 11 21H2 (Build 22000)
  • Other (specify)

Other Windows Build number

No response

App minimum and target SDK version

  • Windows 10, version 1809 (Build 17763)
  • Windows 10, version 1903 (Build 18362)
  • Windows 10, version 1909 (Build 18363)
  • Windows 10, version 2004 (Build 19041)
  • Windows 10, version 2104 (Build 20348)
  • Windows 11, version 22H2 (Build 22000)
  • Other (specify)

Other SDK version

No response

Visual Studio Version

2022, Preview

Visual Studio Build Number

17.11.0 Preview 5.0

Device form factor

Desktop

Additional context

CommunityToolkit.WinUI.Controls.SettingsControls Version: 8.1.240821

Help us help you

No, I'm unable to contribute a solution.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcomponents::controls::settingscontrolsCreate a Windows 11 style settings experiences with these controls.help wantedExtra attention is neededux 🖌️Everything design related

Type

No type

Projects

Status

🔖 Ready

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions