c# - 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
导致异常的原因?
解决方案
推荐阅读
- entity-framework - 访问孩子的子属性的计数
- java - 将 Mac OS 升级到 Big Sur(v11.0.1) 后 Java 运行不佳
- php - 如何限制对 slim 4 端点的访问以仅允许浏览器扩展 ajax 请求
- kubernetes - 为每个 pod 运行 cron 作业的 Spring Boot 调度程序
- .net-core - .Net Core Odata 响应错过了元数据值
- excel - 如何使用excel在6列中获得“是”和“否”的排列?
- javascript - Angular Rxjs 运算符,帮助我们在某些变量更改时开始发射
- c# - 如何在 C# 中解析部分不完整的 JSON
- reactjs - 提交登录和注册按钮后如何重定向到 React 中的个人资料页面?
- c# - Discord.Net - 检查用户是否具有 ManageServer 权限