locked
How to target WinRT and Desktop within same project RRS feed

  • Question

  • Dear all,

    I was wondering what is the best way to build an application project and be able to target WinRT and Desktop App.

    In orther words, I want to have an application running on WinRT from the store, I wold likt to get it also available without any application change to Dektop Store

    The idea in such project would be to reuse as much as possible common code and control for instance.

    For instance, today for platform I was using a main input window entry using userControls for content and component. So in such case only the entry window might be different but same framwork was targetting.

    In windows 8 seems a bit more tricky from the fact that seems that as soon as you target the store you main project is far different from a Desktop app.

    Is tehre any rules or architecture study on how project can be settup to get you have compatible ?

    Would love to avoid different project

    thanks for advise


    Your knowledge is enhanced by that of others.

    Sunday, October 20, 2013 11:26 AM

Answers

All replies

  • There is no way to create an app that runs in the store or desktop.  Best option for you is to create a solution with 3 projects a portable class library, wpf app, and store app.   I would develop using the mvvm pattern and have as much of the code in the portable class library as possible.  Use the portable class library with both the store and wpf app
    Sunday, October 20, 2013 3:00 PM
  • Doug Holland's article and the guidance in the Windows Phone rev center on sharing code between Windows Store and Windows Phone apps may be useful. You'll have to swap the Phone code for SPF, but they give good examples of what Ken suggests with MVVM, dependency injection, PCLs, and linked files.

    http://msdn.microsoft.com/en-us/magazine/dn201744.aspx

    http://aka.ms/sharecode

    --Rob

    Sunday, October 20, 2013 3:31 PM
    Moderator