PageRenderTime 23ms CodeModel.GetById 17ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 1ms

/Main/src/DevSamples/InertiaSample/Window1.xaml.cs

#
C# | 61 lines | 43 code | 9 blank | 9 comment | 0 complexity | ed150de44cad7fdd9d78875799e0b150 MD5 | raw file
 1using System;
 2using System.Collections.Generic;
 3using System.Linq;
 4using System.Text;
 5using System.Windows;
 6using System.Windows.Controls;
 7using System.Windows.Data;
 8using System.Windows.Documents;
 9using System.Windows.Input;
10using System.Windows.Media;
11using System.Windows.Media.Imaging;
12using System.Windows.Navigation;
13using System.Windows.Shapes;
14using Microsoft.Research.DynamicDataDisplay.Navigation;
15using Microsoft.Research.DynamicDataDisplay.Charts.Navigation;
16using System.Windows.Markup;
17
18namespace InertiaSample
19{
20	/// <summary>
21	/// Interaction logic for Window1.xaml
22	/// </summary>
23	public partial class Window1 : Window
24	{
25		public Window1()
26		{
27			InitializeComponent();
28
29			//plotter.Children.Clear();
30
31			Loaded += new RoutedEventHandler(Window1_Loaded);
32		}
33
34		void Window1_Loaded(object sender, RoutedEventArgs e)
35		{
36			plotter.Children.Remove(plotter.Children.OfType<MouseNavigation>().FirstOrDefault());
37			//plotter.Children.Remove(plotter.Children.OfType<DefaultContextMenu>().First());
38			//plotter.Children.Remove(plotter.Children.OfType<Microsoft.Research.DynamicDataDisplay.Navigation.KeyboardNavigation>().First());
39
40			//var inertialNav = new InertialMouseNavigation();
41			var inertialNav = new PhysicalNavigation();
42			plotter.Children.Add(inertialNav);
43
44			List<DataPoint> data = new List<DataPoint> { 
45				new DataPoint {
46					X = 0.1, Y = 0.1 
47				}, new DataPoint { X = 0.2, Y = 0.2 } };
48			//listView.ItemsSource = data;
49
50			//VisualDebug.Instance.DrawVector("test", new Point(0.1, 0.9), new Vector(0.5, -0.5), Colors.Indigo);
51
52			plotter.Children.Add(new AxisCursorGraph());
53		}
54	}
55
56	public class DataPoint
57	{
58		public double X { get; set; }
59		public double Y { get; set; }
60	}
61}