2
votes

I am working on Windows Phone App (Windows Phone 8.1) and I have a strange behavior of my ListView control.

I have a ListView with text items (Sort of a chat) which is bound to ReadOnlyObservebleCollection to whom I am inserting items as I write a new message or when I receive a new one. I choose my ListView items template with my DataTemplateSelector.

The issue:

Sometimes, when my ListView is empty, I add a new message to my ListView I don't see it on the screen, but I can see that it in my collection and I know for sure that the RaisePropertyEvent is fired.

As I continue to add new item to the collection I can scroll down the list (there is some sort of placeholder in the first idex) and then I am seeing the rest of the items - except the first one.

I've also noticed that the missing item is getting to the DataTemplateSelector and it's returns the right template.

Getting weirder, when I am refreshing the view - all the items(including the first one) at their right places.

I guess there is something wrong with the first item generation but I don't get any binding exceptions or such.

Any help will be appreciated.

1
Can you show your xaml for ListView control?OpenMinded
Well I can post some of the xaml code, but it will be a simple ListView declaration with ItemSource bindingPavel Durov

1 Answers

1
votes

Same issue was occurring to me in my ListView. It was happening because listview was not loaded(loaded event was not fired) at the time first item was added to my observable collection. To fix this issue I start adding items in my observable collection after listview loaded event is raised.