PageRenderTime 293ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

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

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