ScrollTo Class
Scrolls a ScrollView to a given position when triggered.
Absolute position
To scroll to an absolute position, provide a value to the Position
property.
This property accepts a pair of numbers, representing X and Y coordinates.
<ScrollTo Target="myScrollView" Position="0, 50" />
Relative position
Alternatively, you can scroll to a relative position using the RelativePosition
property.
RelativePosition
also accepts a pair of numbers, representing X and Y coordinates.
Each coordinate should be in the range 0..1
, where 1
represents the largest distance
the user can scroll in that direction.
For instance, a RelativePosition
of 1, 1
will scroll to the bottom-right corner.
<ScrollTo Target="myScrollView" RelativePosition="0, 0.5" />
When triggered, the above will scroll myScrollView
to the vertical center of its scrollable area.
Example
<DockPanel>
<Button Dock="Top" Text="Scroll to top" Margin="20">
<Clicked>
<ScrollTo Target="myScrollView" Position="0,0" />
</Clicked>
</Button>
<ScrollView ux:Name="myScrollView">
<Rectangle Height="2000">
<LinearGradient>
<GradientStop Offset="0" Color="Red" />
<GradientStop Offset="1" Color="Blue" />
</LinearGradient>
</Rectangle>
</ScrollView>
</DockPanel>
Location
- Namespace
- Fuse.Gestures
- Package
- Fuse.Controls.ScrollView 2.9.1
Interface of ScrollTo
Position : float2 ux
The absolute position to scroll to, in points.
RelativePosition : float2 ux
ScrollTo Constructor uno
Creates a new ScrollTo
Target : ScrollView ux
The ScrollView to perform the scrolling on.
Inherited from TriggerAction
AtProgress : float ux
Delay : float ux
The number of seconds after the start of the trigger that the action should be performed.
Direction : TriggerWhen ux
IsActive : bool ux
IsProgressTriggered : bool uno
OnUnrooted uno
Perform(Node) uno
PerformFromNode(Node) uno
ProgressWhen(float) : float uno
SourceFileName : string ux
hide
SourceLineNumber : int ux
hide
TargetNode : Node ux
Unroot uno
When : TriggerWhen ux
Inherited from PropertyObject
AddPropertyListener(IPropertyListener) uno
OnPropertyChanged(Selector, IPropertyListener) uno
OnPropertyChanged(Selector) uno
RemovePropertyListener(IPropertyListener) uno
Inherited from object
Equals(object) : bool uno
GetHashCode : int uno
GetType : Type uno
ToString : string uno
Attached UX Attributes
GlobalKey (attached by Resource) : string ux
Implemented Interfaces
ISourceLocation uno
hide