mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-11-05 10:36:30 +01:00
27 lines
771 B
C#
27 lines
771 B
C#
|
using Xamarin.Forms;
|
|||
|
|
|||
|
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;
|
|||
|
|
|||
|
public BikeViewCellTemplateSelector()
|
|||
|
{
|
|||
|
bCBike = new DataTemplate(typeof(BCBike));
|
|||
|
iLockIBike = new DataTemplate(typeof(ILockItBike));
|
|||
|
}
|
|||
|
|
|||
|
protected override DataTemplate OnSelectTemplate(object item, BindableObject container)
|
|||
|
{
|
|||
|
return item is TINK.ViewModel.Bikes.Bike.BluetoothLock.BikeViewModel
|
|||
|
? iLockIBike
|
|||
|
: bCBike;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|