views:

104

answers:

1

I'm working on a Prism Composite application where I load different views into a region. I need to make sure that the view I'm loading is resized to the same height as the region. Each view is a usercontrol that has a Grid as the outer element. I'm using the following code

    <Grid  Height="{Binding RelativeSource={RelativeSource FindAncestor,
        AncestorType={x:Type ItemsControl}}, Path=ActualHeight}">

To set the height of the grid. My problem is that this exact code works fine for one view and doesn't for another view. On the grid that doesn't work, the height is what I would expect as if the Height property is not being set.

Any suggestions on how to trouble shoot this.

+2  A: 

Without knowing much, I'd say this issue really just boils down to a binding issue. Debugging bindings is tricky, but there is a really great article on the subject here: http://www.beacosta.com/blog/?p=52

Use the "diagnostics:PresentationTraceSources.TraceLevel=High" approach that Bea describes and find out what element you are actually binding to by watching the output window. That ought to help figure out why it's failing.

Good luck.

Anderson Imes
Thanks, that pointed me in the right direction
photo_tom