Quantcast
Channel: patterns & practices: Prism
Viewing all articles
Browse latest Browse all 1878

New Post: How to instantiate a new view/view-model each time it is navigated to?

$
0
0
Hi,

As you correctly pointed out, Castle Windsor discourages to implement IDisposable because the release policy can opt out of tracking components and therefore lose the ability to perform the proper destruction of the component. Also, take into account that Windsor may track components defined as "transient" when you Resolve their instances. In that case, you will need to Release them in order for the Garbage Collector to be able to reclaim them. In other words, you have to Release what you explicitly Resolved.

Regarding the ClearChildViews attribute, if this attribute is correctly set and you remove a view that has a nested region, Prism should automatically remove the views from that nested region. Therefore, it won't invoke the view's navigation methods. If you need to check this, you could subscribe to the CollectionChanged event of the region views collection or verify that it is empty after you remove the view containing the nested region.

Regards,

Federico Martinez
http://blogs.southworks.net/fmartinez

Viewing all articles
Browse latest Browse all 1878

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>