/// <summary>
        /// Adds a child at the given index.
        /// </summary>
        /// <param name="parent">The parent view.</param>
        /// <param name="child">The child view.</param>
        /// <param name="index">The index.</param>
        public void AddView(DependencyObject parent, DependencyObject child, int index)
        {
            var span = (Span)parent;

            var inlineChild = child as Inline;

            if (inlineChild == null)
            {
                inlineChild = new InlineUIContainer
                {
                    Child = (UIElement)child,
                };
            }

#if WINDOWS_UWP
            span.Inlines.Insert(index, inlineChild);

            var parentUIElement = AccessibilityHelper.GetParentElementFromTextElement(span);
            if (parentUIElement != null)
            {
                AccessibilityHelper.OnChildAdded(parentUIElement, child);
            }
#else
            ((IList)span.Inlines).Insert(index, inlineChild);
#endif
        }
        /// <summary>
        /// Removes all children from the view parent.
        /// </summary>
        /// <param name="parent">The view parent.</param>
        public void RemoveAllChildren(DependencyObject parent)
        {
            var span = (Span)parent;

            span.Inlines.Clear();
#if WINDOWS_UWP
            var parentUIElement = AccessibilityHelper.GetParentElementFromTextElement(span);
            if (parentUIElement != null)
            {
                AccessibilityHelper.OnChildRemoved(parentUIElement);
            }
#endif
        }
        /// <summary>
        /// Removes the child at the given index.
        /// </summary>
        /// <param name="parent">The view parent.</param>
        /// <param name="index">The index.</param>
        public void RemoveChildAt(DependencyObject parent, int index)
        {
            var span = (Span)parent;

#if WINDOWS_UWP
            span.Inlines.RemoveAt(index);

            var parentUIElement = AccessibilityHelper.GetParentElementFromTextElement(span);
            if (parentUIElement != null)
            {
                AccessibilityHelper.OnChildRemoved(parentUIElement);
            }
#else
            ((IList)span.Inlines).RemoveAt(index);
#endif
        }