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.

xaml2015

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:-

http://www.microsoft.com/en-in/download/details.aspx?id=38819

The latest Compact 2013 Platform update is here:-

http://www.microsoft.com/en-us/download/details.aspx?id=42027

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

XAML In The Hand

 

Advertisements

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.

https://guruce.com/blogpost/windows-embedded-compact-may-2014-update-35-breaks-binary-compatibility-of-silverlight

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.

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:-

http://inthehand.uservoice.com/knowledgebase/articles/209986-winforms-versus-xaml-runtime-controls

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.

Use Team Foundation Service for Embedded Projects

Microsoft’s hosted TFS (http://tfs.visualstudio.com/) 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>.visualstudio.com. 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.

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

 

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:-

http://support.microsoft.com/kb/2673642