Optimizing CAL Application - SL3

Topics: Prism v2 - Silverlight 3
Dec 23, 2009 at 3:34 PM

Hello,

i have a rather complex CAL Application which  is composed of several modules; each one has a dedicated controller, which loads the module's composite view, assembled of several other sub views, into a specific region in the shell. 

So whenever a navigation button is clicked, a global event a with the destination view's name is triggered. All module controllers subscribe this event, and the one that controls the destination view, remove the previous view from the region and injects it own. Despite removing the view from the region, it is still referenced by the container. And while navigating back and forward i can notice a decline in performance.

I wonder if i could get advantage in disposing the views (IUnityContainer.Teardown(view)) and resolving them again when needed for perfomance purposes ? Are there any guidelines for optimizing the application performance ? 

Thank you,

Francisco

 

Dec 30, 2009 at 7:36 PM

Hi Francisco,

Without knowing the specifics of your application, if the Unity container is referencing your views it is probably because you are registering specific instances of the view in it. This could be avoided by resolving the views without registering them in the container. You can read more about this in this thread.

However, your issue might not be related to the views being kept alive. Another possible reason could be that there are too many modules listening to the same event. A possible way I can think of to solve this could be adding specific navigation buttons for each module, so there is no need to publish any events (simply calling Controller methods from the Button’s click handler should show the view).

Please let me know if this helps.

Damian Schenkelman
http://blogs.southworks.net/dschenkelman