Answered by:
[UWP]Load modules on demand

Question
-
Hi,
In my current WPF MVVM application, I was using PRISM 5.0. So using PRISM, I was loading module on demand when it's required to load using below line of code.
this.moduleManager.LoadModule("SettingsModule");
Even for navigation from one view to another, I used PRISM for navigation.
Now, I am creating Windows 10 UWP application. For navigation, I used NavigationService of Template10.
In this application, same as above I want to load module on demand WITHOUT using PRISM. So is there any way in Windows 10 UWP application or I have to use PRISM 6.0 for this.
If it's available then I can skip the use of PRISM in Windows 10 UWP.
Kindly guide me.
Thanks,
Ayaz Shaikh
- Edited by Amy PengMicrosoft employee Wednesday, December 23, 2015 6:21 AM add tag
Tuesday, December 22, 2015 11:12 AM
Answers
-
You can use MEF with UWP apps.
Look at the nuget package Microsoft.Composition
This older article explains the basics
https://visualstudiomagazine.com/articles/2012/12/20/mef-for-windows-store-apps.aspx
- Proposed as answer by Amy PengMicrosoft employee Monday, January 4, 2016 9:32 AM
- Marked as answer by Amy PengMicrosoft employee Thursday, January 7, 2016 3:05 AM
Tuesday, December 22, 2015 1:11 PM -
>>So is there any way in Windows 10 UWP application or I have to use PRISM 6.0 for this.
There is no concept of "modules" in UWP, i.e. there is no built-in ModuleManager class or similar.
In fact, the ModuleManager in Prism 6 belongs the Prism.WPF package so it is not available for use in a UWP. There is no equivalent class either.
Hope that helps.
Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't ask several questions in the same thread.
- Edited by Magnus (MM8)MVP Tuesday, December 22, 2015 3:44 PM
- Proposed as answer by Amy PengMicrosoft employee Monday, January 4, 2016 9:32 AM
- Marked as answer by Amy PengMicrosoft employee Thursday, January 7, 2016 3:05 AM
Tuesday, December 22, 2015 3:44 PM
All replies
-
You can use MEF with UWP apps.
Look at the nuget package Microsoft.Composition
This older article explains the basics
https://visualstudiomagazine.com/articles/2012/12/20/mef-for-windows-store-apps.aspx
- Proposed as answer by Amy PengMicrosoft employee Monday, January 4, 2016 9:32 AM
- Marked as answer by Amy PengMicrosoft employee Thursday, January 7, 2016 3:05 AM
Tuesday, December 22, 2015 1:11 PM -
>>So is there any way in Windows 10 UWP application or I have to use PRISM 6.0 for this.
There is no concept of "modules" in UWP, i.e. there is no built-in ModuleManager class or similar.
In fact, the ModuleManager in Prism 6 belongs the Prism.WPF package so it is not available for use in a UWP. There is no equivalent class either.
Hope that helps.
Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't ask several questions in the same thread.
- Edited by Magnus (MM8)MVP Tuesday, December 22, 2015 3:44 PM
- Proposed as answer by Amy PengMicrosoft employee Monday, January 4, 2016 9:32 AM
- Marked as answer by Amy PengMicrosoft employee Thursday, January 7, 2016 3:05 AM
Tuesday, December 22, 2015 3:44 PM