PDC Xaml Demo

This is probably stupid (and old news now), but if you saw the xaml demo during the PDC of Avalon (presented by Don Box I think), here is the code to reproduce that sample. Please note that you would need to change the source tag in the Video class to a path that makes more sense for you.

Also, as always, please use common sense when running this. Don’t flame me if something blows up. 🙂


    Text=”Amit’s First Longhorn App” Visible=”True”
    <!–  The namespace + class name in the codebehind file and the def:Class attribute in the root of this document, must stay identical.  You can change them, but you must keep them in sync. –>
        <Canvas DockPanel.Dock=”Fill”>
    <Video Width=”100%” Height=”100%” Stretch=”Fill” Source=”c:\temp\ChrisA-DonB_300K.wmv” />
    <TransformDecorator Transform=”rotate 30 scale 3 3″ DockPanel.Dock=”Fill”>
        <TextBox ID=”foo” Width=”2in” Height=”20pt”></TextBox>
        <Button Click=”Pushed”>Click Me</Button>

window1.xaml codebehind:

//This is a list of commonly used namespaces for a window.
using System;
using MSAvalon.Windows;
using MSAvalon.Windows.Controls;
using MSAvalon.Windows.Documents;
using MSAvalon.Windows.Navigation;
using MSAvalon.Windows.Shapes;
using MSAvalon.Windows.Data;

namespace LonghornApp1


/// Interaction logic for Window1.xaml

public partial class Window1 : Window

// To use Loaded event put Loaded=”WindowLoaded” attribute in root element of .xaml file.
// private void WindowLoaded(object sender, EventArgs e) {}

void Pushed(object o, ClickEventArgs e)



Author: Amit Bahree

This blog is my personal blog and while it does reflect my experiences in my professional life, this is just my thoughts. Most of the entries are technical though sometimes they can vary from the wacky to even political – however that is quite rare. Quite often, I have been asked what’s up with the “gibberish” and the funny title of the blog? Some people even going the extra step to say that, this is a virus that infected their system (ahem) well. [:D] It actually is quite simple, and if you have still not figured out then check out this link – whats in a name?

Leave a Reply