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.
public class GenList : Layout, IAccessibleObject
- Inheritance
- Derived
- Implements
Constructors
View SourceGenList()
Creates and initializes a new instance of the GenList class.
Declaration
protected GenList()
API Level: preview
View SourceGenList(EvasObject)
Creates and initializes a new instance of the GenList class.
Declaration
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 SourceBlockCount
Gets or sets the maximum number of items within an item block.
Declaration
public int BlockCount { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: preview
View SourceCount
Gets the count of items in a this genlist widget.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: preview
View SourceFirstItem
Gets the first item in the genlist.
Declaration
public GenListItem FirstItem { get; }
Property Value
Type | Description |
---|---|
GenListItem |
API Level: preview
View SourceFocusOnSelection
Gets or sets the focus upon the items selection mode.
Declaration
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 SourceHomogeneous
Gets or sets whether the homogeneous mode is enabled.
Declaration
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 SourceHorizontalScrollBarVisiblePolicy
Sets or gets the value of HorizontalScrollBarVisiblePolicy.
Declaration
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 SourceIsHighlight
Gets or sets whether the genlist items should be highlighted when an item is selected.
Declaration
public bool IsHighlight { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
API Level: preview
View SourceIsMultiSelection
Gets or sets whether to enable multi-selection in the genlist.
Declaration
public bool IsMultiSelection { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
API Level: preview
View SourceLastItem
Gets the last item in the genlist.
Declaration
public GenListItem LastItem { get; }
Property Value
Type | Description |
---|---|
GenListItem |
API Level: preview
View SourceListMode
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
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 SourceLongPressTimeout
Gets or sets the timeout in seconds for the longpress event.
Declaration
public double LongPressTimeout { get; set; }
Property Value
Type | Description |
---|---|
Double |
API Level: preview
View SourceReorderMode
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
public bool ReorderMode { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
API Level: preview
View SourceSelectedItem
Gets the selected item in a given GenList widget.
Declaration
public GenListItem SelectedItem { get; }
Property Value
Type | Description |
---|---|
GenListItem |
API Level: preview
View SourceSelectionMode
Gets or sets the genlist select mode by GenItemSelectionMode.
Declaration
public GenItemSelectionMode SelectionMode { get; set; }
Property Value
Type | Description |
---|---|
GenItemSelectionMode |
API Level: preview
View SourceVerticalScrollBarVisiblePolicy
Sets or gets the value of VerticalScrollBarVisiblePolicy.
Declaration
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 SourceAppend(GenItemClass, Object)
Appends a new item to the end of a given GenList widget.
Declaration
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. |
See Also
API Level: preview
View SourceAppend(GenItemClass, Object, GenListItemType)
Appends a new item with GenListItemType to the end of a given GenList widget.
Declaration
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 SourceAppend(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
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 SourceClear()
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
public void Clear()
See Also
API Level: preview
View SourceCreateHandle(EvasObject)
Creates a widget handle.
Declaration
protected override IntPtr CreateHandle(EvasObject parent)
Parameters
Type | Name | Description |
---|---|---|
EvasObject | parent | Parent EvasObject. |
Returns
Type | Description |
---|---|
IntPtr | Handle IntPtr. |
Overrides
API Level: preview
View SourceGetItemByIndex(Int32)
Gets the nth item in a given genlist widget, placed at position nth, in its internal items list.
Declaration
public GenListItem GetItemByIndex(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The number of the item to grab (0 being the first). |
Returns
Type | Description |
---|---|
GenListItem |
API Level: preview
View SourceGetItemByPosition(Int32, Int32, out Int32)
Gets the item that is at the X, Y canvas coordinates.
Declaration
public GenListItem GetItemByPosition(int x, int y, out int pos)
Parameters
Type | Name | Description |
---|---|---|
Int32 | x | The input X-coordinate. |
Int32 | y | The input Y-coordinate. |
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 SourceInsertAfter(GenItemClass, Object, GenListItem, GenListItemType, GenListItem)
Inserts an item with GenListItemType after another item under a parent in a GenList widget.
Declaration
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 SourceInsertBefore(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
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 SourceInsertBefore(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
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 SourceInsertBefore(GenItemClass, Object, GenListItem, GenListItemType, GenListItem)
Inserts an item with GenListItemType before another item under a parent in a GenList widget.
Declaration
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 SourceInsertSorted(GenItemClass, Object, Comparison<Object>, GenListItemType, GenListItem)
Inserts an item in a GenList widget using a user-defined sort function.
Declaration
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. |
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 SourceOnRealized()
The callback of the Unrealized event.
Declaration
protected override void OnRealized()
Overrides
API Level: preview
View SourcePrepend(GenItemClass, Object)
Prepends a new item to the beginning of a given GenList widget.
Declaration
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 SourcePrepend(GenItemClass, Object, GenListItemType)
Prepends a new item with GenListItemType to the beginning of a given genlist widget.
Declaration
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 SourcePrepend(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
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 SourceScrollTo(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
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 SourceUpdateRealizedItems()
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
public void UpdateRealizedItems()
See Also
API Level: preview
Events
View SourceChanged
Changed is raised when the genlist has changed.
Declaration
public event EventHandler Changed
Event Type
Type | Description |
---|---|
EventHandler |
API Level: preview
View SourceItemActivated
ItemActivated is raised when a new genlist item is double-clicked or pressed (enter|return|spacebar).
Declaration
public event EventHandler<GenListItemEventArgs> ItemActivated
Event Type
Type | Description |
---|---|
EventHandler<GenListItemEventArgs> |
API Level: preview
View SourceItemDoubleClicked
ItemDoubleClicked is raised when a new genlist item is double-clicked.
Declaration
public event EventHandler<GenListItemEventArgs> ItemDoubleClicked
Event Type
Type | Description |
---|---|
EventHandler<GenListItemEventArgs> |
API Level: preview
View SourceItemExpanded
ItemExpanded is raised when a new genlist item is indicated to expand.
Declaration
public event EventHandler<GenListItemEventArgs> ItemExpanded
Event Type
Type | Description |
---|---|
EventHandler<GenListItemEventArgs> |
API Level: preview
View SourceItemLongPressed
ItemLongPressed is raised when a genlist item is pressed for a certain amount of time. By default, it's 1 second.
Declaration
public event EventHandler<GenListItemEventArgs> ItemLongPressed
Event Type
Type | Description |
---|---|
EventHandler<GenListItemEventArgs> |
API Level: preview
View SourceItemMoved
ItemMoved is raised when a genlist item is moved in the reorder mode.
Declaration
public event EventHandler<GenListItemEventArgs> ItemMoved
Event Type
Type | Description |
---|---|
EventHandler<GenListItemEventArgs> |
API Level: preview
View SourceItemMovedAfter
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
public event EventHandler<GenListItemEventArgs> ItemMovedAfter
Event Type
Type | Description |
---|---|
EventHandler<GenListItemEventArgs> |
API Level: preview
View SourceItemMovedBefore
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
public event EventHandler<GenListItemEventArgs> ItemMovedBefore
Event Type
Type | Description |
---|---|
EventHandler<GenListItemEventArgs> |
API Level: preview
View SourceItemPressed
ItemPressed is raised when a new genlist item is pressed.
Declaration
public event EventHandler<GenListItemEventArgs> ItemPressed
Event Type
Type | Description |
---|---|
EventHandler<GenListItemEventArgs> |
API Level: preview
View SourceItemRealized
ItemRealized is raised when a new genlist item is created as a real object.
Declaration
public event EventHandler<GenListItemEventArgs> ItemRealized
Event Type
Type | Description |
---|---|
EventHandler<GenListItemEventArgs> |
API Level: preview
View SourceItemReleased
ItemReleased is raised when a new genlist item is released.
Declaration
public event EventHandler<GenListItemEventArgs> ItemReleased
Event Type
Type | Description |
---|---|
EventHandler<GenListItemEventArgs> |
API Level: preview
View SourceItemSelected
ItemSelected is raised when a new genlist item is selected.
Declaration
public event EventHandler<GenListItemEventArgs> ItemSelected
Event Type
Type | Description |
---|---|
EventHandler<GenListItemEventArgs> |
API Level: preview
View SourceItemUnrealized
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
public event EventHandler<GenListItemEventArgs> ItemUnrealized
Event Type
Type | Description |
---|---|
EventHandler<GenListItemEventArgs> |
API Level: preview
View SourceItemUnselected
ItemUnselected is raised when the genlist item is unselected.
Declaration
public event EventHandler<GenListItemEventArgs> ItemUnselected
Event Type
Type | Description |
---|---|
EventHandler<GenListItemEventArgs> |
API Level: preview
View SourceScrollAnimationStarted
ScrollAnimationStarted is raised when the scrolling animation has started.
Declaration
public event EventHandler ScrollAnimationStarted
Event Type
Type | Description |
---|---|
EventHandler |
API Level: preview
View SourceScrollAnimationStopped
ScrollAnimationStopped is raised when the scrolling animation has stopped.
Declaration
public event EventHandler ScrollAnimationStopped
Event Type
Type | Description |
---|---|
EventHandler |