Delay loading content of auto-hide ToolWindows

Docking/MDI for WPF Forum

Posted 7 years ago by Martin Wagner - H. Stoll GmbH & Co. KG
Version: 12.1.0560
Avatar

Hi,

I have a lot of ToolWindows with large content. Most of them are set to auto-hide. The initialization of the main window takes a lot of time because all the content is loaded at startup. 

I have implemented a solution that the content of the ToolWindows is only created when it is going to be visible. That works fine for all states of toolwindows but no for the auto-hide ones. It seems that the set of the content property forces no refresh of the ToolWindow. It opens with no content. If I set to float or dock it works. Thre content is shown correctly. 

Is there a way to force the update of the content for auto-hide toolwindows?

Thanks,

Martin

Comments (3)

Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Martin,

I would think that it would work ok but perhaps there is a bug here.  Could you make a new simple sample project that has an auto-hide window and shows the issue, and e-mail that to our support address?  Please rename the .zip file extension so it doesn't get spam blocked.

Also, are you doing this initialization in a DockSite.WindowOpening event handler?  That is typically a good place to do a first-time initialization if the specified tool window hasn't been initialized yet, since it occurs before the tool window is opened into the layout.


Actipro Software Support

Posted 7 years ago by Martin Wagner - H. Stoll GmbH & Co. KG
Avatar

Thanks for the quick answer.

 

I do this inititalization in the IsWindowVisible event handler because I want to create the content only if the toolwindow is going to be first visible. But I found a workaround that works great:

I added a ContentPresenter control as content of the ToolWindow. If first visible event comes in, the content of the ContentPresenter is set to my UserControl and the ToolWindow shows the correct content. 

Do you want to have the sample anyway?

Thanks,

Martin

Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Martin,

Auto-hide windows render their content a couple layers deep in terms of ItemsControls, but if you initialize them in WindowOpening like I had mentioned, it should work even there.  We don't have an IsWindowVisible event.  Do you mean you're using our DockSite.WindowOpening event?


Actipro Software Support

The latest build of this product (v2019.1 build 0681) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.