Class ItemAdaptor
Base class for an Adapter Adapters provide a binding from an app-specific data set to views that are displayed within a CollectionView.
Inheritance
Implements
Inherited Members
Namespace: Tizen.UIExtensions.ElmSharp
Assembly: Tizen.UIExtensions.ElmSharp.dll
Syntax
public abstract class ItemAdaptor : INotifyCollectionChanged
Constructors
ItemAdaptor(IEnumerable)
Initializes a new instance of the ItemAdaptor class.
Declaration
protected ItemAdaptor(IEnumerable items)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.IEnumerable | items | Items soruce |
Properties
CollectionView
A CollectionView associated with current Adaptor
Declaration
public CollectionView CollectionView { get; set; }
Property Value
Type | Description |
---|---|
CollectionView |
Count
the number of items
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Item[Int32]
Declaration
public object this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Property Value
Type | Description |
---|---|
System.Object |
Methods
CreateNativeView(EvasObject)
Create a new view
Declaration
public abstract EvasObject CreateNativeView(EvasObject parent)
Parameters
Type | Name | Description |
---|---|---|
EvasObject | parent |
Returns
Type | Description |
---|---|
EvasObject | Created view |
CreateNativeView(Int32, EvasObject)
Create a new view
Declaration
public abstract EvasObject CreateNativeView(int index, EvasObject parent)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | To used item when create a view |
EvasObject | parent |
Returns
Type | Description |
---|---|
EvasObject | Created view |
GetFooterView(EvasObject)
Create a footer view, if footer is not existed, null will be returned
Declaration
public abstract EvasObject GetFooterView(EvasObject parent)
Parameters
Type | Name | Description |
---|---|---|
EvasObject | parent |
Returns
Type | Description |
---|---|
EvasObject | A created view |
GetHeaderView(EvasObject)
Create a header view, if header is not existed, null will be returned
Declaration
public abstract EvasObject GetHeaderView(EvasObject parent)
Parameters
Type | Name | Description |
---|---|---|
EvasObject | parent |
Returns
Type | Description |
---|---|
EvasObject | A created view |
GetItemIndex(Object)
Find item index by item
Declaration
public int GetItemIndex(object item)
Parameters
Type | Name | Description |
---|---|---|
System.Object | item | item to find |
Returns
Type | Description |
---|---|
System.Int32 | index of item |
GetViewCategory(Int32)
A view category that represent a item, it use to distinguish kinds of view
Declaration
public virtual object GetViewCategory(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | item index |
Returns
Type | Description |
---|---|
System.Object | An identifier of category |
MeasureFooter(Int32, Int32)
Measure Footer size
Declaration
public abstract ElmSharp.Size MeasureFooter(int widthConstraint, int heightConstraint)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | widthConstraint | A width size that could be reached as maximum |
System.Int32 | heightConstraint | A height size that could be reached as maximum |
Returns
Type | Description |
---|---|
ElmSharp.Size | Footer size |
MeasureHeader(Int32, Int32)
Measure header size
Declaration
public abstract ElmSharp.Size MeasureHeader(int widthConstraint, int heightConstraint)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | widthConstraint | A width size that could be reached as maximum |
System.Int32 | heightConstraint | A height size that could be reached as maximum |
Returns
Type | Description |
---|---|
ElmSharp.Size | Header size |
MeasureItem(Int32, Int32)
Measure item size
Declaration
public abstract ElmSharp.Size MeasureItem(int widthConstraint, int heightConstraint)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | widthConstraint | A width size that could be reached as maximum |
System.Int32 | heightConstraint | A height size that could be reached as maximum |
Returns
Type | Description |
---|---|
ElmSharp.Size | Item size |
MeasureItem(Int32, Int32, Int32)
Measure item size
Declaration
public abstract ElmSharp.Size MeasureItem(int index, int widthConstraint, int heightConstraint)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | A item index to measure |
System.Int32 | widthConstraint | A width size that could be reached as maximum |
System.Int32 | heightConstraint | A height size that could be reached as maximum |
Returns
Type | Description |
---|---|
ElmSharp.Size | Item size |
RemoveNativeView(EvasObject)
Remove view, a created view by Adaptor, should be removed by Adaptor
Declaration
public abstract void RemoveNativeView(EvasObject native)
Parameters
Type | Name | Description |
---|---|---|
EvasObject | native | A view to remove |
RequestItemSelected(Object)
Declaration
public void RequestItemSelected(object item)
Parameters
Type | Name | Description |
---|---|---|
System.Object | item |
SendItemSelected(Int32)
Handle Selected item
Declaration
public virtual void SendItemSelected(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
SetBinding(EvasObject, Int32)
Set data binding between view and item
Declaration
public abstract void SetBinding(EvasObject view, int index)
Parameters
Type | Name | Description |
---|---|---|
EvasObject | view | A target view |
System.Int32 | index | A target item |
SetItemsSource(IEnumerable)
Sets ItemsSource
Declaration
protected void SetItemsSource(IEnumerable items)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.IEnumerable | items | Items source |
UnBinding(EvasObject)
Unset data binding on view
Declaration
public abstract void UnBinding(EvasObject view)
Parameters
Type | Name | Description |
---|---|---|
EvasObject | view | A view to unbinding |
UpdateViewState(EvasObject, ViewHolderState)
Update View state
Declaration
public virtual void UpdateViewState(EvasObject view, ViewHolderState state)
Parameters
Type | Name | Description |
---|---|---|
EvasObject | view | A view to update |
ViewHolderState | state | State of view |
Events
ItemSelected
Declaration
public event EventHandler<SelectedItemChangedEventArgs> ItemSelected
Event Type
Type | Description |
---|---|
System.EventHandler<SelectedItemChangedEventArgs> |
Explicit Interface Implementations
INotifyCollectionChanged.CollectionChanged
Declaration
event NotifyCollectionChangedEventHandler INotifyCollectionChanged.CollectionChanged
Returns
Type | Description |
---|---|
System.Collections.Specialized.NotifyCollectionChangedEventHandler |