开发者

when is SelectionChanged event called on the Pivot control in windows phone 7?

开发者 https://www.devze.com 2023-03-24 03:11 出处:网络
why is it that sometimes setting the ItemsSource property on a Pivot control calls the SelectionChanged event, and sometimes it doesn\'t?

why is it that sometimes setting the ItemsSource property on a Pivot control calls the SelectionChanged event, and sometimes it doesn't?

myPivot.ItemsSource = (ObservableCollections)someList;

it seems when i'm launching the app fresh from the app list, if i set the ItemsSource, the SelectionChanged event is always called. however, if i navigate away, tombstone the app (hit the home button) and then navigate back (hit the back button) to the original page, even though ItemsSource is set, SelectionChan开发者_如何学Pythonged is never raised.


The behaviour changed in Windows Phone 7.1 (Mango). Due to the new "fast resume" improvement, the pivot control now automatically persists the position, and thus you no longer need to persist the selected pivot.

And for the same reason, the SelectionChanged event is never called, as the selection never changed.

For Windows Phone 7.0 (NoDo) you need to set the Pivot.SelectedIndex upon return (Best done in the Pivot.Loaded event).

0

精彩评论

暂无评论...
验证码 换一张
取 消