0

I am very new in SilverLight and Windows Phone programming. I am working on one twitter application. In Timeline view - when I click on refresh application fetches twitter feeds data and update on top of already existing feeds. I saved all earlier feed in isolated storage.

Now my problem is whenever I refresh feeds listbox position goes to top. How can I retain the position where scroll is earlier? I am total new in SilverLight and Windows Phone.

<ListBox ItemsSource="{Binding feeds}" Margin="0,10,0,0">
  <ListBox.ItemTemplate>
    <DataTemplate>
      <StackPanel>
        <TextBlock Text="{Binding FeedText}" Style="{StaticResource PhoneTextNormalStyle}" />
        <TextBlock Text="{Binding FeedDate}" Style="{StaticResource PhoneTextNormalStyle}" />
      </StackPanel>
    </DataTemplate>
  </ListBox.ItemTemplate>
</ListBox>
LarsTech
  • 80,625
  • 14
  • 153
  • 225
Nilay Shah
  • 67
  • 7

1 Answers1

0

This question might have an answer for you: Restore Scroll Position in LongListSelector after tombstone

This question might be of use too: Restoring exact scroll position of a listbox in Windows Phone 7

A lot depends on the way you are loading/refreshing the data (replacing all of it or updating the items). In some cases you will need to scroll to a different position because the content has changed (or the order of the items) in other scenarios you will want to keep the relative position.

Make sure you know what you want to happen from a functional point of view.

Community
  • 1
  • 1
Emond
  • 50,210
  • 11
  • 84
  • 115