Exemplo n.º 1
0
        protected override void OnDisplayed(Row element, ElementDisplayedContext context)
        {
            var columnShapes = ((IEnumerable <dynamic>)context.ElementShape.Items).ToList();
            var columnIndex  = 0;

            foreach (var columnShape in columnShapes)
            {
                var column = (Column)columnShape.Element;

                if (column.Collapsible == true && IsEmpty(columnShape))
                {
                    columnShape.Collapsed = true;

                    // Get the first non-collapsed sibling column so we can increase its width with the width of the current column being collapsed.
                    var sibling = GetNonCollapsedSibling(columnShapes, columnIndex);
                    if (sibling != null)
                    {
                        // Increase the width of the sibling by the width of the current column.
                        sibling.Width += columnShape.Width;
                    }
                    else
                    {
                        // The row has only one column, which is collapsed, so we hide the row entirely.
                        context.ElementShape.Collapsed = true;
                    }
                }

                ++columnIndex;
            }
        }
 public virtual void Displayed(ElementDisplayedContext context)
 {
 }
Exemplo n.º 3
0
 public void Displayed(ElementDisplayedContext context)
 {
     OnDisplayed((TElement)context.Element, context);
 }
Exemplo n.º 4
0
 protected virtual void OnDisplayed(TElement element, ElementDisplayedContext context)
 {
 }
 void IElementEventHandler.Displayed(ElementDisplayedContext context)
 {
 }