Пример #1
0
        private void table_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            MValueFunct2DInfo table = sender as MValueFunct2DInfo;

            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)
        {
            MValueFunct2DInfo instance = d as MValueFunct2DInfo;

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

            instance.UnitX = instance.DataField.MVUnitX;
            instance.UnitY = instance.DataField.MVUnitY;

            // fill in the function graphs
            for (int i = 0; i < instance.DataField.Graphs.Count; i++)
            {
                List <Point3D> funct = instance.DataField.Graphs[i];
                string         name  = instance.DataField.Graph_Names[i];
                if (funct != null && funct.Count >= 2 && funct[0].Z == instance.Depth)
                {
                    instance.polylines.Add(funct);
                    instance.polylines_names.Add(name);
                }
            }

            // set the bounds -> triggers rescaling and redrawing of all functions
            instance.Bounds = new Point4D(instance.DataField.MinX, instance.DataField.MaxX,
                                          instance.DataField.MinY, instance.DataField.MaxY);
        }
Пример #3
0
        private void PopulateTabITem(int _tag, ref TabItem tab_item)
        {
            if (tab_item == null)
            {
                return;
            }

            MValueFunct2DInfo table = new MValueFunct2DInfo();

            table.Width  = this.Width - 8;
            table.Height = this.Height - 24;
            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);
        }