Example #1
0
        void IViewParentManager.RemoveAllChildren(DependencyObject parent)
        {
            var element = (TFrameworkElement)parent;

            RemoveAllChildren(element);
#if WINDOWS_UWP
            AccessibilityHelper.OnChildRemoved(element);
#endif
        }
Example #2
0
        void IViewParentManager.RemoveChildAt(object parent, int index)
        {
            var element = (TFrameworkElement)parent;

            RemoveChildAt((TFrameworkElement)parent, index);
#if WINDOWS_UWP
            AccessibilityHelper.OnChildRemoved(element);
#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
        }