InvalidCastException: 无法将类型为“System.String”的对象强制转换为类型“System.Windows.Controls.StackPanel”。 StackTrace: 在 DynamicClass.<>c__DisplayClass5.<OnWindowLoaded>b__3(<>f__AnonymousType0`2 x) 在 System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext() 在 System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) 在 System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) 在 DynamicClass.<>c__DisplayClass5.<OnWindowLoaded>b__1(Object s, EventArgs e) 在 System.EventHandler.Invoke(Object sender, EventArgs e) 在 System.Windows.Window.OnClosed(EventArgs e) 在 System.Windows.Window.WmDestroy() 在 System.Windows.Window.WindowFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 在 System.Windows.Interop.HwndSource.PublicHooksFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 在 MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) 在 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)