XAML: speak now or forever hold your peace

Note: this entry has moved.

Chris, Don and Rob are asking for feedback on XAML design. It's your opportunity to contribute something and be happy when it comes out. If you don't, don't complain later ;)
My contribution:
No code inline please. No processing instructions, please. Rob has already read my suggestion in a comment elsewhere, but here it goes again: instead of

<?Mapping XmlNamespace="rob" CtrlNamespace="Rob.UI.Controls.RobLink" Assembly="RobControls.dll"?>

use this:

<Xaml>
    <rob:RobLink xmlns:rob="RobControls.dll#Rob.UI.Controls.RobLink">Fancy link</rob:RobLink>

Of course, there's some redundancy in the RobLink name, being present as a sort of "fragment identifier" into the assembly, and as the tag name itself. However, I believe if the xmlns path is taken, I could name the element with any other name, provided y give it the appropriate control namespace.

Another (even better, I believe) approach would be for the fragment to end in the control namespace, and leave the class (type) resolution to the element name... this is good as it would allow us to avoid nested namespace declarations, as follows:

<Xaml xmlns:rob="RobControls.dll#Rob.UI.Controls">
    <rob:RobLink>Fancy link</rob:RobLink>
    <rob:RobButton>Click me!</rob:RobButton>

I believe this is much more XML-friendly than the PI approach... by FAAAR.

Daniel Cazzulino
Rob sort of answered when I suggested this in a comment to a post from DonXML:
Please note, each control doesn't need to be in its own assembly. If I have RobButton and RobLink, I can put them both in RobControls.dll.

Currently, all controls that you build in markup or code, and hope to use in markup elsewhere, need to be in a different assembly than the one you are building your app into.

We had a model like Daniel mentioned at one point...I'll have to go back and have discussions about the pros and cons of those 2 approaches.

Please keep the feedback coming.

Thanks, Rob Rob Relyea Program Manager, Avalon Team

I certainly would like to know those pros and cons!!!

No Comments