Can I use the same WPF view for Desktop and Web?

Asked

Viewed 2,290 times

3

Dear ones, I have never programmed with WPF but soon I will have the opportunity and already thinking about the future, which is now, in which desktop applications will be/are being migrated to the web and, also thinking of those who are still reluctant against it, which in case are the customers, i want to make the system serve both by web and by desktop.

Trying to avoid code redundancy I ask you: Is it possible to use the same view desktop and web? If not, how far can I go without having redundant codes unnecessary, or actually the view desktop is different for the view web?

Would you like to take the opportunity to ask if WPF runs at least on the most popular browsers such as IE, Firefox and Chrome? It is also cross-platform, for Linux and Mac OS?

  • 1

    In short, for the first question, the answer is no.

  • Thanks for your help! But you could answer me about the other questions too?

  • @user3628, I believe it is more interesting to have a multilayered architecture, so you can have as many layers of presentation as you want (desktop, web, mobile, wearable, tvs, refrigerators, etc) and keep your business rules centralized.

2 answers

4


Since it wasn’t an answer, I chose to send it by the comments, but here it goes:

I haven’t heard any complaints from WPF in any browser yet. If you use Silverlight then you will surely have the peace of cross-browser compatibility natively.

As for migrating, this ends up becoming too personal, I at least find it more interesting to start new projects in WPF than to migrate, or, if you are migrating, as you said you have no experience in wpf, I suggest small projects not to come across a monster first. But some people prefer big challenges right off the bat, so as I said, it’s pretty relative.

Finally, since you’re still learning, I think it’s worth taking a look in this example which shows the same system in windows Forms and wpf.

  • Forgive my ignorance, but Se você utilizar Silverlight então, vai, com certeza ter a tranquilidade da compatibilidade cross-browser de forma nativa. for Linux and Mac OS, that’s right?

  • And also.. WPF with Silverlight? I have a lot to research yet.. (rs)

  • 1

    Exactly that. A lot of research, but I guess it’s worth.

  • 1

    To finish convincing you about WPF. http://social.msdn.microsoft.com/Forums/pt-BR/602a3c75-d996-4a39-8c77-0439bde0034e/wpf-x-winforms

3

There is no WPF for the web and it will never exist. Web is web, if you’re not using HTML, CSS, Javascript, it’s not web. Not even Silverlight is web, just like Flash. The fact that it runs on top of a browser doesn’t mean it’s web.

If you want to run WPF in a browser get ready to use only Internet Explorer, obviously only in Windows. As far as I know, not even the Microsoft Edge that replaced IE can run WPF (which eventually became Chromium). And it is not any Windows that will run, need to have a . NET installed and updated. IE, forget this.

Want to do something for desktop, do it with WPF, Windows Forms or Winrt. Don’t fall into marketing. If you are going to do something for the web use the standard technologies mentioned above. It is no use trying to take advantage that it does not give.

And desktop applications are not being migrated to the web, unless one likes fads. There are new applications or at least new web clients for applications when they are relevant and necessary.

With the end of. NET Framework some things there may have changed.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.