示例#1
0
        private void InputHandler_MouseMove(object sender, MouseEventArgs e)
        {
            if (Bounds.IsPointInRect(e.Position))
            {
                style.OnMouseMove(this);
                if (MouseMove != null)
                {
                    MouseMove(this, e);
                }

                if (!wasMouseInComponent)
                {
                    style.OnMouseEnter(this);
                    if (MouseEnter != null)
                    {
                        MouseEnter(this, e);
                    }
                    wasMouseInComponent = true;
                }
            }
            else
            {
                if (wasMouseInComponent)
                {
                    style.OnMouseLeave(this);
                    if (MouseLeave != null)
                    {
                        MouseLeave(this, e);
                    }
                    wasMouseInComponent = false;
                }
            }
        }