Looking for my RSS feed? Here it is!

Using Xaml to Represent Objects (Video)

Saturday, March 25, 2006

Since most of the WinFX (.NET) world is going to declarative programming, I think it would be wise for us API designers to starting thinking the same way. Xaml is really our key to that. We don't need to have our own XML dialect to provide a declarative model to developers, we just need to realize that Xaml isn't just a markup language for graphical controls... nor is it solely for Microsoft created frameworks (i.e. WPF, WWF). We too can tap into the beauty of Xaml by simply understanding how simple it is.

In this video I demonstrate how to create a simple data-bound WPF application using Xaml using a C# class to feed the data. Then I alter the WPF application to be purely in Xaml... even the data binding to LLBLGen.

This video is really just a proof of concept of something that I personally consider very experimental at this stage. In the future however, I do expect most WinFX coding to go hand in hand with declarative programming. In fact, you can already see how ASP.NET, Atlas, WPF, WCF (the config file), and WWF are strongly declarative based. Since Xaml is not much more than an XML representation of .NET objects, exposing an API shouldn't be that difficult for us. Most of the time I'm sure a simple framework built with SOA principles in mind should be OK.

Here's the link to download the video:

October 11, 2006 Update

About the time I released the video, the API changed... and for some reason I didn't post this update until just now! So here's an update for it.

In the video I put this at the top of the Xaml file.

<?Mapping XmlNamespace="NorthwindCollections" ClrNamespace="Northwind.DAL.CollectionClasses" Assembly="Northwind.DAL" ?>

That's not how we do things anymore. These days we do this...

<Window x:Class="..."
xmlns="..."
xmlns:x="..."
xmlns:ns="clr-namespace:Northwind.DAL.CollectionClasses;assembly=Northwind.DAL">

Comments (3)

Anonymous

This video is great! Someone should do a series of these for WPF, WCF and WWF. Great job!!

3/27/2006 2:36:00 PM

David Betz

I actually do plan on doing a few more videos on this type of stuff. Tonight or so I'll be recording what you could think of as part 2 of this. I'll be demonstrating how you can alter the default generated LLBLGen code a tad bit more as an example of how full APIs can be altered slightly to allow for purely declarative development. The XAML will also be updated to use the Feb CTP release (this video uses the Jan CTP XAML).

3/27/2006 2:49:00 PM

Kai Bohli

Great video David !. I was actually wondering about how I could use LLBLGen with WPF. After countless attempts with Expression Blend and VS2008 Beta 2, I was on the verge to give up. You've given me a great start of this week. I like your style and your fast progress through the stuff. Please keep up the great work you're doing on .net 3.x and LLBLGen. Thanks a lot. Best wishes Kai Bohli Norway

10/1/2007 11:15:36 AM

Math Problem: 9 + 3 (type the answer in the box)

Notice: all comments are subject to moderation.

Comment saved. All comments are moderated and may not show up for some time.

Creative Commons License
This work is licensed under a Creative Commons Attribution 2.5 License.

Powered by the Minima Blog Engine, NetFXHarmonics Prominax, and Squid Micro-Blogging library.

Developed using NetFXHarmonics DevServer.

Mini-icons are part of the Silk Icons set of icons at famfamfam.com