2022-09-20 13:51:55 +02:00
|
|
|
<?xml version="1.0" encoding="utf-8" ?>
|
2022-12-07 16:54:52 +01:00
|
|
|
<ContentPage
|
|
|
|
xmlns="http://xamarin.com/schemas/2014/forms"
|
2022-09-20 13:51:55 +02:00
|
|
|
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"
|
2022-09-20 13:51:55 +02:00
|
|
|
x:Class="TINK.View.MyBikes.MyBikesPage"
|
|
|
|
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
|
|
|
|
xmlns:sharedGui="clr-namespace:ShareeSharedGuiLib.View"
|
2023-08-31 12:20:06 +02:00
|
|
|
xmlns:rental_process="clr-namespace:TINK.ViewModel.Bikes;assembly=TINKLib"
|
|
|
|
xmlns:bikeRentalProcess="clr-namespace:ShareeSharedGuiLib.View.Bike.RentalProcess"
|
2022-09-22 20:58:30 +02:00
|
|
|
xmlns:local_bike="clr-namespace:TINK.View.Bike"
|
2023-03-08 13:18:54 +01:00
|
|
|
BackgroundColor="{DynamicResource background-color}"
|
|
|
|
Shell.FlyoutBehavior="{Binding FlyoutBehavior}"
|
2023-08-31 12:20:06 +02:00
|
|
|
Shell.NavBarIsVisible="{Binding IsIdle}">
|
2022-09-20 13:51:55 +02:00
|
|
|
|
|
|
|
<Shell.TitleView>
|
|
|
|
<Grid ColumnDefinitions="Auto, 1*">
|
2022-12-07 16:54:52 +01:00
|
|
|
<Image Style="{StaticResource Image-Navbar}"/>
|
2022-09-20 13:51:55 +02:00
|
|
|
<Label Style="{StaticResource Label-Navbar}"
|
|
|
|
Text="{x:Static resources:AppResources.MarkingMyBikes}"/>
|
|
|
|
</Grid>
|
|
|
|
</Shell.TitleView>
|
|
|
|
|
2023-03-08 13:18:54 +01:00
|
|
|
|
2022-09-20 13:51:55 +02:00
|
|
|
<ContentPage.Resources>
|
|
|
|
<ResourceDictionary>
|
|
|
|
<local_bike:BikeViewCellTemplateSelector x:Key="bikeTemplateSelector"/>
|
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-20 13:51:55 +02:00
|
|
|
</ResourceDictionary>
|
|
|
|
</ContentPage.Resources>
|
|
|
|
|
|
|
|
<ContentPage.Content>
|
|
|
|
|
2022-12-07 16:54:52 +01:00
|
|
|
<!--Grid for Bike(s) view and Running process in same row-->
|
|
|
|
<Grid>
|
2022-09-20 13:51:55 +02:00
|
|
|
|
2023-03-08 13:18:54 +01:00
|
|
|
<!--Bike(s) view-->
|
|
|
|
<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">
|
2023-02-22 14:03:35 +01:00
|
|
|
|
2023-03-08 13:18:54 +01:00
|
|
|
<StackLayout
|
|
|
|
Grid.Row="0"
|
|
|
|
Spacing="0"
|
|
|
|
Orientation="Vertical">
|
2023-02-22 14:03:35 +01:00
|
|
|
|
2023-03-08 13:18:54 +01:00
|
|
|
<!--No Network Connection-->
|
|
|
|
<sharedGui:NotConnectedToNetView/>
|
2022-09-20 13:51:55 +02:00
|
|
|
|
2023-07-04 11:06:38 +02:00
|
|
|
<!--Bike data-->
|
|
|
|
<Grid
|
2023-07-19 10:10:36 +02:00
|
|
|
RowDefinitions="Auto,1*"
|
2023-07-04 11:06:38 +02:00
|
|
|
RowSpacing="0">
|
2023-02-22 14:03:35 +01:00
|
|
|
|
2023-03-08 13:18:54 +01:00
|
|
|
<!--Hint for Outdated Data.-->
|
2023-07-04 11:06:38 +02:00
|
|
|
<sharedGui:HintForRefreshingPageView
|
|
|
|
Grid.Row="0"/>
|
|
|
|
|
|
|
|
<!--No Bikes-->
|
|
|
|
<Label
|
|
|
|
Grid.Row="1"
|
|
|
|
Margin="20"
|
|
|
|
IsVisible="{Binding IsNoBikesOccupiedVisible}"
|
|
|
|
Text="{Binding NoBikesOccupiedText}"/>
|
2023-02-22 14:03:35 +01:00
|
|
|
|
2023-07-04 11:06:38 +02:00
|
|
|
<!--Bike(s)-->
|
2023-03-08 13:18:54 +01:00
|
|
|
<ListView
|
2023-07-04 11:06:38 +02:00
|
|
|
Grid.Row="1"
|
|
|
|
x:Name="MyBikesListView"
|
|
|
|
SelectionMode="None"
|
|
|
|
SelectedItem="{Binding SelectedBike}"
|
|
|
|
IsEnabled="{Binding IsIdle}"
|
|
|
|
HasUnevenRows="True"
|
|
|
|
SeparatorVisibility="None"
|
|
|
|
ItemTemplate="{StaticResource bikeTemplateSelector}"
|
|
|
|
IsPullToRefreshEnabled="True"
|
|
|
|
RefreshCommand="{Binding RefreshCommand}"
|
|
|
|
IsRefreshing="{Binding IsRefreshing}"/>
|
|
|
|
</Grid>
|
2022-09-20 13:51:55 +02:00
|
|
|
|
2023-03-08 13:18:54 +01:00
|
|
|
</StackLayout>
|
|
|
|
|
|
|
|
<!--Info text-->
|
|
|
|
<Label
|
2022-12-07 16:54:52 +01:00
|
|
|
Grid.Row="1"
|
|
|
|
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
|
|
|
TextColor="DimGray"
|
|
|
|
Padding="5"
|
|
|
|
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>
|
|
|
|
|
|
|
|
</Grid>
|
2022-09-20 13:51:55 +02:00
|
|
|
|
2022-12-07 16:54:52 +01:00
|
|
|
<!--While process is running-->
|
|
|
|
<sharedGui:RunningProcessView
|
2022-09-20 13:51:55 +02:00
|
|
|
Grid.Row="0"
|
2023-01-18 14:22:51 +01:00
|
|
|
IsVisible="{Binding IsProcessWithRunningProcessView}"/>
|
2022-09-20 13:51:55 +02:00
|
|
|
|
2023-08-31 12:20:06 +02:00
|
|
|
<!--CloseLock View-->
|
|
|
|
<bikeRentalProcess:RentalProcessBookedOpenCloseLock
|
|
|
|
Grid.Row="0"/>
|
|
|
|
|
|
|
|
<!--EndRental View-->
|
|
|
|
<bikeRentalProcess:RentalProcessBookedClosedEndRental
|
|
|
|
Grid.Row="0"/>
|
|
|
|
|
2022-12-07 16:54:52 +01:00
|
|
|
</Grid>
|
2022-09-20 13:51:55 +02:00
|
|
|
|
|
|
|
</ContentPage.Content>
|
2023-03-08 13:18:54 +01:00
|
|
|
|
2022-09-20 13:51:55 +02:00
|
|
|
</ContentPage>
|