PlotBase.Properties.cs 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. // --------------------------------------------------------------------------------------------------------------------
  2. // <copyright file="PlotBase.Properties.cs" company="OxyPlot">
  3. // Copyright (c) 2014 OxyPlot contributors
  4. // </copyright>
  5. // <summary>
  6. // Represents a control that displays a <see cref="PlotModel" />.
  7. // </summary>
  8. // --------------------------------------------------------------------------------------------------------------------
  9. using Avalonia;
  10. using Avalonia.Input;
  11. using Avalonia.Markup.Xaml.Templates;
  12. namespace OxyPlot.Avalonia
  13. {
  14. /// <summary>
  15. /// Represents a control that displays a <see cref="PlotModel" />.
  16. /// </summary>
  17. public partial class PlotBase
  18. {
  19. /// <summary>
  20. /// Identifies the <see cref="DefaultTrackerTemplate"/> dependency property.
  21. /// </summary>
  22. public static readonly StyledProperty<ControlTemplate> DefaultTrackerTemplateProperty = AvaloniaProperty.Register<PlotBase, ControlTemplate>(nameof(DefaultTrackerTemplate));
  23. /// <summary>
  24. /// Identifies the <see cref="IsMouseWheelEnabled"/> dependency property.
  25. /// </summary>
  26. public static readonly StyledProperty<bool> IsMouseWheelEnabledProperty = AvaloniaProperty.Register<PlotBase, bool>(nameof(IsMouseWheelEnabled), true);
  27. /// <summary>
  28. /// Identifies the <see cref="PanCursor"/> dependency property.
  29. /// </summary>
  30. public static readonly StyledProperty<Cursor> PanCursorProperty = AvaloniaProperty.Register<PlotBase, Cursor>(nameof(PanCursor), new Cursor(StandardCursorType.Hand));
  31. /// <summary>
  32. /// Identifies the <see cref="ZoomHorizontalCursor"/> dependency property.
  33. /// </summary>
  34. public static readonly StyledProperty<Cursor> ZoomHorizontalCursorProperty = AvaloniaProperty.Register<PlotBase, Cursor>(nameof(ZoomHorizontalCursor), new Cursor(StandardCursorType.SizeWestEast));
  35. /// <summary>
  36. /// Identifies the <see cref="ZoomRectangleCursor"/> dependency property.
  37. /// </summary>
  38. public static readonly StyledProperty<Cursor> ZoomRectangleCursorProperty = AvaloniaProperty.Register<PlotBase, Cursor>(nameof(ZoomRectangleCursor), new Cursor(StandardCursorType.SizeAll));
  39. /// <summary>
  40. /// Identifies the <see cref="ZoomRectangleTemplate"/> dependency property.
  41. /// </summary>
  42. public static readonly StyledProperty<ControlTemplate> ZoomRectangleTemplateProperty = AvaloniaProperty.Register<PlotBase, ControlTemplate>(nameof(ZoomRectangleTemplate));
  43. /// <summary>
  44. /// Identifies the <see cref="ZoomVerticalCursor"/> dependency property.
  45. /// </summary>
  46. public static readonly StyledProperty<Cursor> ZoomVerticalCursorProperty = AvaloniaProperty.Register<PlotBase, Cursor>(nameof(ZoomVerticalCursor), new Cursor(StandardCursorType.SizeNorthSouth));
  47. static PlotBase()
  48. {
  49. }
  50. /// <summary>
  51. /// Gets or sets the default tracker template.
  52. /// </summary>
  53. public ControlTemplate DefaultTrackerTemplate
  54. {
  55. get
  56. {
  57. return GetValue(DefaultTrackerTemplateProperty);
  58. }
  59. set
  60. {
  61. SetValue(DefaultTrackerTemplateProperty, value);
  62. }
  63. }
  64. /// <summary>
  65. /// Gets or sets a value indicating whether IsMouseWheelEnabled.
  66. /// </summary>
  67. public bool IsMouseWheelEnabled
  68. {
  69. get
  70. {
  71. return GetValue(IsMouseWheelEnabledProperty);
  72. }
  73. set
  74. {
  75. SetValue(IsMouseWheelEnabledProperty, value);
  76. }
  77. }
  78. /// <summary>
  79. /// Gets or sets the pan cursor.
  80. /// </summary>
  81. /// <value>The pan cursor.</value>
  82. public Cursor PanCursor
  83. {
  84. get
  85. {
  86. return GetValue(PanCursorProperty);
  87. }
  88. set
  89. {
  90. SetValue(PanCursorProperty, value);
  91. }
  92. }
  93. /// <summary>
  94. /// Gets or sets the horizontal zoom cursor.
  95. /// </summary>
  96. /// <value>The zoom horizontal cursor.</value>
  97. public Cursor ZoomHorizontalCursor
  98. {
  99. get
  100. {
  101. return GetValue(ZoomHorizontalCursorProperty);
  102. }
  103. set
  104. {
  105. SetValue(ZoomHorizontalCursorProperty, value);
  106. }
  107. }
  108. /// <summary>
  109. /// Gets or sets the rectangle zoom cursor.
  110. /// </summary>
  111. /// <value>The zoom rectangle cursor.</value>
  112. public Cursor ZoomRectangleCursor
  113. {
  114. get
  115. {
  116. return GetValue(ZoomRectangleCursorProperty);
  117. }
  118. set
  119. {
  120. SetValue(ZoomRectangleCursorProperty, value);
  121. }
  122. }
  123. /// <summary>
  124. /// Gets or sets the zoom rectangle template.
  125. /// </summary>
  126. /// <value>The zoom rectangle template.</value>
  127. public ControlTemplate ZoomRectangleTemplate
  128. {
  129. get
  130. {
  131. return GetValue(ZoomRectangleTemplateProperty);
  132. }
  133. set
  134. {
  135. SetValue(ZoomRectangleTemplateProperty, value);
  136. }
  137. }
  138. /// <summary>
  139. /// Gets or sets the vertical zoom cursor.
  140. /// </summary>
  141. /// <value>The zoom vertical cursor.</value>
  142. public Cursor ZoomVerticalCursor
  143. {
  144. get
  145. {
  146. return GetValue(ZoomVerticalCursorProperty);
  147. }
  148. set
  149. {
  150. SetValue(ZoomVerticalCursorProperty, value);
  151. }
  152. }
  153. }
  154. }