// -------------------------------------------------------------------------------------------------------------------- // // Copyright (c) 2020 OxyPlot contributors // // // Represents a tracker definition. // // -------------------------------------------------------------------------------------------------------------------- namespace OxyPlot.Wpf { using System.Windows; using System.Windows.Controls; /// /// Represents a tracker definition. /// /// The tracker definitions make it possible to show different trackers for different series. /// The property is matched with the /// in the TrackerDefinitions collection in the control. public class TrackerDefinition : DependencyObject { /// /// Identifies the dependency property. /// public static readonly DependencyProperty TrackerKeyProperty = DependencyProperty.Register( nameof(TrackerKey), typeof(string), typeof(TrackerDefinition), new PropertyMetadata(null)); /// /// Identifies the dependency property. /// public static readonly DependencyProperty TrackerTemplateProperty = DependencyProperty.Register( nameof(TrackerTemplate), typeof(ControlTemplate), typeof(TrackerDefinition), new PropertyMetadata(null)); /// /// Gets or sets the tracker key. /// /// The Plot will use this property to find the TrackerDefinition that matches the TrackerKey of the current series. public string TrackerKey { get => (string)this.GetValue(TrackerKeyProperty); set => this.SetValue(TrackerKeyProperty, value); } /// /// Gets or sets the tracker template. /// /// The tracker control will be added/removed from the Tracker overlay as necessary. /// The DataContext of the tracker will be set to a TrackerHitResult with the current tracker data. public ControlTemplate TrackerTemplate { get => (ControlTemplate)this.GetValue(TrackerTemplateProperty); set => this.SetValue(TrackerTemplateProperty, value); } } }