Пример #1
0
        public DGDynamicFrame(MobileTableRow row, EbMobileTableLayout layout, bool isHeader = false)
        {
            IsHeader = isHeader;

            DynamicGrid = new DynamicGrid(layout);
            this.FillTableColums(row, layout.CellCollection);

            this.Content = DynamicGrid;
        }
        protected void Initialize(EbMobileVisualization viz)
        {
            DynamicGrid = new DynamicGrid(viz.DataLayout);
            DynamicGrid.SetSpacing(viz.RowSpacing, viz.ColumnSpacing);

            this.SetFrameStyle(viz);

            this.FillData(viz.DataLayout.CellCollection);

            if (viz.ShowLinkIcon && !this.IsHeader)
            {
                DynamicGrid.ShowLinkIcon();
            }
            this.Content = DynamicGrid;
        }
Пример #3
0
        private void FillTableColums(MobileTableRow row, List <EbMobileTableCell> CellCollection)
        {
            foreach (EbMobileTableCell cell in CellCollection)
            {
                if (cell.ControlCollection.Count > 0)
                {
                    EbMobileDataColumn column = (EbMobileDataColumn)cell.ControlCollection[0];

                    MobileTableColumn tableColumn = row[column.ColumnName];

                    if (tableColumn != null)
                    {
                        var value = tableColumn.DisplayValue ?? tableColumn.Value;

                        EbXLabel label = new EbXLabel(column)
                        {
                            Text              = value?.ToString(),
                            VerticalOptions   = LayoutOptions.FillAndExpand,
                            HorizontalOptions = LayoutOptions.FillAndExpand,
                            XBackgroundColor  = Color.Transparent
                        };
                        XViewExtensions.SetTextAlignment(label, column.HorrizontalTextAlign, column.VerticalTextAlign);

                        if (IsHeader)
                        {
                            label.FontFamily    = (OnPlatform <string>)HelperFunctions.GetResourceValue("Roboto-Medium");
                            label.LineBreakMode = LineBreakMode.WordWrap;
                        }
                        else
                        {
                            label.SetFont(column.Font, this.IsHeader);
                            label.SetTextWrap(column.TextWrap);
                        }

                        DynamicGrid.SetPosition(label, cell.RowIndex, cell.ColIndex, column.RowSpan, column.ColumnSpan);
                    }
                }
            }
        }