Reputation: 291
What I am looking for is a way to write the UI once and get the same running both in browser and on desktop.
We would like to use C# and SQL Server / MySQL as DB. Can you suggest the best way to code in c# to make this work
We are thinking of writing forms in WPF and then writing a wrapper to show as an application and to show as a webpage too. is it practical as we do not have experience in working of WPF
Upvotes: 0
Views: 1214
Reputation: 106926
we need the rich experience of desktop, and accessibility of web application too
I suggest that you take a look at Silverlight. It runs in the browser and deploys seamlessly like any web page. And you get a "richer" client experience compared to a true web application.
Upvotes: 0
Reputation: 39898
It's not possible to reuse a WPF application as a Web application. A Web application has a totally different setup then WPF. Web uses stateless HTTP while WPF runs completely on a clients computer.
Your best bet is to make sure you can reuse as much of your code as possible. By using a layered architecture you can create two applications that only differ in the User Interface layer.
Then you can optimize for both platforms but have a single shared code base for all other aspects of your application.
Upvotes: 0
Reputation: 223402
I don't think writing a wrapper around WPF application will solve your problem. You can convert WPF application to Silverlight (Which is for web) , but there are limitations. Here is a good question for that : Convert WPF Application to SilverLight
One better way of doing it is layered architecture. You can write a data access layer and a business layer, Then you can have separate UI layer for both Web applications and desktop applications. Make your solution as loosely coupled as possible and this will help in having separate applications for desktop and web.
Upvotes: 2