|
13 | 13 | Height="500" Width="720" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" Loaded="LoginWindow_Loaded" Closing="MetroWindow_Closing"> |
14 | 14 | <mah:MetroWindow.Resources> |
15 | 15 | <conv:InverseBoolConverter x:Key="invBoolConv"/> |
| 16 | + <conv:BoolToVisibilityConverter x:Key="boolToVisConv"/> |
16 | 17 | </mah:MetroWindow.Resources> |
17 | 18 | <Grid> |
18 | 19 | <TabControl SelectedIndex="{Binding LoginStepIndex}" Background="{DynamicResource MahApps.Brushes.ThemeBackground2}"> |
|
172 | 173 | <TextBlock Text="Sign In" FontSize="30" HorizontalAlignment="Center"/> |
173 | 174 | <TextBlock Text="Specify Your Server URL" TextDecorations="Underline" Margin="0,15,0,5"/> |
174 | 175 | <StackPanel Orientation="Horizontal" Margin="0,0,0,0"> |
175 | | - <TextBox Text="{Binding LoginUser.ServerUrl}" mah:ControlsHelper.CornerRadius="5" BorderThickness="2" Width="400" LostFocus="ServerUrlInput_LostFocus"/> |
176 | | - <Path Data="{StaticResource IconCheck}" Fill="Green" Margin="2,1,-25,0" Visibility="Collapsed"/> |
| 176 | + <TextBox Text="{Binding LoginUser.ServerUrl}" mah:ControlsHelper.CornerRadius="5" BorderThickness="2" Width="400" TextChanged="ServerUrlInput_TextChanged"/> |
| 177 | + <Path Data="{StaticResource IconCheck}" Fill="Green" Margin="2,1,-25,0"> |
| 178 | + <Path.Style> |
| 179 | + <Style TargetType="Path"> |
| 180 | + <Setter Property="Visibility" Value="Collapsed"/> |
| 181 | + <Style.Triggers> |
| 182 | + <DataTrigger Binding="{Binding LoginServerInfo.IsAvailable}" Value="True"> |
| 183 | + <Setter Property="Visibility" Value="Visible"/> |
| 184 | + </DataTrigger> |
| 185 | + </Style.Triggers> |
| 186 | + </Style> |
| 187 | + </Path.Style> |
| 188 | + </Path> |
177 | 189 | </StackPanel> |
178 | | - <StackPanel IsEnabled="{Binding LoginUser.IsLoggedInWithSSO,Converter={StaticResource invBoolConv}}"> |
| 190 | + <StackPanel> |
| 191 | + <StackPanel.Style> |
| 192 | + <Style TargetType="StackPanel"> |
| 193 | + <Setter Property="IsEnabled" Value="False"/> |
| 194 | + <Style.Triggers> |
| 195 | + <DataTrigger Binding="{Binding LoginServerInfo.IsBasicAuthEnabled}" Value="True"> |
| 196 | + <Setter Property="IsEnabled" Value="{Binding LoginUser.IsLoggedInWithSSO,Converter={StaticResource invBoolConv}}"/> |
| 197 | + </DataTrigger> |
| 198 | + </Style.Triggers> |
| 199 | + </Style> |
| 200 | + </StackPanel.Style> |
179 | 201 | <TextBlock Text="Username or Email" TextDecorations="Underline" Margin="0,15,0,5"/> |
180 | 202 | <TextBox Text="{Binding LoginUser.Username}" mah:ControlsHelper.CornerRadius="5" BorderThickness="2"/> |
181 | 203 |
|
|
187 | 209 | <TextBlock Text="OR" HorizontalAlignment="Center" Margin="10,0,10,0"/> |
188 | 210 | <Rectangle Fill="{DynamicResource MahApps.Brushes.ThemeForeground}" Width="70" Height="2"/> |
189 | 211 | </StackPanel> |
190 | | - <CheckBox IsChecked="{Binding LoginUser.IsLoggedInWithSSO}" Content="Sign in using your Identity Provider" mah:CheckBoxHelper.CheckCornerRadius="5" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,15,0,0"/> |
| 212 | + <CheckBox IsChecked="{Binding LoginUser.IsLoggedInWithSSO}" Content="Sign in using your Identity Provider" mah:CheckBoxHelper.CheckCornerRadius="5" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,15,0,0"> |
| 213 | + <CheckBox.Style> |
| 214 | + <Style TargetType="CheckBox" BasedOn="{StaticResource MahApps.Styles.CheckBox}"> |
| 215 | + <Setter Property="IsEnabled" Value="False"/> |
| 216 | + <Style.Triggers> |
| 217 | + <DataTrigger Binding="{Binding LoginServerInfo.IsSSOEnabled}" Value="True"> |
| 218 | + <Setter Property="IsEnabled" Value="True"/> |
| 219 | + </DataTrigger> |
| 220 | + </Style.Triggers> |
| 221 | + </Style> |
| 222 | + </CheckBox.Style> |
| 223 | + </CheckBox> |
191 | 224 | </StackPanel> |
192 | 225 | <uc:IconButton Text="Save and Login" Height="30" Margin="0,0,10,10" Width="100" HorizontalAlignment="Right" VerticalAlignment="Bottom" Click="SaveAndLogin_Click"/> |
193 | 226 | <uc:IconButton Text="Back" Kind="Skeleton" BorderThickness="1" Height="30" Margin="10,0,0,10" Width="100" HorizontalAlignment="Left" VerticalAlignment="Bottom" Click="Back_Click" Tag="{x:Static local:LoginStep.SignInOrSignUp}"/> |
|
198 | 231 | <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="400" Height="430" Margin="0,8,0,0"> |
199 | 232 | <TextBlock Text="Sign Up" FontSize="30" HorizontalAlignment="Center"/> |
200 | 233 | <TextBlock Text="Specify Your Server URL" TextDecorations="Underline" Margin="0,15,0,5"/> |
201 | | - <TextBox Text="{Binding SignupUser.ServerUrl}" mah:ControlsHelper.CornerRadius="5" BorderThickness="2"/> |
202 | | - <StackPanel IsEnabled="{Binding SignupUser.IsLoggedInWithSSO,Converter={StaticResource invBoolConv}}"> |
| 234 | + <StackPanel Orientation="Horizontal"> |
| 235 | + <TextBox Text="{Binding SignupUser.ServerUrl}" mah:ControlsHelper.CornerRadius="5" Width="400" BorderThickness="2" TextChanged="ServerUrlInput_TextChanged"/> |
| 236 | + <Path Data="{StaticResource IconCheck}" Fill="Green" Margin="2,1,-25,0"> |
| 237 | + <Path.Style> |
| 238 | + <Style TargetType="Path"> |
| 239 | + <Setter Property="Visibility" Value="Collapsed"/> |
| 240 | + <Style.Triggers> |
| 241 | + <DataTrigger Binding="{Binding SignUpServerInfo.IsAvailable}" Value="True"> |
| 242 | + <Setter Property="Visibility" Value="Visible"/> |
| 243 | + </DataTrigger> |
| 244 | + </Style.Triggers> |
| 245 | + </Style> |
| 246 | + </Path.Style> |
| 247 | + </Path> |
| 248 | + </StackPanel> |
| 249 | + <StackPanel> |
| 250 | + <StackPanel.Style> |
| 251 | + <Style TargetType="StackPanel"> |
| 252 | + <Setter Property="IsEnabled" Value="False"/> |
| 253 | + <Style.Triggers> |
| 254 | + <DataTrigger Binding="{Binding SignUpServerInfo.IsBasicAuthEnabled}" Value="True"> |
| 255 | + <Setter Property="IsEnabled" Value="{Binding SignupUser.IsLoggedInWithSSO,Converter={StaticResource invBoolConv}}"/> |
| 256 | + </DataTrigger> |
| 257 | + </Style.Triggers> |
| 258 | + </Style> |
| 259 | + </StackPanel.Style> |
203 | 260 | <Grid> |
204 | 261 | <Grid.ColumnDefinitions> |
205 | 262 | <ColumnDefinition Width="Auto"/> |
|
211 | 268 | <TextBox Text="{Binding SignupUser.Username}" mah:ControlsHelper.CornerRadius="5" BorderThickness="2"/> |
212 | 269 | </StackPanel> |
213 | 270 | <StackPanel Width="195" Grid.Column="2"> |
214 | | - <TextBlock Text="Birth Date" TextDecorations="Underline" Margin="0,15,0,5"/> |
| 271 | + <StackPanel Orientation="Horizontal" Margin="0,15,0,5"> |
| 272 | + <TextBlock Text="Birth Date" TextDecorations="Underline"/> |
| 273 | + <TextBlock Text="(Mandatory)" Visibility="{Binding SignUpServerInfo.IsBirthDateMandatory,Converter={StaticResource boolToVisConv}}" VerticalAlignment="Center" Margin="5,0,0,0"/> |
| 274 | + </StackPanel> |
215 | 275 | <DatePicker SelectedDate="{Binding SignupUser.BirthDate}" mah:ControlsHelper.CornerRadius="5" BorderThickness="2"/> |
216 | 276 | </StackPanel> |
217 | 277 | </Grid> |
218 | | - <TextBlock Text="E-Mail" TextDecorations="Underline" Margin="0,15,0,5"/> |
| 278 | + <StackPanel Orientation="Horizontal" Margin="0,15,0,5"> |
| 279 | + <TextBlock Text="E-Mail" TextDecorations="Underline"/> |
| 280 | + <TextBlock Text="(Mandatory)" Visibility="{Binding SignUpServerInfo.IsEMailMandatory,Converter={StaticResource boolToVisConv}}" VerticalAlignment="Center" Margin="5,0,0,0"/> |
| 281 | + </StackPanel> |
219 | 282 | <TextBox Text="{Binding SignupUser.EMail}" mah:ControlsHelper.CornerRadius="5" BorderThickness="2"/> |
220 | 283 | <Grid> |
221 | 284 | <Grid.ColumnDefinitions> |
|
224 | 287 | <ColumnDefinition Width="Auto"/> |
225 | 288 | </Grid.ColumnDefinitions> |
226 | 289 | <StackPanel Width="195" Grid.Column="0"> |
227 | | - <TextBlock Text="First Name" TextDecorations="Underline" Margin="0,15,0,5"/> |
| 290 | + <StackPanel Orientation="Horizontal" Margin="0,15,0,5"> |
| 291 | + <TextBlock Text="First Name" TextDecorations="Underline"/> |
| 292 | + <TextBlock Text="(Mandatory)" Visibility="{Binding SignUpServerInfo.IsFirstNameMandatory,Converter={StaticResource boolToVisConv}}" VerticalAlignment="Center" Margin="5,0,0,0"/> |
| 293 | + </StackPanel> |
228 | 294 | <TextBox Text="{Binding SignupUser.FirstName}" mah:ControlsHelper.CornerRadius="5" BorderThickness="2"/> |
229 | 295 | </StackPanel> |
230 | 296 | <StackPanel Width="195" Grid.Column="2"> |
231 | | - <TextBlock Text="Last Name" TextDecorations="Underline" Margin="0,15,0,5"/> |
| 297 | + <StackPanel Orientation="Horizontal" Margin="0,15,0,5"> |
| 298 | + <TextBlock Text="Last Name" TextDecorations="Underline"/> |
| 299 | + <TextBlock Text="(Mandatory)" Visibility="{Binding SignUpServerInfo.IsLastNameMandatory,Converter={StaticResource boolToVisConv}}" VerticalAlignment="Center" Margin="5,0,0,0"/> |
| 300 | + </StackPanel> |
232 | 301 | <TextBox Text="{Binding SignupUser.LastName}" mah:ControlsHelper.CornerRadius="5" BorderThickness="2"/> |
233 | 302 | </StackPanel> |
234 | 303 | </Grid> |
|
253 | 322 | <Rectangle Fill="{DynamicResource MahApps.Brushes.ThemeForeground}" Width="70" Height="2"/> |
254 | 323 | </StackPanel> |
255 | 324 | </StackPanel> |
256 | | - <CheckBox IsChecked="{Binding SignupUser.IsLoggedInWithSSO}" Content="Sign up using your Identity Provider" mah:CheckBoxHelper.CheckCornerRadius="5" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,15,0,0"/> |
| 325 | + <CheckBox IsChecked="{Binding SignupUser.IsLoggedInWithSSO}" Content="Sign up using your Identity Provider" mah:CheckBoxHelper.CheckCornerRadius="5" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,15,0,0"> |
| 326 | + <CheckBox.Style> |
| 327 | + <Style TargetType="CheckBox" BasedOn="{StaticResource MahApps.Styles.CheckBox}"> |
| 328 | + <Setter Property="IsEnabled" Value="False"/> |
| 329 | + <Style.Triggers> |
| 330 | + <DataTrigger Binding="{Binding SignUpServerInfo.IsSSOEnabled}" Value="True"> |
| 331 | + <Setter Property="IsEnabled" Value="True"/> |
| 332 | + </DataTrigger> |
| 333 | + </Style.Triggers> |
| 334 | + </Style> |
| 335 | + </CheckBox.Style> |
| 336 | + </CheckBox> |
257 | 337 | </StackPanel> |
258 | 338 | <uc:IconButton Text="Save and Sign Up" Height="30" Margin="0,0,10,10" Width="100" HorizontalAlignment="Right" VerticalAlignment="Bottom" Click="SaveAndSignUp_Click"/> |
259 | 339 | <uc:IconButton Text="Back" Kind="Skeleton" BorderThickness="1" Height="30" Margin="10,0,0,10" Width="100" HorizontalAlignment="Left" VerticalAlignment="Bottom" Click="Back_Click" Tag="{x:Static local:LoginStep.SignInOrSignUp}"/> |
|
0 commit comments