Silverlight for Windows Embedded Lab 1
Posted by chrisryu on October 30, 2009
This document is based on
ms-help://MS.VSCC.v80/MS.VSIPCC.v80/MS.WindowsCE.v60.en/CE_OS_ShellUI/html/094028e1-0058-4c5b-97b1-e4e2d4ba20eb.htm. For further information, visit this site.
And this exercise is using the sample XAML (http://chrisryu.wordpress.com/2009/10/30/simple-xaml-code/)
Lab Setup
To complete this lab, you must have :
l A running emulator image which contains Silverlight for Windows Embedded component
l A XAML file(VisualUI.xaml) which contains Button and Animation attributes
* Sysgen variable for creating the Silverlight for Windows Embedded
SYSGEN_XAML_RUNTIME
Exercise 1. Load XAML file
1. Create a typical Hello World application subproject and name it “EXRTest” in Platform Builder.
2. Copy the VisulaUI.xaml file designed in Expression Blend to the EXRTest project folder.
3. Open the EXRTest.rc file and add the definition of XAML file as follows.
4. Open the resource.h file and define the ID_XAML_PANEL value.
#define ID_XAML_PANEL 0×2000
5. Save the resource.h file, you can check if the XAML file was imported successfully in Resource View.
6. Open the source file and add source codes as below.
7. Open the EXRTest.cpp file and remove all unnecessary codes except WinMain function and header files as below.
8. Add following header files related to using Silverlight UI.
9. Below header files, declare the RunXR() function, that parse the XAML file and load a window.
10. In WinMain function, declare a HWND and call the RunXR() function.
11. Write the RunXR function as below. This function parses the VisualUI.xaml file and displays it.
12. After building the EXRTest project without error, you can execute the EXRTest.exe as follows.

Silverlight for Windows Embedded Lab 2 « Chris Ryu’s Tech Diary said
[...] Comments (RSS) « Silverlight for Windows Embedded Lab 1 [...]