How to convert WPF Application in Silverlight


  • Hi,

    We have a WPF Desktop application with XAML and supporting C# code behind files.

    Now we want to convert it in Silverlight as we want it as a browser application.

    Can anybody suggest me, what is the best way to do this? Should I go with normal Silverlight project or ASP.Net Futures website?

    In my current WPF Desktop application I have some controls like checkbox, button, combo, list, which are not there in Silverlight(orcas beta 1).

    Any clue? Any scenario you people can suggest for this?

    Thanks in advance.


    Thursday, July 19, 2007 8:49 AM

All replies

  • I think the normal transition is to use Silverlight application, since you already have a WPF application. I think what you will need to do first is to convert WPF XAML to Silverlight XAML, you can do this through Expression design. It can export Silverlight XAML.

    Regarding input controls. There is a coming release in a couple of weeks or less. It was implied on this forum that this release will have input controls, so I believe you should wait for the next soon to be released version. If you can't wait, you can use the SilverlightControls that comes with the 1.1 SDK. THese controls are included: Button, Slider, ScrollBar, ScrollViewer, ListBox. Another approach is to overlay HTML input controls over the Silverlight control, which I do not recommend. There is also 40+ controls available for Silverlight for free . My personal recommendation, and I could be wrong, but I think you better wait for a couple of weeks till the next release comes to light.

    Thursday, July 19, 2007 9:04 AM
  • Hey Yasser,

    Thanks a ton for your quick responce. Great help. I am counting on next version. Let's see how much time it gona take.

     thanks again

    Thursday, July 19, 2007 12:06 PM
  • Hi Yaseer,

    I thing i forgot to ask, how can I give the reference of these third party controls in my XAML. I mean, if I incude any DLL or reference for these control, it will appear in code behind, but can I also access these control in XAML.

    Sorry if i m asking stupid questions:)


    Praveen Verma

    Thursday, July 19, 2007 3:05 PM
  • No problem, you are welcome to ask questions, and no question is too simple :). To access these controls you need to do CLR namespace mapping, this is done by defining a reference to the assembly and namespace to the root canvas. I don't remember the exact DLL name and namespace for GOA winforms, but your could should be somethink like this:


    and to reference a control:

    <goa:GoaControl ... />

    Please do not forget to change the namesapce, assembly names, control names to the correct names, the names provided are just examples

    Also please mark the post that helped you as the answer :) 

    Friday, July 20, 2007 12:53 PM
  • Hi Yaseer,

    That post was really helpful. Thanks for this wonderful help.

    Thanks : Praveen Verma

    Saturday, July 21, 2007 12:26 PM
  • I tried to convert to WPF/XAML to SilverLight2.0/XAML , it didn't work on SilverLight2.0, becuse I am using Triggers in WPF/XAML and but Triggers are not supported in SliverLight2.0.

     Before start converting make a key difference between WPF/XAML and SilverLight2.0/XAML and for the unsupported features, may have to write code using C# or VB.NET in the code behind file. Here are the few difference

    Features:                                    WPF:                                           SliverLight2.0:

    Triggers                                         S                                                  N

    Dynamic Resources                       S                                                  N

    3D                                                S                                                  N

    Label                                            S                                                  N

    DockPanel                                    S                                                  N ( Note: Slivelight Toolkit)

    Note: More Info will be posted on in near future

     Thanks and Regards: Krishna Reddy Bayanna.

    Friday, January 23, 2009 11:51 AM

    Friday, January 23, 2009 12:15 PM