ViewportManagerBase
Defines a base class for a ViewportManager, which may be used to control visible range and ranging on a UltrachartSurface
Implements: IViewportManager, IUltrachartController, ISuspendable, IInvalidatableElement
Properties
public bool IsAttached { get; private set; }
value = viewportManagerBase.IsAttached
viewportManagerBase.IsAttached = value
Gets the value indicating whether a ViewportManagerBase has the UltrachartSurface attached to.
public bool IsSuspended { get; }
value = viewportManagerBase.IsSuspended
Gets a value indicating whether updates for the target are currently suspended
public IServiceContainer Services { get; set; }
value = viewportManagerBase.Services
viewportManagerBase.Services = value
Gets the ServiceContainer which provides access to services throughout Ultrachart. ServiceContainers are created one per UltrachartSurface instance, and shared between peripheral components such as AxisBase, BaseRenderableSeries, ChartModifierBase instances. For a full list of available services, see the remarks on ServiceContainer
Methods
public void AnimateZoomExtents(TimeSpan duration)
viewportManagerBase.AnimateZoomExtents(duration)
Zooms to extents with the specified animation duration
- duration
- The duration of animation when zooming to extents
public void AnimateZoomExtentsX(TimeSpan duration)
viewportManagerBase.AnimateZoomExtentsX(duration)
Zooms the chart to the extents of the data in the X-Direction
- duration
public void AnimateZoomExtentsY(TimeSpan duration)
viewportManagerBase.AnimateZoomExtentsY(duration)
Zooms the chart to the extents of the data in the Y-Direction, accounting for the current data in view in the X-direction
- duration
public virtual void AttachUltrachartSurface(IUltrachartSurface scs)
viewportManagerBase.AttachUltrachartSurface(scs)
Called when the ViewportManagerBase is attached to a parent UltrachartSurface
- scs
- The UltrachartSurface instance
public virtual IRange CalculateAutoRange(IAxis axis)
result = viewportManagerBase.CalculateAutoRange(axis)
Overridden by derived types, called when the parent UltrachartSurface requests to perform autoranging. The Range returned by this method will be applied to the chart on render
- axis
- The axis
Returns: The new VisibleRange for the YAxis
public IRange CalculateNewXAxisRange(IAxis xAxis)
result = viewportManagerBase.CalculateNewXAxisRange(xAxis)
Called by the UltrachartSurface during render to calculate the new XAxis VisibleRange. Override in derived types to return a custom value
- xAxis
Returns: The new IRange VisibleRange for the axis
public IRange CalculateNewYAxisRange(IAxis yAxis, RenderPassInfo renderPassInfo)
result = viewportManagerBase.CalculateNewYAxisRange(yAxis, renderPassInfo)
Called by the UltrachartSurface during render to calculate the new YAxis VisibleRange. Override in derived types to return a custom value
- yAxis
- The YAxis to calculate for
- renderPassInfo
- The current RenderPassInfo containing render data
Returns: The new IRange VisibleRange for the axis
public void DecrementSuspend()
viewportManagerBase.DecrementSuspend()
Called by IUpdateSuspender each time a target suspender is disposed. When the final target suspender has been disposed, ResumeUpdates is called
public virtual void DetachUltrachartSurface()
viewportManagerBase.DetachUltrachartSurface()
Called when the ViewportManagerBase is detached from a parent UltrachartSurface
public void InvalidateElement()
viewportManagerBase.InvalidateElement()
Asynchronously requests that the element redraws itself plus children. Will be ignored if the element is ISuspendable and currently IsSuspended (within a SuspendUpdates/ResumeUpdates call)
public void InvalidateParentSurface(RangeMode rangeMode)
viewportManagerBase.InvalidateParentSurface(rangeMode)
Triggers a redraw on the parent surface with the specified RangeMode
- rangeMode
- The RangeMode specifying how to redraw the parent surface
protected abstract IRange OnCalculateNewXRange(IAxis xAxis)
result = viewportManagerBase.OnCalculateNewXRange(xAxis)
Overridden by derived types, called when the parent UltrachartSurface requests the XAxis VisibleRange. The Range returned by this method will be applied to the chart on render
- xAxis
- The XAxis
Returns: The new VisibleRange for the XAxis
protected abstract IRange OnCalculateNewYRange(IAxis yAxis, RenderPassInfo renderPassInfo)
result = viewportManagerBase.OnCalculateNewYRange(yAxis, renderPassInfo)
Overridden by derived types, called when the parent UltrachartSurface requests a YAxis VisibleRange. The Range returned by this method will be applied to the chart on render
- yAxis
- The YAxis
- renderPassInfo
- The render pass info.
Returns: The new VisibleRange for the YAxis
protected void OnInvalidateParentSurface(DependencyPropertyChangedEventArgs e)
viewportManagerBase.OnInvalidateParentSurface(e)
Raises the InvalidateParentSurface event.
- e
- The DependencyPropertyChangedEventArgs instance containing the event data.
public virtual void OnParentSurfaceRendered(IUltrachartSurface ultraChartSurface)
viewportManagerBase.OnParentSurfaceRendered(ultraChartSurface)
Called when the IUltrachartSurface is rendered.
- ultraChartSurface
- The UltrachartSurface instance
public virtual void OnVisibleRangeChanged(IAxis axis)
viewportManagerBase.OnVisibleRangeChanged(axis)
Called when the VisibleRange changes for an axis. Override in derived types to get a notification of this occurring
- axis
- The IAxisinstance
public void ResumeUpdates(IUpdateSuspender suspender)
viewportManagerBase.ResumeUpdates(suspender)
Resumes updates on the target, intended to be called by IUpdateSuspender
- suspender
public IUpdateSuspender SuspendUpdates()
result = viewportManagerBase.SuspendUpdates()
Suspends drawing updates on the target until the returned object is disposed, when a final draw call will be issued
Returns: The disposable Update Suspender
public void ZoomExtents()
viewportManagerBase.ZoomExtents()
Zooms the chart to the extents of the data, plus any X or Y Grow By fraction set on the X and Y Axes
public void ZoomExtentsX()
viewportManagerBase.ZoomExtentsX()
Zooms the chart to the extents of the data in the X-Direction
public void ZoomExtentsY()
viewportManagerBase.ZoomExtentsY()
Zooms the chart to the extents of the data in the Y-Direction, accounting for the current data in view in the X-direction