diff 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 diff
--- a/Messaging/Common/Themes/Generic.xaml	Tue Mar 27 16:15:45 2012 +0100
+++ b/Messaging/Common/Themes/Generic.xaml	Tue Mar 27 18:33:44 2012 +0100
@@ -10,64 +10,60 @@
         <Setter Property="Template">
             <Setter.Value>
                 <ControlTemplate TargetType="{x:Type c:MetroTile}">
-                    <Grid Background="Black">
-
-                        <Grid.RowDefinitions>
-                            <RowDefinition Height="*" />
-                            <RowDefinition Height="*" />
-                            <RowDefinition Height="1.25*" />
-                        </Grid.RowDefinitions>
-
-                        <Grid.ColumnDefinitions>
-                            <ColumnDefinition Width="*" />
-                            <ColumnDefinition Width="*" />
-                        </Grid.ColumnDefinitions>
+                    <Border Background="{StaticResource MetroPurpleBrush}">
+                        <Grid Background="{Binding Path=Background, RelativeSource={RelativeSource TemplatedParent}}">
 
-                        <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 FindAncestor,
-                                                                               AncestorType=c:MetroTile,
-                                                                               AncestorLevel=1},
-                                                UpdateSourceTrigger=PropertyChanged}"
-                               Stretch="None" />
+                            <Grid.RowDefinitions>
+                                <RowDefinition Height="*" />
+                                <RowDefinition Height="*" />
+                                <RowDefinition Height="1.25*" />
+                            </Grid.RowDefinitions>
 
-                        <TextBlock x:Name="PART_DISPLAY_COUNT_CONTAINER"
-                                   Grid.Row="1"
+                            <Grid.ColumnDefinitions>
+                                <ColumnDefinition Width="*" />
+                                <ColumnDefinition Width="*" />
+                            </Grid.ColumnDefinitions>
+
+                            <Image x:Name="PART_DISPLAY_ICON"
+                                   Grid.Row="0"
                                    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 FindAncestor,
-                                                                                 AncestorType=c:MetroTile,
-                                                                                 AncestorLevel=1},
-                                                  UpdateSourceTrigger=PropertyChanged}" />
+                                   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_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 FindAncestor,
-                                                                                 AncestorType=c:MetroTile,
-                                                                                 AncestorLevel=1},
-                                                  UpdateSourceTrigger=PropertyChanged}"
-                                   TextWrapping="Wrap" />
-                    </Grid>
+                            <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>