view Messaging/Common/Themes/Generic.xaml @ 36:c8c79f05d76f

WORKING VERSION! HIGH FIVE!
author adminsh@apollo
date Tue, 27 Mar 2012 18:33:44 +0100
parents 83c1f62d9370
children
line wrap: on
line source

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:c="clr-namespace:Common.Controls">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/Elysium.Theme;component/Themes/SharedResources.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <Style TargetType="{x:Type c:MetroTile}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type c:MetroTile}">
                    <Border Background="{StaticResource MetroPurpleBrush}">
                        <Grid Background="{Binding Path=Background, RelativeSource={RelativeSource TemplatedParent}}">

                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="1.25*" />
                            </Grid.RowDefinitions>

                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>

                            <Image x:Name="PART_DISPLAY_ICON"
                                   Grid.Row="0"
                                   Grid.Column="0"
                                   Margin="10,10,0,0"
                                   HorizontalAlignment="Left"
                                   VerticalAlignment="Top"
                                   Source="{Binding Path=DisplayIcon,
                                                    RelativeSource={RelativeSource TemplatedParent},
                                                    UpdateSourceTrigger=PropertyChanged}"
                                   Stretch="None" />

                            <TextBlock x:Name="PART_DISPLAY_COUNT_CONTAINER"
                                       Grid.Row="1"
                                       Grid.Column="0"
                                       Grid.ColumnSpan="2"
                                       Margin="0,0,10,0"
                                       HorizontalAlignment="Right"
                                       FontSize="48"
                                       Foreground="White"
                                       Text="{Binding Path=DisplayCount,
                                                      StringFormat=N0,
                                                      RelativeSource={RelativeSource TemplatedParent},
                                                      UpdateSourceTrigger=PropertyChanged}" />

                            <TextBlock x:Name="PART_DISPLAY_TITLE_CONTAINER"
                                       Grid.Row="2"
                                       Grid.RowSpan="2"
                                       Grid.Column="0"
                                       Grid.ColumnSpan="3"
                                       Margin="10"
                                       HorizontalAlignment="Right"
                                       VerticalAlignment="Bottom"
                                       FontSize="24"
                                       Foreground="White"
                                       Text="{Binding Path=DisplayText,
                                                      RelativeSource={RelativeSource TemplatedParent},
                                                      UpdateSourceTrigger=PropertyChanged}"
                                       TextWrapping="Wrap" />
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>