Viewbox disappears on restoring the WPF window down

319 views Asked by At

I have a Viewbox Control that contains a WindowsFormsHost which in turn acts as a container to display images.

<Viewbox Grid.Row="1" Grid.Column="1" Stretch="Fill" MinHeight="50" MinWidth="50">
   <WindowsFormsHost  Width="100" Height="100" Name="ImageSegment" Background="Black"/>
</Viewbox>  

With the above code, the ViewBox appears and resizes accordingly. But the Viewbox disappears once it is restored down to a below specified Width.

<Viewbox Grid.Row="1" Grid.Column="1" Stretch="Fill" Height="875" Width="975">
   <WindowsFormsHost  Width="100" Height="100" Name="ImageSegment" Background="Black"/> 
</Viewbox>

If i give it this way, Viewbox stays, but its auto-scaling property is lost. Is there a way to get around this problem? Why it occurs? Thanks in Advance!

0

There are 0 answers