简体   繁体   中英

Best way to merge multiple Windows Phone apps

The problem I face is the following: I've been tasked with creating a sort of "launcher page" for a Windows Phone application whose components have been developed as separate WP apps.

After some Googling, it appears that one can't simply install the separate apps and then call them from the main launcher application, this isn't supported by the platform apparently...

The most direct approach that I can see (and that I've tested quickly) is to reference the other applications from the solution in my launcher app and then call their respective MainPage.xaml pages. This raises other problems however, for example:

  • all the paths in each of the projects that don't explicitly include a namespace ( /Namespace;component/foo.bar ) are no longer valid;
  • also, any application-specific code created in App.xaml / App.cs is no longer accessible since the launcher's App class is the one that gets instantiated at startup.

These are the two main problems that popped up with a quick test...I expect there will be others as well.

Is the approach I'm taking the only way to accomplish this task? Is there a best-practice for developing large but modular apps so that I can avoid this in future?

EDIT: The app(s) must remain compatible with WP7

The way I would develop applications is to have a component with code used by all modules, and then a project per section of the application. Links to pages should explicitly reference components.

For now, I suppose the 'easy' way to fix this, is to check what logic is contained within both App.xaml and App.cs files, and attempt to merge those into one. Then you should indeed replace all links with an explicit link.

It's either that, or merging both project together, which will probably cause a lot more conflicts.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM