Skip to content

Conversation

@nicolaihenriksen
Copy link
Contributor

As mentioned in discussion #3201, there is something that does not work as expected with the elevation in combination with GroupBox.

The demo app already includes a sample of a GroupBox with elevation only applied on the header (ColorZone), so I am assuming this is a needed feature, and thus this PR will retain it.

image

However, if the GroupBox has a border, or a background, or is using the "card" style, then I would also assume elevation should work, but that does not seem to be the case.

It currently looks like this:
image
You'll notice that the elevation is still only applied at the header. This seems wrong to me.

This PR changes it into this instead:
image

Since the drop shadow is done using an DropShadowEffect, there is a bit of funkyness to this. If the GroupBox.Background property is left at its default value (Transparent), then the effect is applied only at the header to retain the current feature. However, if the it is set to any other value, then the effect is applied at the root grid instead, which effectively - in the case of a "reasonably opaque" brush - will let the shadow cover the whole body of the GroupBox. You can of course provide a funky value with a very low opacity and then you may not get the result you want. I could not really see any other good way to solve this. Hints/input is very welcome.

Another thing: I removed the use of the ShadowAssist.ShadowEdges attached property as I don't believe it has any effect. Perhaps it needs to be removed completely as part of the 5.0 release?

@Keboo Keboo added enhancement visual breaking change Items here have affected the visual look of controls. release notes Items are likely to be highlighted in the release notes. labels May 26, 2023
@Keboo Keboo enabled auto-merge (squash) May 26, 2023 16:36
@Keboo Keboo merged commit 2549ba4 into master May 26, 2023
@Keboo Keboo deleted the groupBoxElevation branch May 26, 2023 16:50
@nicolaihenriksen nicolaihenriksen added this to the 4.10.0 milestone May 26, 2023
@Keboo Keboo modified the milestones: 4.10.0, 5.0.0 Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement release notes Items are likely to be highlighted in the release notes. visual breaking change Items here have affected the visual look of controls.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants