Silverlight Viewbox 不适用于 IE9
我正在开发一个用于小型和大型显示器的 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(正确)
IE 分辨率约为 800x600(不正确)
两者都使用相同的 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)
IE at roughly 800x600 (Incorrect)
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否曾通过控制鼠标滚轮缩放 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.