Hi all ,
I have a WPF application with many views , part of them is exported with creation policy "Shared" and part not "Shared"
the export of each view looks like this :
[ViewOfType(TypeName = "View1)]
public partial class PasswordConfirmationView : UserControl
I built a Navigation service with a method called NavigateTo(string viewName) in this method I get the view from the container and navigate to it .
the navigation service has the following Views array which I query it for each view .
public Lazy<UserControl, IViewOfTypeCapabilities> Views;
my problem is with the views with creation policy "NonShared" , say I get an instance for a certain view , I did some work with it , then I called NavigationService.NavigateTo(viewName)
then the service will create it a gain and here I have different instances of view .
How can do that if I use NavigateTo then to use the same instance that mef allready created it .
Thanks in advance ...