Welcome to WindowsClient.net | Sign in | Join

Rob Relyea - XAMLified

WPF, Silverlight and XAML

Syndication

Sponsors





  • advertise here
XAML in .NET 4 Update

Random news on the .NET4/XAML/BAML front…builds more info on top of last month’s XAML State of the Union

Localization

  • Doing WPF Localization review internally today…
  • Separately talking with Silverlight, Blend, Cider…on how WPF/Silverlight should both Localize.  Any feedback on Silverlight’s Loc model…and what you’d like to see there???
  • Met with Windows Build lab recently to discuss getting WPF localization working with Windows’ localization process. Currently it fails due to delay signed assemblies and “LocBamls” reliance on Assembly.Load().

BAML

  • We are doing a bunch of Perf optimizations in Baml2006Reader which is making its XAML node stream much less useful for analysis…  We aren’t sure if our first Beta will have a BamlReaderAsText mode enabled or not.  Trying to make it happen…  Want to see FxCop/etc… scenarios enabled early in release to get feedback.

Performance

  • We are making steady progress getting Baml to Object scenarios on par with v3.  Still not all the way there yet.  We may even adapt the BAML format in v4 (or a known types table in PF.dll) a bit to get optimizations that we now need due to new features that Types can tap into. (The old parser used to hard code many things…now that we’ve made those opt in for any type, we currently have to check many types and properties to see if they have opted in.)
  • Our tallest dev is looking to see how multithreading a BAML load could speed things up some more. We’ve been discussing this option for a while.  Application.LoadComponent craziness won’t make it easy…

Compatibility

  • Reliance on DPs: The other day I tweeted that Lutz had found a problem with Blend/WPF4It turns out that the Type in a DPs registration should match the CLR property’s Type.  Seems like XAML/BAML v3.* didn’t enforce this.
  • Assembly loading fun: how many ways to load an assembly can we have? Dev on team digging into a morass of issues/options…should be fun…
Published Wednesday, March 25, 2009 9:48 AM by Rob_Relyea

Comments

# re: XAML in .NET 4 Update@ Wednesday, March 25, 2009 2:07 PM

Hi Rob,

Nice to know how much effort you and your team put into the new xaml loader. I appreciate it so much.

For localizations, I would like to see Visual Studio integration just like what we had in Win Forms.

Also, it could be interesting to see a localization extension so we could use the resources files ".resx". Most of the time, localizing the whole baml is not what we want to do. We just want to translate labels and preview the result.

Dany

by Dany Laporte

# XAML in .NET 4 Update - Rob Relyea@ Wednesday, March 25, 2009 9:05 PM

Thank you for submitting this cool story - Trackback from DotNetShoutout

# re: XAML in .NET 4 Update@ Thursday, March 26, 2009 6:00 AM

hi rob!

Do you know if the new silverlight 3 features, eg. die PlaneProjection,

will be available also with WPF4 ?

I hope so...! :)

bye

Thomas

by Thomas Gugler

# re: XAML in .NET 4 Update@ Thursday, March 26, 2009 6:47 AM

"•We are doing a bunch of Perf optimizations in Baml2006Reader which is making its XAML node stream much less useful for analysis…"

Don't you mean your work should make XAML node stream more useful for analysis? But as with optimizations, this may not be a typo. Happy to hear an elaboration.

# re: XAML in .NET 4 Update@ Thursday, March 26, 2009 8:50 AM

Hello, I would definitely want to localize inside Visual Studio, without any external tools needed to be executed by me manually.

It would be also nice to have the ability to switch the current localization at development time just for testing purposes.

by Jan Kučera

# Dew Drop - March 26, 2009 | Alvin Ashcraft's Morning Dew@ Thursday, March 26, 2009 9:23 AM

Pingback from  Dew Drop - March 26, 2009 | Alvin Ashcraft's Morning Dew

# re: XAML in .NET 4 Update@ Thursday, March 26, 2009 3:32 PM

Tanveer-

Our perf optimization of the default behavior of Baml2006Reader is doing things like sending a Value across from BamlReader to XamlObjectWriter instead of a bunch of nodes representing a Template.

Great for perf...not so great if you want to search for things in BAML.

Our plan has always been to have a Setting to be able to pass into the Baml2006Reader to ask for a "verbose" stream of XAML nodes.  Our first public preview may not have that "verbose" switch enabled.

Thanks, Rob

# re: XAML in .NET 4 Update@ Thursday, March 26, 2009 11:06 PM

Hi,

About localization, please don't make the same errors as in MFC and WinForms...  The framework should be pluggable!  We store the strings in a database for a variety of reasons including flexibility (ie we don't localize, it's the distributors and end users can change the labels). Please allow users to implement an interface to map the uid or key through any mechanism needed.

Thanks!

by cverdon

# re: XAML in .NET 4 Update@ Wednesday, April 01, 2009 6:54 AM

Localization: Really hope this story gets better because currently the process is hideous. Agree with cverdon - an easy pluggable mode, either with a ProviderFactory like ASP.NET has or some other hook to swap the provider at runtime.

Also an easy mechanism to swap locales at runtime is needed. Easy to do with custom implementations but this should be native to the default handling.

Tooling: Localization is painful enough without having to struggle throught several command line tools. Why this whole mess when the Resx tools for WinForms were already available???

# re: XAML in .NET 4 Update@ Thursday, April 02, 2009 1:59 PM

Rob,

when will Silverlight get MarkupExtension?  I use a custom ME for Inversion of Control scenarios.  This is the ONE use case I can't swap out a ME w/ an attached property...and also the ONE MarkupExtension you can't hardcode into XAML.

Please put the X into XAML for Silverlight...

by John "Z-Bo" Zabroski

# re: XAML in .NET 4 Update@ Wednesday, April 08, 2009 10:38 AM

This is all very interestting stuf! Any idee when the CTP for System.Xaml will be released?

Thank in advance!

# re: XAML in .NET 4 Update@ Wednesday, April 08, 2009 8:34 PM

Tim-

Glad you are interested.

The next preview of VS2010 will contain System.Xaml.dll.  We haven't announced that timeline.  Sorry I can't say more...

Thanks, Rob

# re: XAML in .NET 4 Update@ Wednesday, April 08, 2009 8:37 PM

John "Z-Bo"-

Silverlight 3 isn't adding the ability to have eXtensible MarkupExtensions. I believe that the Silverlight team is well aware of the request though.

Thanks, Rob

# re: XAML in .NET 4 Update@ Thursday, April 09, 2009 8:38 AM

OK I have to ask this question. I've heard it mentioned that XAML 2010 will have support for references. Will we be able to custom-taylor this behavior via attributes and type converters so that we can do references with without an explicit markup extension?

I want to use XAML as the serialization mechanism for my custom types, because currently DataContractSerializer is the only other serializer that supports reference preservation, and it is not that great. If XAML does what I think it might, it would be a killer feature.

For instance, consider the following example that I would want.

<Table Name="Customer"/>

<Table Name="Order"/>

<Relationship From="Customer" To="Order" Cardinality="OneToMany"/>

That is the behavior I would want. I do not want to have to do something like this:

<Table x:Name="Customer"/>

<Table x:Name="Order"/>

<Relationship From="{x:Reference Customer}" To="{x:Reference Order}" Cardinality="OneToMany"/>

Because that would confuse the other tools and users who make use of our XML files.

Thanks!

by Luke

# re: XAML in .NET 4 Update@ Thursday, April 09, 2009 6:53 PM

Luke-

Yes, you will be able to do what you want.

You will need [RuntimeNameProperty("Name")] on the Table class & you will need to use the NameReferenceConverter via a TypeConverterAttribute on the From/To properties or on the type of those properties.

Beyond that, if you wanted to have a MarkupExtension or TypeConverter that can get access to the right object instance with a certain name, you'll be able to get a serviceProvider that gives you that power.

(perhaps you want to be able to say "Customer.Foo" and have the type converter find the Customer named object and "dot-down"...

Glad it sounds like we are going to meet your needs.

Thanks, Rob

# 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

# Several WPF Localization questions@ Saturday, November 07, 2009 9:03 PM

Email from customer (I’ll keep them anonymous unless they want to chime in). … I have several questions

# Inversion of Control (IOC) with XAML - Rob Relyea - XAMLified@ Sunday, February 21, 2010 5:55 PM

Pingback from  Inversion of Control (IOC) with XAML - Rob Relyea - XAMLified

Leave a Comment

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