Gerald Bauer | 15 Apr 20:02
Picon
Favicon

Css Zen Garden Creator on MSXAML


Hello,

   Allow me to highlight the blog story titled "Avalon/XAML First Look" by CSS Zen Garden 
creator Dave Shea.

   Dave writes:

  The code itself looks like (well-formed) tag soup from 1997. Whereas the web has seen a 
shift from presentational markup (in the form of tables, embedded attributes like bgcolor, 
and the dreaded font tag) to structural markup with a separated presentation layer (CSS), 
XAML is purely a presentational language. I couldn't see evidence of attention toward 
semantics, and all the presentational attributes are embedded right in the markup. 
Januszewski referenced `a CSS-like syntax', but there's nothing CSS-like about it. It's ugly 
presentational HTML all over again. A sample snippet:

   <?xml version="1.0"?>
   <Canvas 
       xmlns="http://schemas.microsoft.com/2003/xaml"
       xmlns:def="Definition"
       Width="500" Height="500" Background="White">
       <Canvas.Resources>
         <LinearGradientBrush def:Name="RedGrad" 
           StartPoint="0,0" EndPoint="1,1">
            <LinearGradientBrush.GradientStops>
               <GradientStopCollection>
                  <GradientStop Color="#FFFFFF" 
                   Offset="0" />
                  <GradientStop Color="#FF0000" 
                   Offset="0.5" />
                  <GradientStop Color="#000000" 
                   Offset="1" />
               </GradientStopCollection>
            </LinearGradientBrush.GradientStops>
         </LinearGradientBrush>
          </Canvas.Resources>
           <Rectangle
              RectangleLeft="0" RectangleTop="0"
              RectangleWidth="500" RectangleHeight="5000"
              Fill="{RedGrad}"
           />
          <SimpleText Margin="5" FontSize="14">
            An h3, this is not.
          </SimpleText>
   </Canvas>

It appears to me this is single-purpose code, rather than the layered approached of HTML/
CSS/DOM. Can it degrade? How much thinking has Microsoft done about accessibility? 
What will this code do on a PocketPC or PalmOS cell phone?

Maybe this code makes sense from a desktop computer application development context, 
but it does not work in today's web development context. The separation of structure and 
presentation is now a no-brainer, so I'm left wondering why it has been completely 
ignored here. It's like the past few years of undoing the markup sins of the late 90's 
haven't happened. Or, they haven't happened at Microsoft. (Other divisions [MSN] seem to 
get it, to be fair.)

XAML on the Web

Which brings us to the second problem — XAML on the web. Yes, XAML is designed to run 
inside a browser. It appears a special XAML plug-in or player or something equivalent is 
necessary, as it was demonstrated running inside of a stock version of IE6 under Windows 
XP. But Microsoft `loves the browser' according to Januszewski, and wants it to be painless 
to select a link on a web page and open a XAML app as a result. Longhorn will presumably 
feature tight integration of the two.

The past couple of years of IE security problems have raised a lot of awareness about 
browser lock-in, and the problems that tying your application into a specific browser/
operating system can later cause. Like ActiveX, in-browser XAML/Avalon appears to be a 
method of continuing that trend. Something tells me we won't be seeing an Avalon player 
for Linux any time soon.

I'd be a whole lot more comfortable with XAML if it were strictly meant as a Windows OS 
rendering language. Proprietary markup on a proprietary platform is nothing to get 
worked up over. But the obvious web cross-over leads me to hope we're not going to see 
a whole new generation of browser/OS-specific web apps. I wonder if Microsoft might be 
hoping for something different.

If anyone who understands XAML better than I would like to come in and tell me how 
backwards I have it, I'd love to hear from you, comments are open. I'd rather my first look 
is all wrong and my worries unfounded (even though I'd like to think I understood the 
presentation properly).

   Source: http://www.mezzoblue.com/archives/2005/04/14/avalonxaml_f

   - Gerald

_________________________________________
United XAML       | http://unitedxaml.org
XAML Forum & News | http://xamlnews.com 

Gmane