Microsoft Research is building a gesture-sensing physical keyboard!

Microsoft Research has posted a report, as well as the video above, about their prototype for a new, gesture-reading, mechanical keyboard. The prototype, built using the keys of an Apple wireless keyboard (oh, irony, sweet sweet irony), uses a low-resolution matrix of infrared sensors placed between the keys to detect gestures, such as swiping and pinch-to-zoom, on the keyboard.

This achieves an effect similar to the new Touch Cover 2 for the Surface 2 tablets, though the prototype goes a step further, reading gestures taking place above the keyboard instead of sensing you brushing your fingers over its surface.

Source: Microsoft Research

BLU Products teases a shiny new Windows Phone!


Blu Products is a mobile phone maker out in Miami, Florida. They focus on making devices aimed at emerging markets and have a great presence in Latin America, the Caribbean and in the United States. Head to their Facebook page and you’ll see they’ve just teased a new Windows Phone. It’s very, very shiny.

We don’t know much about Blu Products or their plans with Windows Phone. Though it’s not too hard for anyone to become a Windows Phone OEM now that Microsoft has relaxed the rules a bit. Even you can become an OEM by heading to

The Windows Phone they’ve teased, image above, looks a little bit like an Android handset they already make called the Dash 5.0. Inside the Dash 5.0 you’ll find 5-inch display with a resolution of 480 x 854, a 1.3 GHz dual-core processor, 512MB of RAM, dual-SIM support and more. The specs won’t blow you away, but the device does retail for $129.99 on Amazon.

Could this upcoming Windows Phone handset give Microsoft a boost in the emerging smartphone market? Probably.

We’ll work on making contact with Blu Products to learn more about their plans for Windows Phone. In the meantime let us know what you think of the teased image!

Find your local //publish/ event and check out Appy Mondays!

Microsoft does a pretty good job of courting developers and keeping them happy in the Windows Phone and Windows ecosystem. They produce a ton of content and resources to make developers successful in their ecosystem. Appy Mondays is a new program that you can watch live on Channel 9 or YouTube. The content will focus on new apps and development tricks. There’s also a new contest going on that will give out developers prizes for developing apps for Windows 8.1 and Windows Phone 8.1. We’re full of developer information after the break!

There’s a new series on Channel 9 that airs every Monday live. The program is called Appy Mondays and explores new topics in HTML, C#, Objective C, Java and more! Each episode is about 30 minutes long, so something really easy to digest.

We’ve embedded the first episode above so you can watch it. Be sure to head to the shows homepage on Channel 9 for all the other episodes! You can also follow the #AppyMondays hashtag on Twitter to join the conversation.


You already know about //build/, but now it’s time to //publish/. Microsoft is launching a new series of global events to help energize developers to build and publish apps for Windows Phone 8.1 and Windows 8.1. The events take place over May 16 and May 17 around the world.

Be sure to head to the //publish/ website to find and register for your local event. Can’t attend? Check out the //publish/ contest to still win prizes!


Complex Polygons in #Bing Maps

In Bing Maps we can easily create simple polygons. Simple polygons consist of a single exterior ring of coordinates. However, in more advance applications it is useful to be able to draw more complex polygons. Take for instance the borders of Lesotho, which is a land locked country within the main exterior borders of South Africa. In this case to properly represent this country’s borders we would need to have a hole in the polygon. In this blog post we are going to see how you can create complex polygons such as MultiPolygons and polygons with holes using both JavaScript and .NET code in Windows Store Apps.

Complex Polygons in the JavaScript API

The Bing Maps JavaScript controls, both for the web and for Windows Store apps support complex polygons. To enable this support you first need to load the AdvancedShapes module into your application. This module updates the definition of the Polygon and EntityCollection classes. The new Polygon class is initialized with an array of rings, where each ring is an array of locations. The changes to the EntityCollectionare simply to allow it to support the updated complex polygon class.

To implement complex polygons, first create a new Windows Store App in Visual Studio.

Open Visual Studio and create a new project in JavaScript. Select the Blank App template, name the application, and then press OK.


Next, add a reference to the Bing Maps SDK.

Right click on the References folder and press Add Reference. Select Windows → Extensions, and then select Bing Maps for JavaScript. If you do not see this option, be sure to verify that you have installed the Bing Maps SDK for Windows Store apps. Press OK.


Add a new JavaScript file in the js folder called ComplexShapes.js by right clicking on the js folder and selecting Add → New Item. We will add our application specific logic to this file to keep things clean.

Now open the default.html file and add a reference to the Bing Maps SDK along with the modules API. Add a reference to the ComplexShapes.js file. In the body of the document add a div for the map and a button for adding a complex polygon to the map. To accomplish this, update the HTML in the default.html file to the following:

<!DOCTYPE html>
    <meta charset="utf-8" />

    <!-- WinJS references -->
    <link href="//Microsoft.WinJS.2.0/css/ui-dark.css" rel="stylesheet" />
    <script src="//Microsoft.WinJS.2.0/js/base.js"></script>
    <script src="//Microsoft.WinJS.2.0/js/ui.js"></script>

    <!-- ComplexPolygons references -->
    <link href="/css/default.css" rel="stylesheet" />
    <script src="/js/default.js"></script>

    <!-- Bing Map Control references -->
    <script type="text/javascript" src="ms-appx:///Bing.Maps.JavaScript//js/veapicore.js"></script>
    <script type="text/javascript" src="ms-appx:///Bing.Maps.JavaScript//js/veapiModules.js"></script>

    <!-- Our Bing Maps JavaScript Code -->
    <script src="/js/ComplexPolygons.js"></script>
    <div id='MyMap'></div>

    <div style="position:absolute;bottom:0px;left:50%;margin-left:-110px;background-color:black;padding:10px;">
        <button id="AddComplexPolygonBtn">Add Complex Polygon</button>

Next open the ComplexShapes.js file. In this file we will need to add the logic to load the map and the AdvancedShapes module. We will also need to add the logic to add a complex polygon to the map when the button is pressed. In the button handler, clear the map, create some mock data and create a complex polygon with it, then add the polygon to the map. Add the following code to the ComplexShapes.js file to accomplish this.

(function () {
    var map = null;

    function GetMap() {
        map = new Microsoft.Maps.Map(document.getElementById("MyMap"), { credentials: "YOUR_BING_MAPS_KEY" });


    function initialize() {
        Microsoft.Maps.loadModule('Microsoft.Maps.Map', { callback: GetMap });

        document.getElementById("AddComplexPolygonBtn").addEventListener("click", AddComplexPolygon_Tapped, true);

    function AddComplexPolygon_Tapped() {
        //Clear the map

        //Create mock data
        var rings = [
            [new Microsoft.Maps.Location(40, -100), new Microsoft.Maps.Location(45, -100), new Microsoft.Maps.Location(45, -90), new Microsoft.Maps.Location(40, -90)],
            [new Microsoft.Maps.Location(41, -99), new Microsoft.Maps.Location(43, -97), new Microsoft.Maps.Location(41, -95)],
            [new Microsoft.Maps.Location(44, -91), new Microsoft.Maps.Location(43, -93), new Microsoft.Maps.Location(44, -95)]

        //Create a complex polygon
        var polygon = new Microsoft.Maps.Polygon(rings, {
            fillColor: new Microsoft.Maps.Color(150, 0, 255, 0),
            strokeColor: new Microsoft.Maps.Color(150, 0, 0, 255)
        //Add the polyon to the map.

    document.addEventListener("DOMContentLoaded", initialize, false);

If you run this application and press the button, you should see a square with two triangular holes cut out of it displayed on the map.


Complex Polygons in the Native Windows Store Apps

The Native Bing Maps Windows Store SDK currently does not have built in support for complex polygons. However, we can easily use the techniques used in the past to add complex polygons to previous versions of Bing Maps and add this support to the Window Store SDK. Below are some blog posts I’ve written in the past on this topic:

A complex polygon consists of closed rings that represent each part of the polygon, such as the outer boundary or a hole. We can use the standard polygon class in Bing Maps to create complex polygons by concatenating these rings together and tying them back to a single common location. By tying the rings back to a single common location the polygon ends up back tracking on itself and cancels out that part of the polygon. Here is an example of how to order locations so as to draw a triangle with a hole in it. #


To implement complex polygons in .NET, first create a new Windows Store App in Visual Studio.

Open Visual Studio and create a new project in C# or Visual Basic. Select the Blank App (XAML) template, name the application and then press OK.


Next, add a reference to Bing Maps SDK. Right click on the References folder and press Add Reference. Select Windows → Extensions, and then select Bing Maps for C#, C++ and Visual Basic. If you do not see this option, be sure to verify that you have installed the Bing Maps SDK for Windows Store apps. While you are here, also add a reference to the Microsoft Visual C++ Runtime Package, as this is required by the Bing Maps SDK when developing using C# or Visual Basic. Press OK.


In Solution Explorer, set the Active solution platform in Visual Studio by right clicking on the Solution folder and selecting Properties. Select Configuration Properties → Configuration. Find your project and under the Platform column, set the target platform to x86, and press OK.


Now open the MainPage.xaml file and update the XAML to the following:


    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <m:Map Name="MyMap" Credentials="YOUR_BING_MAPS_KEY"/>

        <Border Background="Black" Width="220" Height="65" Padding="10" VerticalAlignment="Bottom">
            <Button Content="Add Complex Polygon" Tapped="AddComplexPolygon_Tapped" Width="200" Height="45"/>

This will add a map and a button to the app for adding a complex polygon. Next open the MainPage.xaml.cs or MainPage.xaml.vb file and update it with the following code. This code adds a MapShapeLayerto the map and the event handler for the button without any logic in it yet.


using Bing.Maps;
using System.Collections.Generic;
using Windows.UI;
using Windows.UI.Xaml.Controls;

namespace ComplexPolygons
    public sealed partial class MainPage : Page
        private MapShapeLayer shapeLayer;

        public MainPage()

            //Add a MapShapeLayer to the map to display the polygon in
            shapeLayer = new MapShapeLayer();

        private void AddComplexPolygon_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)


Imports Bing.Maps
Imports Windows.UI

Public NotInheritable Class MainPage
    Inherits Page

    Private shapeLayer As MapShapeLayer

    Sub New()

        'Add a MapShapeLayer to the map to display the polygon in
        shapeLayer = New MapShapeLayer()
    End Sub

    Private Sub AddComplexPolygon_Tapped(sender As Object, e As TappedRoutedEventArgs)
    End Sub
End Class

Before adding logic to the button handler, we will first create a method for generating a complex polygon. This method will take in a list of rings which are LocationCollections, a fill color, a stroke color and width. This method will also return a MapPolygon and a list of MapPolyline’s which can be used to outline the polygon. This method will ensure all the rings are closed and concatenate them together and tie them to a base location as described earlier to create the complex polygon. Add the following code to the MainPage.xaml.cs or MainPage.xaml.vbfile:


public void CreatePolygon(List<LocationCollection> rings, Color? fillColor, Color? strokeColor, double width, out MapPolygon polygon, out List<MapPolyline> outlines)
    outlines = new List<MapPolyline>();

    if (rings != null && rings.Count >= 0 && rings[0].Count >= 3)
        //Get the first location in the first ring. This will be used as a base point for all rings.
        var baseLocation = rings[0][0];

        var exteriorRing = new LocationCollection();

        foreach (var r in rings)
            //Ensure ring is closed.

            if (r.Count >= 3)
                //Add ring to main list of locations
                foreach (var l in r)

                //Loop back to starting location

                if (strokeColor.HasValue && width > 0)
                    //Create Polyline to outline ring
                    outlines.Add(new MapPolyline()
                        Color = strokeColor.Value,
                        Width = width,
                        Locations = r

        if (fillColor.HasValue && exteriorRing.Count > 3)
            polygon = new MapPolygon()
                Locations = exteriorRing,
                FillColor = fillColor.Value


    polygon = null;


Private Sub CreatePolygon(rings As List(Of LocationCollection), fillColor As Color?, strokeColor As Color?, width As Double, ByRef polygon As MapPolygon, ByRef outlines As List(Of MapPolyline))
    outlines = New List(Of MapPolyline)

    If (rings IsNot Nothing And rings.Count >= 0 And rings(0).Count >= 3) Then
        'Get the first location in the first ring. This will be used as a base point for all rings.
        Dim baseLocation = rings(0)(0)

        Dim exteriorRing = New LocationCollection()

        For Each r In rings
            'Ensure ring is closed.

            If (r.Count >= 3) Then
                'Add ring to main list of locations
                For Each l In r

                'Loop back to starting location

                If (strokeColor.HasValue And width > 0) Then
                    'Create Polyline to outline ring
                    Dim p = New MapPolyline()
                    p.Color = strokeColor.Value
                    p.Width = width
                    p.Locations = r

                End If
            End If

        If (fillColor.HasValue And exteriorRing.Count > 3) Then
            polygon = New MapPolygon()
            polygon.Locations = exteriorRing
            polygon.FillColor = fillColor.Value
        End If
    End If

    polygon = Nothing
End Sub

We can now add logic to the button event handler. In this event handler we will want to clear the shape layer of any data, create mock data and use it to generate a complex polygon, and then finally add the polygon and/or the outlines of the polygon to the map. This last step is a great place to add any additional logic you wish to add to the polygon, such as a tap event. Update the AddComplexPolygon_Tappedevent handler with the following code to do this:


private void AddComplexPolygon_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
    //Clear any shapes in the map shape layer.

    //Create mock data
    var rings = new List<LocationCollection>(){
        new LocationCollection(){ new Location(40, -100), new Location(45, -100), new Location(45, -90), new Location(40, -90) },
        new LocationCollection(){ new Location(41, -99), new Location(43, -97), new Location(41, -95) },
        new LocationCollection(){ new Location(44, -91), new Location(43, -93), new Location(44, -95) }

    //Create the colors for styling the complex polygon
    var fillColor = Windows.UI.Color.FromArgb(150, 0, 255, 0);
    var strokeColor = Windows.UI.Color.FromArgb(150, 0, 0, 255);

    MapPolygon polygon;
    List<MapPolyline> outlines;

    //Create the complex polygon.
    CreatePolygon(rings, fillColor, strokeColor, 5, out polygon, out outlines);

    //If the polygon is not null add it to the shape layer
    if (polygon != null)

    //If the outlines for the complex polygon are not null add them to the shape layer.
    if (outlines != null)
        foreach (var l in outlines)


Private Sub AddComplexPolygon_Tapped(sender As Object, e As TappedRoutedEventArgs)
    'Clear any shapes in the map shape layer.

    'Create mock data
    Dim rings = New List(Of LocationCollection)

    rings.Add(New LocationCollection())
    rings(0).Add(New Location(40, -100))
    rings(0).Add(New Location(45, -100))
    rings(0).Add(New Location(45, -90))
    rings(0).Add(New Location(40, -90))

    rings.Add(New LocationCollection())
    rings(1).Add(New Location(41, -99))
    rings(1).Add(New Location(43, -97))
    rings(1).Add(New Location(41, -95))

    rings.Add(New LocationCollection())
    rings(2).Add(New Location(44, -91))
    rings(2).Add(New Location(43, -93))
    rings(2).Add(New Location(44, -95))

    'Create the colors for styling the complex polygon
    Dim fillColor = Windows.UI.Color.FromArgb(150, 0, 255, 0)
    Dim strokeColor = Windows.UI.Color.FromArgb(150, 0, 0, 255)

    Dim polygon As MapPolygon
    Dim outlines As List(Of MapPolyline)

    'Create the complex polygon.
    CreatePolygon(rings, fillColor, strokeColor, 5, polygon, outlines)

    'If the polygon is not null add it to the shape layer
    If polygon IsNot Nothing Then
    End If

    'If the outlines for the complex polygon are not null add them to the shape layer.
    If outlines IsNot Nothing Then
        For Each l In outlines
    End If
End Sub

The application is now complete. Run it and press the button to generate a complex polygon on the map.


You can download the full source code for this blog from the MSDN samples here. You can also find a WPF version of this code sample here.

If you are looking for some other great resources on Bing Maps for Windows Store apps, look through this blog, or check out all the Bing Maps MSDN code samples.

For more Bing Maps posts for developers, check out the Bing Developer Center blog.

Microsoft Launches Ad-Free ‘Bing in the Classroom’


Microsoft’s Bing in the Classroom program launched today, bringing ad-free searches to K-12 schools across the U.S.

A pilot version of the service, formerly known as “Bing for Schools,” launched earlier this year in five of the largest public school districts in the country.

In the months since, it has grown to hundreds of new districts, covering more than 4.5 million kids in 5,000-plus schools. According to Microsoft, the service has processed more than 35 million ad-free queries during this school year.

“We created Bing in the Classroom because we believe students deserve a search environment tailored for learning,” Microsoft’s Matt Wallaert said in a statement. “Classrooms should be ad-free, and that should be as true online as it is offline.”

More than just an educational search tool, the program offers enhanced privacy protections and sets strict filters to block adult content. It also prevents searches from being used for ad targeting.

Once activated, Bing in the Classroom searches only from within the school network, removing all advertisements from search results. Parents and teachers can breath a sigh of relief, as Redmond promises to guard kids from marketing messages like for-profit online degree programs and fast food.

Enhanced specialized learning features also promote digital literacy in the classroom by offering three learning activities each school day. Just like the adult version, Bing in the Classroom features a daily homepage image, which poses a question that requires critical thinking and the search engine to find an answer.

And if you miss a day or two of homepage lessons, Bing keeps an archive on the Microsoft Educator Network.

Adults can participate, as well, earning credits toward Bing Rewards by searching with the Microsoft-owned engine. When 30,000 credits are accrued, your school of choice will earn a Microsoft Surface tablet with Type Cover. There is no limit on the number of tablets a school can earn; about 60 Bing Rewards users can earn a Surface in a month.

To celebrate today’s Bing in the Classroom launch, NBC correspondent and former presidential daughter Jenna Bush Hager is visiting PS 205 Clarion in Brooklyn, NY, to discuss the importance of digital literacy in schools.

Last year, Google joined the education revolution when it launched Google Play for Education, which allows teachers to discover apps designed specifically for K-12 students.

Changes to Theme Resources in Windows Phone 8.1

On Windows Phone we have the choice to set our theme to either Light or Dark – this will affect all apps and on top of that we also have the Accent Color to personalize our device even more. Windows 8.1 on the other side hasn’t themes or Accent Color but as the platforms converge we get same API on both platforms – but with slightly different behavior.


We couldn’t force our Windows Phone 8 app out of the box to only use the light theme but PhoneThemeManager made it possible. A single line of code and the app was forced into light theme. Though AppBars required some extra code and MessageBoxes wasn’t themed at all it worked really well.

Then came Windows Phone 8.1

With a single line of code in XAML we can force the app to a theme we want without additional code or hacks.

<Application x:Class="App2.App"

In this example it’s done in app.xaml which sets the theme to light across the app. But we are not limited to only set this property in app.xaml but we can also do it on any page or even on any FrameworkElement.

Accent Color

By changing accent color the user can get a feel of a more personalized device, and using this color in your app may enhance this feeling. In Windows Phone 8.0 we could do this with:

Background="{StaticResource PhoneAccentBrush}"

In Windows Phone 8.1 we got a new type of accentcolor resource:

Background="{ThemeResource SystemColorControlAccentColor}"

This also works in Windows 8.1 apps so that it’s possible to share XAML in universal apps and still take advantage of accent color. But since accent color doesn’t exist on Windows 8.1 the color we get will always be Blueberry.

No more restarts

Another new feature that comes with Windows Phone 8.1 is that the need to restart the app after changing theme is gone if you are using ThemeResource in your bindings. So changing accent color or theme will take effect immediately which is really cool.


Happy coding! 🙂