如下Xaml文件, 在 Silverlight 4 中会报错。
<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="SilverlightStudy.MainPage" Width="640" Height="480"> <TextBlock> <Hyperlink NavigateUri="http://www.msn.com" >MSN Home Hyperlink> TextBlock> UserControl>
错误信息:
Hyperlink 不支持将 nothing 作为内容。 [Line: 7 Position: 66]
在 Microsoft Expression Blend Preview for .NET 4 中,我们会看到错误信息:
参考资料:
Hyperlink should be able to be inserted in a textblock
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=511958
Bugs fixed (or not) in Silverlight 4 Beta
http://www.olsonsoft.com/blogs/stefanolson/post/Bugs-fixed-(or-not)-in-Silverlight-4-Beta.aspx