Windows Phone-XamlParseException
当导航到我的页面时,我得到一个XAMLParseExection。问题似乎与toolkit TiltEffect或TransitionService有关:Windows Phone-XamlParseException,xaml,windows-phone-8,windows-phone,silverlight-toolkit,Xaml,Windows Phone 8,Windows Phone,Silverlight Toolkit,当导航到我的页面时,我得到一个XAMLParseExection。问题似乎与toolkit TiltEffect或TransitionService有关: System.Windows.Markup.XamlParseException HResult=-2146233087 Message=Unknown parser error: Scanner 2147500037. [Line: 16 Position: 38] Source=System.Windows LineNum
System.Windows.Markup.XamlParseException
HResult=-2146233087
Message=Unknown parser error: Scanner 2147500037. [Line: 16 Position: 38]
Source=System.Windows
LineNumber=16
LinePosition=38
StackTrace:
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
at ContactChooser.ContactChooserPage.InitializeComponent()
at ContactChooser.ContactChooserPage..ctor()
InnerException:
最后一行是16号:
<phone:PhoneApplicationPage
x:Class="ContactChooser.ContactChooserPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
mc:Ignorable="d"
shell:SystemTray.IsVisible="True"
toolkit:TiltEffect.IsTiltEnabled="True">
我认为您不应该在整个页面上使用倾斜效果,而应该只在要启用倾斜功能的控件上使用。我发现了问题所在。我的解决方案中有两个项目:使用TiltEffect的主项目和测试主项目的示例项目。这个问题的解决方案是,我需要在两个项目上都添加对工具箱的引用,而不仅仅是在使用该组件的项目上。您发布的代码片段没有问题。您能否显示该问题的完整副本,并确认您使用的工具包版本。我使用的是WPToolkit的4.2012.10.30版本。如果在代码中设置工具箱的另一个控件,例如PhoneTextBox,则会出现相同的错误。工具箱本身似乎有问题?如果您在页面级别设置它,它将应用于它支持的页面中存在的所有控件。如果你有很多控件并且想将其应用于所有控件,那么它比将效果应用于单个控件要简单得多。是的,你必须在所有使用它的项目中引用它。