I have problem with ScrollIntoView
...
Last time i used this method and was all OK. But now I have a problem and I don't know why.
I think that i looked at 90% of the Internet about this topic and I have found nothing about it..
Here's my XAML:
<Grid Grid.Row="1" >
<ListView
x:Name="NameOfList"
HorizontalAlignment="Stretch"
IsZoomedInView="False"
ItemsSource="{Binding someSource}"
ItemTemplate="{StaticResource someTemplate}"
IsItemClickEnabled="True"
someNamespace:ItemClickedToCommand.Command="{Binding someCommand}"
SelectedItem="{Binding someSelecteditem, Mode=TwoWay}"
SelectedIndex="{Binding someselectedindex, Mode=TwoWay}"
ItemContainerStyle="{StaticResource someContainerStyle}"
>
</ListView>
</Grid>
And here's my code-behind:
var page = GetPage();
var someGrid = page.FindName("SomeGridUserControlGrid") as Grid;
var someUserControl = someGrid.FindName("someUserControl") as SomeUserControl;
ListView listViewSome = someUserControl.FindName("SomeListView") as ListView;
// listViewSome is not null, this object has correct value
//but code below doesn’t work…
listViewSome.SelectedItem = someSelecteditem;
listViewSome.ScrollIntoView(listViewSome.SelectedItem);