Reputation: 3255
I am planning on developing a Windows 8 App that can be used on phones, tablets and PCs. How I understand it, I can use the same code for all devices. (Of course some UI stuff has to be adapted)
Because it's a business application, the customor wants an additonal desktop version. Can I use the metro code for the desktop version? What steps will I have to take to develop a Metro app and a desktop Application at the same time?
P.S. I'm planning on developing it in C#...
Upvotes: 3
Views: 1346
Reputation: 1442
Yes, you can use almost the same code in both apps with MVVM pattern. In this pattern your App gets divided in 3 big parts: View, ViewModel and Model. The Model and ViewModel are portable (you can create a Portable Library and reference the same files as links from both Metro and Desktop apps projects. The View depends on the platform.
As you may have imagined, Model is the Data and ViewModel is whats connects View and Model. The thing is you may want to save data to local storage, that depends on the platform. For this, you can create Interfaces and implement them on your ViewModel, being that the only part that is different accross ViewModels in different platforms.
Upvotes: 7
Reputation: 8426
Yes and no.
Yes you can use C# code both on the Metro and Desktop applications.
However there are a lot of differences between the way data and input is handled in these applications.
They are 2 completely different systems with different input different, ways of building pages on and on
For example sandboxing does not apply on desktop apps. (This is just one example out of a million).
Though the major logic of your application will stay the same it won't be simple to convert between the two
This is a resource that covers the opposite.
Upvotes: 2