PDA

Click to See Complete Forum and Search --> : WPF for Windows & Web


daimous
Apr 21st, 2009, 04:26 AM
Hi guys! i have a question, is it posible to develop a WPF application that can be deployed in desktop and be hosted in a web browser at the same time?

Pac_741
Apr 21st, 2009, 06:19 PM
I have the same question, I think you use Silverlight for web apps.

DeanMc
Apr 24th, 2009, 04:56 AM
There are 3 main choices you have when creating WPF style applications and each one has its strengths and weaknesses.

1: WPF Desktop application:
This is basically a windows application that runs on the desktop, you have full access to things like file writing dialog boxes etc.

2: XBAP (Browser Applications)
This is a windows application that works in the browser. This type of application is a bit awkward to understand, its basically a very rich client model that is hosted on a server and executed and ran through a browser. The thing with XBAP's is they require the user to have the .NET framework installed. Remember though because this application is ran through the browser things like modal dialogs cannot be used. To be honest if an application needs to be hosted over the web I would skip XBAPS and go straight to silverlight.

3:Silverlight
Silverlight is basically a web version of WPF, it obviously has limitations on reading local files, no access to registry the same issues as any RIA.

You cannot develop a desktop application and just port it to Silverlight because you may be using methods and operations that Silverlight cannot use. Careful planing and consideration of these limitations between both will allow you to make UI's and backround classes that a new silverlight application could consume though. For instance if an application did need to have a web presence you could use pages for the UI and consume them in both the silverlight and desktop application.

It tends to be best to create the silverlight application first and then the desktop that way you do not run into limitations after spending hours implementing features that are restrictive to silverlight but ran fine in the desktop build.

Pradeep1210
Apr 24th, 2009, 06:12 AM
I have the same question, I think you use Silverlight for web apps.

I had read somewhere that next version of silverlight will support browserless windows. i.e. they can be hosted in their own windows instead of browser windows.

macnux
May 2nd, 2009, 02:17 AM
i make windows wpf app and another xbap app then
i copy a window of windows app to xbap app then i make the xbap full trust from the security
and i run it and it shows the window normally

so i think you can develop your windwo app then grab your forms and run them in xbap app without changes
please your ideas
thanks.

DeanMc
May 2nd, 2009, 01:00 PM
That is not a good habit to get into... xBaps where not created as windowed versions of desktop applications, they where created to fill a niche in LOB applications and as such should be planned and developed correctly.

Pradeep1210
May 3rd, 2009, 04:04 AM
i make windows wpf app and another xbap app then
i copy a window of windows app to xbap app then i make the xbap full trust from the security
and i run it and it shows the window normally

so i think you can develop your windwo app then grab your forms and run them in xbap app without changes
please your ideas
thanks.

Actually I think it's a lot easier than this.

Have a look at this page where he shows how to create a silverlight applicaiton and then how to get a desktop version (WPF) out of it.
http://weblogs.asp.net/scottgu/archive/2008/02/22/first-look-at-silverlight-2.aspx

macnux
May 3rd, 2009, 05:22 AM
actually sliverlight has limited capability than wpf because wpf based on the .net framework which is much rich and i can run it on desktop and web as i mention above
and sliverlight like flash just an extension that run the plugin

so i think that building apps using wpf and grabbing those forms to a xbap app is better and richer

DeanMc
May 17th, 2009, 10:08 AM
Some of the limitations of silverlight are there for a reason. If you need an application to be really rich and access portions of the OS well then you should be making desktop applications. As I have already stated XBAP's are a niche item they are for companies who need to power of desktop applications with the ease of update that you get from ASP.NET applications.

An XBAP should never be used as an application that you intend to distribute to the public at large.