Hi reyou,
With only code snippet I cannot successfully debugging the app, could you provide more information about your project for instance you could share a repro demo for us.
Simply create a test project by your code, looks like the issue is on your data source binding.
I've change the code like below, works fine now:
//remove DataContext and ItemSource since I don't know how you implement this
<phone:LongListSelector x:Name="list" VerticalAlignment="Stretch"
RenderTransformOrigin="0.5,0.5" BorderBrush="Blue" BorderThickness="2" Margin="10,10,0,0">
<phone:LongListSelector.RenderTransform>
<CompositeTransform/>
</phone:LongListSelector.RenderTransform>
<phone:LongListSelector.ItemTemplate>
<DataTemplate>
<ListBoxItem Margin="0,6,0,6">
<StackPanel Background="Blue">
<TextBlock Text="{Binding Title}" TextWrapping="NoWrap" Foreground="Black"/>
</StackPanel>
</ListBoxItem>
</DataTemplate>
</phone:LongListSelector.ItemTemplate>
</phone:LongListSelector>
In the backend cs file:
InitializeComponent();
Countries = GetCountries();
// manually binding the Countries to XAML.
list.ItemsSource = Countries;
--James
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.