Reseting ScrollView without an animation

Hello! Is there a way to reset the ScrollView’s position without an animation? If I use Set for the ScrollPosition, the ScrollView animates to the top.

ScrollView has a seekTo JS method that bypasses the scrolling animation.

Thank you! Though I think I found the solution also with a trigger:

<WhileTrue Value="{scrollReset}"><Set Target="ScrollView.ScrollPosition" Value="0,0" /</WhileTrue>

Basically I set the scrollReset to False before emptying the Items and after Items are recreated, I set the scrollReset to True which bumps the ScrollView back up.

Well if you’re using JS to recreate items, it would make sense if you reset the position in JS too.

Putting one-timers such as Set inside of While*-triggers is generally a bad practice. Those belong in Pulse triggers.

Ok! Is there a good example of controlling UX elements via JS? I understand the method of UX->JS, but how do I do JS->UX to use seekTo?

You simply refer to the UX element by the ux:Name you give it. You obviously need to be in the same data context for this to work.

Since this deviates from the original question of the thread, if you have further unrelated questions please post them in separate threads.

Ok, thank you!