IContainerStatus + CreationPolicy.Shared

Jun 29, 2010 at 1:52 PM

hi, if my ViewModel is exported via CreationPolicy.Shared IContainerStatus.ContainerLoaded/Unloaded just called once. it would be nice when IContainerStatus.ContainerLoaded/Unloaded would fire every time. is it possible?

Jul 3, 2010 at 7:58 AM
I did not really understood what you mean... IContainerAware is a "UI Service" a service that implements IContextAware. What it is doing is handling the Loaded event for the element (you are setting DataContext for the VM), handle its Loaded event and then raise an event
Jul 5, 2010 at 6:13 AM
Edited Jul 5, 2010 at 6:41 AM
    public class LadeIsnVM : ViewModelBase, IDataErrorInfo, IFocusMover
        public LadeIsnVM(IMediator mediator, IContainerStatus containerStatus)
            this.mediator = mediator;
            this.containerStatus = containerStatus;

            this.containerStatus.ContainerLoaded += ContainerStatusContainerLoaded;
            this.containerStatus.ContainerUnloaded += ContainerStatusContainerUnLoaded;

hi marlon the ContainerLoaded is just called once cause PartCreationPolicy is Shared. do you understand my question now?
thx Frank (sry for my bad english ;))
Jul 5, 2010 at 7:13 AM
when using IContainerStatus you cannot have CreationPolicy.Shared...