Compact Framework Embedded XAML

Windows Embedded Compact 2013 & Visual Studio 2013

The latest update to Windows Embedded Compact 2013 was a bit of a surprise as besides the usual cumulative bug fixes and tweaks it adds development support with Visual Studio 2015. Since the days of Windows Mobile 6 and even CE 7 it has been common to use an old version of Visual Studio to get things done but here the tools have jumped to the latest Visual Studio version.

Besides the usual Console and Windows Forms project types we’ve tested XAML In The Hand too and you can build managed code XAML based applications. You can debug over Ethernet, edit your XAML with intellisense, use NuGet packages etc all as you would with “big” Windows development.


One of the new features added in Compact 2013 was Behaviors and while you can use them already in XAML In The Hand projects from your XAML we’re investigating whether it might be useful to add code support for these too depending on demand.

The Compact 2013 installation is in two parts – Application Builder is the plugin for Visual Studio:-

The latest Compact 2013 Platform update is here:-

More details on XAML In The Hand can be found here:-


Compact Framework Embedded

Binary incompatibility in Silverlight for Windows Embedded in May 2014 Update Onwards

Last Year Michel blogged about a binary incompatibility introduced in the May 2014 update of Compact 7 which broke existing Silverlight for Windows Embedded code including pre-compiled system apps.

The XAML In The Hand library was also affected. It turns out that one of the breaking changes was the addition of the GetTemplateChild method to the IXRControl interface. Previously this was present in the Compact 2013 codebase but not Compact 7.By adding a method to an existing COM interface (breaking the rules of COM again) means that the vtable offsets of all the methods in interfaces which inherit from this one are all shifted by one. Our next update will incorporate a fix for this (as well as exposing the GetTemplateChild functionality to the managed API) and will support Compact 7 from the May 2014 update onwards. The current released version of Compact 7 is the November 2014 update.

Compact Framework XAML

Moving from WinForms to XAML Runtime on Windows Embedded Compact

I recently found an old set of slides I created for TechEd NZ a few years ago which collected together useful information for moving from Windows Mobile to Windows Phone. It struck me that some of this would also be useful for the Embedded XAML Runtime when considering moving code from a traditional WinForms UI to a XAML based UI using Xaml In The Hand. I’ve modified the table listing controls in both UI worlds and added it to the Knowledge Base here:-

While most of this still applies to Windows Phone (and with a few further changes Windows Store apps) there are items here which are specific to Windows Embedded Compact – The ComboBox control which doesn’t exist on Phone (although there is a perfectly good alternative), and the MediaElement and WebBrowser controls which don’t exist in the XAML Runtime but for which we have created managed code controls which expose the same XAML and C# interfaces.

Compact Framework

Use Team Foundation Service for Embedded Projects

Microsoft’s hosted TFS ( provides a cloud hosted TFS project collection which is free for small teams. It works neatly with VS2012 which is fine for Windows Store and Windows Phone project types but for .NET Compact Framework development we are still stuck with using Visual Studio 2008. Luckily with a few patches it is possible to connect to a Team Foundation Service collection from Visual Studio 2008. I recently had to rebuild my Windows 8 desktop machine so for reference thought I would blog the instructions for setting this up. You’ll need to install the items in the following order:-

No before you ask I didn’t make up the name of that last one, I actually shortened it for you 🙂

To open a project from the server open your shiny up-to-date VS2008 IDE and go to File > Source Control > Open from Source Control. You’ll get a blank dialog with a drop down box for servers and an empty list of projects. Select the Servers… button and then click Add..

You’ll notice that after these updates the dialog allows you to enter a fully formed Url for the server and will grey out the connection details below. You must specify https and include the DefaultCollection indicator, this Uri will always be of the form <yourchosenname> When you click okay VS2008 will connect to the service and then prompt you to authenticate with your Microsoft ID. Once this is successful you’ll see the following:-


It will show you the display name of the account you are logged in as at the bottom left (not on this shot) and a Sign Out option. Things get a little complicated if you regularly use different Microsoft IDs because you can get into a situation where VS2008 shows error messages from the service but doesn’t show what account it thinks you are logged in as or give the option to log out and back in with different credentials. Still haven’t found a neat way around this yet other than making sure you log out from your Microsoft ID in your browser and possibly also the browser within the VS shell. It seems to be a cookie issue and possibly compounded if you use a Windows 8 account signing in with your Microsoft ID. If you’ve successfully got to this step you can select a project, assign a local path and work as you would with a local TFS back end. As well as the source control the work items sync back and forth with the web front end. I don’t think there is any capability to use the “Preview” build services for Embedded projects and doubt if this functionality will be added.

Compact Framework XAML

WriteableBitmapEx for Windows Embedded Compact 7

I have ported René Schulte‘s excellent WriteableBitmapEx project to run on Windows Embedded Compact 7. The original library supports drawing across various XAML user interfaces – Silverlight, Windows Phone, WPF and Windows 8 Apps. Because XAML In The Hand exposes an object model which matches Silverlight there was very little work required to port, it just needed a new Dll project for .NETCF 3.5 and a reference to the XAML In The Hand DLL. This allows a whole range of complex drawing operations to be performed where using Silverlight Paths and Shapes would be inefficient.

WriteableBitmap for Windows Embedded

Performance will vary more because the range of hardware platforms available for Windows Embedded Compact varies considerably, both in processing power and screen sizes. I’ve tested the code on FreeScale development boards at up to 1024×768 and on the new Motorola WT41N1 Wearable Computer which has a small 320×240 resistive touch display with encouraging results. Writing XAML user interfaces for embedded devices is incredibly easy once you’ve experienced the Windows Phone and desktop tools. With built in support for touch and dynamic layouts and all the animation and data-binding you would expect it allows you to write fluid user interfaces for specialist devices where a consumer phone or tablet would be impractical. More information on XAML In The Hand is available here


Compact Framework

Connect Visual Studio 2008 to TFS2012 or Team Foundation Service Preview

Now that there is a new release of Team Foundation Server you may consider upgrading. However if you still work on projects for the .NET Compact Framework you’ll still be using Visual Studio 2008. Luckily there is an update available to allow VS2008 to connect to a TFS2012 server or the new Team Foundation Service Preview (hosted TFS – why not check it out with a free preview account). You’ll need VS2008 Service Pack 1 installed first (but you’ve got that already right!). The download and instructions are available here:-

Compact Framework Windows Mobile

Windows Marketplace for Mobile 6.x to be Discontinued

If you publish apps on the old Marketplace for Windows Mobile 6.x you should have received reminders that the service will be discontinued in two weeks. If you have been using our Mobile In The Hand product with a managed code app there are a couple of issues to be aware of. Our libraries contain the following two classes to provide programmatic access to the Marketplace client on Windows Mobile 6.x:-

  • InTheHand.Phone.Tasks.MarketplaceDetailTask
  • InTheHand.Phone.Tasks.MarketplaceLauncher

If these are called on a device with the Marketplace client installed they will launch the client application however once the service is discontinued no application details will be accessible so this may result in a confusing experience for your users. Consider these classes obsolete as they will no longer be supported and will be removed from the next release.

Compact Framework Windows Mobile

Managing Processes and Memory With Mobile In The Hand 7.0

.NET Compact Framework

The Compact Framework provides the capability to start a separate process from your code, and stop it but it doesn’t give you more detailed information about what is running and what components are in use. Windows CE includes the optional ToolHelp component (present in all Windows Mobile versions). The InTheHand.Diagnostics namespace includes a number of classes for working with ToolHelp in a way which matches the full .NET Framework. The ProcessHelper class includes the GetProcesses() static method to return all running processes on the device. Extension methods GetModules() and GetThreads() return ProcessModule and ProcessThread collections for a specific Process.

ProcessModule exposes name, size and version information for an individual module. ProcessThread exposes id, priority and elapsed processor time.

Another way you might want to interrogate a process is to determine the memory usage. For your own process we’ve followed the Windows Phone model and so InTheHand.Phone.Info.DeviceExtendedProperties.ApplicationCurrentMemoryUsage

provides you this useful figure as a strongly-typed property. It is also accessible from the GetValue method as you would on Windows Phone.

Windows Phone

Other than the built in set of tasks you can’t start any other applications or tell if they are running. You do have access to memory statistics though which are accessible from the Microsoft.Phone.Info.DeviceExtendedProperties class. A limitation here is that if you use this method to get the memory statistics your app will automatically get marked as requiring the ID_CAP_IDENTITY_DEVICE capability which it doesn’t actually need for these properties. We built a helper class for two reasons – firstly to remove this requirement and secondly to provide strongly-typed properties as an alternative to the GetValue implementation. On Windows Phone therefore you can use:-





Mobile In The Hand 7.0

Mobile In The Hand is a suite of components for developing mobile applications across Microsoft’s various mobile and embedded operating systems. It will save you development time and allow you to share more code across different .NET project types.

Compact Framework Windows Mobile

Geocoding and Reverse Geocoding with Mobile In The Hand 7.0

This is the first in a series of posts about Mobile In The Hand 7.0 which brings a collection of reusable components to the .NET Compact Framework. This latest version is updated to support all versions of Windows Mobile including Windows Embedded Handheld, All versions of Windows Embedded Compact (in it’s various names) from 4.1 to 7.0 and a set of companion libraries offering a subset of the functionality on Windows Phone 7.

When the .NET Framework 4.0 was released it introduced a new namespace – System.Device.Location which provided a range of location features. Subsequently this was used as the model for Windows Phone’s APIs. One major whole in the Windows Phone implementation is that the CivicAddressResolver is not implemented and doesn’t return a result. Mobile In The Hand 7.0 comes to the rescue with a two pronged attack:-

An InTheHand.Device.Location.GeoCoordinateWatcher for the .NET Compact Framework. This uses the GPS Intermediate driver present on all Windows Mobile 5.0 and later devices and available as a system component on Windows CE 6.0 and beyond. This is exposed with a familiar object model which matches that found in .NET 4.0 and Silverlight for Windows Phone.

Secondly two new components are provided – BingCivicAddressResolver takes a GeoCoordinate and uses Bing Maps to resolve a CivicAddress object similar to the functionality available on desktop windows. Additionally as an extra feature the BingGeoCoordinateResolver allows you to resolve a GeoCoordinate from an address or partial address. Both of these classes are provided in the .NET Compact Framework and Silverlight for Windows Phone libraries which make up Mobile In The Hand 7.0. The Compact Framework version offers both Synchronous and Asynchronous calls, the Silverlight version just exposes the Asynchronous calls.

Compact Framework Mobile4 Windows Mobile

Mobile In The Hand 4.2 Released

This latest update includes a number of performance enhancements and wider device compatibility.

A new SystemEvents class is added in the InTheHand.Win32 namespace which allows you to monitor power changes on devices which do not support the State and Notifications Broker (Pocket PC 2003 and all Windows CE devices).

InTheHand.Net.WebUtils provides a method to safely encode/decode strings in a HTML/XML friendly way.

InTheHand.WindowsMobile.Status.SystemState now supports more properties on Pocket PC 2003 and Windows CE devices by interfacing with lower level APIs on these devices.

This is a free update from v4.x. Registered users of v3.x can purchase a reduced price upgrade. Full product details here:-