none
Moving UWP App to WPF RRS feed

  • Question

  • I am creating a game in Universal Windows Platform (Windows 10). Since, both UWP and WPF uses XAML for design, I tried copying my design code to a WPF File. RelativePanel gave me an error, also my static resources were giving me erros. How do I make my UWP apps into WPF applications? 

    ClintonYeboah

    Sunday, January 10, 2016 4:24 PM

Answers

  • You cannot share XAML markup between a UWP and a WPF application. They use different XAML parsers and different "dialects" of XAML so this is not possible: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/2c40447c-7e24-4eca-89a8-f39708fe53c8/shared-project-missing-usercontrol-wpf-new-item-template?forum=csharpgeneral

    There are for example no RelativePanel available in WPF.

    >>How do I make my UWP apps into WPF applications? 

    You create a new WPF application from scratch and basically rewrite all the views. If you have developed your application according to the recommended MVVM pattern, you should be able to reuse most of the application logic/view model code. You could put the view models in a portable class library and reference this one from both the WPF application and the UWP app. But you will have to rewrite the XAML views for the WPF application.

    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.

    Sunday, January 10, 2016 4:52 PM

All replies

  • The xaml is different, the code is different.

    So you just have to port your xaml and code piece by piece.

    There's no automated translator or conversion process.

    Just you.


    Hope that helps.

    Technet articles: WPF: Layout Lab; All my Technet Articles

    Sunday, January 10, 2016 4:47 PM
    Moderator
  • You cannot share XAML markup between a UWP and a WPF application. They use different XAML parsers and different "dialects" of XAML so this is not possible: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/2c40447c-7e24-4eca-89a8-f39708fe53c8/shared-project-missing-usercontrol-wpf-new-item-template?forum=csharpgeneral

    There are for example no RelativePanel available in WPF.

    >>How do I make my UWP apps into WPF applications? 

    You create a new WPF application from scratch and basically rewrite all the views. If you have developed your application according to the recommended MVVM pattern, you should be able to reuse most of the application logic/view model code. You could put the view models in a portable class library and reference this one from both the WPF application and the UWP app. But you will have to rewrite the XAML views for the WPF application.

    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.

    Sunday, January 10, 2016 4:52 PM