summaryrefslogtreecommitdiff
path: root/Juick/Controls
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2013-03-29 14:30:06 +0400
committerGravatar Vitaly Takmazov2013-03-29 14:30:06 +0400
commit32fc287a28c24ca980f4fe67ccab178c04cd9159 (patch)
treed1529dc0a60eca2032d55b8a7c68b5687f40ed83 /Juick/Controls
parentd8877eea3c619fe3d0228dbff2693a582e85fc6e (diff)
move message list markup to MessageList usercontrol
Diffstat (limited to 'Juick/Controls')
-rw-r--r--Juick/Controls/MessageList.xaml70
-rw-r--r--Juick/Controls/MessageList.xaml.cs22
2 files changed, 92 insertions, 0 deletions
diff --git a/Juick/Controls/MessageList.xaml b/Juick/Controls/MessageList.xaml
new file mode 100644
index 0000000..7a5882f
--- /dev/null
+++ b/Juick/Controls/MessageList.xaml
@@ -0,0 +1,70 @@
+<UserControl x:Class="Juick.Controls.MessageList"
+ 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"
+ xmlns:bindings="clr-namespace:Juick.Classes"
+ xmlns:usercontrols="clr-namespace:Juick.Controls"
+ xmlns:converters="clr-namespace:Juick.Converters"
+ mc:Ignorable="d"
+ FontFamily="{StaticResource PhoneFontFamilyNormal}"
+ FontSize="{StaticResource PhoneFontSizeNormal}"
+ Foreground="{StaticResource PhoneForegroundBrush}"
+ d:DesignHeight="480" d:DesignWidth="480">
+ <UserControl.Resources>
+ <converters:MidToUriConverter x:Key="uriConverter" />
+ </UserControl.Resources>
+
+ <Grid x:Name="LayoutRoot">
+ <ScrollViewer>
+ <ItemsControl Margin="0, 0, -12, 0"
+ ItemsSource="{Binding Items}"
+ bindings:ScrollViewerMonitor.AtEndCommand="{Binding LoadMessagesPageCommand}">
+ <ItemsControl.ItemTemplate>
+ <DataTemplate>
+ <HyperlinkButton NavigateUri="{Binding MID, Converter={StaticResource uriConverter}}">
+ <HyperlinkButton.Template>
+ <ControlTemplate>
+ <Border BorderBrush="{StaticResource PhoneForegroundBrush}" BorderThickness="0 0 0 1">
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="*" />
+ </Grid.ColumnDefinitions>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
+ <Image bindings:LowProfileImageLoader.UriSource="{Binding AvatarUri}" Grid.Row="0" Grid.Column="0" Margin="3" />
+ <TextBlock Text="{Binding Username}" Grid.Row="0" Grid.Column="1"
+ Margin="5,0,5,5" VerticalAlignment="Top"
+ HorizontalAlignment="Left"
+ FontFamily="{StaticResource PhoneFontFamilySemiLight}"
+ FontSize="{StaticResource PhoneFontSizeLarge}"
+ Style="{StaticResource PhoneTextAccentStyle}" />
+ <!--Style="{StaticResource PhoneTextNormalStyle}"-->
+ <usercontrols:HyperLinkRichTextBox Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2"
+ TextWrapping="Wrap" HorizontalAlignment="Left"
+ Foreground="{StaticResource PhoneForegroundBrush}"
+ Margin="5,0,5,5" VerticalAlignment="Top"
+ IsReadOnly="True" Text="{Binding MessageText}" />
+ <Image bindings:LowProfileImageLoader.UriSource="{Binding Attachment}" Grid.Row="2" Grid.Column="0" Margin="3" Grid.ColumnSpan="2" />
+ <TextBlock Text="{Binding Status}" Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2"
+ Foreground="{StaticResource PhoneForegroundBrush}"
+ Style="{StaticResource PhoneTextAccentStyle}"
+ FontSize="{StaticResource PhoneFontSizeSmall}"
+ Margin="5,0,5,5" VerticalAlignment="Top"
+ TextWrapping="Wrap" HorizontalAlignment="Left"/>
+ </Grid>
+ </Border>
+ </ControlTemplate>
+ </HyperlinkButton.Template>
+ </HyperlinkButton>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
+ </ScrollViewer>
+ </Grid>
+</UserControl>
diff --git a/Juick/Controls/MessageList.xaml.cs b/Juick/Controls/MessageList.xaml.cs
new file mode 100644
index 0000000..0b74705
--- /dev/null
+++ b/Juick/Controls/MessageList.xaml.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace Juick.Controls
+{
+ public partial class MessageList : UserControl
+ {
+ public MessageList()
+ {
+ InitializeComponent();
+ }
+ }
+}