I'm trying to implement a solution to increase the size of a ListView Cell when tapped using Xamarin Forms (and custom renderers if required).
I'm still pretty new to C#, and the idea of data binding is still a little unclear to me, however, it seems like that is the way to go to solve this problem (perhaps something along the lines of binding the Height / HeightRequest properties of the cell?).
My attempts thus far have been unsuccessful.
If anyone could give me a push in the right direction it would be much appreciated.
Thank you!
ViewCelldoes not exposeHeightas aBindablePropertyinXamarin.Forms 1.4.2xHowever if you create your own
BindablePropertyin yourModelyou can achieve changing the height still as shown below:-Model:-
XAML:-
XAML Code-Behind:-
If you don't set
.HasUnevenRowsyou will not be able to change the cell height.Custom ViewCell:-
Remember to call
ForceLayouton the root element of theViewCell'sViewproperty, so it can redraw correctly.This will give you a result something similar to the following (tested only on WindowsPhone at present):-
In order to do it on a
ViewCellbeing tapped, on the XAML Page add:-and then change the
modelfor the item to something like this:-