2013-07-08 27 views
3

在windows phone 8中,如果有一個xaml文件引用後面的代碼中的OnFooClick事件處理程序,如果它碰巧存在另一個OnFooClick方法在同一個類上具有不同的簽名,應用程序在啓動時吹了與此異常:異常時,有一個事件處理程序的重載

MS.Internal.WrappedException: Error HRESULT E_FAIL has been returned from a call to a COM component. ---> System.Exception: Error HRESULT E_FAIL has been returned from a call to a COM component. at MS.Internal.XcpImports.CheckHResult(UInt32 hr) at MS.Internal.XcpImports.UIElement_Measure_WithDesiredSize(UIElement element, Size availableSize) at System.Windows.UIElement.Measure_WithDesiredSize(Size availableSize) at System.Windows.Controls.VirtualizingStackPanel.MeasureChild(UIElement child, Size layoutSlotSize) at System.Windows.Controls.VirtualizingStackPanel.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Double inWidth, Double inHeight, Double& outWidth, Double& outHeight) --- End of inner exception stack trace ---

這是一個錯誤,還是我做錯了什麼?

+0

你找到一個解決方案?我遇到了完全相同的問題,至少我有完全相同的異常消息。我已經用完了想法,請有人在這裏幫忙... –

+1

只需重命名方法 –

+0

謝謝你發佈這個,Gustavo! –

回答

0

這個例外是因爲綁定不好。你有沒有在你的xaml中使用任何工具包。如果你試圖在工具包下綁定任何值,有時候會出現這種異常。

0

這個問題談到,如果我們通過只是給喜歡聲明 X忘了名字控制:NAME =「」

相關問題