forked from zcbenz/sbbs-client-wp7
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MailPage.xaml.cs
55 lines (48 loc) · 1.74 KB
/
MailPage.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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;
MailContent.Visibility = Visibility.Visible;
if (mail != null)
App.ViewModel.Mail.Content = mail.Content;
});
}
}
private void Reply_Click(object sender, EventArgs e)
{
this.NavigationService.Navigate(new Uri("/ComposePage.xaml?reid=" + App.ViewModel.Mail.Id + "&title=" + HttpUtility.UrlEncode(App.ViewModel.Mail.Title)
+ "&user=" + App.ViewModel.Mail.Author, UriKind.Relative));
}
}
}