Ejemplo n.º 1
0
        private async Task ResizeChart()
        {
            CommandHelper ch = new CommandHelper();

            await ch.RunBackgroundWorkerWithFlagHelperAsync(() => IsDrawing, async() =>
            {
                this.Dispatcher.Invoke(() =>
                {
                    //Filtering data based on the selection
                    try
                    {
                        drawingBackground.Visibility = Visibility.Visible;

                        chartCanvas.Children.Clear();
                        textCanvas.Children.RemoveRange(1, textCanvas.Children.Count - 1);
                        cs.AddTernaryChartStyle();

                        if (DataCollection != null)
                        {
                            if (DataCollection.Count > 0)
                            {
                                cs.SetLinesControl(new BindableCollection <LineSeries>(DataCollection));

                                lg.AddLegend(chartCanvas, new BindableCollection <LineSeries>(DataCollection));
                            }
                        }
                    }
                    catch
                    {
                    }
                    finally
                    {
                        drawingBackground.Visibility = Visibility.Hidden;
                    }
                });
            });
        }