ArgumentException: 已添加项。字典中的关键字:“DynamicClass+MyButton”所添加的关键字:“DynamicClass+MyButton” --Message: 已添加项。字典中的关键字:“DynamicClass+MyButton”所添加的关键字:“DynamicClass+MyButton” StackTrace: 在 System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) 在 System.Windows.ResourceDictionary.AddWithoutLock(Object key, Object value) 在 System.Windows.ResourceDictionary.Add(Object key, Object value) 在 DynamicClass.cc.<初始化>d__ed.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)