Archive for the 'LaunchE' Category

Writing controls for WPF/E

Saturday, February 24th, 2007
One of my old buddies from the Avalon team Nick Kramer has a great post on building controls for WPF/E. This article has a ton of great tips for how to work with the current builds.
For controls he uses an interesting technique of putting the control in the WPF/E markup as a <Canvas> with an onLoaded event on each control that triggers the control creation-

<Canvas Loaded="javascript:MakeButton" Canvas.Top="100" Canvas.Left="20"/>

This brings up another thing that I was working on for the next build of LaunchE. I’m hoping to enable full markup of the controls more like this-
<TextBlock x:Name="ScrollText" Canvas.Top="50" Canvas.Left="20"
  FontFamily="Verdana" FontSize="12">Scroll value:</TextBlock>
<l:Button x:Name="Button1" Left="50" Top="100" Width="100" Height="20"
  Text="A Button" />
<TextBlock x:Name="ScrollText" Canvas.Top="150" Canvas.Left="20"
  FontFamily="Verdana" FontSize="12">More Text</TextBlock>
The idea is that a pre-processor scans through your XAML and interprets the tags in the LaunchE namespace (l: prefix). Those get reparsed an the XAML parser is fed the new tree.

Coming in the next build of LaunchE

Thursday, February 22nd, 2007

The first build of LaunchE that is online now is pretty basic. We considered waiting to make more progress but it made sense to try to get it out in the public sooner and get feedback as soon as possible. So please, let us know what you think either in the comments here or by email. We also welcome code submissions as long as you are willing to grant us the necessary copyright so that we can continue with our existing license.

Also I thought it would be useful to give everyone a heads up on the next things that are coming in the library. RadioButton and ScrollBar are both pretty much done and after that we will probably start working on some layout concepts like Grid.

One important decision that we are still wrestling with is control composition. Real WPF controls are all pretty much built out of other controls and can have any other controls embedded in them. In that model ScrollBar gets built out of 5+ other controls for the various regions.

So far we are not taking the same approach for LaunchE. My concern is that the quantity of controls was sometimes a perf issue even with compiled C# code, with the JavaScript platform we need to be careful to make sure it runs fast enough. So ScrollBar is itself one control that deals with its own sub-parts. This reduces some degree of flexibility, but I hope to still enable a Button control that has arbitrary other stuff embedded for its content.

Introducing LaunchE WPF/E Library

Tuesday, February 20th, 2007

Since Microsoft first introduced WPF/E in December we have been pretty excited to do some cool stuff with it. WPF/E itself is a very basic vector and media rendering tool, so building a framework for controls (and eventually layout) seemed like an obvious project to enable the use of this tool in real-world applications.

Today we are putting online the very first early-preview build of LaunchE, the WPF/E controls library. This version only supports Button and Checkbox, and only very basic support for those, but more controls and capabilities are coming soon.

LaunchE Basics Demo

Some key features-

Uses JavaScript inheritance to build sub-classed controls.

Ability to re-skin a control without inheritance (just replace the template XAML).

Support for adaptive layouts (for example, centering the text in the button control).

Events (just Click for right now).

Please check it out and send us feedback. Feel free to use it in your own projects, but at this point we are still likely to make breaking changes as we flush out its capabilites.

Check out a very simple demo of LaunchE

Download the JavaScript Source code (version 0.001)