Initial Commit
This commit is contained in:
26
PointMarkers/PointMarker.cs
Normal file
26
PointMarkers/PointMarker.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace Microsoft.Research.DynamicDataDisplay.PointMarkers
|
||||
{
|
||||
public delegate void MarkerRenderHandler(DrawingContext dc, Point screenPoint);
|
||||
|
||||
/// <summary>Renders markers along graph</summary>
|
||||
public abstract class PointMarker : DependencyObject {
|
||||
|
||||
/// <summary>Renders marker on screen</summary>
|
||||
/// <param name="dc">Drawing context to render marker on</param>
|
||||
/// <param name="dataPoint">Point from data source</param>
|
||||
/// <param name="screenPoint">Marker center coordinates on drawing context</param>
|
||||
public abstract void Render(DrawingContext dc, Point screenPoint);
|
||||
|
||||
public static implicit operator PointMarker(MarkerRenderHandler renderer) {
|
||||
return FromRenderer(renderer);
|
||||
}
|
||||
|
||||
public static PointMarker FromRenderer(MarkerRenderHandler renderer)
|
||||
{
|
||||
return new DelegatePointMarker(renderer);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user