|
8 | 8 | xmlns:mi_cupertino="clr-namespace:MauiIcons.Cupertino;assembly=MauiIcons.Cupertino" |
9 | 9 | xmlns:mi_material="clr-namespace:MauiIcons.Material;assembly=MauiIcons.Material" |
10 | 10 | xmlns:uc="clr-namespace:SecureFolderFS.Maui.UserControls" |
| 11 | + xmlns:uco="clr-namespace:SecureFolderFS.Maui.UserControls.Options" |
11 | 12 | xmlns:vc="clr-namespace:SecureFolderFS.Maui.ValueConverters" |
12 | 13 | Title="{Binding ViewModel.VaultViewModel.Title, Mode=OneWay}" |
13 | 14 | x:DataType="local:LoginPage"> |
|
18 | 19 |
|
19 | 20 | <Grid> |
20 | 21 | <ScrollView> |
21 | | - <VerticalStackLayout Padding="20,0" VerticalOptions="CenterAndExpand"> |
| 22 | + <Grid Padding="20"> |
| 23 | + <VerticalStackLayout VerticalOptions="Center"> |
| 24 | + <!-- Lock icon plate + heading --> |
| 25 | + <VerticalStackLayout Margin="0,0,0,48" Spacing="16"> |
| 26 | + <Border |
| 27 | + Background="{StaticResource ThemeSecondaryColorBrush}" |
| 28 | + HeightRequest="88" |
| 29 | + HorizontalOptions="Center" |
| 30 | + StrokeThickness="0" |
| 31 | + WidthRequest="88"> |
| 32 | + <Border.StrokeShape> |
| 33 | + <RoundRectangle CornerRadius="22" /> |
| 34 | + </Border.StrokeShape> |
| 35 | + <Grid> |
| 36 | + <mi:MauiIcon |
| 37 | + HorizontalOptions="Center" |
| 38 | + Icon="{mi_material:Material Lock}" |
| 39 | + IconColor="{AppThemeBinding Light={StaticResource PrimaryLightColor}, |
| 40 | + Dark={StaticResource PrimaryDarkColor}}" |
| 41 | + IconSize="44" |
| 42 | + OnPlatforms="Android" |
| 43 | + VerticalOptions="Center" /> |
| 44 | + <mi:MauiIcon |
| 45 | + HorizontalOptions="Center" |
| 46 | + Icon="{mi_cupertino:Cupertino Lock}" |
| 47 | + IconColor="{AppThemeBinding Light={StaticResource PrimaryLightColor}, |
| 48 | + Dark={StaticResource PrimaryDarkColor}}" |
| 49 | + IconSize="44" |
| 50 | + OnPlatforms="iOS" |
| 51 | + VerticalOptions="Center" /> |
| 52 | + </Grid> |
| 53 | + </Border> |
| 54 | + <Label |
| 55 | + FontAttributes="Bold" |
| 56 | + FontSize="22" |
| 57 | + HorizontalOptions="Center" |
| 58 | + HorizontalTextAlignment="Center" |
| 59 | + Text="{l:ResourceString Rid=VaultLocked}" /> |
| 60 | + </VerticalStackLayout> |
22 | 61 |
|
23 | | - <!-- Lock icon plate + heading --> |
24 | | - <VerticalStackLayout Margin="0,0,0,48" Spacing="16"> |
25 | | - <Border |
26 | | - Background="{StaticResource ThemeSecondaryColorBrush}" |
27 | | - HeightRequest="88" |
28 | | - HorizontalOptions="Center" |
29 | | - StrokeThickness="0" |
30 | | - WidthRequest="88"> |
31 | | - <Border.StrokeShape> |
32 | | - <RoundRectangle CornerRadius="22" /> |
33 | | - </Border.StrokeShape> |
34 | | - <Grid> |
35 | | - <mi:MauiIcon |
36 | | - HorizontalOptions="Center" |
37 | | - Icon="{mi_material:Material Lock}" |
38 | | - IconColor="{AppThemeBinding Light={StaticResource PrimaryLightColor}, |
39 | | - Dark={StaticResource PrimaryDarkColor}}" |
40 | | - IconSize="44" |
41 | | - OnPlatforms="Android" |
42 | | - VerticalOptions="Center" /> |
43 | | - <mi:MauiIcon |
44 | | - HorizontalOptions="Center" |
45 | | - Icon="{mi_cupertino:Cupertino Lock}" |
46 | | - IconColor="{AppThemeBinding Light={StaticResource PrimaryLightColor}, |
47 | | - Dark={StaticResource PrimaryDarkColor}}" |
48 | | - IconSize="44" |
49 | | - OnPlatforms="iOS" |
50 | | - VerticalOptions="Center" /> |
51 | | - </Grid> |
52 | | - </Border> |
53 | | - <Label |
54 | | - FontAttributes="Bold" |
55 | | - FontSize="22" |
56 | | - HorizontalOptions="Center" |
57 | | - HorizontalTextAlignment="Center" |
58 | | - Text="{l:ResourceString Rid=VaultLocked}" /> |
59 | | - </VerticalStackLayout> |
| 62 | + <!-- Remote connection progress indicator --> |
| 63 | + <ActivityIndicator |
| 64 | + Margin="0,0,0,16" |
| 65 | + IsRunning="{Binding ViewModel.IsProgressing, Mode=OneWay}" |
| 66 | + IsVisible="{Binding ViewModel.LoginViewModel, Mode=OneWay, Converter={StaticResource NullToBoolConverter}}" |
| 67 | + Opacity="{Binding ViewModel.IsProgressing, Mode=OneWay, Converter={StaticResource BoolOpacityConverter}}" /> |
60 | 68 |
|
61 | | - <!-- Remote connection progress indicator --> |
62 | | - <ActivityIndicator |
63 | | - Margin="0,0,0,16" |
64 | | - IsRunning="{Binding ViewModel.IsProgressing, Mode=OneWay}" |
65 | | - IsVisible="{Binding ViewModel.LoginViewModel, Mode=OneWay, Converter={StaticResource NullToBoolConverter}}" |
66 | | - Opacity="{Binding ViewModel.IsProgressing, Mode=OneWay, Converter={StaticResource BoolOpacityConverter}}" /> |
| 69 | + <!-- Login --> |
| 70 | + <uc:VaultLocatorControl |
| 71 | + CancelConnectionCommand="{Binding ViewModel.CancelConnectionCommand, Mode=OneWay}" |
| 72 | + ConnectCommand="{Binding ViewModel.ConnectToVaultCommand, Mode=OneWay}" |
| 73 | + IsConnected="{Binding ViewModel.LoginViewModel, Mode=OneWay, Converter={StaticResource NullToBoolConverter}}" |
| 74 | + IsRunning="{Binding ViewModel.ConnectToVaultCommand.IsRunning, Mode=OneWay}"> |
| 75 | + <uc:VaultLocatorControl.LoginView> |
| 76 | + <VerticalStackLayout IsVisible="{Binding ViewModel.IsProgressing, Mode=OneWay, Converter={StaticResource BoolInvertConverter}}" Spacing="8"> |
| 77 | + <uc:LoginControl CurrentViewModel="{Binding ViewModel.LoginViewModel.CurrentViewModel, Mode=OneWay}" ProvideContinuationButton="True" /> |
| 78 | + <Button |
| 79 | + Command="{Binding ViewModel.LoginViewModel.RecoverAccessCommand}" |
| 80 | + HorizontalOptions="{OnPlatform Android={LayoutOptions Alignment=Fill}, |
| 81 | + iOS={LayoutOptions Alignment=Center}}" |
| 82 | + IsVisible="{Binding ViewModel.LoginViewModel.CurrentViewModel, Mode=OneWay, Converter={StaticResource TypeNameBoolConverter}, ConverterParameter='MigrationViewModel,ErrorViewModel|invert'}" |
| 83 | + Style="{OnPlatform Android={StaticResource TransparentButtonStyle}, |
| 84 | + iOS={StaticResource NoBackgroundButtonStyle}}" |
| 85 | + Text="{l:ResourceString Rid=RecoverAccess}" /> |
| 86 | + </VerticalStackLayout> |
| 87 | + </uc:VaultLocatorControl.LoginView> |
| 88 | + </uc:VaultLocatorControl> |
| 89 | + </VerticalStackLayout> |
67 | 90 |
|
68 | | - <!-- Login --> |
69 | | - <uc:VaultLocatorControl |
70 | | - CancelConnectionCommand="{Binding ViewModel.CancelConnectionCommand, Mode=OneWay}" |
71 | | - ConnectCommand="{Binding ViewModel.ConnectToVaultCommand, Mode=OneWay}" |
72 | | - IsConnected="{Binding ViewModel.LoginViewModel, Mode=OneWay, Converter={StaticResource NullToBoolConverter}}" |
73 | | - IsRunning="{Binding ViewModel.ConnectToVaultCommand.IsRunning, Mode=OneWay}"> |
74 | | - <uc:VaultLocatorControl.LoginView> |
75 | | - <VerticalStackLayout IsVisible="{Binding ViewModel.IsProgressing, Mode=OneWay, Converter={StaticResource BoolInvertConverter}}" Spacing="8"> |
76 | | - <uc:LoginControl CurrentViewModel="{Binding ViewModel.LoginViewModel.CurrentViewModel, Mode=OneWay}" ProvideContinuationButton="True" /> |
77 | | - <Button |
78 | | - Command="{Binding ViewModel.LoginViewModel.RecoverAccessCommand}" |
79 | | - HorizontalOptions="{OnPlatform Android={LayoutOptions Alignment=Fill}, |
80 | | - iOS={LayoutOptions Alignment=Center}}" |
81 | | - IsVisible="{Binding ViewModel.LoginViewModel.CurrentViewModel, Mode=OneWay, Converter={StaticResource TypeNameBoolConverter}, ConverterParameter='MigrationViewModel,ErrorViewModel|invert'}" |
82 | | - Style="{OnPlatform Android={StaticResource TransparentButtonStyle}, |
83 | | - iOS={StaticResource NoBackgroundButtonStyle}}" |
84 | | - Text="{l:ResourceString Rid=RecoverAccess}" /> |
| 91 | + <uco:OptionsContainer VerticalOptions="End"> |
| 92 | + <uco:OptionsContainer.InnerContent> |
| 93 | + <VerticalStackLayout> |
| 94 | + <uco:OptionsControl Title="{l:ResourceString Rid=UnlockAsReadOnly}"> |
| 95 | + <uco:OptionsControl.Slot> |
| 96 | + <Switch IsToggled="{Binding ViewModel.IsReadOnly, Mode=TwoWay}" /> |
| 97 | + </uco:OptionsControl.Slot> |
| 98 | + </uco:OptionsControl> |
| 99 | + <uco:OptionsControl Title="{l:ResourceString Rid=SaveCredentials}" IsSeparatorVisible="False"> |
| 100 | + <uco:OptionsControl.Slot> |
| 101 | + <Switch IsToggled="{Binding ViewModel.ShouldSaveCredentials, Mode=TwoWay}" /> |
| 102 | + </uco:OptionsControl.Slot> |
| 103 | + </uco:OptionsControl> |
85 | 104 | </VerticalStackLayout> |
86 | | - </uc:VaultLocatorControl.LoginView> |
87 | | - </uc:VaultLocatorControl> |
88 | | - </VerticalStackLayout> |
| 105 | + </uco:OptionsContainer.InnerContent> |
| 106 | + </uco:OptionsContainer> |
| 107 | + </Grid> |
89 | 108 | </ScrollView> |
90 | 109 | </Grid> |
91 | 110 | </ContentPage> |
0 commit comments