From 3b17e68842045463e6044936f4df79aeacb38dc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Rodr=C3=ADguez?= Date: Sat, 14 Dec 2024 20:18:24 -0600 Subject: [PATCH] initialize/dispose tooltips and legends from core. fixes a new issue introduced with the new changes, because the older versions of tooltips where disposed/created evetime the data changed, now tooltips are cached and only updated when necessary, we need to handle the creation/diposing when the control is loaded/disposed. --- src/LiveChartsCore/Chart.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/LiveChartsCore/Chart.cs b/src/LiveChartsCore/Chart.cs index 2d946671d..79faf262e 100644 --- a/src/LiveChartsCore/Chart.cs +++ b/src/LiveChartsCore/Chart.cs @@ -298,6 +298,8 @@ public virtual void Load() { IsLoaded = true; _isFirstDraw = true; + View.Tooltip = LiveCharts.DefaultSettings.GetTheme().DefaultTooltip(); + View.Legend = LiveCharts.DefaultSettings.GetTheme().DefaultLegend(); Update(); } @@ -307,6 +309,8 @@ public virtual void Load() public virtual void Unload() { IsLoaded = false; + View.Tooltip = null; + View.Legend = null; _everMeasuredElements.Clear(); _toDeleteElements.Clear(); _activePoints.Clear();