You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
4.8 KiB

1 year ago
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
  4. x:Class="GMCabsDriverAssistantSolution.Views.AdminPasswordPage"
  5. xmlns:vm="clr-namespace:GMCabsDriverAssistantSolution.ViewModels"
  6. xmlns:custom="clr-namespace:GMCabsDriverAssistantSolution.CustomControls"
  7. Shell.FlyoutBehavior="Disabled"
  8. Shell.NavBarIsVisible="False">
  9. <ContentPage.BindingContext>
  10. <vm:AdminPasswordViewModel />
  11. </ContentPage.BindingContext>
  12. <ContentPage.Resources>
  13. <ResourceDictionary>
  14. <Style x:Key="EntryStyle" TargetType="Entry">
  15. <Setter Property="TextColor" Value="#000"></Setter>
  16. <Setter Property="PlaceholderColor" Value="#9999"></Setter>
  17. <Setter Property="TranslationY" Value="1" />
  18. <Setter Property="MinimumHeightRequest" Value="36" />
  19. </Style>
  20. <Style x:Key="NoUnderlineEntryFrameStyle" TargetType="Frame">
  21. <Setter Property="Padding">
  22. <OnPlatform x:TypeArguments="Thickness">
  23. <On Platform="Android">16,4</On>
  24. <On Platform="iOS">16</On>
  25. </OnPlatform>
  26. </Setter>
  27. <Setter Property="CornerRadius" Value="12"></Setter>
  28. <Setter Property="Margin" Value="4,8,4,4"></Setter>
  29. <Setter Property="HasShadow" Value="True"></Setter>
  30. <Setter Property="MinimumHeightRequest" Value="50" />
  31. <Setter Property="BackgroundColor" Value="White" />
  32. </Style>
  33. </ResourceDictionary>
  34. </ContentPage.Resources>
  35. <ContentPage.Content>
  36. <StackLayout Orientation="Vertical"
  37. BackgroundColor="#DCDCDC">
  38. <StackLayout.Padding>
  39. <OnPlatform x:TypeArguments="Thickness">
  40. <On Platform="Android">20</On>
  41. <On Platform="iOS">20,60</On>
  42. </OnPlatform>
  43. </StackLayout.Padding>
  44. <Image Source="{OnIdiom Phone='gmlogo.png',Tablet='gmlogo_tablet.png'}"
  45. Margin="{OnIdiom Phone='48,30,48,12',Tablet='48,-40,48,-30'}"
  46. Scale="{OnIdiom Phone='1.2',Tablet='0.4'}"/>
  47. <Frame Style="{StaticResource NoUnderlineEntryFrameStyle}" Margin="{OnIdiom Tablet='270,0,270,0'}">
  48. <Grid MinimumHeightRequest="50">
  49. <Grid.ColumnDefinitions>
  50. <ColumnDefinition Width="*"/>
  51. </Grid.ColumnDefinitions>
  52. <custom:NoUnderlineEntry x:Name="Pin"
  53. Grid.Column="0"
  54. FontSize="20"
  55. Keyboard="Text"
  56. Text="{Binding AdminPassword}"
  57. Placeholder="Admin Password"
  58. IsPassword="True"
  59. Style="{StaticResource EntryStyle}"/>
  60. </Grid>
  61. </Frame>
  62. <Grid Margin="20,30,20,0"
  63. MinimumHeightRequest="40">
  64. <ActivityIndicator IsRunning="True" IsVisible="{Binding IsBusy}"/>
  65. <Button Text="Continue"
  66. FontSize="20"
  67. Command="{Binding ContinueCommand}"
  68. IsVisible="{Binding IsBusy}"
  69. MinimumHeightRequest="40"
  70. Margin="{OnIdiom Tablet='270,0,270,0'}">
  71. <Button.Triggers>
  72. <DataTrigger TargetType="Button" Binding="{Binding IsBusy}" Value="False">
  73. <Setter Property="IsVisible" Value="True" />
  74. </DataTrigger>
  75. <DataTrigger TargetType="Button" Binding="{Binding IsBusy}" Value="True">
  76. <Setter Property="IsVisible" Value="False" />
  77. </DataTrigger>
  78. </Button.Triggers>
  79. </Button>
  80. </Grid>
  81. <Label Text="{Binding ErrorMessage}"
  82. HorizontalTextAlignment="Center"
  83. FontSize="20"
  84. TextColor="Red"/>
  85. <Button Text="Back"
  86. FontSize="20"
  87. Margin="{OnIdiom Phone='20,16,20,0',Tablet='270,0,270,0'}"
  88. CharacterSpacing="5"
  89. Command="{Binding BackCommand}"
  90. VerticalOptions="EndAndExpand"/>
  91. </StackLayout>
  92. </ContentPage.Content>
  93. </ContentPage>