Chris Ryu’s Tech Diary

Windows Embedded OS

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

 1 

 

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.

 2 

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.

 3 

6. Open the source file and add source codes as below.

 4 

7. Open the EXRTest.cpp file and remove all unnecessary codes except WinMain function and header files as below. 

 5 

8. Add following header files related to using Silverlight UI.

 6 

9. Below header files, declare the RunXR() function, that parse the XAML file and load a window.

 7 

10. In WinMain function, declare a HWND and call the RunXR() function.

 8    

11. Write the RunXR function as below. This function parses the VisualUI.xaml file and displays it.

 9 

12. After building the EXRTest project without error, you can execute the EXRTest.exe as follows.  

 10

 

 

 

Advertisement

One Response to “Silverlight for Windows Embedded Lab 1”

  1. [...] Comments (RSS) « Silverlight for Windows Embedded Lab 1 [...]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.