Rev | Line | |
---|
[12503] | 1 | using System;
|
---|
| 2 | using System.Windows;
|
---|
| 3 | using System.Windows.Controls;
|
---|
| 4 | using System.Windows.Shapes;
|
---|
| 5 |
|
---|
| 6 | namespace Microsoft.Research.DynamicDataDisplay.PointMarkers
|
---|
| 7 | {
|
---|
| 8 | /// <summary>Adds Circle element at every point of graph</summary>
|
---|
| 9 | public class CircleElementPointMarker : ShapeElementPointMarker {
|
---|
| 10 |
|
---|
| 11 | public override UIElement CreateMarker()
|
---|
| 12 | {
|
---|
| 13 | Ellipse result = new Ellipse();
|
---|
| 14 | result.Width = Size;
|
---|
| 15 | result.Height = Size;
|
---|
| 16 | result.Stroke = Brush;
|
---|
| 17 | result.Fill = Fill;
|
---|
| 18 | if (!String.IsNullOrEmpty(ToolTipText))
|
---|
| 19 | {
|
---|
| 20 | ToolTip tt = new ToolTip();
|
---|
| 21 | tt.Content = ToolTipText;
|
---|
| 22 | result.ToolTip = tt;
|
---|
| 23 | }
|
---|
| 24 | return result;
|
---|
| 25 | }
|
---|
| 26 |
|
---|
| 27 | public override void SetMarkerProperties(UIElement marker)
|
---|
| 28 | {
|
---|
| 29 | Ellipse ellipse = (Ellipse)marker;
|
---|
| 30 |
|
---|
| 31 | ellipse.Width = Size;
|
---|
| 32 | ellipse.Height = Size;
|
---|
| 33 | ellipse.Stroke = Brush;
|
---|
| 34 | ellipse.Fill = Fill;
|
---|
| 35 |
|
---|
| 36 | if (!String.IsNullOrEmpty(ToolTipText))
|
---|
| 37 | {
|
---|
| 38 | ToolTip tt = new ToolTip();
|
---|
| 39 | tt.Content = ToolTipText;
|
---|
| 40 | ellipse.ToolTip = tt;
|
---|
| 41 | }
|
---|
| 42 | }
|
---|
| 43 |
|
---|
| 44 | public override void SetPosition(UIElement marker, Point screenPoint)
|
---|
| 45 | {
|
---|
| 46 | Canvas.SetLeft(marker, screenPoint.X - Size / 2);
|
---|
| 47 | Canvas.SetTop(marker, screenPoint.Y - Size / 2);
|
---|
| 48 | }
|
---|
| 49 | }
|
---|
| 50 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.