コード例 #1
0
        /// <summary>Called when this element got removed from the DOM.</summary>
        internal override void RemovedFromDOM()
        {
            Css.ReflowDocument reflowDocument = document as Css.ReflowDocument;

            if (reflowDocument.AttributeIndex != null)
            {
                // Remove this from the DOM attribute cache:
                reflowDocument.RemoveCachedElement(this);
            }

            // Remove handler:
            // OnRemovedFromDOM();

            // Let the style know we went offscreen:
            RenderableData renderable = RenderData;

            renderable.WentOffScreen();

            // Apply to all virtual elements:
            VirtualElements virts = renderable.Virtuals;

            if (virts != null)
            {
                foreach (KeyValuePair <int, Node> kvp in virts.Elements)
                {
                    // Remove it:
                    kvp.Value.RemovedFromDOM();
                }
            }

            base.RemovedFromDOM();

            // Request a layout:
            reflowDocument.RequestLayout();
        }
コード例 #2
0
        /// <summary>Called when this element goes offscreen.</summary>
        public void WentOffScreen()
        {
            RenderableData renderable = RenderData;

            renderable.WentOffScreen();

            // Apply to all virtual elements:
            VirtualElements virts = renderable.Virtuals;

            if (virts != null)
            {
                foreach (KeyValuePair <int, Node> kvp in virts.Elements)
                {
                    // Tell it that it's gone offscreen:
                    IRenderableNode irn = (kvp.Value as IRenderableNode);

                    if (irn != null)
                    {
                        irn.WentOffScreen();
                    }
                }
            }

            if (childNodes_ != null)
            {
                for (int i = 0; i < childNodes_.length; i++)
                {
                    // Get as a HTML node:
                    IRenderableNode htmlNode = (childNodes_[i] as IRenderableNode);

                    if (htmlNode == null)
                    {
                        return;
                    }

                    // Call offscreen:
                    htmlNode.WentOffScreen();
                }
            }
        }