mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-06-22 13:57:28 +02:00
Version 3.0.381
This commit is contained in:
parent
f963c0a219
commit
3a363acf3a
1525 changed files with 60589 additions and 125098 deletions
97
LastenradBayern/ShareeBike/View/Bike/BCBike.xaml
Normal file
97
LastenradBayern/ShareeBike/View/Bike/BCBike.xaml
Normal file
|
@ -0,0 +1,97 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ViewCell xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:conv="clr-namespace:ShareeBike.View;assembly=SharedBusinessLogic"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:resources="clr-namespace:ShareeBike.MultilingualResources;assembly=SharedBusinessLogic"
|
||||
mc:Ignorable="d"
|
||||
x:Class="ShareeBike.View.Bike.BCBike">
|
||||
<ContentView>
|
||||
<ContentView.Resources>
|
||||
<conv:StringNotNullOrEmptyToVisibleConverter x:Key="Label_Converter"/>
|
||||
</ContentView.Resources>
|
||||
<StackLayout
|
||||
Padding="10">
|
||||
<Label
|
||||
FontAttributes="Bold"
|
||||
Text="{Binding Name}"/>
|
||||
<Label
|
||||
Text="{Binding StateText}"
|
||||
TextColor="{Binding StateColor}"/>
|
||||
<Label
|
||||
Text="{Binding ErrorText}"
|
||||
IsVisible="{Binding ErrorText, Converter={StaticResource Label_Converter}}"
|
||||
TextColor="Red"/>
|
||||
<Button
|
||||
Text="{Binding ButtonText}"
|
||||
IsVisible="{Binding IsButtonVisible}"
|
||||
IsEnabled="{Binding IsIdle}"
|
||||
Command="{Binding OnButtonClicked}"/>
|
||||
<Grid
|
||||
IsVisible="{Binding TariffDescription.Header, Converter={StaticResource Label_Converter}}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label
|
||||
Text=
|
||||
"{Binding TariffDescription.Header}"
|
||||
Grid.ColumnSpan="3"
|
||||
FontAttributes="Bold"/>
|
||||
<Label
|
||||
Text="{x:Static resources:AppResources.MessageBikesManagementTariffDescriptionFreeTimePerSession}"
|
||||
IsVisible="{Binding TariffDescription.FreeTimePerSession, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="1"/>
|
||||
<Label
|
||||
Text="{Binding TariffDescription.FreeTimePerSession}"
|
||||
IsVisible="{Binding TariffDescription.FreeTimePerSession, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"/>
|
||||
<Label
|
||||
Text="{x:Static resources:AppResources.MessageBikesManagementTariffDescriptionFeeEuroPerHour}"
|
||||
IsVisible="{Binding TariffDescription.FeeEuroPerHour, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="2"/>
|
||||
<Label
|
||||
Text="{Binding TariffDescription.FeeEuroPerHour}"
|
||||
IsVisible="{Binding TariffDescription.FeeEuroPerHour, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"/>
|
||||
<Label
|
||||
Text="{x:Static resources:AppResources.MessageBikesManagementTariffDescriptionMaxFeeEuroPerDay}"
|
||||
IsVisible="{Binding TariffDescription.MaxFeeEuroPerDay, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="3"/>
|
||||
<Label
|
||||
Text="{Binding TariffDescription.MaxFeeEuroPerDay}"
|
||||
IsVisible="{Binding TariffDescription.MaxFeeEuroPerDay, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"/>
|
||||
<Label
|
||||
Text="{x:Static resources:AppResources.MessageBikesManagementTariffDescriptionAboEuroPerMonth}"
|
||||
IsVisible="{Binding TariffDescription.AboEuroPerMonth, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="4"/>
|
||||
<Label
|
||||
Text="{Binding TariffDescription.AboEuroPerMonth}"
|
||||
IsVisible="{Binding TariffDescription.AboEuroPerMonth, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="4"
|
||||
Grid.Column="1"/>
|
||||
<Label
|
||||
TextType="Html"
|
||||
Text="{Binding TariffDescription.OperatorAgb}"
|
||||
IsVisible="{Binding TariffDescription.OperatorAgb, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="5"
|
||||
Grid.ColumnSpan="3"/>
|
||||
</Grid>
|
||||
</StackLayout>
|
||||
</ContentView>
|
||||
</ViewCell>
|
20
LastenradBayern/ShareeBike/View/Bike/BCBike.xaml.cs
Normal file
20
LastenradBayern/ShareeBike/View/Bike/BCBike.xaml.cs
Normal file
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
namespace ShareeBike.View.Bike
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class BCBike : ViewCell
|
||||
{
|
||||
public BCBike()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
using Xamarin.Forms;
|
||||
|
||||
namespace ShareeBike.View.Bike
|
||||
{
|
||||
/// <summary>
|
||||
/// Selects different templates for different bike types (BordComputer bikes, iLockIt bikes).
|
||||
/// </summary>
|
||||
public class BikeViewCellTemplateSelector : DataTemplateSelector
|
||||
{
|
||||
DataTemplate bCBike;
|
||||
DataTemplate iLockIBike;
|
||||
|
||||
public BikeViewCellTemplateSelector()
|
||||
{
|
||||
bCBike = new DataTemplate(typeof(BCBike));
|
||||
iLockIBike = new DataTemplate(typeof(ILockItBike));
|
||||
}
|
||||
|
||||
protected override DataTemplate OnSelectTemplate(object item, BindableObject container)
|
||||
=> item is ShareeBike.ViewModel.Bikes.Bike.BluetoothLock.BikeViewModel ||
|
||||
item is ShareeBike.ViewModel.Bikes.Bike.CopriLock.BikeViewModel
|
||||
? iLockIBike
|
||||
: bCBike;
|
||||
}
|
||||
}
|
368
LastenradBayern/ShareeBike/View/Bike/ILockItBike.xaml
Normal file
368
LastenradBayern/ShareeBike/View/Bike/ILockItBike.xaml
Normal file
|
@ -0,0 +1,368 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ViewCell xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:conv="clr-namespace:ShareeBike.View;assembly=SharedBusinessLogic"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:resources="clr-namespace:ShareeBike.MultilingualResources;assembly=SharedBusinessLogic"
|
||||
xmlns:sharedGui="clr-namespace:SharedGui.View"
|
||||
mc:Ignorable="d"
|
||||
x:Class="ShareeBike.View.Bike.ILockItBike">
|
||||
<ContentView>
|
||||
|
||||
<ContentView.Resources>
|
||||
<conv:StringNotNullOrEmptyToVisibleConverter x:Key="Label_Converter"/>
|
||||
</ContentView.Resources>
|
||||
|
||||
<Frame
|
||||
Padding="10"
|
||||
Margin="0,10,0,0"
|
||||
HasShadow="False"
|
||||
HorizontalOptions="FillAndExpand"
|
||||
VerticalOptions="FillAndExpand"
|
||||
BackgroundColor="White">
|
||||
|
||||
<StackLayout
|
||||
Orientation="Vertical"
|
||||
Padding="10">
|
||||
|
||||
<!-- Icons, Name, ID, ... -->
|
||||
<Grid
|
||||
Padding="0"
|
||||
RowSpacing="15"
|
||||
ColumnSpacing="5"
|
||||
ColumnDefinitions="Auto,*,Auto"
|
||||
RowDefinitions="Auto,Auto,Auto">
|
||||
|
||||
<!-- Bike image -->
|
||||
<Image
|
||||
Grid.Column="0"
|
||||
Grid.Row="0"
|
||||
Grid.RowSpan="2"
|
||||
VerticalOptions="End"
|
||||
HorizontalOptions="Start"
|
||||
Source="{Binding DisplayedBikeImageSourceString}"
|
||||
HeightRequest="60"
|
||||
Aspect="AspectFit"/>
|
||||
|
||||
<!-- Battery level image -->
|
||||
<sharedGui:BarLevelView
|
||||
Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
Grid.RowSpan="2"
|
||||
VerticalOptions="End"
|
||||
HorizontalOptions="Start"
|
||||
Current="{Binding CurrentChargeBars}"
|
||||
Maximum="{Binding MaxChargeBars}"
|
||||
IsVisible="{Binding IsBatteryChargeVisible}"/>
|
||||
|
||||
<!-- Rental state and error -->
|
||||
<StackLayout
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Grid.Row="2"
|
||||
Spacing="0"
|
||||
Orientation="Vertical"
|
||||
HorizontalOptions="Start"
|
||||
VerticalOptions="End">
|
||||
|
||||
<!-- Rental state -->
|
||||
<Label
|
||||
Text="{Binding StateText}"
|
||||
FontSize="Small"
|
||||
LineBreakMode="WordWrap"
|
||||
TextColor="{Binding StateColor}"/>
|
||||
|
||||
<!-- Rental state error info -->
|
||||
<Label
|
||||
Text="{Binding ErrorText}"
|
||||
FontSize="Small"
|
||||
LineBreakMode="WordWrap"
|
||||
IsVisible="{Binding ErrorText, Converter={StaticResource Label_Converter}}"
|
||||
TextColor="Red"/>
|
||||
|
||||
</StackLayout>
|
||||
|
||||
<!-- Name and Id of the bike -->
|
||||
<StackLayout
|
||||
Grid.Column="1"
|
||||
Grid.ColumnSpan="2"
|
||||
Grid.Row="0"
|
||||
Orientation="Vertical"
|
||||
VerticalOptions="Start"
|
||||
HorizontalOptions="End"
|
||||
Spacing="0">
|
||||
|
||||
<!-- Name -->
|
||||
<Label
|
||||
FontAttributes="Bold"
|
||||
FontSize="Large"
|
||||
TextColor="Black"
|
||||
HorizontalTextAlignment="Right"
|
||||
Text="{Binding Name}"/>
|
||||
|
||||
<!-- Id -->
|
||||
<Label
|
||||
TextColor="DimGray"
|
||||
FontAttributes="Bold"
|
||||
HorizontalTextAlignment="Right"
|
||||
IsVisible="{Binding DisplayId, Converter={StaticResource Label_Converter}}"
|
||||
Text="{Binding DisplayId}"/>
|
||||
|
||||
</StackLayout>
|
||||
|
||||
<!-- AaAbRideType -->
|
||||
<StackLayout
|
||||
Grid.Column="2"
|
||||
Grid.Row="1"
|
||||
Grid.RowSpan="2"
|
||||
Spacing="0"
|
||||
HorizontalOptions="End"
|
||||
VerticalOptions="End"
|
||||
IsVisible="{Binding AaRideType}">
|
||||
<StackLayout
|
||||
Orientation="Horizontal"
|
||||
HorizontalOptions="End">
|
||||
<Image>
|
||||
<Image.Source>
|
||||
<FontImageSource
|
||||
Glyph="{StaticResource LocationPin}"
|
||||
Color="Black"
|
||||
FontFamily="FA-S"
|
||||
Size="20"/>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
<Image>
|
||||
<Image.Source>
|
||||
<FontImageSource
|
||||
Glyph="{StaticResource ArrowReturnBack}"
|
||||
Color="Black"
|
||||
FontFamily="FA-S"
|
||||
Size="20"/>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
<Button
|
||||
Command="{Binding ShowRideTypeInfoCommand}"
|
||||
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>
|
||||
<Label
|
||||
Text= "{Binding StationId}"
|
||||
FontSize="Small"
|
||||
HorizontalOptions="End"/>
|
||||
</StackLayout>
|
||||
|
||||
</Grid>
|
||||
|
||||
<!-- Buttons -->
|
||||
<Button
|
||||
Text="{Binding ButtonText}"
|
||||
IsVisible="{Binding IsButtonVisible}"
|
||||
Command="{Binding OnButtonClicked}"/>
|
||||
<Button
|
||||
Style="{StaticResource SecondaryButton}"
|
||||
Text="{Binding LockitButtonText}"
|
||||
IsVisible="{Binding IsLockitButtonVisible}"
|
||||
Command="{Binding OnLockitButtonClicked}"/>
|
||||
|
||||
<!-- Rental description (tariff name, options and rental info -->
|
||||
<Grid
|
||||
RowSpacing="0"
|
||||
IsVisible="{Binding TariffDescription.Header, Converter={StaticResource Label_Converter}}">
|
||||
<Grid.RowDefinitions>
|
||||
<!-- start tariff entries -->
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<!-- start rental info -->
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- start tariff entries (should be a CollectionView) -->
|
||||
<Label
|
||||
Text= "{x:Static resources:AppResources.MessageBikesManagementTariffDescriptionTariffHeader}"
|
||||
IsVisible="{Binding TariffDescription.Header, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="0"
|
||||
FontAttributes="Bold"/>
|
||||
<Label
|
||||
Text="{Binding TariffDescription.Header}"
|
||||
IsVisible="{Binding TariffDescription.Header, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
FontAttributes="Bold"/>
|
||||
|
||||
<!--Tracking-->
|
||||
<Grid
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Grid.ColumnSpan="2"
|
||||
ColumnDefinitions="*,Auto"
|
||||
IsVisible="{Binding TariffDescription.TrackingInfoText, Converter={StaticResource Label_Converter}}">
|
||||
<Label
|
||||
Text= "Tracking"
|
||||
Grid.Column="0"
|
||||
HorizontalOptions="End"/>
|
||||
<Button
|
||||
Command="{Binding ShowTrackingInfoCommand}"
|
||||
WidthRequest="24"
|
||||
HeightRequest="24"
|
||||
BackgroundColor="Transparent"
|
||||
BorderWidth="0"
|
||||
Grid.Column="1"
|
||||
Padding="0"
|
||||
Margin="0">
|
||||
<Button.ImageSource>
|
||||
<FontImageSource
|
||||
Glyph="{StaticResource InfoCircle}"
|
||||
Color="DimGray"
|
||||
FontFamily="FA-S"
|
||||
Size="20"/>
|
||||
</Button.ImageSource>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
<Label
|
||||
Text= "{Binding TariffDescription.TarifEntry1.Description}"
|
||||
IsVisible="{Binding TariffDescription.TarifEntry1.Description, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="1"/>
|
||||
<Label
|
||||
Text="{Binding TariffDescription.TarifEntry1.Value}"
|
||||
IsVisible="{Binding TariffDescription.TarifEntry1.Value, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Grid.ColumnSpan="2"/>
|
||||
<Label
|
||||
Text= "{Binding TariffDescription.TarifEntry2.Description}"
|
||||
IsVisible="{Binding TariffDescription.TarifEntry2.Description, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="2"/>
|
||||
<Label
|
||||
Text="{Binding TariffDescription.TarifEntry2.Value}"
|
||||
IsVisible="{Binding TariffDescription.TarifEntry2.Value, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Grid.ColumnSpan="2"/>
|
||||
<Label
|
||||
Text= "{Binding TariffDescription.TarifEntry3.Description}"
|
||||
IsVisible="{Binding TariffDescription.TarifEntry3.Description, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="3"/>
|
||||
<Label
|
||||
Text="{Binding TariffDescription.TarifEntry3.Value}"
|
||||
IsVisible="{Binding TariffDescription.TarifEntry3.Value, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Grid.ColumnSpan="2"/>
|
||||
<Label
|
||||
Text= "{Binding TariffDescription.TarifEntry4.Description}"
|
||||
IsVisible="{Binding TariffDescription.TarifEntry4.Description, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="4"/>
|
||||
<Label
|
||||
Text="{Binding TariffDescription.TarifEntry4.Value}"
|
||||
IsVisible="{Binding TariffDescription.TarifEntry4.Value, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="4"
|
||||
Grid.Column="1"
|
||||
Grid.ColumnSpan="2"/>
|
||||
<Label
|
||||
Text= "{Binding TariffDescription.TarifEntry5.Description}"
|
||||
IsVisible="{Binding TariffDescription.TarifEntry5.Description, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="5"/>
|
||||
<Label
|
||||
Text="{Binding TariffDescription.TarifEntry5.Value}"
|
||||
IsVisible="{Binding TariffDescription.TarifEntry5.Value, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="5"
|
||||
Grid.Column="1"
|
||||
Grid.ColumnSpan="2"/>
|
||||
<Label
|
||||
Text= "{Binding TariffDescription.TarifEntry6.Description}"
|
||||
IsVisible="{Binding TariffDescription.TarifEntry6.Description, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="6"/>
|
||||
<Label
|
||||
Text="{Binding TariffDescription.TarifEntry6.Value}"
|
||||
IsVisible="{Binding TariffDescription.TarifEntry6.Value, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="6"
|
||||
Grid.Column="1"
|
||||
Grid.ColumnSpan="2"/>
|
||||
<Label
|
||||
Text= "{Binding TariffDescription.TarifEntry7.Description}"
|
||||
IsVisible="{Binding TariffDescription.TarifEntry7.Description, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="7"/>
|
||||
<Label
|
||||
Text="{Binding TariffDescription.TarifEntry7.Value}"
|
||||
IsVisible="{Binding TariffDescription.TarifEntry7.Value, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="7"
|
||||
Grid.Column="1"
|
||||
Grid.ColumnSpan="2"/>
|
||||
<Label
|
||||
Text= "{Binding TariffDescription.TarifEntry8.Description}"
|
||||
IsVisible="{Binding TariffDescription.TarifEntry8.Description, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="8"/>
|
||||
<Label
|
||||
Text="{Binding TariffDescription.TarifEntry8.Value}"
|
||||
IsVisible="{Binding TariffDescription.TarifEntry8.Value, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="8"
|
||||
Grid.Column="1"
|
||||
Grid.ColumnSpan="2"/>
|
||||
<Label
|
||||
Text= "{Binding TariffDescription.TarifEntry9.Description}"
|
||||
IsVisible="{Binding TariffDescription.TarifEntry9.Description, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="9"/>
|
||||
<Label
|
||||
Text="{Binding TariffDescription.TarifEntry9.Value}"
|
||||
IsVisible="{Binding TariffDescription.TarifEntry9.Value, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="9"
|
||||
Grid.Column="1"
|
||||
Grid.ColumnSpan="2"/>
|
||||
<!-- start tariff entries (should be a CollectionView) -->
|
||||
<Label
|
||||
Text= "{Binding TariffDescription.InfoEntry1}"
|
||||
IsVisible="{Binding TariffDescription.InfoEntry1, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="10"
|
||||
Grid.ColumnSpan="3"/>
|
||||
<Label
|
||||
Text= "{Binding TariffDescription.InfoEntry2}"
|
||||
IsVisible="{Binding TariffDescription.InfoEntry2, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="11"
|
||||
Grid.ColumnSpan="3"/>
|
||||
<Label
|
||||
Text= "{Binding TariffDescription.InfoEntry3}"
|
||||
IsVisible="{Binding TariffDescription.InfoEntry3, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="12"
|
||||
Grid.ColumnSpan="3"/>
|
||||
<Label
|
||||
Text= "{Binding TariffDescription.InfoEntry4}"
|
||||
IsVisible="{Binding TariffDescription.InfoEntry4, Converter={StaticResource Label_Converter}}"
|
||||
Grid.Row="13"
|
||||
Grid.ColumnSpan="3"/>
|
||||
</Grid>
|
||||
</StackLayout>
|
||||
</Frame>
|
||||
</ContentView>
|
||||
</ViewCell>
|
44
LastenradBayern/ShareeBike/View/Bike/ILockItBike.xaml.cs
Normal file
44
LastenradBayern/ShareeBike/View/Bike/ILockItBike.xaml.cs
Normal file
|
@ -0,0 +1,44 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ShareeBike.Model.Bikes.BikeInfoNS.BluetoothLock;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
namespace ShareeBike.View.Bike
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class ILockItBike : ViewCell
|
||||
{
|
||||
public ILockItBike()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnBindingContextChanged()
|
||||
{
|
||||
base.OnBindingContextChanged();
|
||||
|
||||
if (Device.RuntimePlatform != Device.iOS)
|
||||
// Update of size is only required for iOS.
|
||||
return;
|
||||
|
||||
var viewModel = BindingContext as ShareeBike.ViewModel.Bikes.Bike.BluetoothLock.BikeViewModel;
|
||||
if (viewModel == null)
|
||||
return;
|
||||
|
||||
viewModel.PropertyChanged += (sender, e) =>
|
||||
{
|
||||
if (e.PropertyName == nameof(ShareeBike.ViewModel.Bikes.Bike.BC.RequestHandler.Base<IBikeInfoMutable>.IsButtonVisible)
|
||||
|| e.PropertyName == nameof(ShareeBike.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler.Base.IsLockitButtonVisible))
|
||||
{
|
||||
// Force update of view cell on iOS.
|
||||
// https://hausource.visualstudio.com/ShareeBike/_workitems/edit/132
|
||||
ForceUpdateSize();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue