<$BlogRSDUrl$>

Wednesday, September 08, 2004

Rationale for partial classes in XAML 

Dominic Fox
The XAML file and the "code-behind" file are typically separate, so a mechanism is needed to weave them together. If each were compiled into a separate class, then composition or inheritance could be used to combine the two. Partial classes allow the two files to be compiled together into a single class. Is this necessary? No, but it might be "better" in some ways (at the cost of adding another language feature).

. . . The real reason, I strongly suspect, is that weaving partial classes together is more like the way ASP.Net works, and makes XAML interface coding and web interface coding look more like each other. Don mentioned that his website is now served as XAML internally within Microsoft, where presumably it's rendered as a XAML document within the Longhorn browser/explorer. So XAML is meant to "stand alone" (within the context of a suitable browser) as well as provide a UI design markup for applications. XAML over HTTP rendered in Longhorn = the Microsoft web. Now doesn't that thought warm the heart of your cockles?

Topics: XML | XAML | Programming


Comments: Post a Comment

This page is powered by Blogger. Isn't yours?