Exemplo n.º 1
0
        private void Viewport_PropertyChanged(object sender, ExtendedPropertyChangedEventArgs e)
        {
            if (e.PropertyName == "Visible")
            {
                DataRect currVisible = (DataRect)e.NewValue;
                if (increasedVisible.Contains(currVisible))
                {
                    var increasedSquare = increasedVisible.GetSquare();
                    if (increasedSquare > 0)
                    {
                        var squareRatio = increasedSquare / currVisible.GetSquare();
                        if (2 < squareRatio && squareRatio < 6)
                        {
                            // keeping old value of increasedVisible
                            return;
                        }
                    }
                }

                increasedVisible = currVisible.ZoomOutFromCenter(2.0);
                chart.OnReset();
            }
            else if (e.PropertyName == "Output")
            {
                chart.OnReset();
            }
        }