Exemplo n.º 1
0
        public SeriesSettings()
        {
            InitializeComponent();
            _initialized = true;

            SeriesType.ItemsSource = new[]
            {
                new SeriesInformation(typeof(ColumnSeries), null, typeof(CategoryAxis),
                                      AxisOrientation.X, typeof(LinearAxis),
                                      AxisOrientation.Y),
                new SeriesInformation(typeof(BarSeries), null, typeof(CategoryAxis),
                                      AxisOrientation.Y, typeof(LinearAxis),
                                      AxisOrientation.X),
                new SeriesInformation(typeof(PieSeries), null, null, null, null, null),
                new SeriesInformation(typeof(LineSeries), "", typeof(LinearAxis),
                                      AxisOrientation.X, typeof(LinearAxis),
                                      AxisOrientation.Y),
                new SeriesInformation(typeof(AreaSeries), "", typeof(LinearAxis),
                                      AxisOrientation.X, typeof(LinearAxis),
                                      AxisOrientation.Y),
                new SeriesInformation(typeof(ScatterSeries), "", typeof(LinearAxis),
                                      AxisOrientation.X, typeof(LinearAxis),
                                      AxisOrientation.Y),
                new SeriesInformation(typeof(BubbleSeries), "", typeof(LinearAxis),
                                      AxisOrientation.X, typeof(LinearAxis),
                                      AxisOrientation.Y),
            };
            SeriesType.SelectedIndex = 0;
            ValueSource.ItemsSource  = new[]
            {
                new ValueInformation(ValueType.AutomaticDoubles, "Automatic Doubles"),
                new ValueInformation(ValueType.ManualDoubles, "Manual Doubles"),
                new ValueInformation(ValueType.ManualPairs, "Manual Pairs"),
            };
            ValueSource.SelectedIndex = 0;
            for (int i = 0; i < 8; i++)
            {
                var valueTextBox = new DualTextBox
                {
                    TextA     = string.Format(CultureInfo.CurrentCulture, "Value {0}", i + 1),
                    TextB     = (i + 1).ToString(CultureInfo.CurrentCulture),
                    IsChecked = true,
                    Tag       = i
                };
                valueTextBox.CheckedChanged += ValueTextBox_CheckedChanged;
                valueTextBox.TextChanged    += ValueTextBox_TextChanged;
                ValueContainer.Children.Insert(i, valueTextBox);
            }
            IndependentAxisSettings.SettingsChanged += ValueChanged_UpdateProperties;
            DependentAxisSettings.SettingsChanged   += ValueChanged_UpdateProperties;

            UpdateCollection();
        }
Exemplo n.º 2
0
        private int CurrentIndex(DualTextBox valueTextBox)
        {
            int index = 0;

            foreach (DualTextBox element in GetValueContainerDualTextBoxes())
            {
                if (element == valueTextBox)
                {
                    break;
                }
                if (0 <= (int)element.Tag)
                {
                    index++;
                }
            }
            return(index);
        }