I'm trying to familiarize myself with the DocumentManager control, specifically the MetroView portion of it. The application seems to be working well, except that, when I right-click and press the Exit button from the top bar to close the application, it crashes in Application.Run(new Main()) with a "Object reference not set to an instance of an object." exception. This is the stack trace:
at DevExpress.XtraBars.Docking2010.Views.MetroUI.BaseContentContainerActionsBarInfo.DevExpress.XtraBars.Docking2010.IButtonsPanelOwner.Invalidate()
at DevExpress.XtraBars.Docking2010.ButtonsPanelHandler.Invalidate()
at DevExpress.XtraBars.Docking2010.BaseButtonHandler.OnMouseUp(MouseEventArgs e)
at DevExpress.XtraBars.Docking2010.Views.MetroUI.BaseContentContainerActionsBarInfo.DevExpress.XtraBars.Docking2010.Views.IInteractiveElementInfo.ProcessMouseUp(MouseEventArgs e)
at DevExpress.XtraBars.Docking2010.Customization.NavigationAdornerElementInfoArgs.OnMouseUp(Point screenPoint)
at DevExpress.XtraBars.Docking2010.Customization.NavigationAdornerBootStrapper.System.Windows.Forms.IMessageFilter.PreFilterMessage(Message& m)
at System.Windows.Forms.Application.ThreadContext.ProcessFilters(MSG& msg, Boolean& modified)
at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)
at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FPreTranslateMessage(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at iAIM.Program.Main() in C:\Users\aa\Desktop\RP\Test LINQ\iAIM\iAIM\Program.cs:line 22
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
It's almost as if the application is attempting to run twice. But I'm not quite sure why. Any thoughts on why this might be occurring?
I have not managed to reproduce this issue on my side. Please modify my project to illustrate it.
I've added a PageGroup and User Control. If you click on the tile and then right-click and select Exit you will see the crash. Obviously I'm doing something wrong when I'm hooking up the document/user control logic. Please advice.