root / trunk / Pithos.Client.WPF / Preferences / AddAccountView.xaml.cs @ f734ab5b
History | View | Annotate | Download (1.9 kB)
1 |
using System; |
---|---|
2 |
using System.Collections.Generic; |
3 |
using System.Linq; |
4 |
using System.Text; |
5 |
using System.Windows; |
6 |
using System.Windows.Controls; |
7 |
using System.Windows.Data; |
8 |
using System.Windows.Documents; |
9 |
using System.Windows.Input; |
10 |
using System.Windows.Media; |
11 |
using System.Windows.Media.Imaging; |
12 |
using System.Windows.Shapes; |
13 |
using Microsoft.Windows.Controls; |
14 |
|
15 |
namespace Pithos.Client.WPF.Preferences |
16 |
{ |
17 |
/// <summary> |
18 |
/// Interaction logic for AddAccountView.xaml |
19 |
/// </summary> |
20 |
public partial class AddAccountView : Window |
21 |
{ |
22 |
public AddAccountView() |
23 |
{ |
24 |
InitializeComponent(); |
25 |
|
26 |
//When the busy indicator changes, force a focus change. Workaround for delayed change of the Next button's visibility |
27 |
ManualBusyMessage.IsVisibleChanged += (sender, evt) => Token.Focus(); ; |
28 |
} |
29 |
|
30 |
|
31 |
private void Automatic_Checked(object sender, RoutedEventArgs e) |
32 |
{ |
33 |
ChooseMethodPage.NextPage = AutoAccountPage; |
34 |
ChooseMethodPage.CanSelectNextPage = true; |
35 |
} |
36 |
|
37 |
private void Manually_Checked(object sender, RoutedEventArgs e) |
38 |
{ |
39 |
ChooseMethodPage.NextPage = ManualAccountPage; |
40 |
ChooseMethodPage.CanSelectNextPage = true; |
41 |
} |
42 |
|
43 |
|
44 |
Stack<WizardPage> _history=new Stack<WizardPage>(); |
45 |
|
46 |
private void AccountWizard_PageChanged(object sender, RoutedEventArgs e) |
47 |
{ |
48 |
WizardPage lastPage=null; |
49 |
if (_history.Count>1 && _history.ElementAt(1) == AccountWizard.CurrentPage) |
50 |
{ |
51 |
_history.Pop(); |
52 |
_history.Pop(); |
53 |
} |
54 |
if (_history.Count > 0) |
55 |
lastPage = _history.Peek(); |
56 |
|
57 |
if (lastPage != null) |
58 |
AccountWizard.CurrentPage.PreviousPage = lastPage; |
59 |
|
60 |
_history.Push(AccountWizard.CurrentPage); |
61 |
|
62 |
} |
63 |
} |
64 |
} |