Welcome to WindowsClient.net | Sign in | Join

Rob Relyea - XAMLified

WPF, Silverlight and XAML

XAML State of the Union – Feb 2009

Dear XAML Nation:

My days, like many of you, are filled with work with XAML.  This space gets more exciting every year!  I wanted to do a brain dump of our current work items, plans, etc…  We first unveiled most of this information at our XAML talk at PDC 2008. If you haven’t seen that talk and you are hungry to understand much of the writing below, you should watch the video. We’re trying to be transparent with our progress with this complex set of components and scenarios.  I look forward to your questions/comments now, and when you get the first .NET 4 beta… 

Thanks, Rob

New XAML Engine for .NET 4System.Xaml

We are providing a unified, enhanced XAML engine for WPF, WCF, WF and more.  This unified XAML engine is System.Xaml.dll (planned to ship in .NET 4).

New XAML Language Features: XAML2009 - XAML2009

At PDC 2008, we discussed ~9 new XAML language features.  When .NET 4 Beta 1 ships, we’ll begin posting individual posts going into the different features.

XAML Reading

Our work to make WPF 4 use System.Xaml includes a new codebase for interpreting XAML files.  XamlXmlReader will ship in System.Xaml.dll v4.  Current users of XamlReader.Load() will automatically get the new engine doing the same work for them, but better.

BAML Reading

Our work to make WPF 4 use System.Xaml includes a new codebase for interpreting BAML files (a binary format).  Baml2006Reader will ship in PresentationFramework.dll v4.  Our focus here right now is compatibility and matching performance of BAML in v3.  BAML in general, at least for built in WPF types, avoids much of the reflection that XAML usually needs to go through.  Current calls to Application.LoadComponent() will automatically get the new engine doing the same work for them, but better.

  • FxCop: With .NET 4, FxCop rules that can analyze BAML will be possible to write. If appropriate for your scenario, using XamlXmlReader in FxCop would also allow you to write FxCop rules to analyze XAML (if you distribute this as part of this app) as well (without having to create the corresponding object graph.)

Localization – WPF (BAML)UI Localization

We have work under way to make the localization APIs that LocBaml relies on built on top of the System.Xaml infrastructure.  As we do that work, we are attempting to address several issues in this space.  We are unsure if this work will ship with .NET 4 or seperately.  In v3, it was provided by PresentationFramework.dll, but this API generally isn’t needed at runtime, so we are considering not making it part of the framework directly.

As more and more groups inside and outside of Microsoft are localizing more and more BAML, we are getting a very good idea of which problems we need to focus on first.

Localization – XAML (Silverlight, other)

The work I mention above in “Localization – WPF (BAML)” will benefit localization scenarios (x:Uid based) for XAML as well (not just BAML).  Systems that want to benefit from that should make sure to not crash if they see an “x:Uid” attribute.

Markup Compiler – WPF

We have a goal to completely rewrite the markup compiler, however it is very unlikely that will happen in .NET 4.  We likely provide an updated Markup Compiler in conjunction with good support from Cider and Blend for XAML2009 features.  Designers and compilers need to move in lock step, ideally.

BAML Writing

Since both Localization and the WPF Markup Compiler require Baml2006Writer, and since they both may not ship in the v4 box, we may not have Baml2006Writer baked enough to ship in the runtime in v4.  I still hope to, but it may not be feasible.  We’ll see.  I know many of you want this!

  • Obfuscation of BAML: once we provide the BamlWriter, we believe that obfuscation engines will be able to obfuscate type/member names in BAML.

XAML Writing

We have invested a lot of time and effort in XamlServices.Save() which uses XamlObjectReader and XamlXmlWriter under its covers.  If all goes well, we will be providing a number of enhancements for current uses of XamlWriter.Save().  We currently don’t plan to make your old calls to XamlWriter.Save() use the new XAML Writing engine in v4, but if XamlServices.Save provides value for you, you can call it.

Markup Compiler – Silverlight

My team builds the markup compiler that validates XAML and generated .g.cs/.g.vb code files in Silverlight projects.  We are doing some minor work in this space for SL3 and plan more major investments in releases beyond that.

XAML Language Spec - Specification

We are actually finally getting some customer issues on [MS-XAML] come in through our support channels.  Great to get these.  We plan on shipping a version updated with fixes for many of those issues and including the new XAML2009 features.

XAML VocabulariesXAML Vocabularies, Specification

WPF v4 – we are planning on shipping a draft of the WPF v4 XAML Vocabulary when Beta 1 ships.  This will be similar to [MS-WPFXV], with new stuff added in.

Other – inside Microsoft and around the world we continue to see more and more people use XAML for things other than UI, Workflows, Paper.  We’re always excited to see new uses for XAML!

Published Thursday, February 26, 2009 6:34 AM by Rob_Relyea

Comments

# Dew Drop - February 27, 2009 | Alvin Ashcraft's Morning Dew@ Friday, February 27, 2009 8:26 AM

Pingback from  Dew Drop - February 27, 2009 | Alvin Ashcraft's Morning Dew

# XAML State of the Union ??? Feb 2009 | DavideZordan.net@ Monday, March 02, 2009 12:54 PM

Pingback from  XAML State of the Union ??? Feb 2009 | DavideZordan.net

# http://blogs.msdn.com/jaimer/archive/2009/02/28/wpf-discussion-090228.aspx@ Thursday, March 05, 2009 8:54 AM

# This Week: Martin Woodward, MVP Summit, Web Perf, Show Off, and a VSTS Pep Talk | CHARGED's Digital Lifestyle at Work or Play@ Saturday, March 07, 2009 6:16 PM

Pingback from  This Week: Martin Woodward, MVP Summit, Web Perf, Show Off, and a VSTS Pep Talk | CHARGED's Digital Lifestyle at Work or Play

# re: XAML State of the Union – Feb 2009@ Sunday, March 08, 2009 3:33 AM

Where can I find documentation on how to resolve an error I get when I use XamlReader.Load/Parse to read in a Xaml that references StaticResources in the page I am inserting into?

by Donal Adams

# re: XAML State of the Union – Feb 2009@ Monday, March 09, 2009 4:19 PM

Hi Rob,

I have a question about the new XAML engine:

Will the new XAML engine allow serializing and deserializing of any kind of custom DependecyProperties ? As DependecyProperty is a sealed class, you currently can't control in any way how the backing values are stored and manipulated behind the scenes.

I've very interested if this will be possible.

Thanks.

by Pop Catalin

# re: XAML State of the Union – Feb 2009@ Tuesday, March 10, 2009 12:40 PM

Pop-

I don't fully understand your question. Can you lay out a specific example, what happens now, and what you'd like to happen?

Thanks, Rob

# re: XAML State of the Union – Feb 2009@ Tuesday, March 10, 2009 2:38 PM

What I mean is,

will the new XAML engine able to deserialize objects that implement ICustomTypeDescriptor?

What I want is to be able to serialize/deserialize from XAML classes that don't have neither CLR or Depency properties but custom properties for which I provide the PropertyDescriptors.

Thanks.

by Pop Catalin

# re: XAML State of the Union – Feb 2009@ Tuesday, March 10, 2009 2:56 PM

I think my last post needs a little more explanation, still.

The WPF binding infrastructure has support for CustomTypeDescriptors and you can bind to any kind of properties even "fake ones" like the columns of a DataTable... but the XAML Loader doesn't recognize those virtual properties, you can't use them in XAML directly, except in binding expressions.

Thanks, again.

by Pop Catalin

# re: XAML State of the Union – Feb 2009@ Tuesday, March 10, 2009 4:12 PM

Pop-

3.0 and 4.0 don't support ICustomTypeDescriptor in XAML/BAML loading scenarios. However, if you own the code that decides how to call XamlReader.Load(), it maybe a scenario that would know be possible with v4. Could you please create a small project that shows what you'd like to work and email it to me @ rob.relyea (at microsoft.com), I'll work on a sample to ensure it is possible.

Thanks, Rob

# This Week: Martin Woodward, MVP Summit, Web Perf, Show Off, and a VSTS Pep Talk@ Saturday, March 21, 2009 10:32 PM

This week on Channel 9, Dan and Brian are joined by MVP Martin Woodward to discuss this week's news

# XAML2009 and System.Xaml.dll Preview (in .NET FX 4 Beta1)@ Tuesday, May 19, 2009 7:08 PM

On May 20th, 2009, Beta 1 of .NET FX 4 and Visual Studio 2010 will be available for download 1 . We’re

Leave a Comment

(required) 
(required) 
(optional)
(required) 
Page view counter