PageRenderTime 16ms CodeModel.GetById 12ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/Main/src/DynamicDataDisplay/PointMarkers/DelegatePointMarker.cs

#
C# | 24 lines | 18 code | 4 blank | 2 comment | 2 complexity | 941c8bd417b55acfc4074965ff3d0846 MD5 | raw file
 1using System;
 2using System.Windows;
 3using System.Windows.Media;
 4
 5namespace Microsoft.Research.DynamicDataDisplay.PointMarkers
 6{
 7    /// <summary>Invokes specified delegate for rendering custon marker
 8    /// at every point of graph</summary>
 9	public sealed class DelegatePointMarker : PointMarker {
10		public MarkerRenderHandler RenderCallback { get; set; }
11
12		public DelegatePointMarker() { }
13		public DelegatePointMarker(MarkerRenderHandler renderCallback) {
14			if (renderCallback == null)
15				throw new ArgumentNullException("renderCallback");
16	
17			RenderCallback = renderCallback;
18		}
19
20		public override void Render(DrawingContext dc, Point screenPoint) {
21			RenderCallback(dc, screenPoint);
22		}
23	}
24}