« Jensen Harris: Office User Interface Blog | Main | Another useless Error Dialog »

XAML Fun

Some fun this morning with XAML.

XAMLFun1

If you want to experiement or try different combinations, here’s the XAML I used:

<Page xmlns="http://schemas.microsoft.com/winfx/avalon/2005" xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005" >
  <Grid>
 <Grid.Resources>
  <Style TargetType="{x:Type TextBlock}">
   <Setter Property="FontSize" Value="20" />
   <Setter Property="Foreground" Value="White" />
   <Setter Property="HorizontalAlignment" Value="Center" />
   <Setter Property="VerticalAlignment" Value="Center" />
   <Setter Property="FontWeight" Value="Bold" />
  </Style>
 </Grid.Resources>
 <Grid.ColumnDefinitions>
  <ColumnDefinition />
  <ColumnDefinition />
  <ColumnDefinition />
 </Grid.ColumnDefinitions>
 <Grid.RowDefinitions>
  <RowDefinition/>
  <RowDefinition/>
  <RowDefinition/>
  <RowDefinition/>   
  <RowDefinition/> 
 </Grid.RowDefinitions>
 
 <Rectangle Grid.ColumnSpan="3" Grid.RowSpan="4" Fill="Black"> 
 </Rectangle>

 <TextBlock Grid.Column="0" Grid.Row="0" Foreground="Red">
  BLUE
 </TextBlock>

 <TextBlock Grid.Column="1" Grid.Row="0" Foreground="Blue">
  GREEN
 </TextBlock>

 <TextBlock Grid.Column="2" Grid.Row="0" Foreground="Yellow">
  RED
 </TextBlock>

 <TextBlock Grid.Column="0" Grid.Row="1" Foreground="Green">
  BROWN
 </TextBlock>

 <TextBlock Grid.Column="1" Grid.Row="1" Foreground="Red">
  GRAY
 </TextBlock>

 <TextBlock Grid.Column="2" Grid.Row="1" Foreground="Purple">
  BLACK
 </TextBlock>

 <TextBlock Grid.Column="0" Grid.Row="2" Foreground="Red">
  WHITE
 </TextBlock>

 <TextBlock Grid.Column="1" Grid.Row="2" Foreground="Yellow">
  RED
 </TextBlock>

 <TextBlock Grid.Column="2" Grid.Row="2" Foreground="Green">
  TAN
 </TextBlock>

 <TextBlock Grid.Column="0" Grid.Row="3" Foreground="Blue">
  PURPLE
 </TextBlock>

 <TextBlock Grid.Column="1" Grid.Row="3" Foreground="Red">
  BLUE
 </TextBlock>

 <TextBlock Grid.Column="2" Grid.Row="3" Foreground="Blue">
  PINK
 </TextBlock>

 <Rectangle Grid.ColumnSpan="4" Grid.Column="0" Grid.Row="4" Fill="Black"> 
 </Rectangle>

 <TextBlock Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="3">
  Try to say the names of the colors, not the words.
 </TextBlock>

  </Grid>
</Page>

Help support my web site by searching and buying through Amazon.com (in assocation with Amazon.com).