Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

change the content of tab in SettingsPane depending on the Shape

$
0
0

Hi Martin,

I am doing the same as above with a DataTemplateSelector to populate my SettingsPane for each shape. The only difference is I have created UserControls as the ContentControl for each DataTemplate in my DataTemplateSelector.

So one of my DataTemplates in my DataTemplateSelector would look something like:

        public DataTemplate Something{ get; set; }
        public ContentControl SomethingContent { get { return Microsoft.Practices.ServiceLocation.ServiceLocator.Current.GetInstance<SomethingUserControl>(); } }

I am using MEF and Prism so each of these ContentControls is a UserControl that is an Export. So I have a Singleton. Now I created another Module that implements the same thing as above. When I open a Module in my application and open the SettingsPane, then I open another Module and open the SettingPane that is supposed to be the same as the first Module's, both Modules ViewModels for these two UserControls get updated because of FirePropertyChanged that I am using. This is because the properties have the same names, and when I closed the first module, my UserControls for the DataTemplateSelector are never Removed or Destructed.

I am not really sure how I can implement the DataTemplateSelector and be able to Remove or Destruct my UserControls when I close the Module so that this no longer happens. I would rather not share ViewModels between my two projects in my application. Do you have any suggestions for implemetation?


Viewing all articles
Browse latest Browse all 84751

Trending Articles



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