ItemsView¶
Namespace: WellFired.Guacamole
Implements: WellFired.Guacamole.Views.IItemsView
Inherits: WellFired.Guacamole.Views.ViewWithChildren
Description¶
This class takes care of the complexities of ItemsView, such as the ListView, here, we take care of ItemSources that may or may not be observable collections. we take the slightly complex notification system from .net and whittle it down into easier to understand methods. (I hope).
public-static-attrib¶
readonly BindableProperty | ItemSourceProperty |
readonly BindableProperty | ItemTemplateProperty |
readonly BindableProperty | HeaderTemplateProperty |
protected-attrib¶
CompositeCollection | CompositeCollection |
bool | IsItemSourceContiguous |
int | ItemSourceCount |
Properties¶
IList | ItemSource { get; set; } |
DataTemplate | ItemTemplate { get; set; } |
DataTemplate | HeaderTemplate { get; set; } |
protected-func¶
abstract void | ItemSourceChanged ( ) |
abstract void | ItemSourceCleared ( ) |
abstract void | ItemAdded ( object item, int index ) |
abstract void | ItemRemoved ( object item ) |
abstract void | ItemReplaced ( object oldItem, object newItem, int index ) |
object | GetItem ( int index ) |
int | GetIndexOf ( object item ) |
override void | OnBindablePropertyChanged ( object sender, PropertyChangedEventArgs e ) |
Breakdown¶
- readonly BindableProperty ItemSourceProperty
- readonly BindableProperty ItemTemplateProperty
- readonly BindableProperty HeaderTemplateProperty
- CompositeCollection CompositeCollection
bool IsItemSourceContiguous
Description
This bool will return true if the ItemSource is built from a collection that is sequential, false if it is grouped
int ItemSourceCount
Description
Returns the count of our ItemSource
- IList ItemSource { get; set; }
- DataTemplate ItemTemplate { get; set; }
- DataTemplate HeaderTemplate { get; set; }
abstract void ItemSourceChanged ( )
Description
This is called when the whole ItemSource is changed. I.E. ItemSource = new collection();
abstract void ItemSourceCleared ( )
Description
This is called when the ItemSource is cleared. I.E. ItemSource.Clear(); Note : This is only called if ItemSource is an ObservableCollection.
abstract void ItemAdded ( object item, int index )
Description
This is called when a new Item is added to the ItemSource. Note : This is only called if ItemSource is an ObservableCollection.
Parameters
item The new item index The new position this element was added at.
abstract void ItemRemoved ( object item )
Description
This is called when an item is removed from the ItemSource Note : This is only called if ItemSource is an ObservableCollection.
Parameters
item The removed Item
abstract void ItemReplaced ( object oldItem, object newItem, int index )
Description
This is called when an item is replaced within the ItemSource. Note : This is only called if ItemSource is an ObservableCollection.
Parameters
oldItem The item that used to exist newItem The new item index The index into the ItemSource that you will find this item
object GetItem ( int index )
Description
This method allows an inheritted view to retrieve an item from the ItemsView’s ItemSource
Parameters
index
int GetIndexOf ( object item )
Description
Returns the index of the specified item in the CompositeCollection
Parameters
item
- override void OnBindablePropertyChanged ( object sender, PropertyChangedEventArgs e )