WPF DependencyProperty.UnsetValue выдает «System.InvalidOperationException» - PullRequest
0 голосов
/ 14 декабря 2018

У меня есть приложение WPF, которое выдает System.InvalidOperationException при нажатии клавиш Alt или Ctrl из-за DependencyProperty.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 вызывает исключение?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...