From 5f63fe037ef94f0ac023a369d2366cbfd8a8edc6 Mon Sep 17 00:00:00 2001 From: noberumotto Date: Thu, 24 Nov 2022 02:53:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=97=E8=A1=A8=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UI/Controls/Charts/Charts.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/UI/Controls/Charts/Charts.cs b/UI/Controls/Charts/Charts.cs index eafc644..c76ccf2 100644 --- a/UI/Controls/Charts/Charts.cs +++ b/UI/Controls/Charts/Charts.cs @@ -571,13 +571,16 @@ public override void OnApplyTemplate() Render(); } - var parent = VisualTreeHelper.GetParent(this); - while (!(parent is System.Windows.Window)) + if (ChartsType == ChartsType.HorizontalA && IsSearch) { - parent = VisualTreeHelper.GetParent(parent); + var parent = VisualTreeHelper.GetParent(this); + while (!(parent is System.Windows.Window)) + { + parent = VisualTreeHelper.GetParent(parent); + } + var page = parent as System.Windows.Window; + page.SizeChanged += Page_SizeChanged; } - var page = parent as System.Windows.Window; - page.SizeChanged += Page_SizeChanged; } private void _typeColumnCanvas_SizeChanged(object sender, SizeChangedEventArgs e) @@ -1193,7 +1196,7 @@ private void RenderColumnStyle() colValueRect.Height = value / maxValue * canvasHeight; colValueRect.Fill = UI.Base.Color.Colors.GetFromString(colColor); colValueRect.RadiusX = 4; - colValueRect.RadiusY= 4; + colValueRect.RadiusY = 4; Canvas.SetLeft(colValueRect, i * columnBorderWidth + margin); Canvas.SetBottom(colValueRect, colNameHeight);