tags:

views:

51

answers:

1

I have setup a StackPanel with a set of controls. Each control is an instance of the same class. The control is also a stack panel and has another custom control in it. So:

StackPanel:
     CustomControl1:
           StackPanel:
                  CustomControl2:
                         ListBox
     CustomControl1:
           StackPanel:
                  CustomControl2:
                         ListBox
     CustomControl1:
           StackPanel:
                  CustomControl2:
                         ListBox

The RenderTransform is applied at the top stack panel. As expected, all child controls scale accordingly. This is great until I get to this last Listbox control. In that case, I want the scale to either be ignored, or handled differently (likly in the inverse direction).

Is there any way to exclude a control from the transformation? Alternativly, can I evaluate the transformation from within the Listbox?

thanks

+1  A: 

You could apply exactly the inverse of the transformation, though it may take some time to get just right.

If doing this in code, you could use VisualTreeHelper to walk up the tree and read the right values.

Alternatively, might you do some kind of creative:

StackPanel:
 StackPanel: APPLY transformation HERE instead for the first 2
  CustomControl1:
        StackPanel:
               CustomControl2:
                      ListBox
  CustomControl1:
        StackPanel:
               CustomControl2:
                      ListBox
 CustomControl1:
       StackPanel:
              CustomControl2:
                     ListBox
Jeff Wilcox