首页 > 解决方案 > WPF DependencyProperty.UnsetValue 抛出“System.InvalidOperationException”

问题描述

我有一个 WPF 应用程序System.InvalidOperationException,由于. 堆栈跟踪和调试输出没有提示是谁导致了异常。这是堆栈跟踪:AltCtrlDependencyProperty.UnsetValue

WindowsBase.dll!System.Windows.DependencyObject.GetEffectiveValue(System.Windows.EntryIndex entryIndex, System.Windows.DependencyProperty dp, System.Windows.RequestFlags requests)     Unknown
WindowsBase.dll!System.Windows.DependencyObject.GetValueEntry(System.Windows.EntryIndex entryIndex, System.Windows.DependencyProperty dp, System.Windows.PropertyMetadata metadata, System.Windows.RequestFlags requests)          Unknown
WindowsBase.dll!System.Windows.DependencyObject.GetValue(System.Windows.DependencyProperty dp)         Unknown
PresentationFramework.dll!System.Windows.FrameworkElement.FocusVisualStyle.get()       Unknown
PresentationFramework.dll!System.Windows.Input.KeyboardNavigation.ShowFocusVisual(System.Windows.DependencyObject element)            Unknown
PresentationFramework.dll!System.Windows.Input.KeyboardNavigation.ProcessInput(System.Windows.Input.InputEventArgs inputEventArgs)              Unknown
PresentationCore.dll!System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(System.Windows.Input.ProcessInputEventHandler postProcessInput, System.Windows.Input.ProcessInputEventArgs processInputEventArgs)    Unknown
PresentationCore.dll!System.Windows.Input.InputManager.ProcessStagingArea()      Unknown
PresentationCore.dll!System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs input)   Unknown
PresentationCore.dll!System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport inputReport)     Unknown
PresentationCore.dll!System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(System.IntPtr hwnd, System.Windows.Input.InputMode mode, int timestamp, System.Windows.Input.RawKeyboardActions actions, int scanCode, bool isExtendedKey, bool isSystemKey, int virtualKey)   Unknown
PresentationCore.dll!System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(ref System.Windows.Interop.MSG msg, ref bool handled)               Unknown
PresentationCore.dll!System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(ref System.Windows.Interop.MSG msg, System.Windows.Input.ModifierKeys modifiers)               Unknown
PresentationCore.dll!System.Windows.Interop.HwndSource.OnPreprocessMessage(object param)                Unknown
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs)            Unknown
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, System.Delegate callback, object args, int numArgs, System.Delegate catchHandler)   Unknown
WindowsBase.dll!System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, int numArgs)          Unknown
WindowsBase.dll!System.Windows.Threading.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority priority, System.Delegate method, object arg) Unknown
PresentationCore.dll!System.Windows.Interop.HwndSource.OnPreprocessMessageThunk(ref System.Windows.Interop.MSG msg, ref bool handled)               Unknown
WindowsBase.dll!System.Windows.Interop.ComponentDispatcherThread.RaiseThreadMessage(ref System.Windows.Interop.MSG msg)    Unknown
WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame frame)  Unknown
PresentationFramework.dll!System.Windows.Application.RunDispatcher(object ignore)          Unknown
PresentationFramework.dll!System.Windows.Application.RunInternal(System.Windows.Window window)                Unknown
>             ProInspectX14x64.exe!ProInspectX.App.Main() Line 48              C#

我如何了解FrameworkElement导致异常的原因?

标签: c#wpf

解决方案


推荐阅读