PageRenderTime 30ms CodeModel.GetById 22ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/Main/src/Xbap/DynamicDataDisplay.Xbap.Samples/Demos/v04/Markers/Segment.cs

#
C# | 39 lines | 32 code | 7 blank | 0 comment | 1 complexity | e263a5684164f41d2c0f92f21d2e8a14 MD5 | raw file
Possible License(s): CC-BY-SA-3.0
 1using System;
 2using System.Collections.Generic;
 3using System.Linq;
 4using System.Text;
 5using System.ComponentModel;
 6using Microsoft.Research.DynamicDataDisplay;
 7
 8namespace NewMarkersSample
 9{
10	public class Segment : INotifyPropertyChanged
11	{
12		private double yMin;
13		public double YMin { get { return yMin; } set { yMin = value; PropertyChanged.Raise(this, "YMin"); } }
14
15		private double yMax;
16		public double YMax { get { return yMax; } set { yMax = value; PropertyChanged.Raise(this, "YMax"); } }
17
18		private double x;
19		public double X { get { return x; } set { x = value; PropertyChanged.Raise(this, "X"); } }
20
21		#region INotifyPropertyChanged Members
22
23		public event PropertyChangedEventHandler PropertyChanged;
24
25		#endregion
26
27		public static Segment[] LoadSegments(int count)
28		{
29			Segment[] segments = new Segment[count];
30			double coeff = 0.33;
31			for (int i = 0; i < count; i++)
32			{
33				Segment seg = new Segment { X = i, YMin = Math.Sin(i * coeff), YMax = Math.Sin(i * coeff) + 3 };
34				segments[i] = seg;
35			}
36			return segments;
37		}
38	}
39}