public static void ShowViewer(Points2DCollectionsViewer view)
        {
            OpenedView.Add(view);
            Task t = Task.Factory.StartNew(() => view.ShowDialog());

            while (view.RenderFinish == false)
            {
                Thread.Sleep(100);
            }
        }
        public static Points2DCollectionsViewer BuildViewer(IEnumerable <Point2D> PointsWithTag, string Title, int min, int max)
        {
            Points2DCollectionsViewer viewer = new Points2DCollectionsViewer();

            viewer.Text = Title;

            var model = new PlotModel {
                Title = viewer.Text
            };
            var scatterSeries = new ScatterSeries {
                MarkerType = MarkerType.Circle
            };

            foreach (var point in PointsWithTag)
            {
                scatterSeries.Points.Add(new ScatterPoint(point.x, point.y, 2, TagToValue(point.Tag)));
            }

            model.Series.Add(scatterSeries);
            model.Axes.Add(new LinearColorAxis {
                Position = AxisPosition.Right, Palette = OxyPalettes.Rainbow(TagToValueDict.Count() + 1)
            });

            model.Axes.Add(new LinearAxis()
            {
                Minimum = min, Maximum = max, Position = AxisPosition.Bottom
            });
            model.Axes.Add(new LinearAxis()
            {
                Minimum = min, Maximum = max, Position = AxisPosition.Left
            });


            viewer.plotView.Model = model;

            return(viewer);
        }