Silverlight Viewbox 不适用于 IE9

发布于 2024-11-19 15:20:54 字数 1609 浏览 5 评论 0原文

我正在开发一个用于小型和大型显示器的 silverlight 应用程序,

我的代码运行良好,我的主页包含一个视图框,所有控件都是该视图框的子级,并且它们确实可以正确缩放,我一直在 IE9 上进行测试整个时间。

最近 VS2010 崩溃了,这在处理 silverlight 时经常发生,自从这次崩溃后 IE9 拒绝正确显示我的 Viewbox。

Chrome / Opera / Firefox / Safari 都有正确的行为,但 IE9 不再有。

当应用程序启动时,其初始大小是正确的,但几秒钟后它似乎脱离了视图框。

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>

以下图像显示了该页面在 IE 和 Chrome 中的外观。

Chrome 浏览器分辨率约为 800x600(正确) Chrome 缩放正确

IE 分辨率约为 800x600(不正确) IE 缩放不正确

两者都使用相同的 XAP 文件,该应用程序以前从未在 Chrome 上运行过,所以它也不应该被缓存在测试之前清除缓存的方式。

以前有人遇到过类似的问题吗?有没有什么办法可以让这个在 IE 上工作?

这是 silverlight 或 IE 的错误吗?

任何帮助将不胜感激

谢谢

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浊酒尽余欢 2024-11-26 15:20:54

您是否曾通过控制鼠标滚轮缩放 IE 显示?

您已在 ViewBox 上指定了最小显示尺寸,因此您应该将该 ViewBox 包含在 ScrollViewer 中,以防它不适合。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文