summaryrefslogtreecommitdiff
path: root/Juick/Controls
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2013-04-01 12:05:02 +0400
committerGravatar Vitaly Takmazov2013-04-01 12:05:02 +0400
commit0623943dccad5c44831b2ad4a803eab2436e45e6 (patch)
treedf9ea217f9dbfef53a82b4a7e7fc98117d1c11b3 /Juick/Controls
parent4c92def17fef70c35e578ffb2c5e6acde3b9247d (diff)
Using WPToolkit LongListSelector
Diffstat (limited to 'Juick/Controls')
-rw-r--r--Juick/Controls/MessageList.xaml78
1 files changed, 41 insertions, 37 deletions
diff --git a/Juick/Controls/MessageList.xaml b/Juick/Controls/MessageList.xaml
index 7a5882f..96cd81b 100644
--- a/Juick/Controls/MessageList.xaml
+++ b/Juick/Controls/MessageList.xaml
@@ -5,8 +5,10 @@
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"
+ xmlns:converters="clr-namespace:Juick.Converters"
+ xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
mc:Ignorable="d"
+ xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
@@ -16,55 +18,57 @@
</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"
+ <toolkit:LongListSelector x:Name="longList" Margin="0, 0, -12, 0"
+ ItemsSource="{Binding Items}" IsFlatList="true">
+ <i:Interaction.Triggers>
+ <i:EventTrigger EventName="Link">
+ <bindings:InvokeDelegateCommandAction Command="{Binding LoadMessagesPageCommand}"
+ CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=InvokeParameter}"/>
+ </i:EventTrigger>
+ <i:EventTrigger EventName="SelectionChanged">
+ <bindings:InvokeDelegateCommandAction Command="{Binding NavigateNextCommand}"
+ CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=InvokeParameter}"/>
+ </i:EventTrigger>
+ </i:Interaction.Triggers>
+ <toolkit:LongListSelector.ItemTemplate>
+ <DataTemplate>
+ <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"
+ <!--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"
+ <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>
+ </Border>
+
+ </DataTemplate>
+ </toolkit:LongListSelector.ItemTemplate>
+ </toolkit:LongListSelector>
</Grid>
</UserControl>