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#Copypublic class GenList : Layout, IAccessibleObject
- Inheritance
- Derived
- Implements
Constructors
Declaration
C#Copyprotected GenList()
API Level: preview
Declaration
C#Copypublic 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
Declaration
C#Copypublic int BlockCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
API Level: preview
Declaration
C#Copypublic int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
API Level: preview
Declaration
C#Copypublic GenListItem FirstItem { get; }
Property Value
Type | Description |
---|---|
GenListItem |
API Level: preview
Declaration
C#Copypublic 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
Declaration
C#Copypublic 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
HorizontalScrollBarVisiblePolicy
Sets or gets the value of HorizontalScrollBarVisiblePolicy.
Declaration
C#Copypublic 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
IsHighlight
Gets or sets whether the genlist items should be highlighted when an item is selected.
Declaration
C#Copypublic bool IsHighlight { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
API Level: preview
Declaration
C#Copypublic bool IsMultiSelection { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
API Level: preview
Declaration
C#Copypublic GenListItem LastItem { get; }
Property Value
Type | Description |
---|---|
GenListItem |
API Level: preview
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#Copypublic 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
Declaration
C#Copypublic double LongPressTimeout { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
API Level: preview
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#Copypublic bool ReorderMode { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
API Level: preview
Declaration
C#Copypublic GenListItem SelectedItem { get; }
Property Value
Type | Description |
---|---|
GenListItem |
API Level: preview
Declaration
C#Copypublic GenItemSelectionMode SelectionMode { get; set; }
Property Value
Type | Description |
---|---|
GenItemSelectionMode |
API Level: preview
VerticalScrollBarVisiblePolicy
Sets or gets the value of VerticalScrollBarVisiblePolicy.
Declaration
C#Copypublic 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
Declaration
C#Copypublic 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
Append(GenItemClass, Object, GenListItemType)
Appends a new item with GenListItemType to the end of a given GenList widget.
Declaration
C#Copypublic 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
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#Copypublic 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
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#Copypublic void Clear()
See Also
API Level: preview
Declaration
C#Copyprotected override IntPtr CreateHandle(EvasObject parent)
Parameters
Type | Name | Description |
---|---|---|
EvasObject | parent | Parent EvasObject. |
Returns
Type | Description |
---|---|
System.IntPtr | Handle IntPtr. |
Overrides
API Level: preview
GetItemByIndex(Int32)
Gets the nth item in a given genlist widget, placed at position nth, in its internal items list.
Declaration
C#Copypublic 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
GetItemByPosition(Int32, Int32, out Int32)
Gets the item that is at the X, Y canvas coordinates.
Declaration
C#Copypublic 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
InsertAfter(GenItemClass, Object, GenListItem, GenListItemType, GenListItem)
Inserts an item with GenListItemType after another item under a parent in a GenList widget.
Declaration
C#Copypublic 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
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#Copypublic 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
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#Copypublic 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
InsertBefore(GenItemClass, Object, GenListItem, GenListItemType, GenListItem)
Inserts an item with GenListItemType before another item under a parent in a GenList widget.
Declaration
C#Copypublic 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
InsertSorted(GenItemClass, Object, Comparison<Object>, GenListItemType, GenListItem)
Inserts an item in a GenList widget using a user-defined sort function.
Declaration
C#Copypublic 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
Declaration
C#Copyprotected override void OnRealized()
Overrides
API Level: preview
Prepend(GenItemClass, Object)
Prepends a new item to the beginning of a given GenList widget.
Declaration
C#Copypublic 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
Prepend(GenItemClass, Object, GenListItemType)
Prepends a new item with GenListItemType to the beginning of a given genlist widget.
Declaration
C#Copypublic 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
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#Copypublic 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
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#Copypublic 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
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#Copypublic void UpdateRealizedItems()
See Also
API Level: preview
Events
Declaration
C#Copypublic event EventHandler Changed
Event Type
Type | Description |
---|---|
EventHandler |
API Level: preview
ItemActivated
ItemActivated is raised when a new genlist item is double-clicked or pressed (enter|return|spacebar).
Declaration
C#Copypublic event EventHandler<GenListItemEventArgs> ItemActivated
Event Type
Type | Description |
---|---|
System.EventHandler<GenListItemEventArgs> |
API Level: preview
ItemDoubleClicked
ItemDoubleClicked is raised when a new genlist item is double-clicked.
Declaration
C#Copypublic event EventHandler<GenListItemEventArgs> ItemDoubleClicked
Event Type
Type | Description |
---|---|
System.EventHandler<GenListItemEventArgs> |
API Level: preview
Declaration
C#Copypublic event EventHandler<GenListItemEventArgs> ItemExpanded
Event Type
Type | Description |
---|---|
System.EventHandler<GenListItemEventArgs> |
API Level: preview
ItemLongPressed
ItemLongPressed is raised when a genlist item is pressed for a certain amount of time. By default, it's 1 second.
Declaration
C#Copypublic event EventHandler<GenListItemEventArgs> ItemLongPressed
Event Type
Type | Description |
---|---|
System.EventHandler<GenListItemEventArgs> |
API Level: preview
Declaration
C#Copypublic event EventHandler<GenListItemEventArgs> ItemMoved
Event Type
Type | Description |
---|---|
System.EventHandler<GenListItemEventArgs> |
API Level: preview
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#Copypublic event EventHandler<GenListItemEventArgs> ItemMovedAfter
Event Type
Type | Description |
---|---|
System.EventHandler<GenListItemEventArgs> |
API Level: preview
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#Copypublic event EventHandler<GenListItemEventArgs> ItemMovedBefore
Event Type
Type | Description |
---|---|
System.EventHandler<GenListItemEventArgs> |
API Level: preview
Declaration
C#Copypublic event EventHandler<GenListItemEventArgs> ItemPressed
Event Type
Type | Description |
---|---|
System.EventHandler<GenListItemEventArgs> |
API Level: preview
ItemRealized
ItemRealized is raised when a new genlist item is created as a real object.
Declaration
C#Copypublic event EventHandler<GenListItemEventArgs> ItemRealized
Event Type
Type | Description |
---|---|
System.EventHandler<GenListItemEventArgs> |
API Level: preview
Declaration
C#Copypublic event EventHandler<GenListItemEventArgs> ItemReleased
Event Type
Type | Description |
---|---|
System.EventHandler<GenListItemEventArgs> |
API Level: preview
Declaration
C#Copypublic event EventHandler<GenListItemEventArgs> ItemSelected
Event Type
Type | Description |
---|---|
System.EventHandler<GenListItemEventArgs> |
API Level: preview
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#Copypublic event EventHandler<GenListItemEventArgs> ItemUnrealized
Event Type
Type | Description |
---|---|
System.EventHandler<GenListItemEventArgs> |
API Level: preview
Declaration
C#Copypublic event EventHandler<GenListItemEventArgs> ItemUnselected
Event Type
Type | Description |
---|---|
System.EventHandler<GenListItemEventArgs> |
API Level: preview
ScrollAnimationStarted
ScrollAnimationStarted is raised when the scrolling animation has started.
Declaration
C#Copypublic event EventHandler ScrollAnimationStarted
Event Type
Type | Description |
---|---|
EventHandler |
API Level: preview
ScrollAnimationStopped
ScrollAnimationStopped is raised when the scrolling animation has stopped.
Declaration
C#Copypublic event EventHandler ScrollAnimationStopped
Event Type
Type | Description |
---|---|
EventHandler |