PageRenderTime 47ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/View/SystemBasicView.xaml.cs

https://github.com/shader/QuickArch
C# | 73 lines | 60 code | 10 blank | 3 comment | 0 complexity | 03a2783bd2fc003f83559e2129e71a45 MD5 | raw file
  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 System.Windows.Controls.Primitives;
  15. namespace QuickArch.View
  16. {
  17. /// <summary>
  18. /// Interaction logic for ComponentView.xaml
  19. /// </summary>
  20. public partial class SystemBasicView : UserControl
  21. {
  22. public static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register("IsSelected", typeof(bool), typeof(SystemBasicView));
  23. private Guid id;
  24. public List<ConnectorView> EndLines { get; private set; }
  25. public List<ConnectorView> StartLines { get; private set; }
  26. public bool IsSelected
  27. {
  28. get { return (bool)base.GetValue(IsSelectedProperty); }
  29. set { base.SetValue(IsSelectedProperty, value); }
  30. }
  31. public Point Position
  32. {
  33. get
  34. { return new Point(Canvas.GetLeft(this), Canvas.GetTop(this)); }
  35. set
  36. {
  37. Canvas.SetLeft(this, value.X);
  38. Canvas.SetTop(this, value.Y);
  39. }
  40. }
  41. public double Left
  42. {
  43. get { return this.Position.X; }
  44. set { Canvas.SetLeft(this, value); }
  45. }
  46. public double Top
  47. {
  48. get { return this.Position.Y; }
  49. set { Canvas.SetTop(this, value); }
  50. }
  51. public SystemBasicView()
  52. {
  53. InitializeComponent();
  54. id = Guid.NewGuid();
  55. StartLines = new List<ConnectorView>();
  56. EndLines = new List<ConnectorView>();
  57. }
  58. public Guid ID
  59. {
  60. get { return id; }
  61. }
  62. }
  63. }