1. In the Visual Studio 2012 with Windows Embedded Compact project loaded, select: Menu Tools –> Windows Embedded XAML Tools —> Create Platform Builder Project
Figure 15.13: Accessing the XAML Subproject Wizard
Figure 15.14: The XAML Subproject Wizard start up dialog
2. On the next dialog call the project MyFirstXamlApp and for location browse to the location of the OS projects Subprojects (one deep from the folder that has the OS's .sln file). Note this is where the path not having and spaces comes into question. Build.exe can't handle spaces in paths.
Figure 15.15: XAML Subproject Wizard: Project details
Figure 15.16: XAML Subproject Wizard: Select the project from Blend
The startup control should be the MainPage:
Figure 15.16a: XAML Subproject Wizard: Selected project
3. Click [Next] to validate the project:
Figure 15.17: Validation Result Dialog
Note: If there were any spaces in the path, this would lead to an invalidation here.
4. Press [Finish] to complete. You will then get a Summary report:
Figure 15.18: Validation Report
5. Add this project to the OS project:
6. In the Solution Explorer Right-Click on Subprojects and select Add-Existing-Project: (Note that the usual native projects exist under Add-New-project)
Figure 15.19: The OS Subprojects folder
7. Browse to the sources file (or use the .pbxml file) for the project created in this section and select it:
Figure 15.20: File Dialog showing XAML Subproject sources and .pbpxml files
8. Expand the subproject out to see all of its files:
Figure 15.21: The XAML project tree
Note that the XAML files remain in the original project so you can modify them from there (ie in Blend). If you try to open them here you get garbage.
Examine the source files. The project is:
9. Set the subproject properties to build as debug and exclude form the image. In the OS Properties page (Subproject Image Settings). That way you can modify it while the OS is running:
Figure 15.22: Subproject build settings
10. Right-Click on the subproject and build it
11. Run the OS and test the app through target control. This assumes you have a prebuilt OS with Target Control Support (Shell.exe) and with KITL enabled, typically in Retail mode.
Figure 15.23: Adding Target Control Support to the OS
Figure 15.24: KITL (OS Project Property-Build Options)
12. Test the app.
Note: The C# event handler code hasn't been translated to C++. The buttons don’t work. Examine MainPage.cpp file. The event handlers are there. The C# code wasn’t translated!
Figure 15.25: The app running on Windows Embedded Compact system.
13. Use target control to shut down the application using gi proc and kp Target Control commands as shown. Target Control is actioned using the menu: Target—>Target Control
Windows CE>gi proc PROC: Name PID AcctId VMBase CurZone P00: NK.EXE 00400002 00000000 80220000 00000000 P01: CeLogFlush.exe 01290006 00000000 00010000 00000000 P02: shell.exe 012b0006 00000000 00010000 00000000 P03: udevice.exe 01500006 00000000 00010000 00000000 P04: udevice.exe 00de000a 00000000 00010000 00000000 P05: dmsrv.exe 019a0016 00000000 00010000 00000003 P06: servicesd.exe 03ec000e 00000000 00010000 00000000 P07: GweUser.exe 027e001a 00000000 00010000 00000000 P08: xrshell.exe 037a0032 00000000 00010000 00000000 P09: MyFirstXAMLApp.exe 03890042 00000000 00010000 00000000 Windows CE>kp 09 Attempting to kill process of id 03890042 ...Succeeded
Windows CE>gi proc
PROC: Name PID AcctId VMBase CurZone
P00: NK.EXE 00400002 00000000 80220000 00000000
P01: CeLogFlush.exe 01290006 00000000 00010000 00000000
P02: shell.exe 012b0006 00000000 00010000 00000000
P03: udevice.exe 01500006 00000000 00010000 00000000
P04: udevice.exe 00de000a 00000000 00010000 00000000
P05: dmsrv.exe 019a0016 00000000 00010000 00000003
P06: servicesd.exe 03ec000e 00000000 00010000 00000000
P07: GweUser.exe 027e001a 00000000 00010000 00000000
P08: xrshell.exe 037a0032 00000000 00010000 00000000
P09: MyFirstXAMLApp.exe 03890042 00000000 00010000 00000000
Windows CE>kp 09
Attempting to kill process of id 03890042 ...Succeeded
NEXT: 15.4 XAML Time Button Event Handler Code
Click here to provide feedback and input