I have a Window that has a UserControl. What i want to accomplish is Bind the ActualHeight of the StackPanel (stackpanel doesn't have a fixed size) that contains the UserControl in order to achive the correct behavior of the WrapPanel inside the UserControl.
I've tried Height="{Binding ElementName=MyStackPanel, Path=ActualHeight}"
and Height="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type StackPanel}}, Path=ActualHeight}"
but it didn't worked.
The way i place the UserControl inside the Window's StackPanel is as follows:
<StackPanel x:Name="MyStackPanel" Orientation="Vertical">
<!-- Wrap Panel / UserControl-->
<local:WrapControl />
</StackPanel>
If it helps the Main Window is a devexpress DXRibbonWindow
.