PopupContentDecorator Class
Represents a Decorator control that can be used on a ribbon control popup directly as a child of a ScrollViewer to make sure it measures at the real size of the container with support for setting a minimum height and width;
public class PopupContentDecorator : Decorator
- Inheritance:
- object Visual UIElement FrameworkElement Decorator object
Constructors
PopupContentDecorator()
Initializes an instance of the class.
public PopupContentDecorator()
Properties
CanHorizontallyScroll
Gets or sets a value that indicates whether scrolling on the horizontal axis is possible.
CanVerticallyScroll
Gets or sets a value that indicates whether scrolling on the vertical axis is possible.
ExtentHeight
Gets the vertical size of the extent.
public double ExtentHeight { get; }
Property Value
ExtentWidth
Gets the horizontal size of the extent.
public double ExtentWidth { get; }
Property Value
HorizontalOffset
Gets the horizontal offset of the scrolled content.
public double HorizontalOffset { get; }
Property Value
ScrollOwner
Gets or sets a ScrollViewer element that controls scrolling behavior.
public ScrollViewer ScrollOwner { get; set; }
Property Value
- ScrollViewer:
A ScrollViewer element that controls scrolling behavior. This property has no default value.
VerticalOffset
Gets the vertical offset of the scrolled content.
public double VerticalOffset { get; }
Property Value
- double:
A double that represents, in device independent pixels, the vertical offset of the scrolled content. Valid values are between zero and the ExtentHeight minus the ViewportHeight. This property has no default value.
ViewportHeight
Gets the vertical size of the viewport for this content.
public double ViewportHeight { get; }
Property Value
ViewportWidth
Gets the horizontal size of the viewport for this content.
public double ViewportWidth { get; }
Property Value
Methods
ArrangeOverride(Size)
Arranges the content of a Decorator element.
protected override Size ArrangeOverride(Size arrangeSize)
Parameter | Type | Description |
---|---|---|
arrangeSize | Size | The System.Windows.Size this element uses to arrange its child content. |
Returns
- Size:
The System.Windows.Size that represents the arranged size of this Decorator element and its child.
LineDown()
Scrolls down within content by one logical unit.
public void LineDown()
LineLeft()
Scrolls left within content by one logical unit.
public void LineLeft()
LineRight()
Scrolls right within content by one logical unit.
public void LineRight()
LineUp()
Scrolls up within content by one logical unit.
public void LineUp()
MakeVisible(Visual, Rect)
Forces content to scroll until the coordinate space of a Visual object is visible.
public Rect MakeVisible(Visual visual, Rect rectangle)
Parameter | Type | Description |
---|---|---|
visual | Visual | A Visual that becomes visible. |
rectangle | Rect | A bounding rectangle that identifies the coordinate space to make visible. |
Returns
- Rect:
A System.Windows.Rect that is visible.
MeasureOverride(Size)
Measures the child element of a Decorator to prepare for arranging it during the ArrangeOverride(Size) pass.
protected override Size MeasureOverride(Size constraint)
Parameter | Type | Description |
---|---|---|
constraint | Size | An upper limit System.Windows.Size that should not be exceeded. |
Returns
- Size:
The target System.Windows.Size of the element.
MouseWheelDown()
Scrolls down within content after a user clicks the wheel button on a mouse.
public void MouseWheelDown()
MouseWheelLeft()
Scrolls left within content after a user clicks the wheel button on a mouse.
public void MouseWheelLeft()
MouseWheelRight()
Scrolls right within content after a user clicks the wheel button on a mouse.
public void MouseWheelRight()
MouseWheelUp()
Scrolls up within content after a user clicks the wheel button on a mouse.
public void MouseWheelUp()
PageDown()
Scrolls down within content by one page.
public void PageDown()
PageLeft()
Scrolls left within content by one page.
public void PageLeft()
PageRight()
Scrolls right within content by one page.
public void PageRight()
PageUp()
Scrolls up within content by one page.
public void PageUp()
SetHorizontalOffset(double)
Sets the amount of horizontal offset.
public void SetHorizontalOffset(double offset)
Parameter | Type | Description |
---|---|---|
offset | double | The degree to which content is horizontally offset from the containing viewport. |
SetVerticalOffset(double)
Sets the amount of vertical offset.
public void SetVerticalOffset(double offset)
Parameter | Type | Description |
---|---|---|
offset | double | The degree to which content is vertically offset from the containing viewport. |
TryUpdateOffset(Point)
Attempts to update the offset.
public bool TryUpdateOffset(Point offset)
Parameter | Type | Description |
---|---|---|
offset | Point | The offset. |
Returns
- bool:
true
if the offset was updated; otherwise,false
.
Fields
LineSize
Represents the number of pixels contained in a single line.
public const double LineSize = 16
WheelScrollLines
Represents the number of lines scroll when using the mouse wheel.
public static readonly int WheelScrollLines