System.Windows.Markup.XamlParseException发生在调试的Windows Phone应用程序调试仿真器上如何做一个Windows Phone应用程序时

问题描述:

我得到这个错误我去解决这个错误System.Windows.Markup.XamlParseException发生在调试的Windows Phone应用程序调试仿真器上如何做一个Windows Phone应用程序时

 
System.Windows.Markup.XamlParseException occurred 
    Message=Cannot find a Resource with the Name/Key PhoneTitlePanelStyle [Line: 34 Position: 34] 
    LineNumber=34 
    LinePosition=34 
    StackTrace: 
     at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator) 
     at notepadApp.MainPage.InitializeComponent() 
     at notepadApp.MainPage..ctor() 
     at System.Reflection.RuntimeConstructorInfo.InternalInvoke(RuntimeConstructorInfo rtci, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess, StackCrawlMark& stackMark) 
     at System.Reflection.RuntimeConstructorInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, StackCrawlMark& stackMark) 
     at System.Activator.InternalCreateInstance(Type type, Boolean nonPublic, StackCrawlMark& stackMark) 
     at System.Activator.CreateInstance(Type type) 
     at System.Windows.Navigation.PageResourceContentLoader.BeginLoad_OnUIThread(AsyncCallback userCallback, PageResourceContentLoaderAsyncResult result) 
     at System.Windows.Navigation.PageResourceContentLoader.c__DisplayClass4.b__0(Object args) 
     at System.Reflection.RuntimeMethodInfo.InternalInvoke(RuntimeMethodInfo rtmi, Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess, StackCrawlMark& stackMark) 
     at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, StackCrawlMark& stackMark) 
     at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) 
     at System.Delegate.DynamicInvokeOne(Object[] args) 
     at System.MulticastDelegate.DynamicInvokeImpl(Object[] args) 
     at System.Delegate.DynamicInvoke(Object[] args) 
     at System.Windows.Threading.DispatcherOperation.Invoke() 
     at System.Windows.Threading.Dispatcher.Dispatch(DispatcherPriority priority) 
     at System.Windows.Threading.Dispatcher.OnInvoke(Object context) 
     at System.Windows.Hosting.CallbackCookie.Invoke(Object[] args) 
     at System.Windows.Hosting.DelegateWrapper.InternalInvoke(Object[] args) 
     at System.Windows.RuntimeHost.ManagedHost.InvokeDelegate(IntPtr pHandle, Int32 nParamCount, ScriptParam[] pParams, ScriptParam& pResult)
+0

这是因为您缺少'PhoneTitlePanelStyle'资源。因此,无论是添加样式,还是可以从xaml中删除该样式引用。 – asitis 2013-03-11 12:32:04

的错误是不言自明的。您正尝试使用不存在的PhoneTitlePanelStyle风格

+0

对错误感到非常困惑,因为我需要在xaml页面上使用PhoneTitlePanelStyle资源来创建一些样式,我如何将它作为参考包含在内 – user1802674 2013-03-11 13:03:32