2010-12-18 4 views
0

컨텍스트는 Windows Phone 7 용 Silverlight 응용 프로그램입니다. 에뮬레이터를 사용하여 디버깅하고 있습니다.ViewModel에서 속성을 업데이트 한 후 NotImplementedException 0x80004001

DataContext에 ViewModel이 첨부 된 MainPage.xaml이 있습니다.
페이지가 NavigatedTo 일 때 ViewModel에서 메소드를 호출하여 API를 호출하고 정보를 표시합니다.

나는 Dictionary<string, string>을 생성하고 데이터로 채우고 PropertyChanged 이벤트를 구현하는 속성에 설정하는 방법이 있습니다.

이 메서드를 호출하면 디버거가 NotImplementedException을 사용하여 App.Application_UnhandledException에서 중단됩니다.

디버거를 사용하여이 메서드 호출을 건너 뛸 경우 예외가 발생하지 않습니다.

이상한 점은 메서드를 호출 한 후에 예외가 발생한다는 것입니다. 예외에는 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 측에서 데이터 바인딩을 검사하여 사용자 오류를 발견했습니다. 나는 그것이 정적 자원의 작성 잊었

<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입니다