diff --git a/PipeGallery/Model/ColumnGroupInfo.cs b/PipeGallery/Model/ColumnGroupInfo.cs index 89a7b56..aa23ae8 100644 --- a/PipeGallery/Model/ColumnGroupInfo.cs +++ b/PipeGallery/Model/ColumnGroupInfo.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Linq; using System.Threading; -using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Threading; @@ -12,7 +11,6 @@ [Serializable] public class ColumnGroupInfo : ChartBase { - private List _columnListInfo = new List(); public List ColumnListInfo @@ -25,7 +23,8 @@ private double _maxy; private double _miny; - public override void DrawGeometricFigure(Canvas canvas, double maxy, double miny, CoordinatesInfoType coordinates) + public override void DrawGeometricFigure(Canvas canvas, double maxy, double miny, + CoordinatesInfoType coordinates) { _canvas = canvas; _maxy = maxy; @@ -41,26 +40,23 @@ //清空canvas _canvas.Children.Clear(); _canvas.Visibility = Visibility.Hidden; - /* 线程优化1 - System.Threading.ThreadStart start = delegate () + + ThreadStart start = delegate() { //Thread.Sleep(500); - App.Current.Dispatcher.BeginInvoke(new Action(() => - { - _canvas.Visibility = Visibility.Visible; - }), DispatcherPriority.Normal); + Application.Current.Dispatcher.BeginInvoke(new Action(() => { _canvas.Visibility = Visibility.Visible; }), + DispatcherPriority.Normal); }; - Thread t = new System.Threading.Thread(start); + Thread t = new Thread(start); t.IsBackground = true; t.Start(); - * */ - Task t = new Task(()=> { - App.Current.Dispatcher.BeginInvoke(new Action(() => - { - _canvas.Visibility = Visibility.Visible; - }), DispatcherPriority.Normal); - }); + // Task t = new Task(()=> { + // App.Current.Dispatcher.BeginInvoke(new Action(() => + // { + // _canvas.Visibility = Visibility.Visible; + // }), DispatcherPriority.Normal); + // }); //坐标轴的左边沿的X坐标点 double xs = 0; @@ -83,7 +79,6 @@ } } - public override double GetMaxValue() { double max = double.MinValue; @@ -113,8 +108,7 @@ if (min > tmpMin) min = tmpMin; } - return min; } } -} +} \ No newline at end of file