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

New Post: RegionMemberLifetime KeepAlive = false and View Injection, view does not show up

$
0
0

Hi,

I am glad you found this useful.

As a side note, I would like to comment that Prism does not only provide the RegionMemberLifetimeAttribute, it also provides an IRegionMemberLifetime interface. The RegionMemberLifetimeBehavior (the one in charge of removing the deactivated views) checks if the view / view model implements either the attribute or the interface to know if the view should be removed or not. The main difference between using the attribute or the interface is that the interface allows you to change the value of the KeepAlive property during run-time, while the attribute defines the KeepAlive value in design-time.

Hence, when using the interface instead of the attribute you can change the KeepAlive property of a view, for example, if the view is related to the information being shown to the user or not (for example a details view), if a view contains modified data that need to be saved or not (for example an edit view), if the region where the view was injected can contain deactivated views or not (for example a TabControl,) etc. Therefore, the IRegionMemberLifetime interface can provide you with more flexibility than the attribute, which could be useful in some scenarios.

Regards,

Damian Cherubini
http://blogs.southworks.net/dcherubini


Viewing all articles
Browse latest Browse all 1878

Trending Articles



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