// -------------------------------------------------------------------------------------------------------------------- // // Copyright (c) 2020 OxyPlot contributors // // -------------------------------------------------------------------------------------------------------------------- namespace OxyPlot.Wpf { using System.Windows; using System.Windows.Controls; using System.Windows.Input; /// /// Base class for WPF PlotView implementations. /// public abstract partial class PlotViewBase { /// /// Identifies the dependency property. /// public static readonly DependencyProperty ControllerProperty = DependencyProperty.Register(nameof(Controller), typeof(IPlotController), typeof(PlotViewBase)); /// /// Identifies the dependency property. /// public static readonly DependencyProperty DefaultTrackerTemplateProperty = DependencyProperty.Register( nameof(DefaultTrackerTemplate), typeof(ControlTemplate), typeof(PlotViewBase), new PropertyMetadata(null)); /// /// Identifies the dependency property. /// public static readonly DependencyProperty IsMouseWheelEnabledProperty = DependencyProperty.Register(nameof(IsMouseWheelEnabled), typeof(bool), typeof(PlotViewBase), new PropertyMetadata(true)); /// /// Identifies the dependency property. /// public static readonly DependencyProperty ModelProperty = DependencyProperty.Register(nameof(Model), typeof(PlotModel), typeof(PlotViewBase), new PropertyMetadata(null, ModelChanged)); /// /// Identifies the dependency property. /// public static readonly DependencyProperty PanCursorProperty = DependencyProperty.Register( nameof(PanCursor), typeof(Cursor), typeof(PlotViewBase), new PropertyMetadata(Cursors.Hand)); /// /// Identifies the dependency property. /// public static readonly DependencyProperty ZoomHorizontalCursorProperty = DependencyProperty.Register( nameof(ZoomHorizontalCursor), typeof(Cursor), typeof(PlotViewBase), new PropertyMetadata(Cursors.SizeWE)); /// /// Identifies the dependency property. /// public static readonly DependencyProperty ZoomRectangleCursorProperty = DependencyProperty.Register( nameof(ZoomRectangleCursor), typeof(Cursor), typeof(PlotViewBase), new PropertyMetadata(Cursors.SizeNWSE)); /// /// Identifies the dependency property. /// public static readonly DependencyProperty ZoomRectangleTemplateProperty = DependencyProperty.Register( nameof(ZoomRectangleTemplate), typeof(ControlTemplate), typeof(PlotViewBase), new PropertyMetadata(null)); /// /// Identifies the dependency property. /// public static readonly DependencyProperty ZoomVerticalCursorProperty = DependencyProperty.Register( nameof(ZoomVerticalCursor), typeof(Cursor), typeof(PlotViewBase), new PropertyMetadata(Cursors.SizeNS)); /// /// Gets or sets the Plot controller. /// /// The Plot controller. public IPlotController Controller { get => (IPlotController)this.GetValue(ControllerProperty); set => this.SetValue(ControllerProperty, value); } /// /// Gets or sets the default tracker template. /// public ControlTemplate DefaultTrackerTemplate { get => (ControlTemplate)this.GetValue(DefaultTrackerTemplateProperty); set => this.SetValue(DefaultTrackerTemplateProperty, value); } /// /// Gets or sets a value indicating whether IsMouseWheelEnabled. /// public bool IsMouseWheelEnabled { get => (bool)this.GetValue(IsMouseWheelEnabledProperty); set => this.SetValue(IsMouseWheelEnabledProperty, value); } /// /// Gets or sets the model. /// /// The model. public PlotModel Model { get => (PlotModel)this.GetValue(ModelProperty); set => this.SetValue(ModelProperty, value); } /// /// Gets or sets the pan cursor. /// /// The pan cursor. public Cursor PanCursor { get => (Cursor)this.GetValue(PanCursorProperty); set => this.SetValue(PanCursorProperty, value); } /// /// Gets or sets the horizontal zoom cursor. /// /// The zoom horizontal cursor. public Cursor ZoomHorizontalCursor { get => (Cursor)this.GetValue(ZoomHorizontalCursorProperty); set => this.SetValue(ZoomHorizontalCursorProperty, value); } /// /// Gets or sets the rectangle zoom cursor. /// /// The zoom rectangle cursor. public Cursor ZoomRectangleCursor { get => (Cursor)this.GetValue(ZoomRectangleCursorProperty); set => this.SetValue(ZoomRectangleCursorProperty, value); } /// /// Gets or sets the zoom rectangle template. /// /// The zoom rectangle template. public ControlTemplate ZoomRectangleTemplate { get => (ControlTemplate)this.GetValue(ZoomRectangleTemplateProperty); set => this.SetValue(ZoomRectangleTemplateProperty, value); } /// /// Gets or sets the vertical zoom cursor. /// /// The zoom vertical cursor. public Cursor ZoomVerticalCursor { get => (Cursor)this.GetValue(ZoomVerticalCursorProperty); set => this.SetValue(ZoomVerticalCursorProperty, value); } } }