diff Messaging/Common/Controls/MessageTile.xaml @ 26:045dac571339

Working on data binding to a user control
author adminsh@apollo
date Wed, 21 Mar 2012 15:39:53 +0000
parents
children 96fdf58e05b4
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Messaging/Common/Controls/MessageTile.xaml	Wed Mar 21 15:39:53 2012 +0000
@@ -0,0 +1,62 @@
+<UserControl x:Class="Common.Controls.MessageTile"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+             Width="200"
+             Height="200"
+             DataContext="{Binding RelativeSource={RelativeSource Mode=Self}}"
+             mc:Ignorable="d">
+
+    <Grid>
+
+        <Grid.RowDefinitions>
+            <RowDefinition Height="60" />
+            <RowDefinition Height="60" />
+            <RowDefinition Height="75" />
+        </Grid.RowDefinitions>
+
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="*" />
+            <ColumnDefinition Width="*" />
+        </Grid.ColumnDefinitions>
+
+        <Image Name="imageIcon"
+               Grid.Row="0"
+               Grid.Column="0"
+               Margin="10,10,0,0"
+               HorizontalAlignment="Left"
+               VerticalAlignment="Top"
+               Source="{Binding Path=DisplayIcon,
+                                Mode=OneWay,
+                                UpdateSourceTrigger=PropertyChanged}"
+               Stretch="None" />
+
+        <TextBlock Name="tbCount"
+                   Grid.Row="1"
+                   Grid.Column="0"
+                   Grid.ColumnSpan="2"
+                   Margin="0,0,10,0"
+                   HorizontalAlignment="Right"
+                   FontSize="48"
+                   Text="{Binding Path=DisplayCount,
+                                  StringFormat=N0,
+                                  Mode=TwoWay,
+                                  UpdateSourceTrigger=PropertyChanged}" />
+
+        <TextBlock Name="tbTitle"
+                   Grid.Row="2"
+                   Grid.RowSpan="2"
+                   Grid.Column="0"
+                   Grid.ColumnSpan="3"
+                   Margin="10"
+                   HorizontalAlignment="Right"
+                   VerticalAlignment="Bottom"
+                   FontSize="24"
+                   Text="{Binding Path=DisplayText,
+                                  Mode=TwoWay,
+                                  UpdateSourceTrigger=PropertyChanged}"
+                   TextWrapping="Wrap" />
+
+    </Grid>
+</UserControl>