In This Article

OverflowPresenter Class

Represents a control that allows inline scrolling when its content overflows.

public class OverflowPresenter : FrameworkElement, IOrientedElement
Inheritance:
object Visual UIElement FrameworkElement object
Implements:
IOrientedElement

Constructors

OverflowPresenter()

Initializes an instance of the class.

public OverflowPresenter()

Properties

CanScrollBackward

Gets whether the control can currently be scrolled backward.

public bool CanScrollBackward { get; }

Property Value

bool:

true if the control can currently be scrolled backward; otherwise, false.

CanScrollForward

Gets whether the control can currently be scrolled forward.

public bool CanScrollForward { get; }

Property Value

bool:

true if the control can currently be scrolled forward; otherwise, false.

Child

Gets or sets the child UIElement to display in the presenter.

public UIElement Child { get; set; }

Property Value

UIElement:

The child UIElement to display in the presenter.

LogicalChildren

Gets an enumerator for logical child elements of this element.

protected override IEnumerator LogicalChildren { get; }

Property Value

IEnumerator:

An enumerator for logical child elements of this element.

MinChildExtent

Gets or sets the minimum child extent.

public double MinChildExtent { get; set; }

Property Value

double:

The minimum child extent. The default value is 0.

Orientation

Gets or sets the orientation of the control.

public Orientation Orientation { get; set; }

Property Value

Orientation:

The orientation of the control.

RequiresAdornerDecorator

Gets or sets whether the presenter requires an adorner decorator.

public bool RequiresAdornerDecorator { get; set; }

Property Value

bool:

true if the presenter requires an adorner decorator; otherwise, false. The default value is false.

ScrollButtonStyle

Gets or sets the Style to apply to the scroll buttons.

public Style ScrollButtonStyle { get; set; }

Property Value

Style:

The Style to apply to the scroll buttons.

ScrollButtonStyleKey

Gets the ResourceKey for a Style that may be applied to ButtonBase elements.

public static ResourceKey ScrollButtonStyleKey { get; }

Property Value

ResourceKey:

A resource key.

ScrollOffset

Gets the current scroll offset.

public double ScrollOffset { get; }

Property Value

double:

The current scroll offset.

TargetScrollOffset

Gets the target scroll offset.

public double TargetScrollOffset { get; }

Property Value

double:

The target scroll offset.

VisualChildrenCount

Gets the number of visual child elements within this element.

protected override int VisualChildrenCount { get; }

Property Value

int:

The number of visual child elements for this element.

Methods

ArrangeOverride(Size)

When overridden in a derived class, positions child elements and determines a size for a FrameworkElement derived class.

protected override Size ArrangeOverride(Size finalSize)
Parameter Type Description
finalSize Size

The final area within the parent that this element should use to arrange itself and its children.

Returns

Size:

The actual size used.

GetVisualChild(int)

Overrides GetVisualChild(int), and returns a child at the specified index from a collection of child elements.

protected override Visual GetVisualChild(int index)
Parameter Type Description
index int

The zero-based index of the requested child element in the collection.

Returns

Visual:

The requested child element. This should not return null; if the provided index is out of range, an exception is thrown.

MeasureOverride(Size)

When overridden in a derived class, measures the size in layout required for child elements and determines a size for the FrameworkElement-derived class.

protected override Size MeasureOverride(Size availableSize)
Parameter Type Description
availableSize Size

The available size that this element can give to child elements. Infinity can be specified as a value to indicate that the element will size to whatever content is available.

Returns

Size:

The size that this element determines it needs during layout, based on its calculations of child element sizes.

OnScrollOffsetChanged(RoutedEventArgs)

Occurs when the ScrollOffset property value has changed.

protected virtual void OnScrollOffsetChanged(RoutedEventArgs e)
Parameter Type Description
e RoutedEventArgs

The RoutedEventArgs containing data related to this event.

Events

ScrollOffsetChanged

Occurs when the ScrollOffset property changes

public event RoutedEventHandler ScrollOffsetChanged

Event Type

RoutedEventHandler

Fields

CanScrollBackwardProperty

Identifies the CanScrollBackward dependency property. This field is read-only.

public static readonly DependencyProperty CanScrollBackwardProperty

CanScrollForwardProperty

Identifies the CanScrollForward dependency property. This field is read-only.

public static readonly DependencyProperty CanScrollForwardProperty

MinChildExtentProperty

Identifies the MinChildExtent dependency property. This field is read-only.

public static readonly DependencyProperty MinChildExtentProperty

OrientationProperty

Identifies the Orientation dependency property. This field is read-only.

public static readonly DependencyProperty OrientationProperty

RequiresAdornerDecoratorProperty

Identifies the RequiresAdornerDecorator dependency property. This field is read-only.

public static readonly DependencyProperty RequiresAdornerDecoratorProperty

ScrollButtonStyleProperty

Identifies the ScrollButtonStyle dependency property. This field is read-only.

public static readonly DependencyProperty ScrollButtonStyleProperty

ScrollOffsetChangedEvent

Identifies the ScrollOffsetChanged routed event. This field is read-only.

public static readonly RoutedEvent ScrollOffsetChangedEvent

ScrollOffsetProperty

Identifies the ScrollOffset dependency property. This field is read-only.

public static readonly DependencyProperty ScrollOffsetProperty

TargetScrollOffsetProperty

Identifies the TargetScrollOffset dependency property. This field is read-only.

public static readonly DependencyProperty TargetScrollOffsetProperty