Thursday, October 29, 2009

Embedded Silverlight For Windows CE 6.0





Today I gave a (too) quick answer in the newsgroups regarding the development of a Silverlight application for Windows CE 6.0. It seems that you do not need Platform Builder to develop Silverlight Applications. Makes sense....
I took the time to see whether it was possible to work with VS2005 (I presume VS2008 will have the same results) alone and was successful. So here is a short tutorial on how to do this:
  • Open a new SmartDevice Win32 project:


  • Choose an SDK that was produced with R3and Silverlight

Then press Finish.

  • Open the RC viewer and delete everything (except for the icon maybe) that you do not need.
  • Go to the project properties (right click on the project node).
  • Choose all configurations.
  • Go to linker-> input. In the Additional Dependencies field enter: xamlruntime.lib
  • Go to the main file of the project and use the code described in Valter Minute's blog (Silverlight Tutorial). For convenience, My code is at this link along with the XAML file for my project.
  • Now all that is left to do is to add the XAML file to the resources in the same way Valter describes in his blog.
  • Open the RC viewer. Right click on it and choose "Add Resource".
  • Now choose "Import". Choose the XAML file and in the resource name type "XAML".
  • I am not including screenshots because this is covered in Valter's blog.
  • To build you will need to make sure that the "pwinuser.h" file is included in your SDK. When I produced my SDK this file was not included automatically.
  • This is it. You can Build and run your project.
I'll organize this post later and maybe include the project. For the mean time, here is the link to the Expression project (includes the XAML) and the cpp file.

Shai

PS
This is my first post, if you find it not organized or missing crucial information, drop a comment and I will try to improve it.

1 comment:

  1. "To build you will need to make sure that the "pwinuser.h" file is included in your SDK. When I produced my SDK this file was not included automatically. "

    Can you explain please how to add "pwinuser.h" in the sdk from additional folder in the tree view?

    Thanks

    ReplyDelete