mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-06-22 13:57:28 +02:00
Version 3.0.338
This commit is contained in:
parent
573fe77e12
commit
0468955d49
751 changed files with 62747 additions and 60672 deletions
|
@ -9,12 +9,12 @@ using Xamarin.Forms.Xaml;
|
|||
|
||||
namespace TINK.View.Bike
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class BCBike : ViewCell
|
||||
{
|
||||
public BCBike()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class BCBike : ViewCell
|
||||
{
|
||||
public BCBike()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,24 +2,24 @@
|
|||
|
||||
namespace TINK.View.Bike
|
||||
{
|
||||
/// <summary>
|
||||
/// Selects different templates for different bike types (BordComputer bikes, iLockIt bikes).
|
||||
/// </summary>
|
||||
public class BikeViewCellTemplateSelector : DataTemplateSelector
|
||||
{
|
||||
DataTemplate bCBike;
|
||||
DataTemplate iLockIBike;
|
||||
/// <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));
|
||||
}
|
||||
public BikeViewCellTemplateSelector()
|
||||
{
|
||||
bCBike = new DataTemplate(typeof(BCBike));
|
||||
iLockIBike = new DataTemplate(typeof(ILockItBike));
|
||||
}
|
||||
|
||||
protected override DataTemplate OnSelectTemplate(object item, BindableObject container)
|
||||
=> item is TINK.ViewModel.Bikes.Bike.BluetoothLock.BikeViewModel ||
|
||||
item is TINK.ViewModel.Bikes.Bike.CopriLock.BikeViewModel
|
||||
? iLockIBike
|
||||
: bCBike;
|
||||
}
|
||||
protected override DataTemplate OnSelectTemplate(object item, BindableObject container)
|
||||
=> item is TINK.ViewModel.Bikes.Bike.BluetoothLock.BikeViewModel ||
|
||||
item is TINK.ViewModel.Bikes.Bike.CopriLock.BikeViewModel
|
||||
? iLockIBike
|
||||
: bCBike;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,36 +9,36 @@ using Xamarin.Forms.Xaml;
|
|||
|
||||
namespace TINK.View.Bike
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class ILockItBike : ViewCell
|
||||
{
|
||||
public ILockItBike()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class ILockItBike : ViewCell
|
||||
{
|
||||
public ILockItBike()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnBindingContextChanged()
|
||||
{
|
||||
base.OnBindingContextChanged();
|
||||
protected override void OnBindingContextChanged()
|
||||
{
|
||||
base.OnBindingContextChanged();
|
||||
|
||||
if (Device.RuntimePlatform != Device.iOS)
|
||||
// Update of size is only required for iOS.
|
||||
return;
|
||||
if (Device.RuntimePlatform != Device.iOS)
|
||||
// Update of size is only required for iOS.
|
||||
return;
|
||||
|
||||
var viewModel = BindingContext as TINK.ViewModel.Bikes.Bike.BluetoothLock.BikeViewModel;
|
||||
if (viewModel == null)
|
||||
return;
|
||||
var viewModel = BindingContext as TINK.ViewModel.Bikes.Bike.BluetoothLock.BikeViewModel;
|
||||
if (viewModel == null)
|
||||
return;
|
||||
|
||||
viewModel.PropertyChanged += (sender, e) =>
|
||||
{
|
||||
if (e.PropertyName == nameof(TINK.ViewModel.Bikes.Bike.BC.RequestHandler.Base<IBikeInfoMutable>.IsButtonVisible)
|
||||
|| e.PropertyName == nameof(TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler.Base.IsLockitButtonVisible))
|
||||
{
|
||||
// Force update of view cell on iOS.
|
||||
// https://hausource.visualstudio.com/TINK/_workitems/edit/132
|
||||
ForceUpdateSize();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
viewModel.PropertyChanged += (sender, e) =>
|
||||
{
|
||||
if (e.PropertyName == nameof(TINK.ViewModel.Bikes.Bike.BC.RequestHandler.Base<IBikeInfoMutable>.IsButtonVisible)
|
||||
|| e.PropertyName == nameof(TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler.Base.IsLockitButtonVisible))
|
||||
{
|
||||
// Force update of view cell on iOS.
|
||||
// https://hausource.visualstudio.com/TINK/_workitems/edit/132
|
||||
ForceUpdateSize();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue