Class Scroller
Definition
- Namespace:
- ElmSharp
- Assembly:
- ElmSharp.dll
- API Level:
- preview
The Scroller is a container that holds and clips a single object and allows you to scroll across it.
public class Scroller : Layout, IAccessibleObject
- Inheritance
- Derived
- Implements
Constructors
View SourceScroller()
Creates and initializes a new instance of the Scroller class.
Declaration
public Scroller()
API Level: preview
View SourceScroller(EvasObject)
Creates and initializes a new instance of the Scroller class.
Declaration
public Scroller(EvasObject parent)
Parameters
Type | Name | Description |
---|---|---|
EvasObject | parent | The EvasObject to which the new Scroller will be attached as a child. |
API Level: preview
Properties
View SourceChildHeight
Gets the height of the content object of the scroller.
Declaration
public int ChildHeight { get; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: preview
View SourceChildWidth
Gets the width of the content object of the scroller.
Declaration
public int ChildWidth { get; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: preview
View SourceContentPropagateEvents
Gets or sets the event propagation for a scroller. This enables or disables event propagation from the scroller content to the scroller and its parent. By default, event propagation is enabled.
Declaration
public bool ContentPropagateEvents { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
API Level: preview
View SourceCurrentRegion
Gets the current region in the content object that is visible through the scroller.
Declaration
public Rect CurrentRegion { get; }
Property Value
Type | Description |
---|---|
Rect |
API Level: preview
View SourceHorizontalBounce
Sets or gets the horizontal bounce behaviour. When scrolling, the scroller may "bounce" when reaching an edge of the content object. This is a visual way to indicate the end has been reached. This is enabled by default for both axis. This API will set if it is enabled for the given axis with the boolean parameters for each axis.
Declaration
public bool HorizontalBounce { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
API Level: preview
View SourceHorizontalGravity
Sets the scrolling gravity values for a scroller. The gravity defines how the scroller will adjust its view when the size of the scroller contents increase. The scroller will adjust the view to glue itself as follows: x=0.0, for staying where it is relative to the left edge of the content, x=1.0, for staying where it is relative to the rigth edge of the content, y=0.0, for staying where it is relative to the top edge of the content, y=1.0, for staying where it is relative to the bottom edge of the content. Default values for x and y are 0.0.
Declaration
public double HorizontalGravity { get; set; }
Property Value
Type | Description |
---|---|
Double |
API Level: preview
View SourceHorizontalLoop
Sets an infinite loop_ for a scroller. This function sets the infinite loop horizontally. If the content is set, it will be shown repeatedly.
Declaration
public bool HorizontalLoop { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
API Level: preview
View SourceHorizontalPageIndex
Sets or gets the scroll current page number.
Declaration
public int HorizontalPageIndex { get; }
Property Value
Type | Description |
---|---|
Int32 |
Remarks
Current page means the page which meets the left of the viewport. If there are two or more pages in the viewport, it returns the number of the page which meets the left of the viewport. The page number starts from 0. 0 is the first page.
API Level: preview
View SourceHorizontalPageScrollLimit
Sets or gets the maximum limit of the movable page at horizontal direction.
Declaration
public int HorizontalPageScrollLimit { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: preview
View SourceHorizontalRelativePageSize
Gets or sets a given scroller widget's scrolling page size, relative to its viewport size.
Declaration
public double HorizontalRelativePageSize { get; set; }
Property Value
Type | Description |
---|---|
Double |
API Level: preview
View SourceHorizontalScrollBarVisiblePolicy
Sets or gets the value of HorizontalScrollBarVisiblePolicy.
Declaration
public virtual ScrollBarVisiblePolicy HorizontalScrollBarVisiblePolicy { get; set; }
Property Value
Type | Description |
---|---|
ScrollBarVisiblePolicy |
Remarks
ScrollBarVisiblePolicy.Auto means the horizontal scrollbar is made visible if it is needed, and otherwise kept hidden. ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off.
API Level: preview
View SourceHorizontalSnap
Gets or sets the page snapping behavior of a scroller.
Declaration
public bool HorizontalSnap { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
When scrolling, if a scroller is paged (see HorizontalRelativePageSize), the scroller may snap to pages when being scrolled, i.e., even if it had momentum to scroll further, it will stop at the next page boundaries. This is disabled, by default, for both axis. This function will set if it that is enabled or not, for each axis.
API Level: preview
View SourceHorizontalStepSize
Gets or sets the step size to move scroller by key event.
Declaration
public int HorizontalStepSize { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: preview
View SourceLastHorizontalPageNumber
Gets the scroll last page number. The page number starts from 0. 0 is the first page. This returns the last page number among the pages.
Declaration
public int LastHorizontalPageNumber { get; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: preview
View SourceLastVerticalPageNumber
Gets the scroll last page number. The page number starts from 0. 0 is the first page. This returns the last page number among the pages.
Declaration
public int LastVerticalPageNumber { get; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: preview
View SourcePageHeight
Gets or sets the page size to an absolute fixed value, with 0 turning it off for that axis.
Declaration
public int PageHeight { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: preview
View SourcePageWidth
Gets or sets the page size to an absolute fixed value, with 0 turning it off for that axis.
Declaration
public int PageWidth { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: preview
View SourceScrollBlock
Sets or gets the value of ScrollBlock.
Declaration
public ScrollBlock ScrollBlock { get; set; }
Property Value
Type | Description |
---|---|
ScrollBlock |
Remarks
This function will block scrolling movement in a given direction. One can disable movements in the X-axis, the Y-axis, or both. The default value is ScrollBlock.None, where movements are allowed in both directions.
API Level: preview
View SourceSingleDirection
Gets or sets the type of single direction scroll.
Declaration
public ScrollSingleDirection SingleDirection { get; set; }
Property Value
Type | Description |
---|---|
ScrollSingleDirection |
API Level: preview
View SourceVerticalBounce
Sets or gets the vertical bounce behaviour. When scrolling, the scroller may "bounce" when reaching an edge of the content object. This is a visual way to indicate the end has been reached. This is enabled by default for both axis. This API will set if it is enabled for the given axis with the boolean parameters for each axis.
Declaration
public bool VerticalBounce { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
API Level: preview
View SourceVerticalGravity
Sets the scrolling gravity values for a scroller. The gravity defines how the scroller will adjust its view when the size of the scroller contents increase. The scroller will adjust the view to glue itself as follows: x=0.0, for staying where it is relative to the left edge of the content, x=1.0, for staying where it is relative to the rigth edge of the content, y=0.0, for staying where it is relative to the top edge of the content, y=1.0, for staying where it is relative to the bottom edge of the content. Default values for x and y are 0.0.
Declaration
public double VerticalGravity { get; set; }
Property Value
Type | Description |
---|---|
Double |
API Level: preview
View SourceVerticalLoop
Sets an infinite loop_ for a scroller. This function sets the infinite loop vertically. If the content is set, it will be shown repeatedly.
Declaration
public bool VerticalLoop { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
API Level: preview
View SourceVerticalPageIndex
Sets or gets the scroll current page number.
Declaration
public int VerticalPageIndex { get; }
Property Value
Type | Description |
---|---|
Int32 |
Remarks
Current page means the page which meets the top of the viewport. If there are two or more pages in the viewport, it returns the number of the page which meets the top of the viewport. The page number starts from 0. 0 is the first page.
API Level: preview
View SourceVerticalPageScrollLimit
Sets or gets the maximum limit of the movable page at vertical direction.
Declaration
public int VerticalPageScrollLimit { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: preview
View SourceVerticalRelativePageSize
Gets or sets a given scroller widget's scrolling page size, relative to its viewport size.
Declaration
public double VerticalRelativePageSize { get; set; }
Property Value
Type | Description |
---|---|
Double |
API Level: preview
View SourceVerticalScrollBarVisiblePolicy
Sets or gets the value of VerticalScrollBarVisiblePolicy.
Declaration
public virtual ScrollBarVisiblePolicy VerticalScrollBarVisiblePolicy { get; set; }
Property Value
Type | Description |
---|---|
ScrollBarVisiblePolicy |
Remarks
ScrollBarVisiblePolicy.Auto means the vertical scrollbar is made visible if it is needed, and otherwise kept hidden. ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off.
API Level: preview
View SourceVerticalSnap
Gets or sets the page snapping behavior of a scroller.
Declaration
public bool VerticalSnap { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
When scrolling, if a scroller is paged (see VerticalRelativePageSize), the scroller may snap to pages when being scrolled, i.e., even if it had momentum to scroll further, it will stop at the next page boundaries. This is disabled, by default, for both axis. This function will set if it that is enabled or not, for each axis.
API Level: preview
View SourceVerticalStepSize
Gets or sets the step size to move scroller by key event.
Declaration
public int VerticalStepSize { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: preview
View SourceWheelDisabled
Gets or sets a value whether mouse wheel is enabled or not over the scroller.
Declaration
public bool WheelDisabled { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
API Level: preview
Methods
View SourceCreateHandle(EvasObject)
Creates a widget handle.
Declaration
protected override IntPtr CreateHandle(EvasObject parent)
Parameters
Type | Name | Description |
---|---|---|
EvasObject | parent | Parent EvasObject. |
Returns
Type | Description |
---|---|
IntPtr | Handle IntPtr. |
Overrides
API Level: preview
View SourceMinimumLimit(Boolean, Boolean)
Sets the scroller minimum size limited to the minimum size of the content. By default, the scroller will be as small as its design allows, irrespective of its content. This will make the scroller minimum size the right size horizontally and/or vertically to perfectly fit its content in that direction.
Declaration
public void MinimumLimit(bool horizontal, bool vertical)
Parameters
Type | Name | Description |
---|---|---|
Boolean | horizontal | Enable limiting minimum size horizontally. |
Boolean | vertical | Enable limiting minimum size vertically. |
API Level: preview
View SourceOnRealized()
The callback of the Realized event.
Declaration
protected override void OnRealized()
Overrides
API Level: preview
View SourceScrollTo(Rect, Boolean)
Shows a specific virtual region within the scroller content object.
Declaration
public void ScrollTo(Rect region, bool animated)
Parameters
Type | Name | Description |
---|---|---|
Rect | region | Rect struct of region. |
Boolean | animated | True means allows the scroller to "smoothly slide" to this location. |
Remarks
This ensures that all (or part, if it does not fit) of the designated region in the virtual content object ((0, 0) starting at the top-left of the virtual content object) is shown within the scroller. If set "animated" to true, it will allows the scroller to "smoothly slide" to this location (if configuration in general calls for transitions). It may not jump immediately to the new location and may take a while and show other content along the way.
API Level: preview
View SourceScrollTo(Int32, Int32, Boolean)
Shows a specific virtual region within the scroller content object by the page number. (0, 0) of the indicated page is located at the top-left corner of the viewport.
Declaration
public void ScrollTo(int horizontalPageIndex, int verticalPageIndex, bool animated)
Parameters
Type | Name | Description |
---|---|---|
Int32 | horizontalPageIndex | The horizontal page number. |
Int32 | verticalPageIndex | The vertical page number. |
Boolean | animated | True means slider with animation. |
API Level: preview
View SourceSetPageSize(Double, Double)
Sets the scroll page size relative to the viewport size.
Declaration
public void SetPageSize(double width, double height)
Parameters
Type | Name | Description |
---|---|---|
Double | width | The horizontal page relative size. |
Double | height | The vertical page relative size. |
Remarks
The scroller is capable of limiting scrolling by the user to "pages". That is to jump by and only show a "whole page" at a time as if the continuous area of the scroller content is split into page sized pieces. This sets the size of a page relative to the viewport of the scroller. 1.0 is "1 viewport" which is the size (horizontally or vertically). 0.0 turns it off in that axis. This is mutually exclusive with the page size (see elm_scroller_page_size_set() for more information). Likewise 0.5 is "half a viewport". Usable values are normally between 0.0 and 1.0 including 1.0. If you only want 1 axis to be page "limited", use 0.0 for the other axis.
API Level: preview
View SourceSetPageSize(Int32, Int32)
Sets the page size to an absolute fixed value, with 0 turning it off for that axis.
Declaration
public void SetPageSize(int width, int height)
Parameters
Type | Name | Description |
---|---|---|
Int32 | width | The horizontal page size. |
Int32 | height | The vertical page size. |
API Level: preview
Events
View SourceDragStart
DragStart will be triggered when dragging the contents around has started.
Declaration
public event EventHandler DragStart
Event Type
Type | Description |
---|---|
EventHandler |
API Level: preview
View SourceDragStop
DragStop will be triggered when dragging the contents around has stopped.
Declaration
public event EventHandler DragStop
Event Type
Type | Description |
---|---|
EventHandler |
API Level: preview
View SourcePageScrolled
PageScrolled will be triggered when the visible page has changed.
Declaration
public event EventHandler PageScrolled
Event Type
Type | Description |
---|---|
EventHandler |
API Level: preview
View SourceScrollAnimationStarted
ScrollAnimationStarted will be triggered when the content animation has been started.
Declaration
public event EventHandler ScrollAnimationStarted
Event Type
Type | Description |
---|---|
EventHandler |
API Level: preview
View SourceScrollAnimationStopped
ScrollAnimationStopped will be triggered when the content animation has been stopped.
Declaration
public event EventHandler ScrollAnimationStopped
Event Type
Type | Description |
---|---|
EventHandler |
API Level: preview
View SourceScrolled
Scrolled will be triggered when the content has been scrolled.
Declaration
public event EventHandler Scrolled
Event Type
Type | Description |
---|---|
EventHandler |