WPF .NET 3.5 Desktop App and Silverlight

Feb 17, 2010 at 9:19 PM

I have an extensive desktop application -- 30+ assemblies, uses the WPF Toolkit (datagrid), data triggers in xaml, etc. So now the customer would like to consider a web version. I have a model-view-controller architecture...So I was thinking it should not be a big deal...But then I tried with Silverlight -- and perhaps I am missing something.

I have tried the (too-good-to-be-true) solution of adding a post-build step to run SLASM that uses ildasm and massages version numbers of mscorlib, etc. I am wondering where I might find a comprehensive list of unsupported attributes because I am guessing that they are fairly extensive and that would be why I cannot get it to run.

So I tried creating a Silverlight Class Library and added one small xaml control as a link to the project. Ok -- That is when I learned that ControlTemplate.Triggers, Dynamic Resource, SnapsToDevicePixels, TargetName in a Setter -- all of these do not exist in http://schemas.microsoft.com/winfx/2006/xaml/presentation.

So, am I missing something? How does one take a complex existing WPF desktop application and make it a web app without rewriting the UI? I have a ton of data triggers all written in xaml.   I have gotten my stuff to run in a WPFWebBrowser application -- but would much prefer Silverlight...

Any advice would be very welcome! 

Thank you!!!!

Feb 17, 2010 at 9:48 PM

I generally have found that the best way is:

a) Know you’re going to do to it from the start (sorry there).

b) Use the “Project Linker” http://msdn.microsoft.com/en-us/library/dd458870.aspx (It helps to keep a SL and WPF library in sync.

c) You practice the alternate paths to get to things …

a. SnapstoDevicePixels has an alternate name in SL, so set it in code (not markup) in an #IF.

b. Dynamic Resource is a pain, but you can replicate it with a content control that toggles it’s content between static resources as it loads.

c. Visual State (which works in both) largely replaces ControlTemplate.Triggers.

Mike

From: Run26 [mailto:notifications@codeplex.com]
Sent: Wednesday, February 17, 2010 3:20 PM
To: kiltsarebreezy@hotmail.com
Subject: WPF .NET 3.5 Desktop App and Silverlight [wpf:85703]

From: Run26

I have an extensive desktop application -- 30+ assemblies, uses the WPF Toolkit (datagrid), data triggers in xaml, etc. So now the customer would like to consider a web version. I have a model-view-controller architecture...So I was thinking it should not be a big deal...But then I tried with Silverlight -- and perhaps I am missing something.

I have tried the (too-good-to-be-true) solution of adding a post-build step to run SLASM that uses ildasm and massages version numbers of mscorlib, etc. I am wondering where I might find a comprehensive list of unsupported attributes because I am guessing that they are fairly extensive and that would be why I cannot get it to run.

So I tried creating a Silverlight Class Library and added one small xaml control as a link to the project. Ok -- That is when I learned that ControlTemplate.Triggers, Dynamic Resource, SnapsToDevicePixels, TargetName in a Setter -- all of these do not exist in http://schemas.microsoft.com/winfx/2006/xaml/presentation.

So, am I missing something? How does one take a complex existing WPF desktop application and make it a web app without rewriting the UI? I have a ton of data triggers all written in xaml. I have gotten my stuff to run in a WPFWebBrowser application -- but would much prefer Silverlight...

Any advice would be very welcome!

Thank you!!!!

Read the full discussion online.

To add a post to this discussion, reply to this email (wpf@discussions.codeplex.com)

To start a new discussion for this project, email wpf@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Feb 18, 2010 at 1:55 PM

Mike:
This is great information. Thank you. Is there any kind of comprehensive list of what is not supported and how one works around it? These are great solutions for the one control that I had…But I have so many more controls. It would be great to have a site to go to in order to know how to resolve problems. Any suggestions?


Thanks again!