sharee.bike-App/Meinkonrad/TINK/View/SelectBike/SelectBikePage.xaml

210 lines
6.3 KiB
Text
Raw Normal View History

2022-09-16 11:19:46 +02:00
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
2023-08-31 12:20:06 +02:00
xmlns:xct="http://xamarin.com/schemas/2020/toolkit"
2023-11-21 15:26:57 +01:00
x:Class="TINK.View.SelectBike.SelectBikePage"
xmlns:conv="clr-namespace:TINK.View;assembly=TINKLib"
2022-09-16 11:19:46 +02:00
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
xmlns:local_bike="clr-namespace:TINK.View.Bike"
2023-02-22 14:03:35 +01:00
xmlns:sharedGui="clr-namespace:ShareeSharedGuiLib.View"
2023-11-21 15:26:57 +01:00
xmlns:rental_process="clr-namespace:TINK.ViewModel.Bikes;assembly=TINKLib"
xmlns:bikeRentalProcess="clr-namespace:ShareeSharedGuiLib.View.Bike.RentalProcess"
2023-08-31 12:20:06 +02:00
BackgroundColor="{DynamicResource background-color}"
Shell.NavBarIsVisible="{Binding IsIdle}">
2022-09-16 11:19:46 +02:00
<Shell.TitleView>
<Grid ColumnDefinitions="Auto, 1*">
<Label Style="{StaticResource Label-Navbar}"
2023-11-21 15:26:57 +01:00
Text="{x:Static resources:AppResources.MarkingSelectBike}"/>
2022-09-16 11:19:46 +02:00
</Grid>
</Shell.TitleView>
2023-11-21 15:26:57 +01:00
2022-09-16 11:19:46 +02:00
<ContentPage.Resources>
<ResourceDictionary>
<local_bike:BikeViewCellTemplateSelector x:Key="bikeTemplateSelector"/>
2023-06-06 12:00:24 +02:00
<conv:StringNotNullOrEmptyToVisibleConverter x:Key="Label_Converter"/>
2023-08-31 12:20:06 +02:00
<xct:MultiConverter x:Key="RentalProcessToVisibleConverter">
<xct:EnumToBoolConverter>
<xct:EnumToBoolConverter.TrueValues>
<rental_process:CurrentRentalProcess>CloseLock</rental_process:CurrentRentalProcess>
<rental_process:CurrentRentalProcess>EndRental</rental_process:CurrentRentalProcess>
</xct:EnumToBoolConverter.TrueValues>
</xct:EnumToBoolConverter>
<xct:InvertedBoolConverter />
</xct:MultiConverter>
2022-09-16 11:19:46 +02:00
</ResourceDictionary>
</ContentPage.Resources>
2022-12-07 16:54:52 +01:00
<ContentPage.Content>
2022-09-16 11:19:46 +02:00
2022-12-07 16:54:52 +01:00
<!--Grid for Bike(s) view and Running process in same row-->
2023-02-22 14:03:35 +01:00
<Grid>
2022-09-16 11:19:46 +02:00
2023-06-06 12:00:24 +02:00
<!-- Grid for Content -->
2023-02-22 14:03:35 +01:00
<Grid
2023-08-31 12:20:06 +02:00
IsVisible="{Binding RentalProcess.State, Converter={StaticResource RentalProcessToVisibleConverter}}"
Grid.Row="0"
2023-03-08 13:18:54 +01:00
RowSpacing="0"
2023-08-31 12:20:06 +02:00
RowDefinitions="1*,Auto">
2022-12-07 16:54:52 +01:00
2023-02-22 14:03:35 +01:00
<StackLayout
2023-06-06 12:00:24 +02:00
Grid.Row="0"
Spacing="0"
Orientation="Vertical">
<StackLayout
BackgroundColor="White"
2023-11-21 15:26:57 +01:00
Padding="20,5,20,0">
<!--Bike type-->
<StackLayout Orientation="Horizontal"
HorizontalOptions="Center"
IsVisible="{Binding ActiveFilteredBikeType, Converter={StaticResource Label_Converter}}"
Spacing="0">
<Label
TextColor="DimGray"
Text="{x:Static resources:AppResources.MarkingSelectBikeTypeOfBikeText}"/>
<Label
TextColor="{DynamicResource primary-back-title-color}"
FontAttributes="Bold"
Text="{Binding ActiveFilteredBikeType}"/>
<Button
Command="{Binding ShowFilterBikeTypeInfoCommand}"
WidthRequest="24"
HeightRequest="24"
BackgroundColor="Transparent"
BorderWidth="0"
Padding="0"
Margin="5,0,0,0">
<Button.ImageSource>
<FontImageSource
Glyph="{StaticResource InfoCircle}"
Color="DimGray"
FontFamily="FA-S"
Size="20"/>
</Button.ImageSource>
</Button>
</StackLayout>
2023-06-06 12:00:24 +02:00
<Grid
RowDefinitions="Auto,Auto"
ColumnDefinitions="*,Auto">
<!--Search bike-->
<Label
Grid.Column="0"
Grid.ColumnSpan="2"
Grid.Row="0"
2023-11-21 15:26:57 +01:00
Text="{x:Static resources:AppResources.MarkingSelectBikeLabel}"
2023-06-06 12:00:24 +02:00
Margin="0,5,0,-5">
2023-05-11 17:39:28 +02:00
</Label>
<Entry
2023-06-06 12:00:24 +02:00
Grid.Column="0"
Grid.Row="1"
2023-11-21 15:26:57 +01:00
x:Name="SelectBikeEntry"
Placeholder="{x:Static resources:AppResources.PlaceholderSelectBike}"
2023-05-11 17:39:28 +02:00
MaxLength="10"
CursorPosition="0"
2023-06-06 12:00:24 +02:00
Text="{Binding BikeIdUserInput, Mode=TwoWay}"/>
2023-05-11 17:39:28 +02:00
<Button
2023-06-06 12:00:24 +02:00
Grid.Column="1"
Grid.Row="1"
WidthRequest="100"
2023-11-21 15:26:57 +01:00
Text="{x:Static resources:AppResources.MarkingSelectBikeButton}"
2023-09-22 11:38:42 +02:00
Command="{Binding OnSelectBikeRequest}">
<Button.Triggers>
<DataTrigger TargetType="Button" Binding="{Binding IsSelectBikeEnabled}" Value="False">
<Setter Property="BorderColor" Value="DimGray" />
<Setter Property="BackgroundColor" Value="DimGray" />
<Setter Property="TextColor" Value="LightGray" />
</DataTrigger>
</Button.Triggers>
</Button>
2022-09-16 11:19:46 +02:00
2023-06-06 12:00:24 +02:00
</Grid>
2022-09-16 11:19:46 +02:00
2023-06-06 12:00:24 +02:00
<!--Line-->
<BoxView
HeightRequest="1"
WidthRequest="400"
HorizontalOptions="Center"
Color="{DynamicResource primary-back-title-color}"/>
</StackLayout>
<!--No Network Connection-->
<sharedGui:NotConnectedToNetView/>
2023-02-22 14:03:35 +01:00
2023-07-04 11:06:38 +02:00
<!--Bike data-->
<Grid
RowDefinitions="Auto,Auto"
RowSpacing="0">
2022-09-16 11:19:46 +02:00
2023-02-22 14:03:35 +01:00
<!--Hint for Outdated Data.-->
2023-07-04 11:06:38 +02:00
<sharedGui:HintForRefreshingPageView
Grid.Row="0"/>
2023-02-22 14:03:35 +01:00
2023-07-04 11:06:38 +02:00
<!--Bike-->
<ListView
Grid.Row="1"
2023-11-21 15:26:57 +01:00
x:Name="SelectBikeListView"
2023-09-22 11:38:42 +02:00
BackgroundColor="{DynamicResource background-color}"
2023-06-06 12:00:24 +02:00
SelectionMode="None"
SelectedItem="{Binding SelectedBike}"
IsEnabled="{Binding IsIdle}"
HasUnevenRows="True"
SeparatorVisibility="None"
ItemTemplate="{StaticResource bikeTemplateSelector}"
IsPullToRefreshEnabled="True"
RefreshCommand="{Binding RefreshCommand}"
IsRefreshing="{Binding IsRefreshing}"/>
2023-07-04 11:06:38 +02:00
</Grid>
2023-06-06 12:00:24 +02:00
2023-02-22 14:03:35 +01:00
</StackLayout>
<!--Info text-->
2023-03-08 13:18:54 +01:00
<Label
Grid.Row="1"
2022-12-07 16:54:52 +01:00
Text="{Binding StatusInfoText}"
2023-01-18 14:22:51 +01:00
IsVisible="{Binding Path=IsProcessWithRunningProcessView, Converter={StaticResource InvertedBoolConverter}}"
2022-12-07 16:54:52 +01:00
FontSize="Small"
2023-03-08 13:18:54 +01:00
Padding="5"
TextColor="DimGray"
HorizontalOptions="CenterAndExpand">
<Label.Triggers>
<DataTrigger
TargetType="Label"
Binding="{Binding Path=StatusInfoText.Length}" Value="0">
<Setter Property="HeightRequest" Value="0" />
</DataTrigger>
<DataTrigger
TargetType="Label"
Binding="{Binding Path=StatusInfoText}" Value="Offline.">
<Setter Property="HeightRequest" Value="0" />
</DataTrigger>
</Label.Triggers>
</Label>
2022-12-07 16:54:52 +01:00
2023-02-22 14:03:35 +01:00
</Grid>
2022-09-16 11:19:46 +02:00
<!--While process is running-->
<sharedGui:RunningProcessView
Grid.Row="0"
2023-01-18 14:22:51 +01:00
IsVisible="{Binding IsProcessWithRunningProcessView}"/>
2022-09-16 11:19:46 +02:00
2023-08-31 12:20:06 +02:00
<!--CloseLock View-->
<bikeRentalProcess:RentalProcessBookedOpenCloseLock
Grid.Row="0"/>
<!--EndRental View-->
<bikeRentalProcess:RentalProcessBookedClosedEndRental
Grid.Row="0"/>
</Grid>
2023-11-21 15:26:57 +01:00
2022-09-16 11:19:46 +02:00
</ContentPage.Content>
2023-11-21 15:26:57 +01:00
2022-09-16 11:19:46 +02:00
</ContentPage>