0

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

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
udaya kumar
  • 169
  • 8
  • Unless you use something like Silverlight, or make your desktop application just a custom web browser, I don't think doing this would be possible. – svick Mar 19 '12 at 09:03
  • we need the rich experience of desktop, and accessibility of web application too. we have no experience in silverlight – udaya kumar Mar 19 '12 at 09:56

3 Answers3

2

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.

Community
  • 1
  • 1
Habib
  • 219,104
  • 29
  • 407
  • 436
0

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.

Wouter de Kort
  • 39,090
  • 12
  • 84
  • 103
0

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.

Martin Liversage
  • 104,481
  • 22
  • 209
  • 256
  • is silverlight supported on all the browsers like the ones on Ipad/IPhone and android browser – udaya kumar Mar 19 '12 at 11:26
  • 1
    @user1211331: No, Silverlight runs on the major browsers on Windows and in Firefox and Safari on the Mac. It does not run in any mobile browser. But trying to get a "rich experience of desktop" on an iPhone seems kinda strange. – Martin Liversage Mar 19 '12 at 11:32
  • the major audience is on desktop and few are on mobile devices like Ipad/tab. that is why we want to retain the experience on the desktop – udaya kumar Mar 19 '12 at 11:49