Midimatt
Midimatt

Reputation: 1114

Silverlight Viewbox not working with IE9

I'm developing a silverlight application for use on small and large monitors,

I had the code working perfectly, my main page contains a viewbox and all controls are children of that viewbox and they did scale correctly, i've been testing on IE9 the whole time.

Recently VS2010 crashed which is does quite frequently when dealing with silverlight, ever since this crash IE9 refuses to display my Viewbox correctly.

Chrome / Opera / Firefox / Safari all have the correct behaviour but not IE9 anymore.

When the application starts, its initial size is correct but after a few seconds it seems to break out of the viewbox.

MainPage.xaml

<Viewbox MinHeight="600" MinWidth="800">
    <Grid Width="1024" Height="768" Background="White" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="25">
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <sdk:Frame Grid.Row="0" Style="{StaticResource FrameStyle}" Source="{Binding SelectedPage.PageUri}" NavigationFailed="Frame_NavigationFailed" />
        <Border Grid.Row="1" BorderBrush="#FFD4D2D2" Background="White" BorderThickness="1 0 1 1">
            <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
               ...
            </StackPanel>
        </Border>
    </Grid>
</Viewbox>

the following images show what the page looks like in IE and Chrome.

Chrome at roughly 800x600 (Correct) Chrome Scaling Correctly

IE at roughly 800x600 (Incorrect) IE Scaling incorrectly

Both are using the same XAP file the app was never run on chrome before so it shouldnt have been cached, either way the cache was cleared before testing.

Has anyone had a problem similar to this before? are there any work arounds to make this work on IE?

Is this a bug with silverlight or IE?

Any help would really be appreciated

Thanks

Upvotes: 1

Views: 744

Answers (1)

iCollect.it Ltd
iCollect.it Ltd

Reputation: 93601

Have you control-mouse-wheel zoomed the IE display by any chance?

You have specified minimum display sizes on the ViewBox, so you should probably contain that ViewBox in a ScrollViewer in case it does not fit.

Upvotes: 3

Related Questions