RenderSurfaceBase

StockSharp.Xaml.Charting.Rendering.Common

An abstract base class for the RenderSurface, which is a viewport used within the to render BaseRenderableSeries types in a fast manner. The renderer architecture is plugin based, meaning we have build multiple implementations of RenderSurfaceBase.

Inherits: ContentControl

Implements: IRenderSurface2D, IRenderSurface, IDisposable, IHitTestable, IInvalidatableElement

Constructors

RenderSurfaceBase
protected RenderSurfaceBase()
renderSurfaceBase = RenderSurfaceBase()

Initializes a new instance of the RenderSurfaceBase class.

Properties

ChildSeries
public ReadOnlyCollection<IRenderableSeries> ChildSeries { get; }
value = renderSurfaceBase.ChildSeries

Gets the child RenderableSeries in this IRenderSurface2D instance

Grid
public Grid Grid { get; }
value = renderSurfaceBase.Grid

Gets the root element Grid which hosts components in the RenderSurfaceBase

IsSizeValidForDrawing
public virtual bool IsSizeValidForDrawing { get; }
value = renderSurfaceBase.IsSizeValidForDrawing

Returns true if the RenderSurfaceBase size is valid for drawing

MaxFrameRate
public double? MaxFrameRate { get; set; }
value = renderSurfaceBase.MaxFrameRate
renderSurfaceBase.MaxFrameRate = value

Gets or sets the Maximum Framerate of this RenderSurface. By default this is bound to the parent UltrachartSurface.MaxFrameRate

NeedsResizing
public virtual bool NeedsResizing { get; }
value = renderSurfaceBase.NeedsResizing

Returns True if the RenderSurfaceBase size has changed and the viewport needs resizing

ResizeThrottleMs
public int ResizeThrottleMs { get; set; }
value = renderSurfaceBase.ResizeThrottleMs
renderSurfaceBase.ResizeThrottleMs = value

Gets or sets a timeout for resizing, e.g. 100ms means that the RenderSurface will batch up all Resize events received within a 100ms window. This reduces the CPU usage on resize. Also see UseResizeThrottle dependency property, which must be true

Services
public IServiceContainer Services { get; set; }
value = renderSurfaceBase.Services
renderSurfaceBase.Services = value

Gets or sets the IServiceContainer instance

UseResizeThrottle
public bool UseResizeThrottle { get; set; }
value = renderSurfaceBase.UseResizeThrottle
renderSurfaceBase.UseResizeThrottle = value

If true, uses the ResizeThrottleMs value to batch up Resize Events received within a certain time window, reducing the CPU load on resize

Methods

AddSeries
public void AddSeries(IRenderableSeries renderableSeries)
renderSurfaceBase.AddSeries(renderableSeries)

Adds the IRenderableSeries instance to the RenderSurfaceBase

renderableSeries
The renderable series.
AddSeries
public void AddSeries(IEnumerable<IRenderableSeries> renderableSeries)
renderSurfaceBase.AddSeries(renderableSeries)

Adds the IRenderableSeries instance to the IRenderSurface2D

renderableSeries
Clear
public void Clear()
renderSurfaceBase.Clear()

Clears the viewport

ClearSeries
public virtual void ClearSeries()
renderSurfaceBase.ClearSeries()

Clears all IRenderableSeries on the RenderSurfaceBase

ContainsSeries
public bool ContainsSeries(IRenderableSeries renderableSeries)
result = renderSurfaceBase.ContainsSeries(renderableSeries)

Returns True if the RenderSurfaceBase contains the IRenderableSeries instance

renderableSeries
the IRenderableSeries instance

Returns: true if the specified renderable series contains series; otherwise, false.

Dispose
public void Dispose(bool disposing)
renderSurfaceBase.Dispose(disposing)

Releases unmanaged and - optionally - managed resources.

disposing
true to release both managed and unmanaged resources; false to release only unmanaged resources.
Dispose
public void Dispose()
renderSurfaceBase.Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

DisposeUnmanagedResources
protected virtual void DisposeUnmanagedResources()
renderSurfaceBase.DisposeUnmanagedResources()

Derived classes may override this method to be notified when to dispose of unmanaged resources. Called when the RenderSurfaceBase is disposed

Finalize
protected override void Finalize()
renderSurfaceBase.Finalize()

Finalizes an instance of the RenderSurfaceBase class.

GetBoundsRelativeTo
public Rect GetBoundsRelativeTo(IHitTestable relativeTo)
result = renderSurfaceBase.GetBoundsRelativeTo(relativeTo)

Gets the bounds of the current IHitTestable element relative to another IHitTestable element

relativeTo
GetRenderContext
public abstract IRenderContext2D GetRenderContext()
result = renderSurfaceBase.GetRenderContext()

When overridden in a derived class, returns a RenderContext valid for the current render pass

GetRenderSurfaceType
public static string GetRenderSurfaceType(UIElement element)
result = RenderSurfaceBase.GetRenderSurfaceType(element)

Gets the RenderSurfaceType attached property

element
The element.
InvalidateElement
public void InvalidateElement()
renderSurfaceBase.InvalidateElement()

Invalidates the RenderSurface, causing a repaint to occur

IsPointWithinBounds
public bool IsPointWithinBounds(Point point)
result = renderSurfaceBase.IsPointWithinBounds(point)

Returns true if the Point is within the bounds of the current IHitTestable element

point
The point to test

Returns: true if the Point is within the bounds

OnDraw
protected virtual void OnDraw()
renderSurfaceBase.OnDraw()

Raises the DrawDraw event which preceeds the render operation

OnRendered
protected virtual void OnRendered(double duration)
renderSurfaceBase.OnRendered(duration)

Raises the Rendered event with the specified duration

duration
The duration.
OnRenderSurfaceBaseLoaded
protected virtual void OnRenderSurfaceBaseLoaded(object sender, RoutedEventArgs e)
renderSurfaceBase.OnRenderSurfaceBaseLoaded(sender, e)

Called when the RenderSurfaceBase is loaded into the visual tree

sender
The sender.
e
The RoutedEventArgs instance containing the event data.
OnRenderSurfaceBaseUnloaded
protected virtual void OnRenderSurfaceBaseUnloaded(object sender, RoutedEventArgs e)
renderSurfaceBase.OnRenderSurfaceBaseUnloaded(sender, e)

Called when the RenderSurfaceBase is Unloaded from the visual tree

sender
The sender.
e
The RoutedEventArgs instance containing the event data.
OnRenderTimeElapsed
protected virtual void OnRenderTimeElapsed()
renderSurfaceBase.OnRenderTimeElapsed()

Called when the Rendering event is raised

PublishResizedMessage
protected void PublishResizedMessage(int width, int height)
renderSurfaceBase.PublishResizedMessage(width, height)

Publishes RenderSurfaceResizedMessage with actual viewport size

width
height
RecreateSurface
public virtual void RecreateSurface()
renderSurfaceBase.RecreateSurface()

Recreates the elements required by the Viewport, called once at startup and when the surface is resized

RemoveSeries
public void RemoveSeries(IRenderableSeries renderableSeries)
renderSurfaceBase.RemoveSeries(renderableSeries)

Removes the IRenderableSeries from the RenderSurfaceBase

renderableSeries
The renderable series.
SetRenderSurfaceType
public static void SetRenderSurfaceType(UIElement element, string value)
RenderSurfaceBase.SetRenderSurfaceType(element, value)

Sets the RenderSurfaceType attached property

element
The element.
value
The value.
TranslatePoint
public Point TranslatePoint(Point point, IHitTestable relativeTo)
result = renderSurfaceBase.TranslatePoint(point, relativeTo)

Translates the point relative to the other IHitTestable element

point
The input point relative to this IHitTestable
relativeTo
The other IHitTestable to use when transforming the point

Returns: The transformed Point

Events

Draw
public event EventHandler<DrawEventArgs> Draw
renderSurfaceBase.Draw += handler

Raised each time the render surface is to be drawn. Handle this event to paint to the surface

Rendered
public event EventHandler<RenderedEventArgs> Rendered
renderSurfaceBase.Rendered += handler

Raised immediately after a render operation has completed

Fields

MaxFrameRateProperty
public static readonly DependencyProperty MaxFrameRateProperty
value = RenderSurfaceBase.MaxFrameRateProperty

Defines the MaxFrameRate DependencyProperty

RenderSurfaceTypeProperty
public static readonly DependencyProperty RenderSurfaceTypeProperty
value = RenderSurfaceBase.RenderSurfaceTypeProperty

Defines the RenderSurfaceType attached property

ResizeThrottleMsProperty
public static readonly DependencyProperty ResizeThrottleMsProperty
value = RenderSurfaceBase.ResizeThrottleMsProperty

Defines the ResizeThrottleMs DependencyProperty

UseResizeThrottleProperty
public static readonly DependencyProperty UseResizeThrottleProperty
value = RenderSurfaceBase.UseResizeThrottleProperty

Defines the UseResizeThrottle DependencyProperty