ColorChart XAML code bug resolved

Well what can i say except, my apologies to the XAML team.  I was reviewing the XAML code from my last post and there you go, I forgot to set the HorizontalAlignment to Center which was present on the Boo code. After inserting the appropriate setter the problem went away. Here's the correct XAML code for the ColorChart:

<Page x:Class="ColorChart.Page1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Page1"
    >
    <Page.Resources>
        <Style x:Key="CCStyle" >
            <Setter Property="Control.BorderBrush" Value="LightGray"/>
            <Setter Property="Control.BorderThickness" Value="1"/>
            <Setter Property="Control.Margin" Value="3"/>
            <Setter Property="Control.HorizontalAlignment" Value="Center"/>
        </Style>
        <ItemsPanelTemplate x:Key="CCPanel">
            <UniformGrid Columns="6"></UniformGrid>
        </ItemsPanelTemplate>
        <DataTemplate x:Key="CCTemplate">
            <StackPanel>
                <Rectangle     
                    Width="100" 
                    Height="40" 
                    Fill="{Binding Path=Brush}" />
                <TextBlock 
                    FontSize="11" 
                    Text="{Binding Path=Name}" 
                    HorizontalAlignment="Center">
                </TextBlock>
            </StackPanel>
        </DataTemplate>
    </Page.Resources>
    <ListBox 
        Name="listBox1" 
        SelectionMode="Single" 
        ItemsPanel="{StaticResource CCPanel}" 
        ItemTemplate="{StaticResource CCTemplate}" 
        ItemContainerStyle="{StaticResource CCStyle}"/>
</Page>

Now here's the result:

Color Chart XBAP Demo Updated
Published 09-30-2006 2:35 PM by smash
Filed under: