The Tim Sneath Challenge I
August 17, 2006
Roscoe, NY
Tim Sneath today has issued a challenge for "the most impressive WPF demo you can construct in a single line of XAML," by which, of course, he means a single element of XAML.
Here's a single-element XAML file that I've formatted into multiple lines for easier human-parsing:
-
<!-- "Jabberwocky" by Lewis Carroll, XAML by Charles Petzold -->
<TextBlock xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontFamily="Bookman Old Style"
FontSize="16pt"
FontStyle="Italic"
Text="’Twas brillig, and the slithy toves
 Did gyre and gimble in the wabe:
All mimsy were the borogoves,
 And the mome raths outgrabe."
LayoutTransform="-1 0 0 1 0 0" />
or you can just run or download Jabberwocky.xaml. It's the first verse of "Jabberwocky" as first seen by Alice in the first chapter of Lewis Carroll's Through the Looking-Glass, and What Alice Found There:
As you'll recall, Alice has to hold the poem up to a mirror to read it all. In the XAML the text of the verse includes embedded Unicode characters for line feeds, em-dashes, and the fancy apostrophe. The transform "mini-language" lets a matrix be directly set to the LayoutTransform property to flip the text around the vertical axis.