walter,
I’ve developed a sample that replicates the behavior that I’m having. How can I send it to you?
Basically, this is how it looks:
<Grid x:Name="LayoutRoot" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="50" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ScrollViewer Grid.Column="1" Grid.Row="1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<Grid Grid.Column="0" Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Stretch">
<Border Margin="5 5 5 5" HorizontalAlignment="Stretch">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
<TextBlock Text="Field 1" VerticalAlignment="Center" />
<TextBox HorizontalAlignment="Stretch" VerticalAlignment="Center" />
</StackPanel>
</Border>
<Border Margin="5 5 5 5" HorizontalAlignment="Stretch">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
<TextBlock Text="Field 2" VerticalAlignment="Center" />
<TextBox HorizontalAlignment="Stretch" VerticalAlignment="Center" />
</StackPanel>
</Border>
<Border Margin="5 5 5 5" HorizontalAlignment="Stretch">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
<TextBlock Text="Field 3" VerticalAlignment="Center" />
<TextBox HorizontalAlignment="Stretch" VerticalAlignment="Center" />
</StackPanel>
</Border>
</StackPanel>
<local:OrgChartEditor HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch"
VerticalAlignment="Stretch" VerticalContentAlignment="Stretch"
Grid.Row="1" Grid.Column="0" />
</Grid>
</Grid>
</ScrollViewer>
</Grid>
In order to replicate the behavior, you need to keep adding nodes to the last leaf. When the diagram height overcomes the height of the OrgChartEditor control, this control resizes, making vertical scrollbar in the parent control to appear.
Thanks in advance
Rodrigo Guerreiro