예제 #1
0
        /// <summary>
        /// Adds the content child
        /// </summary>
        /// <param name="child"></param>
        /// <param name="register"></param>
        override public void AddChild(ComponentAdapter child, bool register)
        {
            if (ContentChildren.Contains(child))
            {
                ContentChildren.Remove(child);
            }

            ContentChildren.Add(child);

            if (child.FactoryMode)
            {
                return;
            }

            if (!Instantiated || !DesignerState.IsPlaying) // not instantiated
            {
                return;
            }

            DoInstantiate(child, register);
        }
예제 #2
0
        /// <summary>
        /// Adds the content child at position
        /// </summary>
        /// <param name="index"></param>
        /// <param name="child"></param>
        /// <param name="register"></param>
        override public void AddChildAt(int index, ComponentAdapter child, bool register)
        {
            ContentChildren.Remove(child);

            if (ContentChildren.Count > 0)
            {
                throw new Exception("Only a single child is supported for Scroller");
            }

            ContentChildren.Add(child);

            if (child.FactoryMode)
            {
                return;
            }

            if (!Instantiated || !DesignerState.IsPlaying) // not instantiated
            {
                return;
            }

            DoInstantiate(child, register);
        }