Skip to content

Commit

Permalink
分区热点样式简化
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Mar 14, 2012
1 parent fef369d commit 584bf3d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
14 changes: 13 additions & 1 deletion HotPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,26 @@
</toolkit:NavigationOutTransition.Forward>
</toolkit:NavigationOutTransition>
</toolkit:TransitionService.NavigationOutTransition>

<phone:PhoneApplicationPage.Resources>
<DataTemplate x:Key="SimpleTopicDataTemplate">
<StackPanel Orientation="Vertical" Margin="-12 0 0 10">
<TextBlock Style="{StaticResource PhoneTextLargeStyle}" Foreground="{Binding Unread, Converter={StaticResource BoolAccentConverter}}" TextWrapping="Wrap" Text="{Binding Title}"/>
<Grid>
<TextBlock Style="{StaticResource PhoneTextSubtleStyle}" Text="{Binding Author}"/>
<TextBlock HorizontalAlignment="Right" Margin="0" Style="{StaticResource PhoneTextSubtleStyle}" Text="{Binding Board}"/>
</Grid>
</StackPanel>
</DataTemplate>
</phone:PhoneApplicationPage.Resources>

<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<!--Pivot Control-->
<controls:Pivot x:Name="HotPivot" LoadedPivotItem="Pivot_LoadedPivotItem" Title="虎踞龙蟠BBS">
<!--Pivot item one-->
<controls:PivotItem Header="分区热点">
<toolkit:LongListSelector SelectionChanged="LongListSelector_SelectionChanged" ItemsSource="{Binding TopicsGroupItems}" ItemTemplate="{StaticResource TopicDataTemplate}">
<toolkit:LongListSelector SelectionChanged="LongListSelector_SelectionChanged" ItemsSource="{Binding TopicsGroupItems}" ItemTemplate="{StaticResource SimpleTopicDataTemplate}">
<toolkit:LongListSelector.GroupHeaderTemplate>
<DataTemplate>
<Border Margin="0 0 0 10" Background="{StaticResource PhoneAccentBrush}">
Expand Down
4 changes: 2 additions & 2 deletions MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@
<local:Tile Title="分区热点" Tap="HotTopics_Tap" Src="/Images/Tiles/board.png"/>
<local:Tile Title="热门版面" Tap="HotBoards_Tap" Src="/Images/Tiles/list.png"/>
<local:Tile Title="版面分区" Tap="Sections_Tap" Src="/Images/Tiles/folder.png"/>
<local:Tile Title="最近浏览" Tap="History_Tap" Src="/Images/Tiles/history.png"/>
<!--<local:Tile Title="最近浏览" Tap="History_Tap" Src="/Images/Tiles/history.png"/>-->
<local:Tile Title="站内信" Tap="Mail_Tap" Src="/Images/Tiles/mailbox.png" Visibility="{Binding IsLogin, Converter={StaticResource BoolVisibleConverter}}"/>
<!--<local:Tile Title="搜索" Src="/Images/Tiles/search.png"/>-->
<local:Tile Title="搜索" Tap="Search_Tap" Src="/Images/Tiles/search.png"/>
<local:Tile Title="注册" Src="/Images/Tiles/cup.png" Visibility="{Binding IsLogin, Converter={StaticResource BoolVisibleConverter}, ConverterParameter=True}"/>
<local:Tile Title="关于" Tap="About_Tap" Src="/Images/Tiles/love.png"/>
<local:Tile Title="退出" Src="/Images/Tiles/pen.png" Tap="Logout_Tap" Visibility="{Binding IsLogin, Converter={StaticResource BoolVisibleConverter}}"/>
Expand Down
6 changes: 6 additions & 0 deletions MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ private void Mail_Tap(object sender, System.Windows.Input.GestureEventArgs e)
NavigationService.Navigate(new Uri("/MailboxPage.xaml?type=0", UriKind.RelativeOrAbsolute));
}

// 搜索
private void Search_Tap(object sender, System.Windows.Input.GestureEventArgs e)
{
NavigationService.Navigate(new Uri("/SearchPage.xaml", UriKind.RelativeOrAbsolute));
}

// 浏览历史
private void History_Tap(object sender, System.Windows.Input.GestureEventArgs e)
{
Expand Down

0 comments on commit 584bf3d

Please sign in to comment.