Esempio n. 1
0
        private void SelectBoxes(Point location)
        {
            this.currentColumnIndex = -1;
            this.currentRowIndex    = -1;

            foreach (LightVisualElement element in this.uniformGrid.Children)
            {
                RectangleF elementBounds = element.ControlBoundingRectangle;

                if (elementBounds.X <= location.X &&
                    elementBounds.Y <= location.Y)
                {
                    int columnIndex = UniformGrid.GetColumnIndex(element);
                    int rowIndex    = UniformGrid.GetRowIndex(element);

                    currentColumnIndex = Math.Max(currentColumnIndex, columnIndex);
                    currentRowIndex    = Math.Max(currentRowIndex, rowIndex);

                    element.BorderColor      = Color.DarkOrange;
                    element.BorderInnerColor = Color.OrangeRed;
                }
                else
                {
                    element.ResetValue(LightVisualElement.BorderColorProperty, ValueResetFlags.Local);
                    element.ResetValue(LightVisualElement.BorderInnerColorProperty, ValueResetFlags.Local);
                }
            }

            string text = RadMenuInsertTableItem.HeaderText;

            if (currentColumnIndex >= 0 && currentRowIndex >= 0)
            {
                text = String.Format("{0}x{1}", currentColumnIndex + 1, currentRowIndex + 1);
            }

            this.header.Text = text;
        }