English 中文(简体)
What does WPF still have to offer over Silverlight 4?
原标题:

Given the list of new features announced in Silverlight 4, when is WPF still required?

问题回答

WPF still has a lot fuller 3D rendering capabilities.

Also even though they announced enhancements to the commanding and binding capabilities, that s no guarantee that it will have the full ability that WPF currently has or will have in the next version

Edit: After playing around with Silverlight 4 beta, it looks like pretty much all of the new features (webcam, file access, full screen keyboard, COM interop, etc) only work when the application is elevated trust, and elevated trust can only be enable when running out of browser. Some of this may change by RTW, but for now, WPF still looks like the only way to do these things inside of a browser window

I ve been using mostly XBAPs for browser deployments while waiting for a Silverlight version that includes WPF s full templating and data binding capabilities. Perhaps Silverlight 4 will do it.

Several things that Silverlight 4 definitely won t be able to do are:

  • Allow you to seamlessly integrate your WinForms and MFC user interface components with your application
  • Efficiently work with data file structures originally defined in C/C++ (with WPF you can simply copy the code across and easily replicate the original C++ code using unsafe and StructLayoutAttribute)
  • Include unmanaged C++ code in your application

I have not actually downloaded the Silverlight 4 beta yet, so this list is necessarily incomplete.

The next version of Visual Studio will not be written in Silverlight ;) I can t wait to write an Audio utility in WPF---and Silverlight must be sand-boxed away from the incredible Windows Audio subsystem. However, I can see the day when WPF will be called Silverlight (or perhaps the other way around).

When you don t want to depend on a browser to do your work, when you need full and fast access to the file system without prior confirmation, when doing interop with unsafe bits of code. These are the few I can think of, but they might be other reasons as well, depending on what features Silverlight 4 will really have and how well will they really work.

The applications we (in our company) write today use nothing that is not supported by Silverlight except for local TCP/IP connections without limitations.

This is the only reason we are using WPF. If we could use Silverlight instead (desktop mode) we d be able to give our customers the choice of working on Mac (and linux) systems as well instead of being forced (by us?) to use a recent version of Windows (you d be surprised how many companies still use old (partially) unsupported versions).

Even in WPF we try to limit access to the system, we create our own sandbox and try not to go outside of it. (Never require admin rights, never access stuff you don t have to)

So for what we do, Silverlight + real tcp/ip support would be more than enough... but there is absolutely still room for WPF and I m pretty sure it s here to stay.

It all depends on what you re building.

Silverlight will always favor small payloads over functionality. Strategically, Microsoft will attempt to out feature Adobe s offerings using Silverlight, while WPF will be competing against other heavy platforms. If you look at WPF 4 you ll notice a push towards heavier weight features. I try to keep in mind that WPF started out as Avalon which was intended to permanently displace Win32. I won t be surprised if one day Windows XX is "native" WPF and Win32 will be emulated.

If you want to do direct database access through ADO.NET that s not something you ll be able to do in Silverlight 4. Access to devices will still be limited although you will now have some printing support and webcam/microphone. I haven t heard anything about 64 bit support so if you want to offer a 64 bit version of your app you ll need WPF. I also think even if Silverlight 4 makes better use of the GPU, it still won t be to the level that WPF utilizes it.

There are also a ton of other assemblies in the .NET framework that Silverlight doesn t include so if you need any of those you ll need to go WPF.

Just like HTML5 will reduce the need for a plugin like Flash or Silverlight in some cases, Silverlight will reduce the need for WPF but there are still plenty of cases where you ll need it.

WPF is still required if you need to do extensive Rich Text (FlowDocument) editing. Silverlight 4 has the new RichTextBox, but it is limited to very basic content, and doesn t provide the full set of features that are available in FlowDocuments in WPF. A FlowDocument can effectively do what the WinForms RichTextBox can do; but if you only need the basics, a RichTextBox in Silveright may do what you need.

The bottom line is that silver light is limiting. So, if you are going to use a less capable technology you should have a compelling reason for doing so. The only one I can come up with, and it is a big one in some circumstances, is that Silverlight is more platform indifferent. I just can t imagine anyone wanting to bring the browser and all of it s headaches into a solution. There must be a good reason.





相关问题
Silverlight Rich text box control

Our team decided that we need our own custom Rich text box control for Silverlight app we are developing. We looked at existing controls mentioned at A good rich text control for Silverlight but ...

Silverlight ImageBrush not rendering (with Bing Map Control)

I m trying to add an image to a Pushpin instance from the Silverlight Bing Map Control, but I can t seem to get it to render (the pushpin renders fine). This is probably a general WPF question rather ...

Silverlight OpenFileDialog DoEvents equivalent

I m processing large files after they are selected by the user. My code looks like the following: if (FileDialog.ShowDialog() == true) { // process really big file } This freezes up the UI so ...

list of controls with templates in silverlight

Does anyone know where to find a list of controls that you can set the template on in Silverlight? I ve wasted several hours now trying to create control templates only to find that the control doesn ...

Silverlight, Updating the UI during processing

I have a simple silverlight multifile upload application, and i want to provide the user with some feedback, right now its only in a test phase and i dont have the webservice. Somehow i cant get the ...

Silverlight 3 - FindName returns null

This looks a bug to me.. Using Silverlight 3 and i have a user control defined in XAML and trying to access the object during runtime returns a null. <Grid> <common:CommonGridEditPanel x:...

silverlight 3 collection binding

Someone please help me understand why this binding does not work... I have a class called SelectionManager with a property called dates which is populated by a WCF service. The property is an ...

热门标签