Exception:ControlTemplate 的 TargetType 必须是 Control、Page、PageFunctionBase 或相同的子类。“StackPanel”类型无效。

报错信息

ArgumentException: ControlTemplate 的 TargetType 必须是 Control、Page、PageFunctionBase 或相同的子类。“StackPanel”类型无效。
--Message: ControlTemplate 的 TargetType 必须是 Control、Page、PageFunctionBase 或相同的子类。“StackPanel”类型无效。
StackTrace:
   在 System.Windows.Controls.ControlTemplate.ValidateTargetType(Type targetType, String argName)
   在 System.Windows.Controls.ControlTemplate..ctor(Type targetType)
   在 DynamicClass.MainViewModel.添加右键菜单到画布()
   在 DynamicClass.MainViewModel.InitializeComponent()
   在 DynamicClass.MainViewModel..ctor()
   在 DynamicClass.a.<OnWindowCreated>d__e.MoveNext()
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

 

解决方法

暂无解决方案。

相关信息
1 查看
17天5小时前
Quicker版本
版本 反馈次数
1.44.23 1