Пример #1
0
        public void InitLayer(double canvasWidth, double canvasHeight, double offsetX = 0, double offsetY = 0, EffectGraphType graphType = EffectGraphType.Shadow)
        {
            return;

            if (graphType == EffectGraphType.Shadow)
            {
                _eg = new ShadowEffectGraph();
            }
            else if (graphType == EffectGraphType.Glow)
            {
                _eg = new GlowEffectGraph();
            }

            ParentWidth  = canvasWidth - offsetX;
            ParentHeight = canvasHeight - offsetY;

            //x
            canvas = new CanvasControl();
            if (ShowGlowArea)
            {
                canvas.ClearColor = Windows.UI.Colors.CornflowerBlue;
            }
            canvas.Width  = ParentWidth + ExpandAmount;
            canvas.Height = ParentHeight + ExpandAmount;

            //if the control begins invisible or hidden then it will not have rendered its tree yet
            //we can only do this init if bkglayer exists, which means only after OnApplyTemplate
            //.. this is such a hack BUT it's a chicken and egg problem, sometimes the InitLayer gets
            //called too early :(
            if (_bkgLayer == null)
            {
                doDlayedInitBkgLayerLaterAfterOnApplyTemplate = true;
            }
            else
            {
                InitBkgLayer(offsetX, offsetY);
            }
        }
Пример #2
0
        public void InitLayer(double canvasWidth, double canvasHeight, double offsetX = 0, double offsetY = 0, EffectGraphType graphType = EffectGraphType.Shadow) {

            return;

            if(graphType == EffectGraphType.Shadow) _eg = new ShadowEffectGraph();
            else if (graphType == EffectGraphType.Glow) _eg = new GlowEffectGraph();

            ParentWidth = canvasWidth - offsetX;
            ParentHeight = canvasHeight - offsetY;

            //x    
            canvas = new CanvasControl();
            if (ShowGlowArea) canvas.ClearColor = Windows.UI.Colors.CornflowerBlue;
            canvas.Width = ParentWidth + ExpandAmount;
            canvas.Height = ParentHeight + ExpandAmount;

            //if the control begins invisible or hidden then it will not have rendered its tree yet 
            //we can only do this init if bkglayer exists, which means only after OnApplyTemplate
            //.. this is such a hack BUT it's a chicken and egg problem, sometimes the InitLayer gets
            //called too early :(
            if (_bkgLayer == null) doDlayedInitBkgLayerLaterAfterOnApplyTemplate = true;
            else InitBkgLayer(offsetX, offsetY);
        }