PlotViewBase.Properties.cs 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. // --------------------------------------------------------------------------------------------------------------------
  2. // <copyright file="PlotViewBase.Properties.cs" company="OxyPlot">
  3. // Copyright (c) 2020 OxyPlot contributors
  4. // </copyright>
  5. // --------------------------------------------------------------------------------------------------------------------
  6. namespace OxyPlot.Wpf
  7. {
  8. using System.Windows;
  9. using System.Windows.Controls;
  10. using System.Windows.Input;
  11. /// <summary>
  12. /// Base class for WPF PlotView implementations.
  13. /// </summary>
  14. public abstract partial class PlotViewBase
  15. {
  16. /// <summary>
  17. /// Identifies the <see cref="Controller"/> dependency property.
  18. /// </summary>
  19. public static readonly DependencyProperty ControllerProperty =
  20. DependencyProperty.Register(nameof(Controller), typeof(IPlotController), typeof(PlotViewBase));
  21. /// <summary>
  22. /// Identifies the <see cref="DefaultTrackerTemplate"/> dependency property.
  23. /// </summary>
  24. public static readonly DependencyProperty DefaultTrackerTemplateProperty =
  25. DependencyProperty.Register(
  26. nameof(DefaultTrackerTemplate), typeof(ControlTemplate), typeof(PlotViewBase), new PropertyMetadata(null));
  27. /// <summary>
  28. /// Identifies the <see cref="IsMouseWheelEnabled"/> dependency property.
  29. /// </summary>
  30. public static readonly DependencyProperty IsMouseWheelEnabledProperty =
  31. DependencyProperty.Register(nameof(IsMouseWheelEnabled), typeof(bool), typeof(PlotViewBase), new PropertyMetadata(true));
  32. /// <summary>
  33. /// Identifies the <see cref="Model"/> dependency property.
  34. /// </summary>
  35. public static readonly DependencyProperty ModelProperty =
  36. DependencyProperty.Register(nameof(Model), typeof(PlotModel), typeof(PlotViewBase), new PropertyMetadata(null, ModelChanged));
  37. /// <summary>
  38. /// Identifies the <see cref="PanCursor"/> dependency property.
  39. /// </summary>
  40. public static readonly DependencyProperty PanCursorProperty = DependencyProperty.Register(
  41. nameof(PanCursor), typeof(Cursor), typeof(PlotViewBase), new PropertyMetadata(Cursors.Hand));
  42. /// <summary>
  43. /// Identifies the <see cref="ZoomHorizontalCursor"/> dependency property.
  44. /// </summary>
  45. public static readonly DependencyProperty ZoomHorizontalCursorProperty =
  46. DependencyProperty.Register(
  47. nameof(ZoomHorizontalCursor), typeof(Cursor), typeof(PlotViewBase), new PropertyMetadata(Cursors.SizeWE));
  48. /// <summary>
  49. /// Identifies the <see cref="ZoomRectangleCursor"/> dependency property.
  50. /// </summary>
  51. public static readonly DependencyProperty ZoomRectangleCursorProperty =
  52. DependencyProperty.Register(
  53. nameof(ZoomRectangleCursor), typeof(Cursor), typeof(PlotViewBase), new PropertyMetadata(Cursors.SizeNWSE));
  54. /// <summary>
  55. /// Identifies the <see cref="ZoomRectangleTemplate"/> dependency property.
  56. /// </summary>
  57. public static readonly DependencyProperty ZoomRectangleTemplateProperty =
  58. DependencyProperty.Register(
  59. nameof(ZoomRectangleTemplate), typeof(ControlTemplate), typeof(PlotViewBase), new PropertyMetadata(null));
  60. /// <summary>
  61. /// Identifies the <see cref="ZoomVerticalCursor"/> dependency property.
  62. /// </summary>
  63. public static readonly DependencyProperty ZoomVerticalCursorProperty =
  64. DependencyProperty.Register(
  65. nameof(ZoomVerticalCursor), typeof(Cursor), typeof(PlotViewBase), new PropertyMetadata(Cursors.SizeNS));
  66. /// <summary>
  67. /// Gets or sets the Plot controller.
  68. /// </summary>
  69. /// <value>The Plot controller.</value>
  70. public IPlotController Controller
  71. {
  72. get => (IPlotController)this.GetValue(ControllerProperty);
  73. set => this.SetValue(ControllerProperty, value);
  74. }
  75. /// <summary>
  76. /// Gets or sets the default tracker template.
  77. /// </summary>
  78. public ControlTemplate DefaultTrackerTemplate
  79. {
  80. get => (ControlTemplate)this.GetValue(DefaultTrackerTemplateProperty);
  81. set => this.SetValue(DefaultTrackerTemplateProperty, value);
  82. }
  83. /// <summary>
  84. /// Gets or sets a value indicating whether IsMouseWheelEnabled.
  85. /// </summary>
  86. public bool IsMouseWheelEnabled
  87. {
  88. get => (bool)this.GetValue(IsMouseWheelEnabledProperty);
  89. set => this.SetValue(IsMouseWheelEnabledProperty, value);
  90. }
  91. /// <summary>
  92. /// Gets or sets the model.
  93. /// </summary>
  94. /// <value>The model.</value>
  95. public PlotModel Model
  96. {
  97. get => (PlotModel)this.GetValue(ModelProperty);
  98. set => this.SetValue(ModelProperty, value);
  99. }
  100. /// <summary>
  101. /// Gets or sets the pan cursor.
  102. /// </summary>
  103. /// <value>The pan cursor.</value>
  104. public Cursor PanCursor
  105. {
  106. get => (Cursor)this.GetValue(PanCursorProperty);
  107. set => this.SetValue(PanCursorProperty, value);
  108. }
  109. /// <summary>
  110. /// Gets or sets the horizontal zoom cursor.
  111. /// </summary>
  112. /// <value>The zoom horizontal cursor.</value>
  113. public Cursor ZoomHorizontalCursor
  114. {
  115. get => (Cursor)this.GetValue(ZoomHorizontalCursorProperty);
  116. set => this.SetValue(ZoomHorizontalCursorProperty, value);
  117. }
  118. /// <summary>
  119. /// Gets or sets the rectangle zoom cursor.
  120. /// </summary>
  121. /// <value>The zoom rectangle cursor.</value>
  122. public Cursor ZoomRectangleCursor
  123. {
  124. get => (Cursor)this.GetValue(ZoomRectangleCursorProperty);
  125. set => this.SetValue(ZoomRectangleCursorProperty, value);
  126. }
  127. /// <summary>
  128. /// Gets or sets the zoom rectangle template.
  129. /// </summary>
  130. /// <value>The zoom rectangle template.</value>
  131. public ControlTemplate ZoomRectangleTemplate
  132. {
  133. get => (ControlTemplate)this.GetValue(ZoomRectangleTemplateProperty);
  134. set => this.SetValue(ZoomRectangleTemplateProperty, value);
  135. }
  136. /// <summary>
  137. /// Gets or sets the vertical zoom cursor.
  138. /// </summary>
  139. /// <value>The zoom vertical cursor.</value>
  140. public Cursor ZoomVerticalCursor
  141. {
  142. get => (Cursor)this.GetValue(ZoomVerticalCursorProperty);
  143. set => this.SetValue(ZoomVerticalCursorProperty, value);
  144. }
  145. }
  146. }