Building an application that uses the LiveFX is easy. So is building an application that uses Windows Live ID. Using the Windows Live ID Client SDK also means that you’re not asking a user to supply your application with the username and password which means that the user can remain safe that they’re not just giving out their username and password for the program to with as he wishes. So if both sorts of programs are easy, is it easy to combine the two? Well, yes.
In Visual Studio, I created a quick Windows Form that looks like the following:

After the LiveFX application I showed yesterday, I will now do the same but for a Silverlight Mesh App, so this would actually appear in your Live Desktop. Like yesterday’s tutorial, this is only really for those who have been given access to the LiveFX and Mesh SDK ‘bits’ at the moment, but when it does eventually go live for all developers, then you’ll be able to use the same tutorial.
Welcome to the first part in series that takes you through the core functionality of the Microsoft’s Virtual Earth JavaScript control. Through example code I hope to either introduce you to the Virtual Earth control or show you how to do things better and highlight some things you may not have known. I will be making use of the jQuery JavaScript library to provide valuable helper functions and simplify our code. If you feel there is something that could done better please share your ideas in the comments below.
Lets start by loading the Virtual Earth map on a page. Sounds trivial? Well it is, but lets do it as if you were building a real world application and include:
- Browser detection to only load the map for supported browsers
- Binding to the body onload method programmatically as you may not have access to the actual HTML tag
- Dispose the map when you are done
- Load the Virtual Earth JavaScript after the page has loaded to make things load fast
- Have a onLoadedMap method where you can add your data once the map has loaded
- Put your code and styles in external files from the HTML page itself
This post is really just a starting point on using the LiveFX. Now, although I’ll show you a quick application, you won’t be able to use any of this just yet unless you have been given a LiveFX token (which you would redeem at the Azure Dev Portal). This framework also works with the Live Mesh client, although you don’t need Live Mesh to be installed for it to work.
For this simple demo, I’ll do a console application that will print out my name, my email address (which will be blurred :P ), my current Messenger PSM (Personal Message Status), and the number of contacts I have.
Because this is mainly for those who already have access to the LiveFX ‘bits’ I will assume at this point that you have already downloaded and installed the relevant prerequisites.
The code for this is very simple:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.LiveFX.ResourceModel;
using Microsoft.LiveFX.Client;
using System.Net;
namespace MeshConsoleApp
{
class Program
{
static void Main(string[] args)
{
LiveOperatingEnvironment loe = new LiveOperatingEnvironment();
string uriResponse = "https://user-ctp.windows.net";
NetworkCredential creds = new NetworkCredential("WLID",
"PASSWORD",
uriResponse);
loe.Connect(creds);
// This gets the Messenger PSM
Profile prof = loe.Profiles.Entries.Single(e => e.Resource.Title == "GeneralProfile");
var _messengerPSM = (GeneralProfile)prof.Resource.ProfileInfo;
// Prints the user's name
Console.WriteLine("Details for " + loe.Mesh.ProvisionedUser.Name);
// Prints the email address
Console.WriteLine("Email Address: " + loe.Mesh.ProvisionedUser.Email);
// Prints the Messenger PSM (gained above)
Console.WriteLine("Messenger PSM: " + _messengerPSM.PersonalStatusMessage);
// Prints the number of contacts I have with this WLID
Console.WriteLine("Number of contacts: " + loe.Contacts.Entries.Count());
Console.ReadLine();
}
}
}
Now, in the NetworkCredential object you would put your WLID and password in (mine are removed for obvious reasons). The results of this look as follows:

As you can see, the PSM taking what mine currently says.
This is only really scratching the surface of what the LiveFX can actually do but is a nice way to quickly get started.
Whilst there has been no official word on this yet, I noticed today that the Windows Live Tools for Visual Studio has been updated on Microsoft Downloads.
From the download page:
This CTP is an update to July 2008 CTP Release. In this CTP, we have made Windows Live Tools compatible with Windows Azure and upgraded to Silverlight 2.0. This package includes following:
ASP.NET Server Controls
• Contacts
• IDLoginStatus
• IDLoginView
• Map
• MessengerChat
• SilverlightStreamingMediaPlayer
Visual Studio Project Template
• ASP.NET Windows Live Web Site
• Windows Live Web Application
• Windows Live Web Role (template for Windows Azure Cloud Project)
The major update is the compatibility with Azure, which as you know, got released yesterday.
The update, from what I can tell, will require you to uninstall any previous version of the Tools (although this could have just been my PC, but whatever).
Download the update from Microsoft Downloads.
Just to whet our appetites for what’s to come, the dev.live.com website has been updated, complete with a new logo. There’s no new content on there yet, but that will start showing up tomorrow after David Treadwell’s Keynote at PDC.
We’ll be keeping our eyes peeled tomorrow, as will Kip. Don’t forget you can follow what’s going on at PDC from our perspective by following us on twitter.

There are locations in Virtual Earth where Bird's eye Imagery doesn't exist for certain directional facings. When a user attempts to rotate the Bird's eye view when imagery is unavailable for that directional facing, maps.live.com displays a warning message. Nothing will occur by default using the VE 6.2 API. In addition, a bug fires that causes the VE dashboard will become unusuable (see screenshot below) when a user rapidly clicks the same button several times using VE 6.2. On the odd occasion the map view will even flip to road view showing all ocean tiles.
So far in this series we have learned about the Sign-In control, how to use it and the new features allowing you customize and hide it. We have also learned about the User class, how to implement that and also some of it’s new features such as the ability to display the user’s sign-in picture. The next step in our journey through the Web Messenger API and our Custom Control is contacts. After all there is little point in having a messenger control if you have nobody to talk to.
In Windows Live Messenger, there is the ability to group your contacts. You can place each contact into a group so that referencing a contact becomes quicker and Messenger is easier to manage. So before we delve into Contacts themselves, we need to implement groups.
Via Mary-Jo Foley and Angus Logan we learn that Microsoft has just aired the site Live Services Jumpstart 2009 for their ‘secret training’ sessions ‘to explore the full breadth of the consumer components of … Live Services’. This 2-day training session will be held in 11 cities around the world (US, Asia, Australia, Western-Europe and Eastern-Europe), and will provide a deep-dive in different Windows Live technologies. While you're able to register for it, it's an invitation-only event and attendance is free (although MJF reports otherwise).
According to the Jumpstart and PDC agendas the following technologies are part of Live Services:
Microsoft Virtual Earth
Live Search
Windows Live ID
Web Authentication
Client Authentication
Delegated Authentication
Federated Authentication
Silverlight Streaming
Windows Live User Data APIs
Windows Live Messenger
Live Mesh
For the reader that paid attention, this list consists of all the current APIs and SDKs that allow developers to get data from Windows Live. Some other remarkable points are:
The logo that is associated with Live Services is the logo currently being used by Live Mesh. Given this and the frequent use of Live Services in combination with Live Mesh in the PDC agenda, it is being revealed that Live Mesh is part of Live Services.
The notion of “I'll ‘MSN’ you!” may sound remarkable to some readers, however in some countries (including The Netherlands) the acronym MSN has become a synonym for IM'ing.
From the PDC agenda we learn that programming against these Live Services is backed by the Live Framework. As it seems that it is a new framework, with a new architecture, we might see a refresh of the whole spectrum of APIs and SDK currently being offered, during PDC later this month.
The Virtual Earth JavaScript control is not small weighing in at 217KB when compressed in Version 6.2. When you require the rich experience of Virtual Earth this size is not an issue, the control is aimed at broadband users and within a few moments of interacting with the map you can easy exceed this with the rich imagery being loaded on demand. But what if your web page only needs to show the Virtual Earth map when a user asks for it or you just want your page to load super fast? You need to load Virtual Earth on demand.
See an example here: http://www.soulsolutions.com.au/examples/VE62/loadondemand.htm (view source for full code)
The Virtual Earth JavaScript control has supported tile overlays for some time. A tile layer is set of 256px square images matching the Mercator projection of Virtual Earth. Tile layers are usually layered on top of Virtual Earth, the control supports transparency and an opacity of the entire layer. With the latest release of Version 6.2 of the control you can now disable the base tile layers allowing for greater performance when your tiles are all you need. Lets look at what is required to load OpenStreetMap tiles into Virtual Earth.
Before moving onto the next part of the Web Messenger User Control, I was running through the code I have developed so far and happened upon a couple of bugs, so this part of the Web Messenger User Control tutorial will be a short one fixing the bugs in the code we have so far.
On fixing these bugs the User Control works as expected and you end up with something akin to the following :-
Continuing our series on the Web Messenger control we will take a look at a couple of more API calls you can make and give your control added functionality.
Going back to our class there are another couple of properties that are quite interesting :-

The first of these is the Mailbox property.
In the last part of this series we covered customizing the Windows Live Sign-In Control and some of the new features that have been added to the API for this control. In this part we will cover some of the new features that are available for Users’ Contacts and the User him/herself.
So now that you are able to sign-in to your messenger User Control, we want to display some information about who’s actually signed in.
