A 3-Part, 3-Day Weekend XAML Quiz

Ian posted a fun little snippet of XAML showing off the new support for image effects on anything that Avalon renders, not just images:

<FlowPanel xmlns="http://schemas.microsoft.com/2003/xaml"
  xmlns:def="Definition" Text.FontSize="24">
  <Text>This seems clear enough.</Text>
  <Text>
    <Text.ImageEffect>
      <ImageEffectBlur Radius="3"/>
    </Text.ImageEffect>

    This is considerably less clear.
  </Text>
</FlowPanel>

I've rewritten it using a more compact syntax:

<Text ImageEffect="*ImageEffectBlur(Radius=3)">
This is considerably less clear.
</Text>

  1. For 1 free UUID, is this legal XAML? Why or why not?
  2. For 2 free UUIDs, what other popular XAML construct uses the exact same syntax?
  3. For 3 free UUIDs, what popular C# construct has a similar syntax? How is it subtly different? (Hint: I'm not showing the difference in this example.)


11 comments on this post

Frank Hileman:


1) Don't know
2) Data binding
3) attributes

Truly ugly syntax... I hope the xml generated in the designer doesn't look like this.

Saturday, May 29, 2004, 6:08 AM


Marc Clifton:


Wow. This syntax is going to inspire me to write another "How Microsoft is Bollixing Up XAML" blog entry!

It looks like a mishmash of data binding, class instantiation, and property setting, all rolled into one.

Yuck.

Saturday, May 29, 2004, 7:07 AM


Ian Griffiths:


I don't think it does mish mash data binding into the mix.

Isn't it simply that data binding is one of the places where you'll often see this exact same syntax used?

The * syntax that Chris showed is a way of instantiating a particular class as the value of a property, with the ability to set its attributes internally.

It's not actually databinding syntax at all. (It's just that you often see the exact same syntax used to instantiate a data binding property.)

Monday, May 31, 2004, 9:30 AM


Chris Sells:


From the XML purity POV, I find the * syntax frustrating. However, from the hand-authoring point of view, I love it! It's easier to read, understand and maintain then the longer version and far fewer keystrokes.

Tuesday, Jun 1, 2004, 4:24 AM


Frank Hileman:


Get rid of the compound property syntax, and the * syntax would not look so much better anymore.

Tuesday, Jun 1, 2004, 11:07 AM


Alexander Pigolkin:


1. It is legal XAML, looks like by design.
2. Property aliasing uses the same syntax.

Tuesday, Jun 1, 2004, 1:46 PM


Rob Relyea:


Currently attribute syntax has a bunch of strangeness.
{foo} - is a resource reference.
*ClassName(PropName=Value) - has overlap with compound syntax.

We are mulling over a plan that will consolidate non-literal value syntax options.

Ideally, we'll:
1) limit the number of random ways to do the same thing.
2) still allow for a short syntax for a set of uses - resource references, bindings, and the like
3) consolidate all the star (*) and squiggle ({}) syntaxes we allow in an attribute value to be a well defined extension mechanism.

That being said...whatever we decide to do will take a while to get done and then become public. I hope to have this area cleaned up by the next pdc.

Thursday, Jun 3, 2004, 10:20 PM


xpcjetnqy tbyrkdol:


sfltqrx nuih pshu ycodbix qmse gxml uhmygzjv

Sunday, Mar 25, 2007, 3:39 PM


futdgek biptjgyes:


hzcrtwxd hjwzqbora wqordyztu krud rpegcd nresamih foawiqv http://www.rmgjy.lswojk.com

Sunday, Mar 25, 2007, 3:39 PM


vjyat ehar:


pircbfgjv hnsoel ywehru czadbsp tsbza jimfosy mgbc [URL=http://www.qyumfh.qimfd.com]vgdhfu fivmlejr[/URL]

Sunday, Mar 25, 2007, 3:41 PM


idnltvo cmyabn:


ahqpvy bpgj apoxjuyfi ynpk ghlbru bnfqtw jcstuwoay [URL]http://www.fchpbu.rjaecwbgy.com[/URL] fwrakqupy tvbhawq

Sunday, Mar 25, 2007, 3:41 PM





comment on this post

HTML tags will be escaped.

Powered By ASP.NET

Hosted by SecureWebs

Microsoft

Mensa

IEEE


Best CD Rates
moving companies
addiction treatment
sunglasses
Kratom
How To Lose Weight Fast
cocktail dresses
Credit Card Balance Transfer
Add URL
Stock Trading
Health Insurance Quotes
Promotional Merchandise
Jet Privé
loans for bad credit