#PDC08 talk: .NET 4.0 Declarative programming using XAML

.NET, PDC, Silverlight, Technical stuff, Work, WPF
See comments

3 XAML vocabularies: UI, Workflow, XPS.

Used in mutliple runtimes: .NET 3,0, 3.5, Silverlight 1 and 2.

Many tools too (Visual Studio, Expression Blend).

XAML Specds were published earlier this week, 600 page volume schema for all variations of the language.

Lots of file converters exist, from SVG, Flash, Illustrator, WMF, etc etc etc. The list is impressive!

Next version will be extended to support more XAML-only code. For example, support for generics.

Investments will be done to catch XAML errors much better than now. Also support obfuscation, localization, FxCop, VS Integration etc.

Some people have been writing their own XAML parser (about 10 people in the room).

In .NET 4.0, XAML 2009 will be released.

XAML 2009 improvements

x:Reference to improve referencing other elements.

Built-in types will be more easily authored: x:String, x:Boolean etc…

Support from generics everywhere: x:TypeArguments to represent the generic type.

Support for arbitrary dictionary key types. x:TypeArguments specifies the type of the key. Not always treated as a string anymore.

Better declarative events. Also supports a markup extension that returns a delegate. For example, returning the delegate by generating a workflow (WF).

Will make it easier to declare new properties. Can add new properties declaratively in XAML.

Using non default constructors. x:Arguments property allows to specify which object constructor you want to use. (Is that the death of ObjectDataProvider?)

Using static factory methods in XAML to create objects. x:FactoryMethod.

Wow impressive

Rob now demonstrates the new content model. A so-called “DOM box” (not to be confused with Don Box!!) is displayed. It shows a graphic representation of the XAML code. It is made possible because the model of the XAML element is exposed.

This new XAML pad is really helpful. Also, it doesn’t blow up anymore if you specify events in your XAML.

System.Xaml.dll in .NET 4.0

This new assembly will make it much easier to process XAML in .NET 4.0. A CTP will be released in November 2008. It will run in .NET 3.5. This is what allowed to create the DOM Box.

Rob shows how XAML is processed to objects in .NET 3.0 and then in 4.0.

New XamlXmlReader class helps to parse XAML. Allows to build a graphic representation of the XAML in less than 5 minutes.

Then Rob shows how to write the “object box” and create the objects from XAML. Class “ObjectWriter”.

There is also a class BamlReader.

The ObjectWriter and XamlXmlReader make it much easier to parse and also debug XAML in just a few lines of code.

The opposite also exists: ObjectReader and XamlXmlWriter. There will be a public API write BAML directly too (BamlWriter, BamlReader).

Pure XAML in WCF

Daniel now demoes how to create a pure XAML application able to display stock option advices.

Wrapping up

Daniel wraps up by encouraging the audience to use XAML in more frameworks, it’s ready.

Previous entry | Next blog entry

Comments for #PDC08 talk: .NET 4.0 Declarative programming using XAML