Skip to content

Commit

Permalink
点击标题刷新
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Mar 3, 2012
1 parent b18b166 commit 78be87a
Show file tree
Hide file tree
Showing 6 changed files with 954 additions and 2 deletions.
Binary file added Images/circle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 26 additions & 2 deletions MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:local="clr-namespace:sbbs_client_wp7"
xmlns:sbbs="clr-namespace:sbbs_client_wp7.Sbbs"
xmlns:motion="clr-namespace:MetroInMotionUtils"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
Expand Down Expand Up @@ -55,6 +56,23 @@
</ContentPresenter>
</Grid>
</DataTemplate>

<Style x:Key ="SimpleButtonStyle" TargetType="Button">
<Setter Property ="toolkit:TiltEffect.IsTiltEnabled" Value="True"/>
<Setter Property ="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<ContentControl x:Name="ContentContainer"
Content="{ TemplateBinding Content}"
ContentTemplate="{ TemplateBinding ContentTemplate}"
HorizontalContentAlignment =
"{TemplateBinding HorizontalContentAlignment }"
VerticalContentAlignment=
"{TemplateBinding VerticalContentAlignment}"/>
</ControlTemplate>
</Setter.Value>
</Setter >
</Style>
</phone:PhoneApplicationPage.Resources>

<!--LayoutRoot is the root grid where all page content is placed-->
Expand All @@ -75,7 +93,10 @@
-->

<!-- 十大热帖 -->
<controls:PanoramaItem Header="十大热帖" HeaderTemplate="{StaticResource MyItemHeaderTemplate}">
<controls:PanoramaItem>
<controls:PanoramaItem.Header>
<TextBlock MouseLeftButtonUp="RefreshTopten_Click" motion:MetroInMotion.Tilt="6" Text="十大热帖" Foreground="{StaticResource PhoneAccentBrush}" FontSize="60"/>
</controls:PanoramaItem.Header>
<ScrollViewer>
<ListBox ItemsSource="{Binding ToptenItems}" ItemTemplate="{StaticResource TopicDataTemplate}"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
Expand All @@ -90,7 +111,10 @@
</controls:PanoramaItem>

<!-- 我的最爱 -->
<controls:PanoramaItem Header="收藏夹" HeaderTemplate="{StaticResource MyItemHeaderTemplate}">
<controls:PanoramaItem>
<controls:PanoramaItem.Header>
<TextBlock MouseLeftButtonUp="RefreshFavorates_Click" motion:MetroInMotion.Tilt="6" Text="收藏夹" Foreground="{StaticResource PhoneAccentBrush}" FontSize="60"/>
</controls:PanoramaItem.Header>
<ScrollViewer>
<ListBox ItemsSource="{Binding FavoratesItems}" ItemTemplate="{StaticResource BoardDataTemplate}"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
Expand Down
14 changes: 14 additions & 0 deletions MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,20 @@ private void Logout_Click(object sender, MouseButtonEventArgs e)
App.ViewModel.IsLogin = false;
}

// 刷新十大
private void RefreshTopten_Click(object sender, MouseButtonEventArgs e)
{
App.ViewModel.IsToptenLoaded = false;
LoadTopten();
}

// 刷新收藏夹
private void RefreshFavorates_Click(object sender, MouseButtonEventArgs e)
{
App.ViewModel.IsFavoratesLoaded = false;
LoadFavorates();
}

// 点击收藏夹
private void Favorates_Selected(object sender, SelectionChangedEventArgs e)
{
Expand Down
Loading

0 comments on commit 78be87a

Please sign in to comment.