Exemplo n.º 1
0
        public virtual void PerformHover(Point point)
        {
            if (Disabled || OutOfBounds)
            {
                return;
            }

            if (HoverAction != null && Bounds.Contains(point))
            {
                HoverAction?.Invoke(point, true, this);
                WasHover = true;
            }
            else if (HoverAction != null && WasHover)
            {
                HoverAction?.Invoke(point, false, this);
                WasHover = false;
            }

            foreach (UIElement child in Children.Where(c => c.Visible))
            {
                Task.Run(() =>
                {
                    child.PerformHover(point);
                });
            }
        }
Exemplo n.º 2
0
        public override void PerformHover(Point point)
        {
            if ((HoverAction != null || Scrollable) && Bounds.Contains(point))
            {
                HoverAction?.Invoke(point, true, this);
                WasHover = true;
            }
            else if ((HoverAction != null || Scrollable) && WasHover)
            {
                HoverAction?.Invoke(point, false, this);
                WasHover = false;
            }

            foreach (UIElement child in Children.Where(c => c.Visible))
            {
                child.PerformHover(point);
            }
        }