I recently wrote an app targeting WP 7.1 SDK which uses a ListBox and DataBinds it from code behind. When I run this app on a WP8 device or a WP8 emulator, the app works fine and I can see the data on the page. But when this exact same app is run on a WP7.5 device or emulator, the ListBox does not show any data. I have not been able to figure out why for the life of me!

Here is the ListBox in XAML:

                    <ListBox Name="lbCurrentTickets" SelectionChanged="lbCurrentTickets_SelectionChanged" Margin="10,10,0,0">
                                    <TextBlock Text="{Binding Path=StartDate}" Margin="0,15,0,0" FontWeight="ExtraBold" Foreground="Black" />
                                    <TextBlock Text="{Binding Path=Title}" Margin="0,-5,0,0" FontSize="30" Foreground="#3A87D3" />
                                    <TextBlock Text="{Binding Path=Address}" Margin="0,-5,0,0" FontSize="22" Foreground="Gray" Visibility="{Binding ShowAddressField}" />
The ListBox is data bound from code behind by doing this:

                lbCurrentTickets.ItemsSource = events;
'events' is an object of a class, and I have verified that it does contain all the right data at this point. When this code is run on a WP7.5 device the ListBox shows up empty even though it is bound with actual data, but when this exact code is run on a WP8 device it shows the data perfectly fine.

Just for testing sake I hardcoded one of the TextBlocks inside the ListBox with a value, like:

                                    <TextBlock Text="This is a test" Margin="0,-5,0,0" FontSize="30" Foreground="#3A87D3" />
and the text "This is a test" shows up the right number of times (the number of items in the 'events' object) which means the ListBox is being data bound somewhat properly.

Can someone help resolve this issue as to why the ListBox displays empty when I run this code on a WP7.5 device?

To summarize, this WP7.1 app works fine on a WP8 device but not on a WP7.5 device.

Paras Wadehra
My WP Apps: http://bit.ly/MyWPApps