From bb546fc1dfc5121086cdb38352895b43f1b46b0b Mon Sep 17 00:00:00 2001 From: Zhao Cheng Date: Wed, 7 Mar 2012 22:04:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E7=AB=99=E5=86=85=E4=BF=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Images/respond.png | Bin 0 -> 599 bytes MailPage.xaml | 67 +++++++++++++++++++++++++++++++++ MailPage.xaml.cs | 53 ++++++++++++++++++++++++++ MailboxPage.xaml.cs | 4 ++ SampleData/MailSampleData.xaml | 18 +++++++++ ViewModels/MainViewModel.cs | 2 + sbbs-client-wp7.csproj | 12 ++++++ 7 files changed, 156 insertions(+) create mode 100644 Images/respond.png create mode 100644 MailPage.xaml create mode 100644 MailPage.xaml.cs create mode 100644 SampleData/MailSampleData.xaml diff --git a/Images/respond.png b/Images/respond.png new file mode 100644 index 0000000000000000000000000000000000000000..f5d7babf54b2627a17ff50895dbafa402ae7cea6 GIT binary patch literal 599 zcmV-d0;v6oP)r%GBIDYwUS z&*nF>U?`Q&vjwi$?_1#ao5YZ04S24*aIyoIx7RE<)&o6Z9wj7dfQ_@iidB9J0GTTU z6AIpQc+3Nww}bUZ+Fw!VxYPn42V~%yZwxVz)!r+Kt8P4@H;WVxJW3zHa=S)jjOqg* z0INw0?%WJm9S>Z&)MBykS>BkWryRUzQL zBLoE-ro1J^FI2O`3PG7-s0xw62Af_804pSy^(1S}JP_T59RLeKc5)vuLL+O~`(KDn zHA)CxNCV(lWbY|?r6-3Bi+K~IfKxyw1K<(b(2V3O0y(W)haP@24=@FD0YA<41{0vl1>O zlUtsc6HcWcqb~IzU`un%e-fUzg0rJ lC;$bZ02F`%xEq}X7yz<{{=?XSlIH*b002ovPDHLkV1gO;^Tq%G literal 0 HcmV?d00001 diff --git a/MailPage.xaml b/MailPage.xaml new file mode 100644 index 0000000..420e204 --- /dev/null +++ b/MailPage.xaml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MailPage.xaml.cs b/MailPage.xaml.cs new file mode 100644 index 0000000..a9387d9 --- /dev/null +++ b/MailPage.xaml.cs @@ -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) + { + } + } +} \ No newline at end of file diff --git a/MailboxPage.xaml.cs b/MailboxPage.xaml.cs index d9f201e..9cafa48 100644 --- a/MailboxPage.xaml.cs +++ b/MailboxPage.xaml.cs @@ -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)); } } diff --git a/SampleData/MailSampleData.xaml b/SampleData/MailSampleData.xaml new file mode 100644 index 0000000..98c360d --- /dev/null +++ b/SampleData/MailSampleData.xaml @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/ViewModels/MainViewModel.cs b/ViewModels/MainViewModel.cs index d4db49c..a8d37ec 100644 --- a/ViewModels/MainViewModel.cs +++ b/ViewModels/MainViewModel.cs @@ -108,6 +108,8 @@ public ObservableCollection FavoratesItems public HotViewModel Hot { get; set; } // 邮箱页面 public MailboxViewModel Mailbox { get; set; } + // 邮件 + public TopicViewModel Mail { get; set; } // 是否已经登陆 public bool IsLogin diff --git a/sbbs-client-wp7.csproj b/sbbs-client-wp7.csproj index 1583abe..578736c 100644 --- a/sbbs-client-wp7.csproj +++ b/sbbs-client-wp7.csproj @@ -84,6 +84,9 @@ MailboxPage.xaml + + MailPage.xaml + MainPage.xaml @@ -145,6 +148,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -165,6 +172,10 @@ Designer MSBuild:Compile + + MSBuild:Compile + Designer + Designer MSBuild:Compile @@ -198,6 +209,7 @@ +