Skip to content

Commit

Permalink
查看站内信
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Mar 7, 2012
1 parent 73a8604 commit bb546fc
Show file tree
Hide file tree
Showing 7 changed files with 156 additions and 0 deletions.
Binary file added Images/respond.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 67 additions & 0 deletions MailPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<phone:PhoneApplicationPage
x:Class="sbbs_client_wp7.MailPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
mc:Ignorable="d" d:DesignHeight="696" d:DesignWidth="480"
d:DataContext="{d:DesignData SampleData/MailSampleData.xaml}"
shell:SystemTray.IsVisible="True"
shell:SystemTray.Opacity="0">

<toolkit:TransitionService.NavigationInTransition>
<toolkit:NavigationInTransition>
<toolkit:NavigationInTransition.Backward>
<toolkit:TurnstileTransition Mode="BackwardIn"/>
</toolkit:NavigationInTransition.Backward>
<toolkit:NavigationInTransition.Forward>
<toolkit:TurnstileTransition Mode="ForwardIn"/>
</toolkit:NavigationInTransition.Forward>
</toolkit:NavigationInTransition>
</toolkit:TransitionService.NavigationInTransition>
<toolkit:TransitionService.NavigationOutTransition>
<toolkit:NavigationOutTransition>
<toolkit:NavigationOutTransition.Backward>
<toolkit:TurnstileTransition Mode="BackwardOut"/>
</toolkit:NavigationOutTransition.Backward>
<toolkit:NavigationOutTransition.Forward>
<toolkit:TurnstileTransition Mode="ForwardOut"/>
</toolkit:NavigationOutTransition.Forward>
</toolkit:NavigationOutTransition>
</toolkit:TransitionService.NavigationOutTransition>

<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>

<!--TitlePanel contains the name of the application and page title-->
<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
<TextBlock Text="{Binding Author}" Margin="2 0 0 0" Style="{StaticResource PhoneTextNormalStyle}"/>
<ScrollViewer VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Visible">
<TextBlock x:Name="PageTitle" Text="{Binding Title}" Margin="0,-7,0,0" Foreground="{StaticResource PhoneAccentBrush}" Style="{StaticResource PhoneTextExtraLargeStyle}"/>
</ScrollViewer>
</StackPanel>

<ScrollViewer x:Name="Content" Visibility="Collapsed" Grid.Row="1" Margin="12,0,12,0">
<TextBlock Text="{Binding Content}" TextWrapping="Wrap" FontSize="{StaticResource PhoneFontSizeMedium}" />
</ScrollViewer>
<toolkit:PerformanceProgressBar x:Name="LoadProgress" IsIndeterminate="True" Grid.Row="1" />
</Grid>

<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
<shell:ApplicationBarIconButton Click="Reply_Click" IconUri="/Images/respond.png" Text="回复"/>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>
53 changes: 53 additions & 0 deletions MailPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Navigation;
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;
using Microsoft.Phone.Controls;

namespace sbbs_client_wp7
{
using Sbbs;

public partial class MailPage : PhoneApplicationPage
{
public MailPage()
{
InitializeComponent();

if (App.ViewModel.Mail == null)
App.ViewModel.Mail = new TopicViewModel();

DataContext = App.ViewModel.Mail;
}

protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);

if (NavigationContext.QueryString.ContainsKey("type"))
{
int type = int.Parse(NavigationContext.QueryString["type"]);
App.Service.Mail(type, App.ViewModel.Mail.Id, delegate(TopicViewModel mail, bool success, string error)
{
LoadProgress.Visibility = Visibility.Collapsed;
LoadProgress.IsIndeterminate = false;
Content.Visibility = Visibility.Visible;
if (mail != null)
App.ViewModel.Mail.Content = mail.Content;
});
}
}

private void Reply_Click(object sender, EventArgs e)
{
}
}
}
4 changes: 4 additions & 0 deletions MailboxPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ private void Mail_Selected(object sender, SelectionChangedEventArgs e)
{
// 清除选择,否则同样的项目无法点击第二次
(sender as ListBox).SelectedIndex = -1;

int type = MailboxPivot.SelectedIndex;
App.ViewModel.Mail = e.AddedItems[0] as TopicViewModel;
NavigationService.Navigate(new Uri("/MailPage.xaml?type=" + type, UriKind.Relative));
}
}

Expand Down
18 changes: 18 additions & 0 deletions SampleData/MailSampleData.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<sbbs:TopicViewModel
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sbbs="clr-namespace:sbbs_client_wp7.Sbbs"
Author="one"
Time="1331122744"
Content="
[WEB]
1、回复提醒及@功能
当自己的帖子被回复时,或者有人在帖子里以@id的形式爱特你时,你将会收到通知
2、显示单篇文章的已阅读数(即人气)
文章阅读数由不同IP的阅读次数决定,同一IP在一段时间内反复阅读只记1次阅读。
[Telnet]
1、增加回复提醒及@功能
在下方状态栏的用户id旁边显示通知数目,使用CTRL+K快捷键,然后选择3进入通知
查看界面。"
Title="[系统]BBS近期功能改进"/>
2 changes: 2 additions & 0 deletions ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ public ObservableCollection<BoardViewModel> FavoratesItems
public HotViewModel Hot { get; set; }
// 邮箱页面
public MailboxViewModel Mailbox { get; set; }
// 邮件
public TopicViewModel Mail { get; set; }

// 是否已经登陆
public bool IsLogin
Expand Down
12 changes: 12 additions & 0 deletions sbbs-client-wp7.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@
<Compile Include="MailboxPage.xaml.cs">
<DependentUpon>MailboxPage.xaml</DependentUpon>
</Compile>
<Compile Include="MailPage.xaml.cs">
<DependentUpon>MailPage.xaml</DependentUpon>
</Compile>
<Compile Include="MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -145,6 +148,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MailPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MainPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand All @@ -165,6 +172,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<DesignData Include="SampleData\MailSampleData.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</DesignData>
<Page Include="SettingsPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -198,6 +209,7 @@
<Content Include="Images\new.png" />
<Content Include="Images\refresh.png" />
<Resource Include="Images\save.png" />
<Content Include="Images\respond.png" />
<Content Include="Images\send.text.png" />
<Content Include="Images\Tiles\cup.png" />
<Content Include="Images\Tiles\folder.png" />
Expand Down

0 comments on commit bb546fc

Please sign in to comment.