コード例 #1
0
 // Methods
 public static ContentLayer CloneLayer(ContentLayer layer)
 {
     using (MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(XamlWriter.Save(layer)), false))
     {
         return(XamlReader.Load(stream) as ContentLayer);
     }
 }
コード例 #2
0
        public DirectContent(iTextSharp.Utility utility, ContentLayer layer)
        {
            _eachDirectOpertions = new List <IDirectOpertion>();

            ContentLayer = layer;

            _utility         = utility;
            _utility.OnSave += _utility_OnSave;
        }
コード例 #3
0
 public SkeletonLayer(SkeletonType type, UIColor[] colors, UIView holder)
 {
     SkeletonType             = type;
     _weakRefHolder           = new WeakReference <UIView>(holder);
     ContentLayer             = type.GetLayer();
     ContentLayer.AnchorPoint = CGPoint.Empty;
     ContentLayer.Bounds      = holder.MaxBoundsEstimated();
     AddMultilinesIfNeeded();
     ContentLayer.Tint(colors);
 }
コード例 #4
0
        private RadSize MeasureCell(GridCellModel cell)
        {
            ContentLayer layer = this.GetContentLayerForColumn(cell.Column);

            // TODO: consider if content needs to be measured with constraint in stretch mode.
            var availableWidth = cell.Column.SizeMode == DataGridColumnSizeMode.Fixed ? cell.Column.Width : double.PositiveInfinity;

            RadSize size = GridModel.DoubleArithmetics.Ceiling(layer.MeasureCell(cell, availableWidth).ToRadSize());

            if (this.HasHorizontalGridLines && !this.decorationLayerCache.IsFirstLine(cell.ParentRow.ItemInfo))
            {
                size.Height += this.GridLinesThickness;
            }
            if (this.HasVerticalGridLines)
            {
                size.Width += this.GridLinesThickness;
            }

            cell.DesiredSize      = size;
            cell.Column.AutoWidth = Math.Max(cell.Column.AutoWidth, size.Width);

            return(cell.DesiredSize);
        }
コード例 #5
0
        private void UpdateLayersOnTemplateApplied()
        {
            // ensure the default XamlContentLayer
            if (this.contentLayers.Count == 0)
            {
                this.contentLayers.Add(new XamlContentLayer());
            }
            foreach (var layer in this.contentLayers)
            {
                this.AddLayer(layer, this.cellsPanel);
            }

            this.editRowLayer = new GridEditRowLayer();

            this.AddLayer(this.EditRowLayer, this.ContentLayers[0].VisualElement as Panel);

            // ensure the default XamlDecorator layer
            if (this.decorationLayerCache == null)
            {
                this.DecorationLayer = new XamlDecorationLayer();
            }

            this.AddLayer(this.decorationLayerCache, this.decorationsHost);

            if (this.frozenDecorationLayer == null)
            {
                // ensure the frozen XamlDecorator layer
                this.frozenDecorationLayer = new XamlDecorationLayer();
                this.frozenLineDecorationsPresenter.Owner = this.frozenDecorationLayer;
            }

            this.AddLayer(this.frozenDecorationLayer, this.FrozenDecorationsHost);

            // ensure the default XamlSelection layer
            if (this.selectionLayerCache == null)
            {
                this.selectionLayerCache = new XamlSelectionLayer();
                this.selectionDecorationsPresenter.Owner = this.selectionLayerCache;
            }

            this.AddLayer(this.selectionLayerCache, this.decorationsHost);

            if (this.frozenSelectionLayerCache == null)
            {
                this.frozenSelectionLayerCache = new XamlSelectionLayer();
                this.frozenSelectionDecorationsPresenter.Owner = this.frozenSelectionLayerCache;
            }

            this.AddLayer(this.frozenSelectionLayerCache, this.FrozenDecorationsHost);

            // ensure the default XamlVisualState layer
            if (this.visualStateLayerCache == null)
            {
                this.visualStateLayerCache = new XamlVisualStateLayer();
            }

            this.AddLayer(this.visualStateLayerCache, this.decorationsHost);

            if (this.dragAdornerLayerCache == null)
            {
                this.dragAdornerLayerCache = new XamlDragAdornerLayer();
            }

            if (this.frozenVisualStateLayerCache == null)
            {
                this.frozenVisualStateLayerCache = new XamlVisualStateLayer();
            }

            this.AddLayer(this.frozenVisualStateLayerCache, this.FrozenDecorationsHost);

            this.AddLayer(this.dragAdornerLayerCache, this.adornerHostPanel);

            if (this.overlayAdornerLayerCache == null)
            {
                this.overlayAdornerLayerCache = new XamlOverlayAdornerLayer();

                this.visualStateService.RegisterDataLoadingListener(this.overlayAdornerLayerCache);
            }

            this.AddLayer(this.overlayAdornerLayerCache, this.adornerHostPanel);

            if (this.scrolalbleAdornerLayerCache == null)
            {
                this.scrolalbleAdornerLayerCache = new XamlScrollableAdornerLayer();
            }

            this.AddLayer(this.scrolalbleAdornerLayerCache, this.scrollableAdornerHostPanel);

            if (this.FrozenColumnsContentLayer == null)
            {
                this.FrozenColumnsContentLayer = new XamlContentLayer();
            }

            this.AddLayer(this.FrozenColumnsContentLayer, this.frozenColumnsHost);

            if (this.GroupHeadersContentLayer == null)
            {
                this.GroupHeadersContentLayer = new XamlContentLayer();
            }

            this.AddLayer(this.GroupHeadersContentLayer, this.GroupHeadersHost);

            this.frozenEditRowLayer = new GridEditRowLayer();

            this.AddLayer(this.FrozenEditRowLayer, this.FrozenColumnsContentLayer.VisualElement as Panel);
        }