Class CollectionView
Definition
- Namespace:
- Tizen.NUI.Components
- Assembly:
- Tizen.NUI.Components.dll
Selectable RecyclerView that presenting a collection of items with variable layouters.
public class CollectionView : RecyclerView, INotifyPropertyChanged, IDisposable
- Inheritance
-
BindableObjectElementControlCollectionView
- Implements
Constructors
View SourceCollectionView()
Base constructor.
Declaration
public CollectionView()
CollectionView(IEnumerable)
Base constructor with ItemsSource
Declaration
public CollectionView(IEnumerable itemsSource)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable | itemsSource | item's data source |
Fields
View SourceSelectedItemProperty
Binding Property of selected item in single selection.
Declaration
public static readonly BindableProperty SelectedItemProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
SelectedItemsProperty
Binding Property of selected items list in multiple selection.
Declaration
public static readonly BindableProperty SelectedItemsProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
SelectionModeProperty
Binding Property of selected items list in multiple selection.
Declaration
public static readonly BindableProperty SelectionModeProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
Properties
View SourceFooter
Footer item placed in bottom-most position.
Declaration
public RecyclerViewItem Footer { get; set; }
Property Value
| Type | Description |
|---|---|
| RecyclerViewItem |
Remarks
Please note that, internal index will be increased by footer.
Header
Header item placed in top-most position.
Declaration
public RecyclerViewItem Header { get; set; }
Property Value
| Type | Description |
|---|---|
| RecyclerViewItem |
Remarks
Please note that, internal index will be increased by header.
ItemTemplate
DataTemplate for items. Create visual contents and binding properties. return object type is restricted RecyclerViewItem. DataTemplate
Declaration
public override DataTemplate ItemTemplate { get; set; }
Property Value
| Type | Description |
|---|---|
| DataTemplate |
Overrides
View SourceItemsLayouter
Items Layouter. Layouting items on the scroll ContentContainer. ItemsLayouter LinearLayouter GridLayouter
Declaration
public virtual ItemsLayouter ItemsLayouter { get; set; }
Property Value
| Type | Description |
|---|---|
| ItemsLayouter |
ItemsSource
Item's source data in IEnumerable.
Declaration
public override IEnumerable ItemsSource { get; set; }
Property Value
| Type | Description |
|---|---|
| IEnumerable |
Overrides
View SourceScrollingDirection
Scrolling direction to display items layout.
Declaration
public ScrollableBase.Direction ScrollingDirection { get; set; }
Property Value
| Type | Description |
|---|---|
| ScrollableBase.Direction |
SelectedItem
Selected item in single selection.
Declaration
public object SelectedItem { get; set; }
Property Value
| Type | Description |
|---|---|
| object |
SelectedItems
Selected items list in multiple selection.
Declaration
public IList<object> SelectedItems { get; }
Property Value
| Type | Description |
|---|---|
| IList<object> |
SelectionMode
Selection mode to handle items selection. See ItemSelectionMode for details.
Declaration
public ItemSelectionMode SelectionMode { get; set; }
Property Value
| Type | Description |
|---|---|
| ItemSelectionMode |
Methods
View SourceDispose(DisposeTypes)
Dispose ItemsView and all children on it.
Declaration
protected override void Dispose(DisposeTypes type)
Parameters
| Type | Name | Description |
|---|---|---|
| DisposeTypes | type | Dispose type. |
Overrides
View SourceOnRelayout(Vector2, RelayoutContainer)
Called after the size negotiation has been finished for this control.
The control is expected to assign this given size to itself or its children.
Should be overridden by derived classes if they need to layout views differently after certain operations like add or remove views, resize, or after changing specific properties.
As this function is called from inside the size negotiation algorithm, you cannot call RequestRelayout (the call would just be ignored).
Declaration
public override void OnRelayout(Vector2 size, RelayoutContainer container)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | size | The allocated size. |
| RelayoutContainer | container | The control should add views to this container that it is not able to allocate a size for. |
Overrides
View SourceOnScrolling(object, ScrollEventArgs)
OnScroll event callback. Requesting layout to the layouter with given scrollPosition.
Declaration
protected override void OnScrolling(object source, ScrollEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| object | source | Scroll source object |
| ScrollEventArgs | args | Scroll event argument |
Overrides
View SourceOnSelectionChanged(SelectionChangedEventArgs)
Internal selection callback.
Declaration
protected virtual void OnSelectionChanged(SelectionChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| SelectionChangedEventArgs | args |
ScrollTo(int, bool, ItemScrollTo)
Scroll to specific item's aligned position with or without animation.
Declaration
public virtual void ScrollTo(int index, bool animate = false, CollectionView.ItemScrollTo align = ItemScrollTo.Nearest)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | Target item index of dataset. |
| bool | animate | Boolean flag of animation. |
| CollectionView.ItemScrollTo | align | Align state of item. See details in CollectionView.ItemScrollTo. |
ScrollTo(float, bool)
Scroll to specific position with or without animation.
Declaration
public void ScrollTo(float position, bool animate)
Parameters
| Type | Name | Description |
|---|---|---|
| float | position | Destination. |
| bool | animate | Scroll with or without animation |
UpdateSelectedItems(IList<object>)
Update selected items list in multiple selection.
Declaration
public void UpdateSelectedItems(IList<object> newSelection)
Parameters
| Type | Name | Description |
|---|---|---|
| IList<object> | newSelection | updated selection list by user |
Events
View SourceSelectionChanged
Event of Selection changed. previous selection list and current selection will be provided.
Declaration
public event EventHandler<SelectionChangedEventArgs> SelectionChanged
Event Type
| Type | Description |
|---|---|
| EventHandler<SelectionChangedEventArgs> |