ComponentFactory.Quicksilver.Layout.MetaElementCollection.this C# (CSharp) Method

this() public method

Gets or sets the UIElement stored at the zero-based index position of the collection.
public this ( int index ) : UIElement
index int The index position of the UIElement.
return UIElement
        public override UIElement this[int index]
        {
            get
            {
                if (_isItemsHost)
                    return base[index];
                else
                    return _externalChildren[index];
            }

            set
            {
                if (_isItemsHost)
                    base[index] = value;
                else
                {
                    if (_externalChildren[index] != value)
                    {
                        ValidateElement(value);
                        VerifyWriteAccess();

                        // Instruct the visual parent it must measure with the change in state
                        _visualParent.InvalidateMeasure();

                        // Actual elements are removed from internal collection once removed animation completes
                        OnUIElementsRemove(new UIElementsEventArgs(_externalChildren[index]));

                        // Update with the new value
                        _externalChildren[index] = value;

                        // Added event is always generated after the base call
                        OnUIElementsAdded(new UIElementsEventArgs(value));
                    }
                }
            }
        }