Posted 15 years ago
by Robert A. McCarter

My main application window has a number of docking ToolWindows. Several of these tool windows seem to take quite a while to initialize (they have background graphics and complex controls). This really slows down the application's start-up time; when the main window calls InitializeComponent() it takes about 5 seconds to complete!
Additionally, once the main window has finished this initialization I actually call Close() on a number of the ToolWindow instances because they are only used later in the application (once the user has opened a document for example, at which point I call the tool window's Open() method).
Thus, it is very frustrating that these tool windows are taking so long to initialize. Additionally, these tool windows are visible for a very brief second before my code can close them (which looks quite bad).
Ideally, in the XAML I could indicate that the initial state of the tool windows is closed, so that they do not need to be initialized and do not appear initially. Unfortunately, looking at the ToolWindow API this doesn't seem possible.
The only other alternative I can come up with is to put the tool window XAML as a resource, and then in code when I want to display the window create the resource and try and add it to the correct docking location (this seems very tricky... how can I easily add something to the right or to the bottom?). This is unfortunate (not just becuase I have to code the solution myself, but also) because it makes it much harder to leverage the built-in docking layout persistence features of your product.
Actipro team - please help! I'm definitely open to suggestions.
Thank you very much,
Robert
[Modified at 09/07/2010 09:29 PM]
Additionally, once the main window has finished this initialization I actually call Close() on a number of the ToolWindow instances because they are only used later in the application (once the user has opened a document for example, at which point I call the tool window's Open() method).
Thus, it is very frustrating that these tool windows are taking so long to initialize. Additionally, these tool windows are visible for a very brief second before my code can close them (which looks quite bad).
Ideally, in the XAML I could indicate that the initial state of the tool windows is closed, so that they do not need to be initialized and do not appear initially. Unfortunately, looking at the ToolWindow API this doesn't seem possible.
The only other alternative I can come up with is to put the tool window XAML as a resource, and then in code when I want to display the window create the resource and try and add it to the correct docking location (this seems very tricky... how can I easily add something to the right or to the bottom?). This is unfortunate (not just becuase I have to code the solution myself, but also) because it makes it much harder to leverage the built-in docking layout persistence features of your product.
Actipro team - please help! I'm definitely open to suggestions.
Thank you very much,
Robert
[Modified at 09/07/2010 09:29 PM]