views:

17

answers:

2

Hello,

I'm wondering how I can do something like this (Excuse my code if it's incorrect, I'm going with psuedo):

<Canvas>
   <StackPanel Canvas.ZIndex="2"> <!-- StackPanel 1 -->

   </StackPanel>
   <StackPanel Canvas.ZIndex="2"> <!-- StackPanel 2 -->

   </StackPanel>
   <StackPanel Canvas.ZIndex="1"> <!-- StackPanel 3 -->
       <!--More StackPanels etc here-->
       <StackPanel Canvas.ZIndex="3"> <!-- StackPanel 4 -->

       </StackPanel>
   </StackPanel>
</Canvas>

What I want to happen is to:

Have stackPanel 1 on top of everything but 4

Have Stack panel 2 on top of everything but 4

Stack Panel 3 under all other ones

Stack Panel 4 on top of everything.

What's happening now is that stack panel 4 is taking on stack panel 1's ZIndex and it's under everything.

Any Ideas?

A: 

Never mind, I was able to pull stackpanel 4 to a sibling level instead of a child.

Aaron
A: 

As you appear to already have discovered. The ZIndex is used only to sort out the relative rendering priority of items that siblings to each other.

AnthonyWJones