Пример #1
0
        private void InsertTableCellsWhereNeeded()
        {
            List <Point> cells = GetEmptyCells();

            Table.BeginLayoutUpdate();
            foreach (Point cell in cells)
            {
                Control view = new LayoutViewItemPanel(cell);

                if (view is LayoutViewItemPanel)
                {
                    LayoutViewItemPanel v = (LayoutViewItemPanel)view;

                    /// Define selection behavior...
                    v.OnHighlightStateChanged += (sender, e) =>
                    {
                        if (e.Highlighted)
                        {
                            ToolbarSelectCell(sender);
                        }
                        else
                        {
                            ToolbarDeselectCell(sender);
                        }
                    };
                }

                Table.Controls.Add(view, cell.X, cell.Y);
            }
            Table.EndLayoutUpdate();
            Table.Invalidate();
        }
Пример #2
0
 private void ToolbarSelectCell(object sender)
 {
     /// Setzt für das "LayoutViewItemPanel" daten...
     if (sender is LayoutViewItemPanel)
     {
         LayoutViewItemPanel view = sender as LayoutViewItemPanel;
         if (view != null)
         {
             lblCell.Text = string.Format("Layout:\"{0}\" | X:\"{1}\" | Y:\"{2}\"", view.GetType().Name, view.GetCellPosition().X, view.GetCellPosition().Y);
         }
     }
 }