Allow negative ZIndexes

When ZIndexBehavior.Sibling is enabled, we’ll need negative ZIndex values to avoid having to awkwardly restructure our UI hierarchy. For example, I want an image border behind a button: Ideally I would create the image, parent it to the button, and then set its ZIndex to -1 so it would layer under the button even though ZIndexBehavior.Sibling is enabled.

With ZIndex values constrained to > 0, I would have to parent the button to its own border so all code becomes root.border.button instead of root.button – this is unwanted because logically a border is an attribute of a button (it doesn’t make sense the other way around), and it bloats the references to the button instance.

5 Likes