mirror of
https://github.com/colhountech/DarkUI.Net5.git
synced 2025-07-23 12:11:32 +03:00
Added GetItemIndex method to DarkListView.
This commit is contained in:
parent
c9c8f0b5db
commit
91c3ac3daf
@ -205,6 +205,19 @@ namespace DarkUI
|
||||
|
||||
#region Method Region
|
||||
|
||||
public int GetItemIndex(DarkListItem item)
|
||||
{
|
||||
var index = -1;
|
||||
foreach (var otherItem in Items)
|
||||
{
|
||||
index++;
|
||||
if (item == otherItem)
|
||||
break;
|
||||
}
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
public void SelectItem(int index)
|
||||
{
|
||||
if (index < 0 || index > Items.Count - 1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user