UPDATE THE SWE APPLICATION SUBPROJECT

In the previous section, the XAML_Hello Expression Blend project has been updated with an event handler added to the button control. The exercise in this section updates the SWE_Hello subproject with the change made to the XAML_Hello project using the Update Silverlight for Windows Embedded Project Wizard.

Work through the following steps to update the SWE_Hello subproject:

1. With the MySWE OS design active, from the VS2008 Solution Explorer, expand the SWE_Hello subproject under the \Subprojects folder.

2. Expand the \Resources files folder, and double-click the MainPage.xaml file.

3. From the VS2008 Tools menu, select Windows Embedded Silverlight Tools, and click Update Silverlight for Windows Embedded Project to launch this wizard and update the SWE_Hello subproject to reflect the change made to the XAML_Hello Expression Blend 3 project.

4. From the VS2008 Solution Explorer tab, expand the SWE_Hello subproject’s \Source files folder, and double-click on the MainPage.cpp file to open this file in the code editor window.

5. Search for the button_Click event handler, and add the MessageBox function to display a message box when this event is triggered, as follows:

image
HRESULT MainPage::button_Click (IXRDependencyObject* pSender, XRMouseButtonEventArgs* pArgs) { HRESULT hr = E_NOTIMPL; if ((NULL == pSender) || (NULL == pArgs)) { hr = E_INVALIDARG; ...

Get Professional Windows® Embedded Compact 7 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.