I have a pivot where each pivotItem contains a scrollviewer.
What I want to do is to set the scrollviewer’s offset to a specific number each time I scroll to a new pivot item. I cannot create a databinding because the offset value is not exposed.
There is a ScrollToVerticalOffset() that i can call, but I need first to find which scrollviewer is currently active and get that object, which means the scrollviewer inside the currently selected pivot item.
I tried to get the scrollviewer by traversing the visual tree based on its name but I always get the 1st scrollviewer.
How could I do that?
thanx
You could traverse the visual tree by type instead of by name and start at the selected PivotItem, which should mean that the first ScrollViewer that you find will be the one you want.
So you’d end up with something like this: