Skip to content

Conversation

@ichan-mb
Copy link
Member

Scroll snapping allows you to lock the viewport to a certain location after a user has finished scrolling. You can use the SnapAlignment property to control the lock position. Three lock positions are available: ' Start Center, and End.

The setup that works now is with a StackPanel (Horizontal or Vertical)

<ScrollView LayoutMode="PreserveVisual" Height="400">
	<StackPanel>
		<Each Count="100" Reuse="Frame" >
			<Panel Color="#AAA">
				<Text Value="Data {= index() }"/>
			</Panel>
		</Each>
	</StackPanel>
	<ScrollViewSnap SnapAlignment="Center" />
</ScrollView>

It's required to use LayoutMode="PreserveVisual" on the ScrollView and the child element in the StackPanel has an equal size

This PR contains:

  • Changelog
  • Documentation
  • Tests

Copy link
Member

@mortend mortend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool :)

Looks good to me!

@mortend mortend merged commit 52804cb into fuse-open:master Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants