-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChooseEmailAccountTypePage.xaml.cs
59 lines (51 loc) · 1.72 KB
/
ChooseEmailAccountTypePage.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
56
57
58
59
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
namespace InstaCollage
{
public partial class ChooseEmailAccountTypePage : BasePhonePage
{
public ChooseEmailAccountTypePage()
{
InitializeComponent();
DataContext = this;
_accountTypes.SelectedIndex = -1;
}
public string FileName { get; set; }
public string FileSize { get; set; }
public IEnumerable<EmailAccountType> AccountTypes
{
get
{
return Enum.GetValues(typeof(EmailAccountType)).OfType<EmailAccountType>();
}
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
_accountTypes.SelectedIndex = -1;
// Get a dictionary of URI parameters and values.
IDictionary<string, string> queryStrings = this.NavigationContext.QueryString;
foreach (var p in queryStrings)
{
if (p.Key == "FileName")
FileName = p.Value;
if (p.Key == "FileSize")
FileSize = p.Value;
}
base.OnNavigatedTo(e);
}
private void _accountTypes_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.AddedItems.Count > 0)
{
NavigationService.Navigate(new Uri(String.Format("/EmailLoginPage.xaml?FileName={0}&FileSize={1}&AccountType={2}", FileName, FileSize, e.AddedItems[0]), UriKind.Relative));
}
}
}
}