Share via


ScrollView.HorizontalScrollRailMode Property

Definition

Gets or sets a value that indicates whether the scroll rail is enabled for the horizontal axis.

public:
 property ScrollingRailMode HorizontalScrollRailMode { ScrollingRailMode get(); void set(ScrollingRailMode value); };
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="ScrollView::s_defaultHorizontalScrollRailMode")]
/// [set: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="ScrollView::s_defaultHorizontalScrollRailMode")]
ScrollingRailMode HorizontalScrollRailMode();

void HorizontalScrollRailMode(ScrollingRailMode value);
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="ScrollView::s_defaultHorizontalScrollRailMode")]
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="ScrollView::s_defaultHorizontalScrollRailMode")]
/// [set: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="ScrollView::s_defaultHorizontalScrollRailMode")]
ScrollingRailMode HorizontalScrollRailMode();

void HorizontalScrollRailMode(ScrollingRailMode value);
public ScrollingRailMode HorizontalScrollRailMode { [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="ScrollView::s_defaultHorizontalScrollRailMode")] get; [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="ScrollView::s_defaultHorizontalScrollRailMode")] set; }
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="ScrollView::s_defaultHorizontalScrollRailMode")]
public ScrollingRailMode HorizontalScrollRailMode { [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="ScrollView::s_defaultHorizontalScrollRailMode")] get; [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="ScrollView::s_defaultHorizontalScrollRailMode")] set; }
var scrollingRailMode = scrollView.horizontalScrollRailMode;
scrollView.horizontalScrollRailMode = scrollingRailMode;
Public Property HorizontalScrollRailMode As ScrollingRailMode

Property Value

A value that indicates whether the scroll rail is enabled for the horizontal axis. The default is Enabled.

Attributes
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValueAttribute

Remarks

When content is scrolled without manipulating the scrollbar directly, for example, by touch, we call it panning. Because content can be both wider and taller than the display area, two-dimensional panning (horizontal and vertical) is often necessary. Rails improve the user experience in these cases by locking the panning to the axis of motion, either vertical or horizontal, as if the content were on a rail.

The following diagram demonstrates the concept of rails.

diagram of a screen with rails that constrain panning

For more info, see Guidelines for panning.

Applies to