ListOfSubItems = null;
}
- public GenListItem Item;
+ public GenItem Item;
public Cell Cell;
public bool IsGroupItem;
public CellRenderer Renderer;
/// <param name="animated">If <c>true</c>, scrolling will be animated. Otherwise the cell will be moved instantaneously.</param>
public void ApplyScrollTo(Cell cell, ScrollToPosition position, bool animated)
{
- GenListItem item = GetItemContext(cell)?.Item;
+ GenListItem item = GetItemContext(cell)?.Item as GenListItem;
if (item != null)
this.ScrollTo(item, position.ToNative(), animated);
}
/// <param name="cell">Cell to be selected.</param>
public void ApplySelectedItem(Cell cell)
{
- GenListItem item = GetItemContext(cell)?.Item;
+ GenListItem item = GetItemContext(cell)?.Item as GenListItem;
if (item != null)
item.IsSelected = true;
}
{
_headerContext = new ItemContext();
_headerContext.Item = _itemContextList.Count > 0 ? InsertBefore(headerTemplate, header, FirstItem) : Append(headerTemplate, header);
- _headerContext.Item.SelectionMode = GenListSelectionMode.None;
+ (_headerContext.Item as GenListItem).SelectionMode = GenListSelectionMode.None;
_headerContext.Item.Deleted += HeaderDeletedHandler;
_itemContextList.Insert(0, _headerContext);
}
_footerElement = footer;
if (HasFooter())
{
- _footerContext.Item.UpdateItemClass(footerTemplate, footer);
+ (_footerContext.Item as GenListItem).UpdateItemClass(footerTemplate, footer);
}
else
{
_footerContext = new ItemContext();
_footerContext.Item = Append(footerTemplate, footer);
- _footerContext.Item.SelectionMode = GenListSelectionMode.None;
+ (_footerContext.Item as GenListItem).SelectionMode = GenListSelectionMode.None;
_footerContext.Item.Deleted += FooterDeletedHandler;
_itemContextList.Add(_footerContext);
}
if (beforeCell != null)
{
- GenListItem beforeItem = GetItemContext(beforeCell)?.Item;
+ GenListItem beforeItem = GetItemContext(beforeCell)?.Item as GenListItem;
groupItemContext.Item = InsertBefore(groupRenderer.Class, groupItemContext, beforeItem, GenListItemType.Group);
}
else
groupItemContext.Item = Append(groupRenderer.Class, groupItemContext, GenListItemType.Group);
}
- groupItemContext.Item.SelectionMode = GenListSelectionMode.None;
+ (groupItemContext.Item as GenListItem).SelectionMode = GenListSelectionMode.None;
groupItemContext.Item.IsEnabled = groupCell.IsEnabled;
groupItemContext.IsGroupItem = true;
{
var groupContext = GetItemContext(groupCell);
itemContext.ListOfSubItems = groupContext.ListOfSubItems;
- parentItem = groupContext.Item;
+ parentItem = groupContext.Item as GenListItem;
}
if (beforeCell != null)
{
- GenListItem beforeItem = GetItemContext(beforeCell)?.Item;
+ GenListItem beforeItem = GetItemContext(beforeCell)?.Item as GenListItem;
itemContext.Item = InsertBefore(renderer.Class, itemContext, beforeItem, GenListItemType.Normal, parentItem);
}
else
itemContext.Item = Append(renderer.Class, itemContext, GenListItemType.Normal, parentItem);
}
- itemContext.Item.SelectionMode = GenListSelectionMode.Always;
+ (itemContext.Item as GenListItem).SelectionMode = GenListSelectionMode.Always;
itemContext.Item.IsEnabled = cell.IsEnabled;
cell.PropertyChanged += OnCellPropertyChanged;