List of WPF functionalities that aren't in Sil

2020-05-29 04:27发布

问题:

A common technical decision nowadays is whether to build a ClickOnce rich client application or a web application.

Here I'm focussing primarily on choosing between a WPF application or a Silverlight application.

The chief benefit of Silverlight is obvious - it can be hosted in a browser.

But, if a programmer used to WPF was to start programing in Silverlight, what would he/she suddenly find is not possible or much harder?

Items can be of the following:

  • You just cannot do it, period
  • You can do it, but only sort of, with lots of caveats
  • You can do it, but there's a lot more hoops to jump through

Examples I've stumbled on so far:

  • Accessing the clipboard. You can only sort of do it, providing you're limited to Internet Explorer and you only write raw text
  • Using Commands - Possible, but with a lot of extra work
  • Context Menus - Possible but with a lot of extra work

What others?

回答1:

Programmatic Differences Between Silverlight and WPF, A Whitepaper by Wintellect, LLC:

http://wpfslguidance.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=28278

69 Pages, covers almost everything.



回答2:

Cross-domain restrictions - Silverlight can only access sites which allow it via crossdomain.xml or clientaccesspolicy.xml.

For example, Silverlight can't communicate directly with Twitter's API or StackOverflow RSS feeds.



回答3:

I answered a very similar question a few days ago, here:

WPF vs XBAP vs Silverlight... which suits business applications?

Some of the more notable ones are you can't open a new window, there's an inability to put the app in the notification area and no mousewheel support (not sure if there is in WPF). Some things are trickier to program too.



回答4:

"...and no mousewheel support (not sure if there is in WPF)...".

There is mouse wheel support, but not as easy as in WPF. You have to listen to the MouseWheel event an calculate the scrolling offset by yourself.

Another thing that is different is, that you do not have Ancestor-Binding in Silverlight.



回答5:

See: Silverlight WPF Compatibility (MSDN) and Contrasting Silverlight and WPF (Patterns & Practices)