Hi, I am using mvvm architecture view first approach in my project. I mean I have view-viewmodel binding defined in resource file. But i'm unable to open multiple instances of same view...If I open the the new viewmodel will refer to the first view.
But Is this x:shared only available in frame work 4.0 ?
Anish
2010-10-04 01:58:20
No, its always been their! AFIK
rudigrobler
2010-10-04 04:57:57
i am unable to find it..:)
Anish
2010-10-04 14:05:19
A:
WPF initializes data templates as singletons by default. You can override this behavior by using the x:Shared=false setting. Note: This works only with compiled resource files.
A more flexible option is to use an IoC Container for creating the associated View for a ViewModel. You might have a look at the WPF Application Framework (WAF) which shows how this works by using the Managed Extensibility Framework (MEF) as an IoC Container.
jbe
2010-09-28 18:02:36