I have a Pivot, whose ItemsSource is set to a collection of data objects, and I use an ItemTemplate to transform the items into UI content (I also use a HeaderTemplate).
When tombstoning, I normally get the ScrollViewer from the current PivotItem and save the current position away, so that I can scroll back to the right position if the user navigates back to my app. This works fine if I hard-code the PivotItems in my XAML.
My issue is that the when the Pivot is bound to my data object collection using ItemsSource, SelectedItem returns one of my data objects - not the PivotItem. I can't see how to get to the current PivotItem (or the UI elements generated from my ItemTemplate). I've noticed protected members to go from a ItemsSource item to its corresponding container - perhaps I need to derive from Pivot to make use of these?
Thanks!
Damian
Another way to get the Pivot item is described here - http://bea.stollnitz.com/blog/?p=7
Get a referenec to the Pivot control and you can then use Pivot.ItemContainerGenerator.ContainerFromIndex(index) tp get the PivotItem or you can use Pivot.ItemContainerGenerator.ContainerFromItem(dataobject)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With