Class ListViewItemComparer
An abstract class for creating an System.Collections.IComparer to compare the items of a System.Windows.Controls.ListView.
Inheritance
Implements
Inherited Members
Namespace: Phoenix.Controls
Assembly: Phoenix.Controls.dll
Syntax
public abstract class ListViewItemComparer : IComparer
Constructors
View SourceListViewItemComparer(ListSortDirection)
Initializes a new instance of the ListViewItemComparer class, and sets the default sort direction.
Declaration
protected ListViewItemComparer(ListSortDirection listSortDirection)
Parameters
Type | Name | Description |
---|---|---|
System.ComponentModel.ListSortDirection | listSortDirection | The sort direction. |
Methods
View SourceCompare(Object, Object)
Compares two objects, if the list sort direction is Ascending, it calls CompareObjects(Object, Object) in two modes -If the System.ComponentModel.ListSortDirection is set to Ascending and passes in object x first, y second. -If the System.ComponentModel.ListSortDirection is set to Descending and passes in object y first, x second.
Declaration
public int Compare(object x, object y)
Parameters
Type | Name | Description |
---|---|---|
System.Object | x | First object. |
System.Object | y | Second object. |
Returns
Type | Description |
---|---|
System.Int32 | Number that represents the comparison order. |
CompareObjects(Object, Object)
Abstract method which is called by Compare(Object, Object), which does that actual compare between the objects.
Declaration
protected abstract int CompareObjects(object value1, object value2)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value1 | First object |
System.Object | value2 | Second object. |
Returns
Type | Description |
---|---|
System.Int32 | Number that represents the comparison order. Less than zero: x precedes y, zero: x occurs in same position as y, greater than 0: x follows y. |