Ejemplo n.º 1
0
        private void tabitem_LostFocus(object sender, RoutedEventArgs e)
        {
            TabItem ti = sender as TabItem;

            if (ti == null)
            {
                return;
            }

            TextBox ti_input = ti.Tag as TextBox;

            if (ti_input == null)
            {
                return;
            }

            ti_input.IsEnabled = false;

            // synchronize table axis values in all tabs
            MValueField2DInput ti_table = ti.Content as MValueField2DInput;

            if (ti_table == null)
            {
                return;
            }
            ti_table.SetAxisValues();
        }
Ejemplo n.º 2
0
        public void FillInfoCellsFromExisting(List <double> _xs, List <double> _ys, List <double> _zs)
        {
            if (this.tables == null || this.tables.Count < 1 || _xs == null || _ys == null || _zs == null)
            {
                return;
            }

            // x, y
            MValueField2DInput table_0 = this.tables[0];

            if (table_0 == null)
            {
                return;
            }

            List <double> ys = (_ys.Count == 0) ? new List <double> {
                0.0
            } : _ys;

            table_0.ApplyAxisValues(new TableAxisValues(_xs, ys));
            table_0.SetAxisValues();

            // z (number of tables has to be set before this method is called)
            for (int i = 0; i < this.Items.Count; i++)
            {
                if (i > _zs.Count - 1)
                {
                    continue;
                }

                TabItem ti = this.Items[i] as TabItem;
                if (ti == null)
                {
                    continue;
                }

                TextBox ti_input = ti.Tag as TextBox;
                if (ti_input == null)
                {
                    continue;
                }

                ti_input.Text = _zs[i].ToString();
            }
        }