Ian Moulster's blog

A Microsoft employee translating Microsoft technology into plain English

A richer web experience with WPF and XBAPs

A richer web experience with WPF and XBAPs

Rate This
  • Comments 7

If you already know what an XBAP is, jump to the samples (eg a clock, a blackjack game, etc) at the end of this post. If you don't, then read on...

Although an increasing number of people are aware of the Windows Presentation Foundation (a component of WinFX), the perception is that this is exclusively a client technology and has no place in the world of the browser.

This misconception, where it occurs, is an important one because it misses one of the points of WinFX - the blurring of the boundaries between web applications and client applications. Simply put, a WPF application can be made to run in a browser, and therefore enjoy all of the ease of deployment and update benefits that normal web applications have, with a flip of a software switch. When the switch is off, the application behaves like any "normal" Windows application and is installed and run locally on your machine (with all of the benefits of WinFX of course). But when the switch is on, the application can be run from within a browser. It's important to note that this is exactly the same code - it isn't a "web version" and developers don't need to write two versions of the code.

So this sounds great but there's an obvious caveat, that of security: A browser-accessed WPF application will have far fewer rights in terms of what it can do with your machine and will run in a security sandbox. Obviously this will limit what you can do with the applications - they can't access the local hard drive for example. However there may be some instances, eg in your intranet, where you want these apps to have full trust. Karsten Januszewski's blog shows how this can be done.

After a few fumbles with names we've settled on XAML Browser Applications (XBAP) for these kind of WPF apps. See Tim Sneath's blog entry about the naming history and for some examples - also listed below.

The good news is you can see this in action right away: If you're running Windows XP you download & install the WinFX Runtime Components (from here), you can just click on the links below to see a WPF application running inside your browser - IE only.

The first two have been produced by the excellent 3rd party vendor MobiForm using their Aurora development tool:

Valentin Iliescu has done some great work in this space. He demonstrates with this example how WPF vector graphics scale, and how you can represent unusual text like mathematical equations without resorting to bitmaps (as you would if you were using HTML).

It's worth visiting Valentin's website for more information, and also to take a look at his 3D Chess game. He's had this available as an XBAP application for some time but has not yet updated it for the latest CTP but you can check out some screenshots and a video to get an idea of how it works.

Finally, I have compiled up one of the SDK samples and made it available to run here - it's a Blackjack card game.

If you come across any other XBAP apps, or indeed have written one yourself, let me know.

Leave a Comment
  • Please add 2 and 3 and type the answer here:
  • Post
  • I'm really looking forward to a replacement for HTML and CSS that really gives me the ability to provide nice interfaces on the web.

    But XAML only becomes interesting when you have a plugin for Firefox and it will also work in MAC and you don't block Linux guys (mono) from making it work on Linux.

    Then and only then will you see large scale adoption of this for the web.
  • Thanks for the comments - they reminded me of something else I should have included in the original post: This is preview software that's still evolving, so bear that in mind when you're looking at it. We've released these early versions to give developers an idea of what to expect, but this isn't a finished product yet. We have already announced cross-platform support for WPF-type applications via WPF/E (the "E" stands for "Everywhere") and demonstrated a WPF application running via a Safari web browser on an Apple Mac at the PDC.
    So don't look at this as a final product in any sense - it's just a preview to give you an idea of the possibilities.
  • In the world of application delivery there has long been a choice between reach and fidelity: either...
  • Hi,

    I'm new at WPF, but I belive in the future of it!
    I've already developed some simple web-aplication. But sometimes I have a "Trust Not Granted" error.

    The same error I have when I try to open the "Web Paint Factory" sample above. Although the "Clock" sample works properly.

    Do you know how to resolve the "Trust Not Granted" error?

    Regards,
    Eugene
  • Hi,

    I'm new at WPF, but I belive in the future of it!
    I've already developed some simple web-aplication. But sometimes I have a "Trust Not Granted" error.

    The same error I have when I try to open the "Web Paint Factory" sample above. Although the "Clock" sample works properly.

    Do you know how to resolve the "Trust Not Granted" error?

    Regards,
    Eugene
  • Very interesting! I've just started looking at WPF and what it might offer us developers and am very excited about it! I think any platform that can offer end users a richer experience is bound to be embraced.

    A couple of blog I ran across that I found some info and xbap examples on:

    http://xamlxaml.com
    http://theWPFblog.com

  • Hi, Thanks to MS for this effort... But after earching a lot on the net i stictly fee that there should be a few more docs clearly mentioning in a much simpler way the advantages of using WPF, XAML and related techs. Please consider this so taht the freshers will get a better understanding and a better start. Mr Ian Moulster's work is quiet appreciable in that sense. I have jsut started working on this and so i think i will coem abck with my works/comments/queries and suggestions soon...

    Regards

    Raj...

    India

Page 1 of 1 (7 items)