Class GenList

Definition

Namespace:
ElmSharp
Assembly:
ElmSharp.dll
API Level:
preview

It inherits Layout. The GenList is a widget that aims to have a more expansive list than the simple List in ElmSharp that could have more flexible items and allow many more entries while still being fast and low on memory usage. At the same time it was also made to be able to do tree structures. But the price to pay is more complex when it comes to usage. If all you want is a simple list with icons and a single text, use List widget.

C#
Copy
public class GenList : Layout, IAccessibleObject
Inheritance
Derived
Implements

Constructors

View Source

GenList()

Creates and initializes a new instance of the GenList class.

Declaration
C#
Copy
protected GenList()
API Level: preview
View Source

GenList(EvasObject)

Creates and initializes a new instance of the GenList class.

Declaration
C#
Copy
public GenList(EvasObject parent)
Parameters
Type Name Description
EvasObject parent

The parent is a given container, which will be attached by GenList as a child. It's EvasObject type.

API Level: preview

Properties

View Source

BlockCount

Gets or sets the maximum number of items within an item block.

Declaration
C#
Copy
public int BlockCount { get; set; }
Property Value
Type Description
System.Int32
API Level: preview
View Source

Count

Gets the count of items in a this genlist widget.

Declaration
C#
Copy
public int Count { get; }
Property Value
Type Description
System.Int32
API Level: preview
View Source

FirstItem

Gets the first item in the genlist.

Declaration
C#
Copy
public GenListItem FirstItem { get; }
Property Value
Type Description
GenListItem
API Level: preview
View Source

FocusOnSelection

Gets or sets the focus upon the items selection mode.

Declaration
C#
Copy
public bool FocusOnSelection { get; set; }
Property Value
Type Description
Boolean
Remarks

When enabled, every selection of an item inside GenList will automatically set focus to its first focusable widget from the left. This is true of course, if the selection was made by clicking an unfocusable area in an item or selecting it with a key movement. Clicking on a focusable widget inside an item will couse this particular item to get focus as usual.

API Level: preview
View Source

Homogeneous

Gets or sets whether the homogeneous mode is enabled.

Declaration
C#
Copy
public bool Homogeneous { get; set; }
Property Value
Type Description
Boolean
Remarks

If true, the genlist items will have the same height and width.

API Level: preview
View Source

HorizontalScrollBarVisiblePolicy

Sets or gets the value of HorizontalScrollBarVisiblePolicy.

Declaration
C#
Copy
public ScrollBarVisiblePolicy HorizontalScrollBarVisiblePolicy { get; set; }
Property Value
Type Description
ScrollBarVisiblePolicy
Remarks

ScrollBarVisiblePolicy.Auto means the horizontal scrollbar is made visible if it is needed, and otherwise kept hidden. ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off.

API Level: preview
View Source

IsHighlight

Gets or sets whether the genlist items should be highlighted when an item is selected.

Declaration
C#
Copy
public bool IsHighlight { get; set; }
Property Value
Type Description
Boolean
API Level: preview
View Source

IsMultiSelection

Gets or sets whether to enable multi-selection in the genlist.

Declaration
C#
Copy
public bool IsMultiSelection { get; set; }
Property Value
Type Description
Boolean
API Level: preview
View Source

LastItem

Gets the last item in the genlist.

Declaration
C#
Copy
public GenListItem LastItem { get; }
Property Value
Type Description
GenListItem
API Level: preview
View Source

ListMode

Gets or sets the horizontal stretching mode. This mode used for sizing items horizontally. The default value is Scroll, which means that if the items are too wide to fit, the scroller scrolls horizontally. If set to Compress, means that the item width is fixed (restricted to a minimum) to the list width when calculating its size in order to allow the height to be calculated based on it. If set to Limit, means that items are expanded to the viewport width and limited to that size. If set to Expand, means that genlist try to reserve space to all its items to be visible at a time.

Declaration
C#
Copy
public GenListMode ListMode { get; set; }
Property Value
Type Description
GenListMode
Remarks

Compress makes the genlist resize slower, as it recalculates every item height again whenever the list width changes. The homogeneous mode is so that all items in the genlist are of the same width/height. With Compress, the genlist items are initialized fast. However, there are no subobjects in the genlist, which can be on the flying resizable (such as TEXTBLOCK). If so, then some dynamic resizable objects in the genlist would not be diplayed properly.

API Level: preview
View Source

LongPressTimeout

Gets or sets the timeout in seconds for the longpress event.

Declaration
C#
Copy
public double LongPressTimeout { get; set; }
Property Value
Type Description
System.Double
API Level: preview
View Source

ReorderMode

Gets or sets the reorder mode. After turning on the reorder mode, longpress on a normal item triggers reordering of the item. You can move the item up and down. However, reordering does not work with group items.

Declaration
C#
Copy
public bool ReorderMode { get; set; }
Property Value
Type Description
Boolean
API Level: preview
View Source

SelectedItem

Gets the selected item in a given GenList widget.

Declaration
C#
Copy
public GenListItem SelectedItem { get; }
Property Value
Type Description
GenListItem
API Level: preview
View Source

SelectionMode

Gets or sets the genlist select mode by GenItemSelectionMode.

Declaration
C#
Copy
public GenItemSelectionMode SelectionMode { get; set; }
Property Value
Type Description
GenItemSelectionMode
API Level: preview
View Source

VerticalScrollBarVisiblePolicy

Sets or gets the value of VerticalScrollBarVisiblePolicy.

Declaration
C#
Copy
public ScrollBarVisiblePolicy VerticalScrollBarVisiblePolicy { get; set; }
Property Value
Type Description
ScrollBarVisiblePolicy
Remarks

ScrollBarVisiblePolicy.Auto means the vertical scrollbar is made visible if it is needed, and otherwise kept hidden. ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off.

API Level: preview

Methods

View Source

Append(GenItemClass, Object)

Appends a new item to the end of a given GenList widget.

Declaration
C#
Copy
public GenListItem Append(GenItemClass itemClass, object data)
Parameters
Type Name Description
GenItemClass itemClass

The itemClass defines how to display the data.

Object data

The item data.

Returns
Type Description
GenListItem

Return a newly added genlist item that contains the data and itemClass.

API Level: preview
View Source

Append(GenItemClass, Object, GenListItemType)

Appends a new item with GenListItemType to the end of a given GenList widget.

Declaration
C#
Copy
public GenListItem Append(GenItemClass itemClass, object data, GenListItemType type)
Parameters
Type Name Description
GenItemClass itemClass

The itemClass defines how to display the data.

Object data

The item data.

GenListItemType type

The genlist item type.

Returns
Type Description
GenListItem

Return a newly added genlist item that contains the data and itemClass.

API Level: preview
View Source

Append(GenItemClass, Object, GenListItemType, GenListItem)

Appends a new item with GenListItemType to the end of a given GenList widget or the end of the children list, if the parent is given.

Declaration
C#
Copy
public GenListItem Append(GenItemClass itemClass, object data, GenListItemType type, GenListItem parent)
Parameters
Type Name Description
GenItemClass itemClass

The itemClass defines how to display the data.

Object data

The item data.

GenListItemType type

The genlist item type.

GenListItem parent

The parent item, otherwise null if there is no parent item.

Returns
Type Description
GenListItem

Return a newly added genlist item that contains the data and itemClass.

API Level: preview
View Source

Clear()

Removes all the items from a given genlist widget. This removes (and deletes) all items in the object, making it empty. To delete just one item, use Delete().

Declaration
C#
Copy
public void Clear()
See Also
API Level: preview
View Source

CreateHandle(EvasObject)

Creates a widget handle.

Declaration
C#
Copy
protected override IntPtr CreateHandle(EvasObject parent)
Parameters
Type Name Description
EvasObject parent

Parent EvasObject.

Returns
Type Description
System.IntPtr

Handle IntPtr.

Overrides
API Level: preview
View Source

GetItemByIndex(Int32)

Gets the nth item in a given genlist widget, placed at position nth, in its internal items list.

Declaration
C#
Copy
public GenListItem GetItemByIndex(int index)
Parameters
Type Name Description
System.Int32 index

The number of the item to grab (0 being the first).

Returns
Type Description
GenListItem
API Level: preview
View Source

GetItemByPosition(Int32, Int32, out Int32)

Gets the item that is at the X, Y canvas coordinates.

Declaration
C#
Copy
public GenListItem GetItemByPosition(int x, int y, out int pos)
Parameters
Type Name Description
System.Int32 x

The input X-coordinate.

System.Int32 y

The input Y-coordinate.

System.Int32 pos

The position relative to the item returned here. -1, 0, or 1 depending on whether the coordinate is on the upper portion of that item (-1), in the middle section (0), or on the lower part (1).

Returns
Type Description
GenListItem

The item at the given coordinates.

API Level: preview
View Source

InsertAfter(GenItemClass, Object, GenListItem, GenListItemType, GenListItem)

Inserts an item with GenListItemType after another item under a parent in a GenList widget.

Declaration
C#
Copy
public GenListItem InsertAfter(GenItemClass itemClass, object data, GenListItem after, GenListItemType type, GenListItem parent)
Parameters
Type Name Description
GenItemClass itemClass

The itemClass defines how to display the data.

Object data

The item data.

GenListItem after

The item after which to place this new one.

GenListItemType type

The genlist item type.

GenListItem parent

The parent item, otherwise null if there is no parent item.

Returns
Type Description
GenListItem

Return a newly added genlist item that contains data and itemClass.

API Level: preview
View Source

InsertBefore(GenItemClass, Object, GenListItem)

Inserts an item before another item in a genlist widget. It is the same tree level or group as the item before which it is inserted.????

Declaration
C#
Copy
public GenListItem InsertBefore(GenItemClass itemClass, object data, GenListItem before)
Parameters
Type Name Description
GenItemClass itemClass

The itemClass defines how to display the data.

Object data

The item data.

GenListItem before

The item before which to place this new one.

Returns
Type Description
GenListItem

Return a newly added genlist item that contains data and itemClass.

API Level: preview
View Source

InsertBefore(GenItemClass, Object, GenListItem, GenListItemType)

Inserts an item with GenListItemType before another item in a GenList widget. It is the same tree level or group as the item before which it is inserted.

Declaration
C#
Copy
public GenListItem InsertBefore(GenItemClass itemClass, object data, GenListItem before, GenListItemType type)
Parameters
Type Name Description
GenItemClass itemClass

The itemClass defines how to display the data.

Object data

The item data.

GenListItem before

The item before which to place this new one.

GenListItemType type

The genlist item type.

Returns
Type Description
GenListItem

Return a newly added genlist item that contains data and itemClass.

API Level: preview
View Source

InsertBefore(GenItemClass, Object, GenListItem, GenListItemType, GenListItem)

Inserts an item with GenListItemType before another item under a parent in a GenList widget.

Declaration
C#
Copy
public GenListItem InsertBefore(GenItemClass itemClass, object data, GenListItem before, GenListItemType type, GenListItem parent)
Parameters
Type Name Description
GenItemClass itemClass

The itemClass defines how to display the data.

Object data

The item data.

GenListItem before

The item before which to place this new one.

GenListItemType type

The genlist item type.

GenListItem parent

The parent item, otherwise null if there is no parent item.

Returns
Type Description
GenListItem

Return a newly added genlist item that contains data and itemClass.

API Level: preview
View Source

InsertSorted(GenItemClass, Object, Comparison<Object>, GenListItemType, GenListItem)

Inserts an item in a GenList widget using a user-defined sort function.

Declaration
C#
Copy
public GenListItem InsertSorted(GenItemClass itemClass, object data, Comparison<object> comparison, GenListItemType type, GenListItem parent)
Parameters
Type Name Description
GenItemClass itemClass

The itemClass defines how to display the data.

Object data

The item data.

System.Comparison<Object> comparison

User-defined comparison function that defines the sort order based on the genlist item and its data.

GenListItemType type

The genlist item type.

GenListItem parent

The parent item, otherwise null if there is no parent item.

Returns
Type Description
GenListItem

Return a genlist item that contains the data and itemClass.

API Level: preview
View Source

OnRealized()

The callback of the Unrealized event.

Declaration
C#
Copy
protected override void OnRealized()
Overrides
API Level: preview
View Source

Prepend(GenItemClass, Object)

Prepends a new item to the beginning of a given GenList widget.

Declaration
C#
Copy
public GenListItem Prepend(GenItemClass itemClass, object data)
Parameters
Type Name Description
GenItemClass itemClass

The itemClass defines how to display the data.

Object data

The item data.

Returns
Type Description
GenListItem

Return a newly added genlist item that contains data and itemClass.

API Level: preview
View Source

Prepend(GenItemClass, Object, GenListItemType)

Prepends a new item with GenListItemType to the beginning of a given genlist widget.

Declaration
C#
Copy
public GenListItem Prepend(GenItemClass itemClass, object data, GenListItemType type)
Parameters
Type Name Description
GenItemClass itemClass

The itemClass defines how to display the data.

Object data

The item data.

GenListItemType type

The genlist item type.

Returns
Type Description
GenListItem

Return a newly added genlist item that contains data and itemClass.

API Level: preview
View Source

Prepend(GenItemClass, Object, GenListItemType, GenListItem)

Prepends a new item with GenListItemType to the beginning of a given GenList widget or the beginning of the children list, if the parent is given.

Declaration
C#
Copy
public GenListItem Prepend(GenItemClass itemClass, object data, GenListItemType type, GenListItem parent)
Parameters
Type Name Description
GenItemClass itemClass

The itemClass defines how to display the data.

Object data

The item data.

GenListItemType type

The genlist item type.

GenListItem parent

The parent item, otherwise null if there is no parent item.

Returns
Type Description
GenListItem

Return a newly added genlist item that contains the data and itemClass.

API Level: preview
View Source

ScrollTo(GenListItem, ScrollToPosition, Boolean)

Shows the given item with the position type in a genlist. When animated is true, the genlist will jump to the given item and display it (by animatedly scrolling), if it is not fully visible. This may use animation and take sometime. When animated is false, the genlist will jump to the given item and display it (by jumping to that position), if it is not fully visible.

Declaration
C#
Copy
public void ScrollTo(GenListItem item, ScrollToPosition position, bool animated)
Parameters
Type Name Description
GenListItem item

The item to display.

ScrollToPosition position

The position to show the given item to ScrollToPosition.

Boolean animated

The animated indicates how to display the item, by scrolling or by jumping.

API Level: preview
View Source

UpdateRealizedItems()

Updates the content of all the realized items. This updates all the realized items by calling all GenItemClass again to get the content, text, and states. Use this when the original item data has changed and the changes are desired to reflect. To update just one item, use Update().

Declaration
C#
Copy
public void UpdateRealizedItems()
See Also
API Level: preview

Events

View Source

Changed

Changed is raised when the genlist has changed.

Declaration
C#
Copy
public event EventHandler Changed
Event Type
Type Description
EventHandler
API Level: preview
View Source

ItemActivated

ItemActivated is raised when a new genlist item is double-clicked or pressed (enter|return|spacebar).

Declaration
C#
Copy
public event EventHandler<GenListItemEventArgs> ItemActivated
Event Type
Type Description
System.EventHandler<GenListItemEventArgs>
API Level: preview
View Source

ItemDoubleClicked

ItemDoubleClicked is raised when a new genlist item is double-clicked.

Declaration
C#
Copy
public event EventHandler<GenListItemEventArgs> ItemDoubleClicked
Event Type
Type Description
System.EventHandler<GenListItemEventArgs>
API Level: preview
View Source

ItemExpanded

ItemExpanded is raised when a new genlist item is indicated to expand.

Declaration
C#
Copy
public event EventHandler<GenListItemEventArgs> ItemExpanded
Event Type
Type Description
System.EventHandler<GenListItemEventArgs>
API Level: preview
View Source

ItemLongPressed

ItemLongPressed is raised when a genlist item is pressed for a certain amount of time. By default, it's 1 second.

Declaration
C#
Copy
public event EventHandler<GenListItemEventArgs> ItemLongPressed
Event Type
Type Description
System.EventHandler<GenListItemEventArgs>
API Level: preview
View Source

ItemMoved

ItemMoved is raised when a genlist item is moved in the reorder mode.

Declaration
C#
Copy
public event EventHandler<GenListItemEventArgs> ItemMoved
Event Type
Type Description
System.EventHandler<GenListItemEventArgs>
API Level: preview
View Source

ItemMovedAfter

ItemMovedAfter is raised when a genlist item is moved after another item in the reorder mode. To get the relative previous item, use Previous.

Declaration
C#
Copy
public event EventHandler<GenListItemEventArgs> ItemMovedAfter
Event Type
Type Description
System.EventHandler<GenListItemEventArgs>
API Level: preview
View Source

ItemMovedBefore

ItemMovedBefore is raised when a genlist item is moved before another item in the reorder mode. To get the relative next item, use Next.

Declaration
C#
Copy
public event EventHandler<GenListItemEventArgs> ItemMovedBefore
Event Type
Type Description
System.EventHandler<GenListItemEventArgs>
API Level: preview
View Source

ItemPressed

ItemPressed is raised when a new genlist item is pressed.

Declaration
C#
Copy
public event EventHandler<GenListItemEventArgs> ItemPressed
Event Type
Type Description
System.EventHandler<GenListItemEventArgs>
API Level: preview
View Source

ItemRealized

ItemRealized is raised when a new genlist item is created as a real object.

Declaration
C#
Copy
public event EventHandler<GenListItemEventArgs> ItemRealized
Event Type
Type Description
System.EventHandler<GenListItemEventArgs>
API Level: preview
View Source

ItemReleased

ItemReleased is raised when a new genlist item is released.

Declaration
C#
Copy
public event EventHandler<GenListItemEventArgs> ItemReleased
Event Type
Type Description
System.EventHandler<GenListItemEventArgs>
API Level: preview
View Source

ItemSelected

ItemSelected is raised when a new genlist item is selected.

Declaration
C#
Copy
public event EventHandler<GenListItemEventArgs> ItemSelected
Event Type
Type Description
System.EventHandler<GenListItemEventArgs>
API Level: preview
View Source

ItemUnrealized

ItemUnrealized is raised when a new genlist item is unrealized. After calling unrealize, the item's content objects are deleted, and the item object itself is deleted or is put into a floating cache.

Declaration
C#
Copy
public event EventHandler<GenListItemEventArgs> ItemUnrealized
Event Type
Type Description
System.EventHandler<GenListItemEventArgs>
API Level: preview
View Source

ItemUnselected

ItemUnselected is raised when the genlist item is unselected.

Declaration
C#
Copy
public event EventHandler<GenListItemEventArgs> ItemUnselected
Event Type
Type Description
System.EventHandler<GenListItemEventArgs>
API Level: preview
View Source

ScrollAnimationStarted

ScrollAnimationStarted is raised when the scrolling animation has started.

Declaration
C#
Copy
public event EventHandler ScrollAnimationStarted
Event Type
Type Description
EventHandler
API Level: preview
View Source

ScrollAnimationStopped

ScrollAnimationStopped is raised when the scrolling animation has stopped.

Declaration
C#
Copy
public event EventHandler ScrollAnimationStopped
Event Type
Type Description
EventHandler
API Level: preview

Implements

Extension Methods