HtmlPanel
Provides HTML rendering using the text property. WPF control that will render html content in it's client rectangle. If the layout of the html resulted in its content beyond the client bounds of the panel it will show scrollbars (horizontal/vertical) allowing to scroll the content. The control will handle mouse and keyboard events on it to support html text selection, copy-paste and mouse clicks.
继承自: HtmlControl
构造函数
HtmlPanel()
Creates a new HtmlPanel and sets a basic css for it's styling.
属性
VisualChildrenCount : int
Get visual child count of the panel.
方法
ArrangeOverride(Size) : Size
After measurement arrange the scrollbars of the panel.
HtmlHeight(Size) : double
Get the width the HTML has to render in (not including vertical scroll iff it is visible)
HtmlWidth(Size) : double
Get the width the HTML has to render in (not including vertical scroll iff it is visible)
MeasureOverride(Size) : Size
Perform the layout of the html in the control.
OnKeyDown(KeyEventArgs)
Handle key down event for selection, copy and scrollbars handling.
OnMouseUp(MouseButtonEventArgs)
Handle mouse up to set focus on the control.
OnMouseWheel(MouseWheelEventArgs)
Handle mouse wheel for scrolling.
OnRender(DrawingContext)
Handle minor case where both scroll are visible and create a rectangle at the bottom right corner between them.
OnScrollBarScroll(object, ScrollEventArgs)
On scrollbar scroll update the scroll offsets and invalidate.
OnScrollChange(object, HtmlScrollEventArgs)
On HTML container scroll change request scroll to the requested location.
OnTextProperty_change(DependencyObject, DependencyPropertyChangedEventArgs)
On text property change reset the scrollbars to zero.
PerformHtmlLayout(Size) : Size
Perform html container layout by the current panel client size.
ScrollToElement(string)
Adjust the scrollbar of the panel on html element by the given id. The top of the html element rectangle will be at the top of the panel, if there is not enough height to scroll to the top the scroll will be at maximum.
- elementId
- the id of the element to scroll to
ScrollToPoint(double, double)
Set the control scroll offset to the given values.
UpdateScrollOffsets()
Update the scroll offset of the HTML container and invalidate visual to re-render.
字段
_horizontalScrollBar : ScrollBar
the horizontal scroll bar for the control to scroll to html content out of view
_verticalScrollBar : ScrollBar
the vertical scroll bar for the control to scroll to html content out of view