我刚刚将 silverlight 浏览器插件更新到 v5,并意识到我的全功能 silverlight 4 应用程序根本没有运行。这很奇怪,因为 silverlight 5 插件应该是完全向后兼容的吧?然后我下载了适用于 Visual Studio 2010 SP1 的 Silverlight 5 工具以及适用于 Windows(32 位)的 Silverlight 5 Developer Runtime 以开始调试。
现在我已经深入研究了这个问题,并意识到是几个控制在 Canvas 中导致了问题,即以下在 VS2010 中引发了灾难性故障:
<UserControl x:Class="Logo.SilverlightControl2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="White">
<Canvas >
<TextBlock Canvas.Left="120" Canvas.Top="110" Height="23" Name="TextBlock1" Text="TextBlock" />
</Canvas>
</Grid>
</UserControl>
一定有我遗漏的东西,任何人都可以知道发生了什么吗?
更新: 似乎我无法在Silverlight 展示中查看单个 Silverlight 5 应用程序。他们每个人都只是显示一个空白的白色区域。也许我的插件安装有问题?