DataTemplate x: Shared = false does not affect presentation

I use a datatemplate to load my views using PRISM 4 detection. I need to create a view / viewmodel several times and not reuse existing instances, so I set x: Shared = false in the resource, but this only affects the viewmodel. I can confirm that the viewmodel is not reused, but the view. The view constructor is called only on the first call. I read similar posts here, but their solutions did not work for me. I want to know if I can somehow extend the bootloader / locator of the resources and make sure that it respects the common flag.

This is how my template is defined:

 <DataTemplate DataType="{x:Type CVM:MyViewModel}" x:Shared="False">
        <V:MyView />
 </DataTemplate>
+5
source share
1 answer

DataTemplate 'Template' , ( viewmodel) .

, 'MyViewModel' , ( Viewmodels ). , , DataTemplate ( ViewModel).

, ItemsControl ( ) , "" ( datatemplate) .

0

All Articles