private void table_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            MValueField2DInfo table = sender as MValueField2DInfo;

            if (table == null || e == null)
            {
                return;
            }

            if (e.PropertyName == "MarkSet")
            {
                if (!(table.Tag is int))
                {
                    return;
                }
                int table_index = (int)table.Tag;

                // delete mark from all other tables
                for (int i = 0; i < this.tables.Count; i++)
                {
                    if (i == table_index)
                    {
                        continue;
                    }
                    this.tables[i].DeleteMark();
                }

                this.MarkTab(table_index);
            }
        }
예제 #2
0
        private static void DataFieldPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            MValueField2DInfo instance = d as MValueField2DInfo;

            if (instance == null)
            {
                return;
            }
            if (instance.DataField == null)
            {
                return;
            }

            instance.UnitX = instance.DataField.MVUnitX;
            instance.UnitY = instance.DataField.MVUnitY;
            instance.ResetGrid();
            instance.RecalculateTableSizes(instance.DataField.NrX, instance.DataField.NrY);
            instance.RedefineTableGrid();

            if (instance.DataField.NrX == 0)
            {
                instance.xs = new List <double> {
                    0.0
                }
            }
            ;
            else
            {
                instance.xs = new List <double>(instance.DataField.Xs);
            }
            if (instance.DataField.NrY == 0)
            {
                instance.ys = new List <double> {
                    0.0
                }
            }
            ;
            else
            {
                instance.ys = new List <double>(instance.DataField.Ys);
            }

            instance.LoadDataPoints();
            instance.SetUnitLabels();
            instance.FillInfoCells();
            instance.FillDataCells();

            instance.Loaded += instance.on_Loaded;
        }
        private void PopulateTabITem(int _tag, ref TabItem tab_item)
        {
            if (tab_item == null)
            {
                return;
            }

            MValueField2DInfo table = new MValueField2DInfo();

            table.Width  = this.Width - 8;
            table.Height = this.Height - 8;
            table.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
            table.VerticalAlignment   = System.Windows.VerticalAlignment.Center;
            table.Depth               = _tag;
            table.DataField           = this.DataField;
            table.Tag                 = _tag;
            table.ShowGridLines       = false;
            table.SnapsToDevicePixels = true;
            table.PropertyChanged    += table_PropertyChanged;
            tab_item.Content          = table;

            this.tables.Add(table);
        }