Files
aistudio-wpf-diagram/Live-Charts-master/Examples/UWP/CartesianChart/CustomTooltipAndLegend/CustomersTooltip.xaml.cs
2021-07-23 09:42:22 +08:00

45 lines
1.2 KiB
C#

using LiveCharts;
using LiveCharts.Uwp;
using System.ComponentModel;
using Windows.UI.Xaml.Controls;
// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236
namespace UWP.CartesianChart.CustomTooltipAndLegend
{
public sealed partial class CustomersTooltip : IChartTooltip
{
private TooltipData _data;
public CustomersTooltip()
{
InitializeComponent();
//LiveCharts will inject the tooltip data in the Data property
//your job is only to display this data as required
DataContext = this;
}
public event PropertyChangedEventHandler PropertyChanged;
public TooltipData Data
{
get { return _data; }
set
{
_data = value;
OnPropertyChanged("Data");
}
}
public TooltipSelectionMode SelectionMode { get; set; }
public void OnPropertyChanged(string propertyName = null)
{
if (PropertyChanged != null)
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}