示例#1
0
        /// <summary>
        /// Draws the borders around a given output grid
        /// </summary>
        /// <param name="strataValue">
        /// The strata value to which this grid cell belongs; used to search the list of grids and
        /// return the proper System.Windows.Controls.Grid for text insertion.
        /// </param>
        protected virtual void DrawOutputGridBorders(string strataValue)
        {
            Grid grid = GetStrataGrid(strataValue);

            object el = FindName("waitPanel");

            if (el is GadgetWaitPanel)
            {
                GadgetWaitPanel waitPanel = el as GadgetWaitPanel;
                waitPanel.Visibility = System.Windows.Visibility.Collapsed;
            }

            int rdcount = 0;

            foreach (RowDefinition rd in grid.RowDefinitions)
            {
                int cdcount = 0;
                foreach (ColumnDefinition cd in grid.ColumnDefinitions)
                {
                    Border border = new Border();
                    border.Style = this.Resources["gridCellBorder"] as Style;

                    if (rdcount == 0)
                    {
                        border.BorderThickness = new Thickness(border.BorderThickness.Left, border.BorderThickness.Bottom, border.BorderThickness.Right, border.BorderThickness.Bottom);
                    }
                    if (cdcount == 0)
                    {
                        border.BorderThickness = new Thickness(border.BorderThickness.Right, border.BorderThickness.Top, border.BorderThickness.Right, border.BorderThickness.Bottom);
                    }

                    Grid.SetRow(border, rdcount);
                    Grid.SetColumn(border, cdcount);
                    grid.Children.Add(border);
                    cdcount++;
                }
                rdcount++;
            }
        }
示例#2
0
        /// <summary>
        /// Adds a new row to a given output grid
        /// </summary>
        /// <param name="strataValue">
        /// The strata value to which this grid cell belongs; used to search the list of grids and
        /// return the proper System.Windows.Controls.Grid for text insertion.
        /// </param>
        /// <param name="height">The desired height of the grid row</param>
        protected virtual void AddGridRow(string strataValue, int height)
        {
            Grid grid = GetStrataGrid(strataValue);

            object el = FindName("waitPanel");

            if (el is GadgetWaitPanel)
            {
                GadgetWaitPanel waitPanel = el as GadgetWaitPanel;
                waitPanel.Visibility = System.Windows.Visibility.Collapsed;
            }
            grid.Visibility = Visibility.Visible;
            RowDefinition rowDef = new RowDefinition();

            if (height == -1)
            {
                rowDef.Height = GridLength.Auto;
            }
            else
            {
                rowDef.Height = new GridLength(height);
            }
            grid.RowDefinitions.Add(rowDef);
        }