I have read most everything I can find to stop autoscrolling in a ScrollViewer without success.
The scenario is the following. I populate a scrollviewer with text hosted by a formatted text object. This is displayed as:
I now scroll down and Tap/click on a word (e.g, "pearly"). The code now dynamically adds new controls on top of the selected word as shown:
All is good. However, when I now select the newly added control (e.g., "p"), the scrollviewer moves the control to the top of the view as shown:
The scrollviewer is defined in xaml as:
<Canvas Grid.Row="1" Grid.RowSpan="3" Grid.Column="0">
<ScrollViewer VerticalScrollBarVisibility="Auto"
Width="{Binding Parent.ActualWidth, Mode=OneWay, RelativeSource={RelativeSource Self}}"
Height="{Binding Parent.ActualHeight, Mode=OneWay, RelativeSource={RelativeSource Self}}" >
<Grid Background="White" >
..............
</Grid>
</ScrollViewer>
</Canvas>
This is visually very distressing.
Any help at stopping this behavior is most appreciated. (Setting CanContentScroll to false does nothing :( ).