6th December 2006

WPF- WPF/E More Questions

The main set of questions that stand out with WPF/E at the moment is to figure out just what is missing (and what will be missing when the final version ships). One of the nice aspects is the install is smaller, and it runs on Macs, etc. But it doesn’t
appear to use the same high fidelity text engine and all that that the full WPF does. The real WPF isn’t a strict superset of WPF/E, to run without the CLR and on other platforms I suspect that its actually a completely different implementation. It would be nice if, on machines where full WPF exists you automatically got the benefits of full WPF, and the WPF/E engine only ran when its not there.
But I guess this brings us to one of the slightly confusing parts of the wonderful Microsoft technology naming. WPF/E isn’t really that similar to WPF. It’s a different engine, a different runtime model, etc. Hopefully they share some of the same rendering code, but mostly from a programming point of view the only thing they share is the ability to specify things in XAML. Even there, you window up using the http://schemas.microsoft.com/client/2007 namespace for WPF/E and the http://schemas.microsoft.com/winfx/2006/xaml namespace for WPF (and some of the later namespace is used for WPF/E also).
What this means is that you can create a XAML file for WPF/E. Double click it in the explorer and it will open in IE, and WPF will try to render it, but fail. Presumably this is a minor inconsistency that Microsoft can fix (although its not clear if that can be fixed in the final 1.0 version of WPF/E or if it needs to wait for a new version of .NET or if its just something you can work around in authoring your XAML).
It is clear that it is still early days for this stuff. WPF/E doesn’t even have a textbox yet. Presumably that is a key thing for them to add before they ship version 1. In the end I’m VERY glad that Microsoft choose to get this out into the community so we could start working with it at such an early stage- it looks like yet another sign of a more responsive Microsoft.
On another front, I’d point out that the support for media that is in the existing build is critical. So many of the scenarios where people want to embed richer content involve media, and this is one of the most common uses of flash around the web. The notion that this is a runtime where I can just play WMV and WMA on any browser any where and that its much easier to construct those players than with flash will be a critical strategic advantage for Microsoft.
On another front, I’m working on some tools to report to Google analytics how many of your users have WPF/E installed vs. not. It seems like it will be very interesting to track what percentage of my audience already has it when they come to my web-sites. I’ve created a small JavaScript function that detects the browser, platform and whether or not WPF/E is installed.
function GetWPFEStatus()
var Status = "WPFE-";
var Installed = false;

if((navigator.appVersion.indexOf('MSIE') != -1))
	Status += "IE-";
		var TheWPFE = new ActiveXObject("AgControl.AgControl.0.8");
			Installed = true;
		if((window.GeckoActiveXObject && navigator.userAgent.indexOf('Windows') != -1))
			Status += "FF-WIN-";
		else if(navigator.userAgent.indexOf("Macintosh") != -1)
			Status += "MAC-";
		else if(navigator.userAgent.indexOf("Linux") != -1)
			Status += "LINUX-";
			Status += "UNK-";
		for (var i=0; i < ; i++)

You can then wire this in to your Google Analytics reporting like this-

_uacct = "-your-code-here-";

Yesterday’s technique to animate the text rotation was a good
exercise in talking to WPF/E with Javascript, but not really the
most efficient way to do an animation in WPF/E. Today I’ve got
an update that uses the built in animation objects. One interesting
point is that while the built-in technique is more efficient, it
isn’t necessarily more clear in the code…

posted in WPF | 0 Comments