TabControl Load on Startup

Mar 12, 2012 at 1:29 PM

Hello again :-)

Another question to the tabcontrol respectively to the nested controls.

I want to load every tab on startup.

Because on the onehand: better a longer startup then load everything dynamicly.

And on the otherhand: In one view model im interessted in an other viewmodels command. But the "WatcherViewModel" is not loaded yet. Only after the command is executed. But than its to late. The method OnViewModelCommandExecuted ist not called.

How is its possible?

Coordinator
Mar 12, 2012 at 10:02 PM

Well, the InterestedIn attribute fully takes care of view models instantiated later. However, in such a case you should either inject the view models into the views, or activate every view at least once.

So the question is: are you loading tabs using model injection, or just simple view models?

Mar 13, 2012 at 6:59 AM

Yes i'm using model injecton. So i think i have to load every tab on startup. I think i have to extend my TabControlExt, an add a Property. Maybe LoadOnStartup.

Or do you have a better idea?

Coordinator
Mar 13, 2012 at 7:22 AM

I think that is a good idea indeed.