2010-12-18 11 views
0

コンテキストは、Windows Phone 7用のSilverlightアプリケーションです。エミュレータでデバッグしています。ViewModelのプロパティを更新した後、NotImplementedException 0x80004001が返される

私はMainPage.xamlのDataContextにViewModelを添付しています。
ページがNavigatedToの場合、ViewModelでメソッドが呼び出され、APIを呼び出して情報を表示します。

Dictionary<string, string>を作成し、データで埋めて、PropertyChangedイベントを実装するプロパティに設定する方法があります。

このメソッドを呼び出すと、デバッガはApp.Application_UnhandledExceptionでNotImplementedExceptionで中断します。

このメソッドの呼び出しをデバッガでスキップすると、例外は発生しません。

奇妙なことは、メソッドを呼び出した後に例外が発生していることです。例外にはInnerExceptionはありません。 -2147467263のHResultと "0x80004001"を含むメッセージがあります。ここではスタックトレースにある:

at MS.Internal.XcpImports.CheckHResult(UInt32 hr) 
at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize) 
at System.Windows.FrameworkElement.MeasureOverride(Size availableSize) 
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight) 
at MS.Internal.XcpImports.MeasureNative(IntPtr element, Single inWidth, Single inHeight) 
at MS.Internal.XcpImports.UIElement_Measure(UIElement element, Size availableSize) 
at System.Windows.UIElement.Measure(Size availableSize) 
at Microsoft.Phone.Controls.Primitives.PanoramaPanel.MeasureOverride(Size availableSize) 
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight) 
at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight) 
at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize) 
at System.Windows.FrameworkElement.MeasureOverride(Size availableSize) 
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight) 
at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight) 
at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize) 
at System.Windows.FrameworkElement.MeasureOverride(Size availableSize) 
at Microsoft.Phone.Controls.Panorama.MeasureOverride(Size availableSize) 
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight) 
at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight) 
at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize) 
at System.Windows.FrameworkElement.MeasureOverride(Size availableSize) 
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight) 
at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight) 
at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize) 
at System.Windows.FrameworkElement.MeasureOverride(Size availableSize) 
at Microsoft.Phone.Controls.PhoneApplicationFrame.MeasureOverride(Size availableSize) 
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight) 

デバッグ出力には含まれています

A first chance exception of type 'System.ArgumentNullException' occurred in mscorlib.dll (x10) 
A first chance exception of type 'System.NotImplementedException' occurred in System.Windows.dll (x6) 

答えて

1

OHWを。私は、XAML側のデータバインディングをチェックすることによってユーザーエラーを発見しました。私はそれが静的リソースのwriteするのを忘れて

<TextBlock Grid.Column="0" Text="{Binding Value}" 
      Style="PhoneTextLargeStyle" /> 
<TextBlock Grid.Column="1" Text="{Binding Key}" 
      Style="PhoneTextLargeStyle" /> 

:この愚かな質問/自動応答が誰かを助ける

<TextBlock Grid.Column="0" Text="{Binding Value}" 
      Style="{StaticResource PhoneTextLargeStyle}" /> 
<TextBlock Grid.Column="1" Text="{Binding Key}" 
      Style="{StaticResource PhoneTextLargeStyle}" /> 

レッツ希望が

を:)ここに私のXAMLです
関連する問題