Skip to content

Fix for issue 2667 - Tab header drop shadow z-order#2819

Merged
Keboo merged 1 commit intoMaterialDesignInXAML:masterfrom
nicolaihenriksen:fix2667
Aug 20, 2022
Merged

Fix for issue 2667 - Tab header drop shadow z-order#2819
Keboo merged 1 commit intoMaterialDesignInXAML:masterfrom
nicolaihenriksen:fix2667

Conversation

@nicolaihenriksen
Copy link
Copy Markdown
Contributor

@nicolaihenriksen nicolaihenriksen commented Aug 18, 2022

Fix for #2667

This defaults the tab header of the TabControl to Panel.ZIndex="1" which makes the shadow appear on top of TabItems as I believe is the desired default.

I also added a binding on the content such that you can have the content cover the drop shadow in case you desire to do so; that is accomplished simply by adding Panel.ZIndex="2" (or higher) on the TabControl itself.

Ideally I thought it would be cool if this behavior could be controlled per TabItem. To do that I wanted the PropertyPath on the binding in line 81 to look something akin to Path='SelectedItem.(Panel.ZIndex)', which essentially would first pick out the TabControl.SelectedItem, on which it would then pick out the Panel.ZIndex attached property. However, I am not able to get a working syntax to accomplish that. Perhaps you know the syntax?

Another way to semi-accomplish it is by binding to SelectedItem in line 81 and then using a converter to pick out the value of the attached property Panel.ZIndex. However, this has the downside that changes to the Panel.ZIndex value on the TabItems will only be reflected when the user changes tab (because the Path of the binding does not change, only the attached property value which the converter picks out). Not really sure whether I prefer that over the current approach in the PR.

@nicolaihenriksen nicolaihenriksen changed the title Fix for issue 2667 - tab header drop shadow Fix for issue 2667 - Tab header drop shadow z-order Aug 18, 2022
@Keboo Keboo added this to the 4.6.0 milestone Aug 20, 2022
@Keboo Keboo merged commit bb8dd40 into MaterialDesignInXAML:master Aug 20, 2022
@nicolaihenriksen nicolaihenriksen deleted the fix2667 branch August 20, 2022 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants