Exception:“MyButton”的类型初始值设定项引发异常。FrameworkElementFactory 已是父级。

报错信息

TypeInitializationException: “MyButton”的类型初始值设定项引发异常。
--TypeName: MyButton
StackTrace:
   在 DynamicClass.cc.<初始化>d__fd.MoveNext()
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   在 DynamicClass.a.<OnWindowCreated>d__2.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)

ArgumentException: FrameworkElementFactory 已是父级。
--Message: FrameworkElementFactory 已是父级。
StackTrace:
   在 System.Windows.FrameworkElementFactory.AppendChild(FrameworkElementFactory child)
   在 DynamicClass.MyButton.创建按钮模板()
   在 DynamicClass.MyButton..cctor()

 

解决方法

暂无解决方案。

相关信息
1 查看
22天3小时前
Quicker版本
版本 反馈次数
1.44.5 1