예제 #1
0
        /// <summary>Called when this element got added to the DOM.</summary>
        internal override void AddedToDOM()
        {
            Css.ReflowDocument doc = document as Css.ReflowDocument;

            if (doc != null)
            {
                if (doc.AttributeIndex != null)
                {
                    // Index element if needed:
                    AddToAttributeLookups();
                }

                // Make sure the stylesheet is present:
                doc.RequireStyleSheet(this);
            }

            // Update its css by telling it the parent changed.
            // This affects inherit, height/width etc.
            Style.Computed.ParentChanged();

            if (doc != null)
            {
                // Request a layout:
                doc.RequestLayout();
            }
        }
예제 #2
0
        internal override void AddedToDOM()
        {
            Css.ReflowDocument doc = document as Css.ReflowDocument;

            if (doc != null)
            {
                if (doc.AttributeIndex != null)
                {
                    // Index element if needed:
                    AddToAttributeLookups();
                }

                // Make sure the stylesheet is present:
                doc.RequireStyleSheet(this);
            }

            // Update its css by telling it the parent changed.
            // This affects inherit, height/width etc.
            Style.Computed.ParentChanged();

            // Obtain the render context:
            SVGElement svgParent = (parentNode as SVGElement);

            if (svgParent != null)
            {
                if (Context == null)
                {
                    // Get the context:
                    Context = svgParent.Context;
                }

                if (Context != null)
                {
                    // Request a rebuild:
                    Context.RequestRebuild();
                }
            }
        }