const string _heightProperty = "Height";
readonly Dictionary<Cell, Dictionary<string, EvasObject>> _realizedNativeViews = new Dictionary<Cell, Dictionary<string, EvasObject>>();
+ Native.ListView.ItemContext _currentItem;
+
protected CellRenderer(string style)
{
Class = new GenItemClass(style)
OnUnrealizedCell(cell);
}
+ internal Native.ListView.ItemContext GetCurrentItem()
+ {
+ return _currentItem;
+ }
+
string GetText(object data, string part)
{
- var span = OnGetText((data as Native.ListView.ItemContext).Cell, part);
+ _currentItem = data as Native.ListView.ItemContext;
+ var span = OnGetText(_currentItem.Cell, part);
return span != null ? ToNative(span).GetMarkupText() : null;
}
EvasObject GetContent(object data, string part)
{
- var cell = (data as Native.ListView.ItemContext).Cell;
+ _currentItem = data as Native.ListView.ItemContext;
+ var cell = _currentItem.Cell;
EvasObject nativeView = OnGetContent(cell, part);
UpdateRealizedView(cell, part, nativeView);
return nativeView;
EvasObject ReusableContent(object data, string part, EvasObject old)
{
- var cell = (data as Native.ListView.ItemContext).Cell;
+ _currentItem = data as Native.ListView.ItemContext;
+ var cell = _currentItem.Cell;
EvasObject nativeView = OnReusableContent(cell, part, old);
UpdateRealizedView(cell, part, nativeView);
return nativeView;
void ItemDeleted(object data)
{
- var cell = (data as Native.ListView.ItemContext).Cell;
+ _currentItem = data as Native.ListView.ItemContext;
+ var cell = _currentItem.Cell;
_realizedNativeViews.Remove(cell);
OnDeleted(cell);
}