我正在尝试在 Visual Studio 中加载 xaml 文件,但它引发了异常,但是当我运行应用程序时,设计和所有功能都非常好。例外情况如下:
InvalidCastException: Unable to cast object of type 'System.Windows.Application' to type 'Omnia.PIE.VTA.App'.
at Omnia.PIE.VTA.MainWindow.get_Instance()
at Omnia.PIE.VTA.Views.AccountHolderInfo.UserControl_Loaded(Object sender, RoutedEventArgs e)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
提前抱歉,但我是视觉工作室的初学者,花了几个小时后我仍然无法解决它。