Ejemplo n.º 1
0
        /// <summary>
        /// Loads/Reloads the WPF visual tree to <see cref="SkiaTree"/>.
        /// </summary>
        protected void ReloadVisualTree()
        {
            SkiaTree    = SkiaTree.LoadTree(_host.Child);
            _containers = new List <BindingEventContainer>();

            _bindingThrottlers.ToList().ForEach(x => x.Value.Dispose());
            _bindingThrottlers.Clear();

            InitElement(SkiaTree.Root);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Handles the element <see cref="SkiaFrameworkElement.ChildAdded"/> event.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="element">The element.</param>
        private void Element_ChildAdded(object sender, FrameworkElement element)
        {
            var skiaElement = SkiaTree.Inject(element);

            InitElement(skiaElement);

            _tree_change_throttle.ResetReplace(() =>
            {
                Render();
            });
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Handles the element <see cref="SkiaFrameworkElement.ChildRemoved"/> event.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="element">The element.</param>
        private void Element_ChildRemoved(object sender, FrameworkElement element)
        {
            var skiaElement = SkiaTree.Eject(element);

            if (skiaElement != null)
            {
                DisposeElement(skiaElement);
            }

            _tree_change_throttle.ResetReplace(() =>
            {
                Render();
            });
        }