Tech Off Thread

3 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Handling Multiple Instances of Module with MEF

Back to Forum: Tech Off
  • User profile image

    We are desinging an LOB application using Silverlgiht 5 ,PRISM 4.1 and MEF as prism's container.

    Issue is

    We desinged a  NewOrders module whichc will take New orders. This module Shell has a TabControl with TabItems as SearchCustomerView,CustomerInfoEnter View,CheckCustomersCreditHistory etc.. and all these have their own viewmodels with partcreation policy for views and viewmodels are default Shared. CustomerInofEnterViewModel has a Import of ISearchCustomerViewModel, which uses Customerobject(on SearchCustomerViewmodel) if he was found on search screen to fill its screen to save a service call and similarly CheckCustomerCreditHistory uses Customer object on CustomerInforEnterViewmodel to run the check.

    Now that we have requirement of User can place multiple orders? which means we have to create multiple instances on NewOrders Module.

    So we decided to make all views and viewmodels partCreation policy as NonShared ,So all imports have new instances, so SearchCustomerView code behind has a import of IsearchCustomerViewmodel and CustomerInfoViewmodel has a import of SearchCustomerViewmodel and both are diffrent and i cannot share information accross other viewmodel's

    How can I handle this situation?


    Any help ideas are greatly appreciated.

  • User profile image

    Research ExportFactories in MEF... will not get a new instance each time when pulling from Lazy<T>...

  • User profile image

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.