Skip to content

Commit 1f02363

Browse files
Fix inconsistent variable names in the ListView sample code (#1902)
<!--- Provide a general summary of your changes in the Title above --> ## Description <!--- Describe your changes in detail --> This PR will fix inconsistency in the sample code for `ListView`s with filtering. ## Motivation and Context <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open issue, please link to the issue here. --> ## How Has This Been Tested? <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> Ran the sample app and confirmed the changes. ## Screenshots (if appropriate): ## Types of changes <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change)
1 parent 3c9cbe6 commit 1f02363

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

WinUIGallery/Samples/SampleCode/ListView/ListViewSample4_cs.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ from the original allContacts list that are now supposed to be displayed (i.e. w
4444

4545
private void Remove_NonMatching(IEnumerable<Contact> filteredData)
4646
{
47-
for (int i = contacts3Filtered.Count - 1; i >= 0; i--)
47+
for (int i = contactsFiltered.Count - 1; i >= 0; i--)
4848
{
49-
var item = contacts3Filtered[i];
49+
var item = contactsFiltered[i];
5050
// If contact is not in the filtered argument list, remove it from the ListView's source.
5151
if (!filteredData.Contains(item))
5252
{
53-
contacts3Filtered.Remove(item);
53+
contactsFiltered.Remove(item);
5454
}
5555
}
5656
}
@@ -60,9 +60,9 @@ private void AddBack_Contacts(IEnumerable<Contact> filteredData)
6060
foreach (var item in filteredData)
6161
{
6262
// If item in filtered list is not currently in ListView's source collection, add it back in
63-
if (!contacts3Filtered.Contains(item))
63+
if (!contactsFiltered.Contains(item))
6464
{
65-
contacts3Filtered.Add(item);
65+
contactsFiltered.Add(item);
6666
}
6767
}
6868
}

0 commit comments

Comments
 (0)