using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using TINK.Model.Bikes.BikeInfoNS.BluetoothLock; using Xamarin.Forms; using Xamarin.Forms.Xaml; namespace TINK.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 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.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(); } }; } } }