How to initialize a view explicitly?

Topics: Framework Services
Aug 18, 2011 at 11:59 PM


I do have an interesting (that already bored me) case where I'd like to improve application responsiveness and for that I'm trying without success to initialize the view explicitly before activating it.

More detailed scenario:

  • Tab Control (from telerik if that matters)
  • Items/pages bound to a collection
  • Collection has few permanent and few dynamic pages
  • When activating, some permanent (and heavy) tabpages take 600-800 ms to load, measured from view's IntializeComponent() to Loaded event. If we talk in terms of Screen, it's the time between OnInitialize and OnActivate.

This is the time I'd like to schred by pre-initializing the view before activating it. I'd like to do it in my Conductor while building items collection.

I've tried few (stupid) things like calling ViewLocator.LocateForModel(myVM) and few other tricks but nothing worked so far.

I'd appreciate any hints on how can I hadle it with Caliburn.Micro. In parallel, I'm trying to see if telerik's tabcontrol can behave in other manner and preload content of his pages.



Aug 19, 2011 at 1:16 AM

Morbid curiosity has me. As to what are you loading in the tabs that results that heavy a load time.  Are you pulling in WCF feeds and if so why not try to load them async (Reactive Framework)?  Are you loading each tab at view display or individually?  Just sounds like your interesting use case is turning into a nightmare case.




Aug 19, 2011 at 8:20 AM

Same curiosity I had. But no. all data pulling & service calling is done after OnViewLoaded.

Tab pages are heavy because they contain, apart of other things, a RadGridView. This grid is known by working fast but with a slower initialization.

TabPage Initialization is done one time, when the tab is activated for first time. And this is the time I'd like to cut by pre-creating (if possible) the view.

Aug 19, 2011 at 4:30 PM

I am guessing that the time it takes for the data to pull down is part of the slow down.  Or the control is the issue... Have you tried to load using the in framework control?

Aug 25, 2011 at 9:08 PM

Have you tried using Telerik's persistance framework?  While you'll still have to create the grids at least once maybe that can help speed it up for the next time the view is created... Although now that I type this perhaps the persisted attributes are applied after the grid is initialized.

Aug 26, 2011 at 8:41 AM


No, I haven't tried it with persistence. I'm using Telerik in a Silverlight client, so I think it wouldn't help.

The GridView takes more time to initialize when it's created first time. After that, even in other parts of application, it takes much less time to initialize - 200-250 ms. While first initialization takes 800 ms.


Feb 21, 2012 at 8:33 AM

excuse me jaddington, do you use Telerik's persistence framework successfully with caliburn micro?


Feb 21, 2012 at 4:11 PM

No I have never tried.

From: advapi [email removed]
Sent: Tuesday, February 21, 2012 1:34 AM
To: Jack Addington
Subject: Re: How to initialize a view explicitly? [caliburnmicro:269626]

From: advapi

excuse me jaddington, do you use Telerik's persistence framework successfully with caliburn micro?