Example #1
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();
            });
        }
Example #2
0
 /// <summary>
 /// Handles the SizeChanged event of the _scrollViewer control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="SizeChangedEventArgs"/> instance containing the event data.</param>
 private void _scrollViewer_SizeChanged(object sender, SizeChangedEventArgs e)
 {
     if (IsVirtualizing)
     {
         _sizing_throttle.ResetReplace(() =>
         {
             InitSurface();
             Render();
         });
     }
 }
Example #3
0
 /// <summary>
 /// Handles the ScrollChanged event of the _scrollViewer control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="ScrollChangedEventArgs"/> instance containing the event data.</param>
 private void _scrollViewer_ScrollChanged(object sender, ScrollChangedEventArgs e)
 {
     _scrolling_throttle.ResetReplace(() =>
     {
         if (IsVirtualizing)
         {
             Render();
         }
     });
 }
Example #4
0
        /// <summary>
        /// Called when a binding container value has been changed.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="BindingEventArgs"/> instance containing the event data.</param>
        protected virtual void OnBindingContainerValueChanged(object sender, BindingEventArgs e)
        {
            ActionThrottle throttle = null;

            if (_bindingThrottlers.TryGetValue(e.BindingProperty, out throttle))
            {
                throttle.ResetReplace(() =>
                {
                    RenderSingle(e.SkiaElement, e.BindingProperty.Mode);
                });
            }
        }