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, IDynamicResourceHandler, INameScope, System.IDisposable, IResourcesProvider, ICollectionChangedNotifier
- Inheritance
-
objectCollectionView
- Implements
-
System.IDisposable
Constructors
View SourceCollectionView()
Base constructor.
Declaration
public CollectionView()
CollectionView(IEnumerable, ItemsLayouter, DataTemplate)
Base constructor with ItemsSource, ItemsLayouter and ItemTemplate
Declaration
public CollectionView(IEnumerable itemsSource, ItemsLayouter layouter, DataTemplate template)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable | itemsSource | item's data source |
ItemsLayouter | layouter | item's layout manager |
DataTemplate | template | item's view template with data bindings |
CollectionView(IEnumerable)
Base constructor with ItemsSource
Declaration
public CollectionView(IEnumerable itemsSource)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable | itemsSource | item's data source |
CollectionView(ControlStyle)
Creates a new instance of a CollectionView with style.
Declaration
public CollectionView(ControlStyle style)
Parameters
Type | Name | Description |
---|---|---|
ControlStyle | style | A style applied to the newly created CollectionView. |
Fields
View SourceFooterProperty
FooterProperty
Declaration
public static readonly BindableProperty FooterProperty
Field Value
Type | Description |
---|---|
BindableProperty |
GroupFooterTemplateProperty
GroupFooterTemplateProperty
Declaration
public static readonly BindableProperty GroupFooterTemplateProperty
Field Value
Type | Description |
---|---|
BindableProperty |
GroupHeaderTemplateProperty
GroupHeaderTemplateProperty
Declaration
public static readonly BindableProperty GroupHeaderTemplateProperty
Field Value
Type | Description |
---|---|
BindableProperty |
HeaderProperty
HeaderProperty
Declaration
public static readonly BindableProperty HeaderProperty
Field Value
Type | Description |
---|---|
BindableProperty |
IsGroupedProperty
IsGroupedProperty
Declaration
public static readonly BindableProperty IsGroupedProperty
Field Value
Type | Description |
---|---|
BindableProperty |
ItemsLayouterProperty
ItemsLayouterProperty
Declaration
public static readonly BindableProperty ItemsLayouterProperty
Field Value
Type | Description |
---|---|
BindableProperty |
ScrollingDirectionProperty
ScrollingDirectionProperty
Declaration
public static readonly BindableProperty ScrollingDirectionProperty
Field Value
Type | Description |
---|---|
BindableProperty |
SelectedItemProperty
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 |
SelectionChangedCommandParameterProperty
SelectionChangedCommandParameterProperty
Declaration
public static readonly BindableProperty SelectionChangedCommandParameterProperty
Field Value
Type | Description |
---|---|
BindableProperty |
SelectionChangedCommandProperty
SelectionChangedCommandProperty
Declaration
public static readonly BindableProperty SelectionChangedCommandProperty
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.
GroupFooterTemplate
DataTemplate of group footer. Group feature is not supported yet.
Declaration
public DataTemplate GroupFooterTemplate { get; set; }
Property Value
Type | Description |
---|---|
DataTemplate |
Remarks
Please note that, internal index will be increased by group footer.
GroupHeaderTemplate
DataTemplate of group header.
Declaration
public DataTemplate GroupHeaderTemplate { get; set; }
Property Value
Type | Description |
---|---|
DataTemplate |
Remarks
Please note that, internal index will be increased by group header. GroupHeaderTemplate is essential for groupable view.
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.
InternalItemsLayouter
Declaration
protected override ItemsLayouter InternalItemsLayouter { get; set; }
Property Value
Type | Description |
---|---|
ItemsLayouter |
Overrides
View SourceIsGrouped
Enable groupable view.
Declaration
public bool IsGrouped { get; set; }
Property Value
Type | Description |
---|---|
bool |
ItemsLayouter
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 SourceItemTemplate
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 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> |
SelectionChangedCommand
Command of selection changed.
Declaration
public ICommand SelectionChangedCommand { get; set; }
Property Value
Type | Description |
---|---|
ICommand |
SelectionChangedCommandParameter
Command parameter of selection changed.
Declaration
public object SelectionChangedCommandParameter { get; set; }
Property Value
Type | Description |
---|---|
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 SourceAccessibilityScrollToChild(View)
Scroll to specified item
Declaration
protected override bool AccessibilityScrollToChild(View child)
Parameters
Type | Name | Description |
---|---|---|
View | child |
Returns
Type | Description |
---|---|
bool |
Overrides
Remarks
Make sure that the item that is about to receive the accessibility highlight is visible.
AdjustTargetPositionOfScrollAnimation(float)
Adjust scrolling position by own scrolling rules. Override this function when developer wants to change destination of flicking.(e.g. always snap to center of item)
Declaration
protected override float AdjustTargetPositionOfScrollAnimation(float position)
Parameters
Type | Name | Description |
---|---|---|
float | position | Scroll position which is calculated by ScrollableBase |
Returns
Type | Description |
---|---|
float | Adjusted scroll destination |
Overrides
View SourceApplyStyle(ViewStyle)
Apply style to CollectionView
Declaration
public override void ApplyStyle(ViewStyle viewStyle)
Parameters
Type | Name | Description |
---|---|---|
ViewStyle | viewStyle | The style to apply. |
Overrides
View SourceClearCache()
Declaration
protected override void ClearCache()
Overrides
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 SourceNotifyDataSetChanged()
Declaration
public override void NotifyDataSetChanged()
Overrides
View SourceOnInitialize()
Initialize AT-SPI object.
Declaration
public override void OnInitialize()
Overrides
View SourceOnRelayout(Vector2, RelayoutContainer)
Declaration
public override void OnRelayout(Vector2 size, RelayoutContainer container)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | size | |
RelayoutContainer | container |
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 |
RealizeItem(int)
Declaration
protected override RecyclerViewItem RealizeItem(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index |
Returns
Type | Description |
---|---|
RecyclerViewItem |
Overrides
View SourceScrollTo(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 |
ScrollToIndex(int)
Scrolls to the item at the specified index.
Declaration
public void ScrollToIndex(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | Index of item. |
UnrealizeItem(RecyclerViewItem, bool)
Declaration
protected override void UnrealizeItem(RecyclerViewItem item, bool recycle = true)
Parameters
Type | Name | Description |
---|---|---|
RecyclerViewItem | item | |
bool | recycle |
Overrides
View SourceUpdateSelectedItems(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> |