Revision 3ddbb7b8 trunk/Pithos.Client.WPF/Preferences/AddAccountView.xaml
b/trunk/Pithos.Client.WPF/Preferences/AddAccountView.xaml | ||
---|---|---|
1 | 1 |
<Window x:Class="Pithos.Client.WPF.Preferences.AddAccountView" |
2 | 2 |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
3 | 3 |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
4 |
xmlns:cal="http://www.caliburnproject.org" |
|
4 | 5 |
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" |
5 |
Title="AddAccountView" Height="300" Width="467"> |
|
6 |
<extToolkit:Wizard FinishButtonClosesWindow="True"> |
|
6 |
Title="AddAccountView" Height="300" Width="467" xmlns:my="clr-namespace:Microsoft.Windows.Controls.Core.Converters;assembly=WPFToolkit.Extended" |
|
7 |
xmlns:Preferences="clr-namespace:Pithos.Client.WPF.Preferences"> |
|
8 |
<Window.Resources> |
|
9 |
<my:InverseBoolConverter x:Key="InverseBool" /> |
|
10 |
<BooleanToVisibilityConverter x:Key="BoolToVisible" /> |
|
11 |
</Window.Resources> |
|
12 |
<extToolkit:Wizard FinishButtonClosesWindow="True" Name="AccountWizard" PageChanged="AccountWizard_PageChanged"> |
|
7 | 13 |
<extToolkit:WizardPage x:Name="IntroPage" |
8 | 14 |
Title="Add new Pithos Account" |
9 | 15 |
Description="This Wizard will walk you through adding a new Pithos account and retrieving an authentication token" /> |
10 | 16 |
<extToolkit:WizardPage x:Name="ChooseMethodPage" PageType="Interior" |
11 | 17 |
Title="How do you want to add the account?" |
12 |
Description="You can add an account either by logging in the Pithos Web Site or by entering your username and password manually" |
|
13 |
NextPage="{Binding ElementName=ManualAccountPage}" |
|
14 |
PreviousPage="{Binding ElementName=IntroPage}"> |
|
18 |
Description="You can add an account either by logging in the Pithos Web Site or by entering your username and password manually" |
|
19 |
CanSelectNextPage="False"> |
|
15 | 20 |
<StackPanel > |
16 |
<RadioButton x:Name="Automatic" Content="By logging to Pithos" IsChecked="True"/>
|
|
17 |
<RadioButton x:Name="Manually" Content="Manually"/> |
|
21 |
<RadioButton x:Name="Automatic" Content="By logging to Pithos" Checked="Automatic_Checked" Margin="5"/>
|
|
22 |
<RadioButton x:Name="Manually" Content="Manually" Checked="Manually_Checked" Margin="5"/>
|
|
18 | 23 |
</StackPanel> |
19 | 24 |
</extToolkit:WizardPage> |
20 | 25 |
<extToolkit:WizardPage x:Name="ManualAccountPage" PageType="Interior" |
21 | 26 |
Title="Add an account manually" |
22 | 27 |
Description="This is the second page in the process" |
23 |
NextPage="{Binding ElementName=AccountPathPage}" |
|
28 |
NextPage="{Binding ElementName=AccountPathPage}" |
|
29 |
CanSelectNextPage="{Binding HasCredentials}" |
|
24 | 30 |
> |
25 | 31 |
<Grid> |
26 | 32 |
<Grid.ColumnDefinitions> |
... | ... | |
39 | 45 |
</Grid> |
40 | 46 |
</extToolkit:WizardPage> |
41 | 47 |
<extToolkit:WizardPage x:Name="AutoAccountPage" PageType="Interior" |
42 |
Title="Add an account manually" |
|
43 |
Description="This is the second page in the process" |
|
44 |
NextPage="{Binding ElementName=AutoConfirmedPage}" |
|
45 |
/> |
|
46 |
<extToolkit:WizardPage x:Name="AutoConfirmedPage" PageType="Interior" |
|
47 |
Title="Token Received" |
|
48 |
Description="The authentication token was received" |
|
49 |
NextPage="{Binding ElementName=AccountPathPage}" |
|
48 |
Title="Add an account automatically" |
|
49 |
Description="By clicking on the button below you will be taken to the Pithos web site where you can login with your username and password." |
|
50 |
NextPage="{Binding ElementName=AutoConfirmedPage}" |
|
51 |
CanSelectNextPage="{Binding IsConfirmed}" |
|
52 |
cal:Message.Attach="[Event GotFocus] = [Action RetrieveCredentials()]" |
|
50 | 53 |
> |
51 |
<Grid> |
|
52 |
<Grid.RowDefinitions> |
|
53 |
<RowDefinition /> |
|
54 |
<RowDefinition /> |
|
55 |
</Grid.RowDefinitions> |
|
56 |
<Grid.ColumnDefinitions> |
|
57 |
<ColumnDefinition Width="Auto"/> |
|
58 |
<ColumnDefinition/> |
|
59 |
</Grid.ColumnDefinitions> |
|
60 |
<TextBlock Text="Account" Grid.Row="0" Grid.Column="0"/> |
|
61 |
<TextBlock Text="Token" Grid.Row="1" Grid.Column="0"/> |
|
62 |
<TextBlock x:Name="FinalAccountName" Grid.Row="0" Grid.Column="1"/> |
|
63 |
<TextBlock x:Name="FinalToken" Grid.Row="1" Grid.Column="1"/> |
|
64 |
</Grid> |
|
54 |
<extToolkit:BusyIndicator IsBusy="{Binding IsRetrieving}"> |
|
55 |
<extToolkit:BusyIndicator.BusyContent> |
|
56 |
<TextBlock TextWrapping="Wrap"> |
|
57 |
<TextBlock HorizontalAlignment="Center">Waiting for credentials. </TextBlock> |
|
58 |
<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap">Please enter your credentials in the Pithos logon page</TextBlock> |
|
59 |
</TextBlock> |
|
60 |
</extToolkit:BusyIndicator.BusyContent> |
|
61 |
<extToolkit:BusyIndicator.Content> |
|
62 |
<StackPanel VerticalAlignment="Center" > |
|
63 |
<Button Margin="5" Name="RetrieveCredentials" Content="Retrieve Credentials" Width="150"/> |
|
64 |
|
|
65 |
<TextBlock Text="Credentials Retrieved Succesfully" Visibility="{Binding Converter={StaticResource BoolToVisible}, Path=HasCredentials}" Margin="10" HorizontalAlignment="Center"/> |
|
66 |
</StackPanel> |
|
67 |
</extToolkit:BusyIndicator.Content> |
|
68 |
</extToolkit:BusyIndicator> |
|
65 | 69 |
</extToolkit:WizardPage> |
66 | 70 |
<extToolkit:WizardPage x:Name="AccountPathPage" PageType="Interior" |
67 | 71 |
Title="Select Account Path" |
68 | 72 |
Description="Please select the roor path for your account" |
69 | 73 |
NextPage="{Binding ElementName=LastPage}" |
74 |
CanSelectNextPage="{Binding HasAccountPath}" |
|
70 | 75 |
> |
71 | 76 |
<StackPanel> |
72 |
<TextBlock Text="Path:"/> |
|
73 |
<StackPanel Orientation="Horizontal"> |
|
74 |
<TextBox x:Name="AccountPath" Width="150" /> |
|
75 |
<Button x:Name="SelectAccount" Content="Select ..."/> |
|
76 |
</StackPanel> |
|
77 |
<Label Content="Path:" Target="{Binding ElementName=AccountPath}"/> |
|
78 |
<Grid HorizontalAlignment="Stretch"> |
|
79 |
<Grid.ColumnDefinitions> |
|
80 |
<ColumnDefinition /> |
|
81 |
<ColumnDefinition Width="Auto" /> |
|
82 |
</Grid.ColumnDefinitions> |
|
83 |
<TextBox x:Name="AccountPath" HorizontalAlignment="Stretch" Grid.Column="0" > |
|
84 |
<TextBox.Text> |
|
85 |
<Binding Path="AccountPath" Mode="TwoWay"> |
|
86 |
<Binding.ValidationRules> |
|
87 |
<Preferences:DirectoryExistsRule/> |
|
88 |
</Binding.ValidationRules> |
|
89 |
</Binding> |
|
90 |
</TextBox.Text> |
|
91 |
<Validation.ErrorTemplate> |
|
92 |
<ControlTemplate> |
|
93 |
<StackPanel> |
|
94 |
<AdornedElementPlaceholder /> |
|
95 |
<TextBlock Foreground="Red" >Invalid Path</TextBlock> |
|
96 |
</StackPanel> |
|
97 |
</ControlTemplate> |
|
98 |
</Validation.ErrorTemplate> |
|
99 |
</TextBox> |
|
100 |
<Button x:Name="SelectAccount" Content="Select ..." HorizontalAlignment="Right" Grid.Column="1"/> |
|
101 |
</Grid> |
|
77 | 102 |
</StackPanel> |
78 | 103 |
</extToolkit:WizardPage> |
79 | 104 |
<extToolkit:WizardPage x:Name="LastPage" PageType="Interior" |
80 | 105 |
Title="Finish" |
81 | 106 |
Description="Press finish to create the account" |
82 | 107 |
CanFinish="True"> |
83 |
<CheckBox x:Name="IsActive" Content="Start using the account immediatelly"/> |
|
108 |
<Grid> |
|
109 |
<Grid.RowDefinitions> |
|
110 |
<RowDefinition Height="Auto"/> |
|
111 |
<RowDefinition Height="Auto"/> |
|
112 |
<RowDefinition Height="Auto"/> |
|
113 |
<RowDefinition /> |
|
114 |
</Grid.RowDefinitions> |
|
115 |
<Grid.ColumnDefinitions> |
|
116 |
<ColumnDefinition Width="Auto"/> |
|
117 |
<ColumnDefinition /> |
|
118 |
</Grid.ColumnDefinitions> |
|
119 |
<TextBlock Text="Account Name:" Grid.Column="0" Grid.Row="0" Margin="5,2"/> |
|
120 |
<TextBlock Text="{Binding AccountName}" Grid.Column="1" Grid.Row="0" Margin="5,2"/> |
|
121 |
<TextBlock Text="Token:" Grid.Column="0" Grid.Row="1" Margin="5,2"/> |
|
122 |
<TextBlock Text="{Binding Token}" Grid.Column="1" Grid.Row="1" Margin="5,2"/> |
|
123 |
<TextBlock Text="Account Path:" Grid.Column="0" Grid.Row="2" Margin="5,2"/> |
|
124 |
<TextBlock Text="{Binding AccountPath}" Grid.Column="1" Grid.Row="2" Margin="5,2"/> |
|
125 |
|
|
126 |
<CheckBox x:Name="IsAccountActive" Content="Start using the account immediatelly" Grid.ColumnSpan="2" Grid.Row="3" Margin="5"/> |
|
127 |
</Grid> |
|
84 | 128 |
</extToolkit:WizardPage> |
85 | 129 |
</extToolkit:Wizard> |
86 | 130 |
|
Also available in: Unified diff