WinUI-Gallery icon indicating copy to clipboard operation
WinUI-Gallery copied to clipboard

ListView sample empty?

Open sdegutis opened this issue 5 years ago • 3 comments

Describe the bug

ListView sample is empty.

Steps to reproduce the bug

https://docs.microsoft.com/en-us/windows/apps/winui/winui3/#xaml-controls-gallery-winui-3-preview-3-branch

Expected behavior

Not blank.

Actual behavior

Blank.

Screenshots

image image

Version Info

Latest as of right now.

Gallery version (found on Settings page):

Latest as of right now.

Windows 10 version:

  • [ ] Insider Build (xxxxx)
  • [ ] May 2020 Update (19041)
  • [ ] November 2019 Update (18363)
  • [ ] May 2019 Update (18362)
  • [ ] October 2018 Update (17763)
  • [ ] April 2018 Update (17134)
  • [ ] Fall Creators Update (16299)
  • [ ] Creators Update (15063)
  • [ ] Anniversary Update (14393)

Device form factor:

  • [ ] Desktop
  • [ ] Mobile
  • [ ] Xbox
  • [ ] Surface Hub
  • [ ] IoT

Additional context

I'm tired.

sdegutis avatar Nov 20 '20 13:11 sdegutis

What a strange issue. I've seen some lag when loading the ListView, which I'm guessing is related to the data being populated.

CC: @MikeHillberg @marb2000 @anawishnoff - should I move this to the WinUI repo?

I'm tired.

Same

stmoy avatar Nov 20 '20 19:11 stmoy

Sorry, just seeing this now. @stmoy / @sdegutis I'm not able to repro this after cloning the latest Preview 3 version of XCG. I think this is probably just lag loading the data as Steven mentioned, so not sure if this requires an issue on the WinUI repo, i.e. I don't know if this is a new issue.

anawishnoff avatar Dec 21 '20 17:12 anawishnoff

Was this ever fixed? To me this looks like Assets\Contacts.txt is checked in with wrong line endings, so

public async static Task<ObservableCollection<Contact>> GetContactsAsync()
{
    IList<string> lines = await FileLoader.LoadLines("Assets/Contacts.txt");

    ObservableCollection<Contact> contacts = new ObservableCollection<Contact>();

    for (int i = 0; i < lines.Count-2; i += 3)
    {
        contacts.Add(new Contact(lines[i], lines[i + 1], lines[i + 2]));
    }

    return contacts;
}

loads only one line and the for loop does nothing...

EDIT: A big LOL to whom, who thinks an application that runs solely on windows and is developed on windows to use UNIX line endings in the whole project is a good idea.

Balkoth avatar Jul 15 '22 08:07 Balkoth