實作Windows Embedded CE 6.0 R3 Silverlight UI.

建置Silverlight UI project

1. 新增Windows CE subproject project

clip_image003

  • 選擇WinCE Application

clip_image006

  • 建置Simple application

clip_image009

2. 新增Resource檔

  • Resource檔可便於放置Silverlight的XAML檔及圖片等

clip_image013

clip_image016

clip_image018

3. 將XAML檔及圖片包入resource檔

  • 將利用Expression Blend所開發出的XAML檔及圖片放置你喜愛的位置
  • 使用文字編輯工具開啟rc檔並增加下面的描述

XAML檔所在位置

IDR_XAML1 XAML "RES\\XAML\\Page.xaml"

同XAML檔元件名稱 此為固定用法 圖片檔所在位置

res/Calendar.png XAML_RESOURCE "RES\\IMG\\Calendar.png"

res/Clock.png XAML_RESOURCE "RES\\IMG\\Clock.png"

res/Settings.png XAML_RESOURCE "RES\\IMG\\Settings.png"

4. 包含所需的Library及header file

  • 於sources檔加入下列描述

INCLUDES=$(_OEMINCPATH)

TARGETLIBS= \

$(_PROJECTROOT)\cesysgen\sdk\lib\$(_CPUINDPATH)\xamlruntime.lib \

5. 增加所需的程式碼

  • 參考Silverlight.cpp

6. 建置Silverlight UI程式

image

7. Download並執行

clip_image023

clip_image026

clip_image029

clip_image031

附註:

Silverlight for Windows Embedded is a native (C++ based) user interface (UI) development framework for Windows Embedded CE powered devices and is based on Microsoft Silverlight 2.

image

Windows Embedded C E 6.0 R3 supports the following gestures.

image

 

Gesture

Description

Flick

The user presses a finger on the screen, moves the finger in any direction, and then lifts up the finger to initiate scrolling that continues for a short time after the screen contact ends.

The gesture recognizer sends the application a single GID_SCROLL gesture message upon finger-up. A flick frequently occurs after a pan (one or more GID_PAN gesture messages followed by a GID_END message immediately before the flick).

Pan

The user presses and holds a finger on the screen and then drags the finger in any direction. This represents a mouse move event.

The gesture recognizer sends the application one or more GID_PAN gesture messages as the position changes, followed by a GID_END when the user lifts the finger. Mouse messages are interleaved for backward compatibility, but the gesture messages are always received before the corresponding mouse events.

Panning can occur after a hold gesture.

Tap

A tap represents the left click of a mouse.

The application receives a single GID_SELECT gesture message when the finger–down event and finger–up event occur within a defined time period and a specific distance. There can be several WM_MOUSEMOVE messages after the WM_LBUTTONDOWN event and before the GID_SELECT message.

Double Tap

A double-tap represents the left double-click of a mouse.

The application receives a GID_DOUBLESELECT message when two finger–up events occur within a defined time period and a specific distance.

Hold

The user presses and holds a finger on the screen. This represents the right-click of a mouse.

The application receives a single GID_HOLD message when the finger remains down for longer than a defined time period and does not move more than a specific distance. The GID_HOLD message is followed by a GID_END message on finger–up or at the end of the hold time threshold.

Barry 發表在 痞客邦 PIXNET 留言(0) 人氣()