Example #1
0
        public TableViewModel(string title, TableProperty <double> table)
        {
            Title        = title;
            TableRows    = table.Rows;
            TableColumns = table.Columns;

            for (int r = 0; r < table.Rows; r++)
            {
                for (int c = 0; c < table.Columns; c++)
                {
                    var valueModel = new TableValueModel()
                    {
                        Row = r, Column = c, Value = table[r, c]
                    };
                    valueModel.OnChange += (int row, int column, double value) => {
                        if (OnChange != null)
                        {
                            OnChange(row, column, value, bInvalidateAll);
                        }
                    };
                    TextBoxTable.Add(valueModel);
                }
            }

            FloatSlider           = new SliderPlusViewModel <double>("SetAll", -10, 10, 0.1);
            FloatSlider.OnChange += FloatSlider_OnChange;
        }
Example #2
0
        public PropertyCtrlViewModel(string name, NumProperty <double> property)
        {
            Name            = name;
            IntSliderShow   = Visibility.Collapsed;
            FloatSliderShow = Visibility.Visible;
            ComboBoxShow    = Visibility.Collapsed;
            FileManagerShow = Visibility.Collapsed;
            TableViewShow   = Visibility.Collapsed;

            FloatSlider           = new SliderPlusViewModel <double>(Name, property.MinVal, property.MaxVal, 1);
            FloatSlider.SliderVal = property.Value;

            FloatSlider.OnChange += (double value) =>
            {
                property.Value = value;
                if (OnUpdateImg != null)
                {
                    OnUpdateImg(this);
                }
            };
        }