root / trunk / Pithos.Client.WPF / Preferences / AddAccountView.xaml @ 3044d745
History | View | Annotate | Download (12.9 kB)
1 | 7e39367d | pkanavos | <Window x:Class="Pithos.Client.WPF.Preferences.AddAccountView" |
---|---|---|---|
2 | 7e39367d | pkanavos | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
3 | 7e39367d | pkanavos | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
4 | 7e39367d | pkanavos | xmlns:cal="http://www.caliburnproject.org" |
5 | 7e39367d | pkanavos | Title="AddAccountView" Height="300" Width="467" |
6 | 7e39367d | pkanavos | xmlns:Preferences="clr-namespace:Pithos.Client.WPF.Preferences" |
7 | 7e39367d | pkanavos | xmlns:my="http://schemas.xceed.com/wpf/xaml/toolkit"> |
8 | 7e39367d | pkanavos | <Window.Resources> |
9 | 7e39367d | pkanavos | <my:InverseBoolConverter x:Key="InverseBool" /> |
10 | 7e39367d | pkanavos | <BooleanToVisibilityConverter x:Key="BoolToVisible" /> |
11 | 7e39367d | pkanavos | </Window.Resources> |
12 | 7e39367d | pkanavos | <my:Wizard FinishButtonClosesWindow="True" Name="AccountWizard" PageChanged="AccountWizard_PageChanged" HelpButtonVisibility="Collapsed"> |
13 | 7e39367d | pkanavos | <my:WizardPage x:Name="IntroPage" |
14 | 7e39367d | pkanavos | Title="Setup your Pithos Account" |
15 | 7e39367d | pkanavos | Description="This wizard will walk you through in setting up your Pithos account and retrieving an authentication token." |
16 | 7e39367d | pkanavos | |
17 | 7e39367d | pkanavos | BackButtonVisibility="Collapsed" |
18 | 7e39367d | pkanavos | FinishButtonVisibility="Collapsed"> |
19 | 7e39367d | pkanavos | <my:WizardPage.ExteriorPanelBackground> |
20 | 7e39367d | pkanavos | <ImageBrush ImageSource="/PithosPlus;component/Images/pithos_logo-icon.ico" Stretch="Uniform" TileMode="None" /> |
21 | 7e39367d | pkanavos | </my:WizardPage.ExteriorPanelBackground> |
22 | 7e39367d | pkanavos | </my:WizardPage> |
23 | 7e39367d | pkanavos | <my:WizardPage x:Name="ChooseServer" PageType="Interior" |
24 | 7e39367d | pkanavos | Title="Where do you want to connect?" |
25 | 7e39367d | pkanavos | Description="You can connect to the production or development server, or enter your own server URL" |
26 | 7e39367d | pkanavos | FinishButtonVisibility="Collapsed" |
27 | 7e39367d | pkanavos | CanSelectNextPage="{Binding IsValidServer}" |
28 | 7e39367d | pkanavos | |
29 | 7e39367d | pkanavos | > |
30 | 7e39367d | pkanavos | <StackPanel > |
31 | 7e39367d | pkanavos | <Label Content="Pithos+ Server" Target="{Binding ElementName=Servers}" /> |
32 | 7e39367d | pkanavos | <ComboBox x:Name="Servers" IsEditable="True" ItemsSource="{Binding Servers}" |
33 | 7e39367d | pkanavos | Text="{Binding CurrentServer,ValidatesOnExceptions=True, Mode=TwoWay}" > |
34 | 7e39367d | pkanavos | <Validation.ErrorTemplate> |
35 | 7e39367d | pkanavos | <ControlTemplate> |
36 | 7e39367d | pkanavos | <StackPanel> |
37 | 7e39367d | pkanavos | <AdornedElementPlaceholder /> |
38 | 7e39367d | pkanavos | <TextBlock Foreground="Red" >Invalid Path</TextBlock> |
39 | 7e39367d | pkanavos | </StackPanel> |
40 | 7e39367d | pkanavos | </ControlTemplate> |
41 | 7e39367d | pkanavos | </Validation.ErrorTemplate> |
42 | 7e39367d | pkanavos | </ComboBox> |
43 | 7e39367d | pkanavos | </StackPanel> |
44 | 7e39367d | pkanavos | </my:WizardPage> |
45 | 7e39367d | pkanavos | <my:WizardPage x:Name="ChooseMethodPage" PageType="Interior" |
46 | 7e39367d | pkanavos | Title="How do you want to add the account?" |
47 | 7e39367d | pkanavos | Description="You can add an account either by logging in the Pithos Web Site or by entering your username and password manually" |
48 | 7e39367d | pkanavos | FinishButtonVisibility="Collapsed" |
49 | 7e39367d | pkanavos | CanSelectNextPage="False" |
50 | 7e39367d | pkanavos | > |
51 | 7e39367d | pkanavos | <StackPanel > |
52 | 7e39367d | pkanavos | <RadioButton x:Name="Automatic" Content="By logging to Pithos" Checked="Automatic_Checked" Margin="5"/> |
53 | 7e39367d | pkanavos | <RadioButton x:Name="Manually" Content="Manually" Checked="Manually_Checked" Margin="5"/> |
54 | 7e39367d | pkanavos | </StackPanel> |
55 | 7e39367d | pkanavos | </my:WizardPage> |
56 | 7e39367d | pkanavos | <my:WizardPage x:Name="ManualAccountPage" PageType="Interior" |
57 | 7e39367d | pkanavos | Title="Add an account manually" |
58 | 7e39367d | pkanavos | Description="Please enter the account credentials and press "Validate Credentials"" |
59 | 7e39367d | pkanavos | NextPage="{Binding ElementName=AccountPathPage}" |
60 | 7e39367d | pkanavos | FinishButtonVisibility="Collapsed" |
61 | 7e39367d | pkanavos | CanSelectNextPage="{Binding HasValidCredentials,NotifyOnTargetUpdated=True}" |
62 | 7e39367d | pkanavos | TargetUpdated="OnTargetUpdated" |
63 | 7e39367d | pkanavos | |
64 | 7e39367d | pkanavos | > |
65 | 7e39367d | pkanavos | <my:BusyIndicator x:Name="ManualBusyIndicator" IsBusy="{Binding IsWorking,NotifyOnSourceUpdated=true}" DisplayAfter="0" > |
66 | 7e39367d | pkanavos | <my:BusyIndicator.BusyContent> |
67 | 7e39367d | pkanavos | <TextBlock x:Name="ManualBusyMessage" Text="{Binding BusyTitle}" HorizontalAlignment="Center" /> |
68 | 7e39367d | pkanavos | </my:BusyIndicator.BusyContent> |
69 | 7e39367d | pkanavos | <my:BusyIndicator.Content> |
70 | 7e39367d | pkanavos | <Grid> |
71 | 7e39367d | pkanavos | <Grid.ColumnDefinitions> |
72 | 7e39367d | pkanavos | <ColumnDefinition Width="Auto"/> |
73 | 7e39367d | pkanavos | <ColumnDefinition Width="91*"/> |
74 | 7e39367d | pkanavos | </Grid.ColumnDefinitions> |
75 | 7e39367d | pkanavos | <Grid.RowDefinitions> |
76 | 7e39367d | pkanavos | <RowDefinition Height="Auto"/> |
77 | 7e39367d | pkanavos | <RowDefinition Height="Auto"/> |
78 | 7e39367d | pkanavos | <RowDefinition Height="Auto"/> |
79 | 7e39367d | pkanavos | <RowDefinition /> |
80 | 7e39367d | pkanavos | </Grid.RowDefinitions> |
81 | 7e39367d | pkanavos | <Label Content="Account" Grid.Column="0" Grid.Row="0" Margin="0,5" HorizontalAlignment="Left"/> |
82 | 7e39367d | pkanavos | <TextBox Name="AccountName" Grid.Column="1" Grid.Row="0" Margin="5"/> |
83 | 7e39367d | pkanavos | <Label Content="API Key" Grid.Column="0" Grid.Row="1" Margin="0,5" HorizontalAlignment="Left"/> |
84 | 7e39367d | pkanavos | <TextBox Name="Token" Grid.Column="1" Grid.Row="1" Margin="5"/> |
85 | 7e39367d | pkanavos | <Button x:Name="TestManualAccount" Content="Validate Credentials" IsEnabled="{Binding HasCredentials}" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Center" cal:Message.Attach="TestAccount" Margin="5"/> |
86 | 7e39367d | pkanavos | <TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding ValidationMessage}" Margin="10" HorizontalAlignment="Center"/> |
87 | 7e39367d | pkanavos | </Grid> |
88 | 7e39367d | pkanavos | </my:BusyIndicator.Content> |
89 | 7e39367d | pkanavos | </my:BusyIndicator> |
90 | 7e39367d | pkanavos | </my:WizardPage> |
91 | 7e39367d | pkanavos | <my:WizardPage x:Name="AutoAccountPage" PageType="Interior" |
92 | 7e39367d | pkanavos | Title="Add an account automatically" |
93 | 7e39367d | pkanavos | 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." |
94 | 7e39367d | pkanavos | FinishButtonVisibility="Collapsed" |
95 | 7e39367d | pkanavos | CanSelectNextPage="{Binding HasValidCredentials,NotifyOnTargetUpdated=true}" |
96 | 7e39367d | pkanavos | TargetUpdated="OnTargetUpdated" |
97 | 7e39367d | pkanavos | |
98 | 7e39367d | pkanavos | > |
99 | 7e39367d | pkanavos | <my:BusyIndicator x:Name="AutoBusyIndicator" IsBusy="{Binding IsWorking}" DisplayAfter="0"> |
100 | 7e39367d | pkanavos | <my:BusyIndicator.BusyContent> |
101 | 7e39367d | pkanavos | <TextBlock TextWrapping="Wrap"> |
102 | 7e39367d | pkanavos | <TextBlock HorizontalAlignment="Center" Text="{Binding BusyTitle}"/> |
103 | 7e39367d | pkanavos | <TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="{Binding BusyDetail}"/> |
104 | 7e39367d | pkanavos | </TextBlock> |
105 | 7e39367d | pkanavos | </my:BusyIndicator.BusyContent> |
106 | 7e39367d | pkanavos | <my:BusyIndicator.Content> |
107 | 7e39367d | pkanavos | <StackPanel x:Name="AutoPanel" VerticalAlignment="Center" > |
108 | 7e39367d | pkanavos | <Button Margin="5" Name="RetrieveCredentials" Content="Retrieve Credentials" Width="150"/> |
109 | 7e39367d | pkanavos | <TextBlock Text="Credentials Retrieved Succesfully" Visibility="{Binding Converter={StaticResource BoolToVisible}, Path=HasCredentials}" Margin="10" HorizontalAlignment="Center"/> |
110 | 7e39367d | pkanavos | <Button x:Name="TestAutoAccount" Content="Validate Credentials" IsEnabled="{Binding HasCredentials}" HorizontalAlignment="Center" cal:Message.Attach="TestAccount" Margin="5"/> |
111 | 7e39367d | pkanavos | |
112 | 7e39367d | pkanavos | <TextBlock x:Name="ValidationMessage" Text="Credentials Validated" Visibility="{Binding Converter={StaticResource BoolToVisible}, Path=HasValidCredentials}" Margin="10" HorizontalAlignment="Center"/> |
113 | 7e39367d | pkanavos | </StackPanel> |
114 | 7e39367d | pkanavos | </my:BusyIndicator.Content> |
115 | 7e39367d | pkanavos | </my:BusyIndicator> |
116 | 7e39367d | pkanavos | </my:WizardPage> |
117 | 7e39367d | pkanavos | <my:WizardPage x:Name="AccountPathPage" PageType="Interior" |
118 | 7e39367d | pkanavos | Title="Select Account Path" |
119 | 7e39367d | pkanavos | Description="Please select the roor path for your account" |
120 | 7e39367d | pkanavos | NextPage="{Binding ElementName=LastPage}" |
121 | 7e39367d | pkanavos | FinishButtonVisibility="Collapsed" |
122 | 7e39367d | pkanavos | CanSelectNextPage="{Binding HasAccountPath}" |
123 | 7e39367d | pkanavos | > |
124 | 7e39367d | pkanavos | <StackPanel> |
125 | 7e39367d | pkanavos | <Label Content="Path:" Target="{Binding ElementName=AccountPath}"/> |
126 | 7e39367d | pkanavos | <Grid HorizontalAlignment="Stretch"> |
127 | 7e39367d | pkanavos | <Grid.RowDefinitions> |
128 | 7e39367d | pkanavos | <RowDefinition Height="Auto"/> |
129 | 7e39367d | pkanavos | <RowDefinition/> |
130 | 7e39367d | pkanavos | </Grid.RowDefinitions> |
131 | 7e39367d | pkanavos | <Grid.ColumnDefinitions> |
132 | 7e39367d | pkanavos | <ColumnDefinition /> |
133 | 7e39367d | pkanavos | <ColumnDefinition Width="Auto" /> |
134 | 7e39367d | pkanavos | </Grid.ColumnDefinitions> |
135 | 7e39367d | pkanavos | <TextBox x:Name="AccountPath" HorizontalAlignment="Stretch" Grid.Column="0" Grid.Row="0"> |
136 | 7e39367d | pkanavos | <TextBox.Text> |
137 | 7e39367d | pkanavos | <Binding Path="AccountPath" Mode="TwoWay"> |
138 | 7e39367d | pkanavos | <Binding.ValidationRules> |
139 | 7e39367d | pkanavos | <Preferences:DirectoryExistsRule/> |
140 | 7e39367d | pkanavos | </Binding.ValidationRules> |
141 | 7e39367d | pkanavos | </Binding> |
142 | 7e39367d | pkanavos | </TextBox.Text> |
143 | 7e39367d | pkanavos | <Validation.ErrorTemplate> |
144 | 7e39367d | pkanavos | <ControlTemplate> |
145 | 7e39367d | pkanavos | <StackPanel> |
146 | 7e39367d | pkanavos | <AdornedElementPlaceholder /> |
147 | 7e39367d | pkanavos | <TextBlock Foreground="Red" >Invalid Path</TextBlock> |
148 | 7e39367d | pkanavos | </StackPanel> |
149 | 7e39367d | pkanavos | </ControlTemplate> |
150 | 7e39367d | pkanavos | </Validation.ErrorTemplate> |
151 | 7e39367d | pkanavos | </TextBox> |
152 | 7e39367d | pkanavos | <Button x:Name="SelectAccount" Content="Select ..." HorizontalAlignment="Right" Grid.Column="1" Grid.Row="0"/> |
153 | 7e39367d | pkanavos | <CheckBox x:Name="ShouldCreateOkeanosFolder" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" > |
154 | 7e39367d | pkanavos | <CheckBox.Content> |
155 | 7e39367d | pkanavos | <TextBlock TextWrapping="Wrap"> |
156 | 7e39367d | pkanavos | Create an Okeanos folder below the selected folder |
157 | 7e39367d | pkanavos | <LineBreak/> |
158 | 7e39367d | pkanavos | Clear this setting to use the currently selected folder and synchronize its contents |
159 | 7e39367d | pkanavos | </TextBlock> |
160 | 7e39367d | pkanavos | </CheckBox.Content> |
161 | 7e39367d | pkanavos | </CheckBox> |
162 | 7e39367d | pkanavos | </Grid> |
163 | 7e39367d | pkanavos | </StackPanel> |
164 | 7e39367d | pkanavos | </my:WizardPage> |
165 | 7e39367d | pkanavos | <my:WizardPage x:Name="LastPage" PageType="Interior" |
166 | 7e39367d | pkanavos | Title="Finish" |
167 | 7e39367d | pkanavos | Description="Press finish to create the account" |
168 | 7e39367d | pkanavos | CanFinish="True" |
169 | 7e39367d | pkanavos | > |
170 | 7e39367d | pkanavos | <Grid> |
171 | 7e39367d | pkanavos | <Grid.RowDefinitions> |
172 | 7e39367d | pkanavos | <RowDefinition Height="Auto"/> |
173 | 7e39367d | pkanavos | <RowDefinition Height="Auto"/> |
174 | 7e39367d | pkanavos | <RowDefinition Height="Auto"/> |
175 | 7e39367d | pkanavos | <RowDefinition Height="Auto"/> |
176 | 7e39367d | pkanavos | <RowDefinition Height="Auto"/> |
177 | 7e39367d | pkanavos | <RowDefinition /> |
178 | 7e39367d | pkanavos | </Grid.RowDefinitions> |
179 | 7e39367d | pkanavos | <Grid.ColumnDefinitions> |
180 | 7e39367d | pkanavos | <ColumnDefinition Width="Auto"/> |
181 | 7e39367d | pkanavos | <ColumnDefinition /> |
182 | 7e39367d | pkanavos | </Grid.ColumnDefinitions> |
183 | 7e39367d | pkanavos | <TextBlock Text="Server:" Grid.Column="0" Grid.Row="0" Margin="5,2"/> |
184 | 7e39367d | pkanavos | <TextBlock Text="{Binding CurrentServer}" Grid.Column="1" Grid.Row="0" Margin="5,2"/> |
185 | 7e39367d | pkanavos | <TextBlock Text="Account Name:" Grid.Column="0" Grid.Row="1" Margin="5,2"/> |
186 | 7e39367d | pkanavos | <TextBlock Text="{Binding AccountName}" Grid.Column="1" Grid.Row="1" Margin="5,2"/> |
187 | 7e39367d | pkanavos | <TextBlock Text="Token:" Grid.Column="0" Grid.Row="2" Margin="5,2"/> |
188 | 7e39367d | pkanavos | <TextBlock Text="{Binding Token}" Grid.Column="1" Grid.Row="2" Margin="5,2"/> |
189 | 7e39367d | pkanavos | <TextBlock Text="Account Path:" Grid.Column="0" Grid.Row="3" Margin="5,2"/> |
190 | 7e39367d | pkanavos | <TextBlock Text="{Binding AccountPath}" Grid.Column="1" Grid.Row="3" Margin="5,2"/> |
191 | 7e39367d | pkanavos | |
192 | 7e39367d | pkanavos | <CheckBox x:Name="IsAccountActive" Content="Start using the account immediatelly" Grid.ColumnSpan="2" Grid.Row="5" Margin="5"/> |
193 | 7e39367d | pkanavos | </Grid> |
194 | 7e39367d | pkanavos | </my:WizardPage> |
195 | 7e39367d | pkanavos | </my:Wizard> |
196 | 7e39367d | pkanavos | |
197 | 52e8e7d9 | Panagiotis Kanavos | </Window> |