public override void OnMouseUp(MouseEventArgs e)
        {
            if (Enabled && Pressed)
            {
                if (InteractiveBounds.Contains(e.Position))
                {
                    Pressed = false;
                    if (IsChecked)
                    {
                        IsChecked = false;
                        UpdateStyle();
                        Unchecked?.Invoke(this, EventArgs.Empty);
                        return;
                    }

                    if (!IsChecked)
                    {
                        IsChecked = true;
                        UpdateStyle();
                        Checked?.Invoke(this, EventArgs.Empty);
                        return;
                    }
                }
            }
        }
Example #2
0
 public virtual void OnMouseUp(MouseEventArgs e)
 {
     if (Enabled && Pressed)
     {
         if (InteractiveBounds.Contains(e.Position))
         {
             Pressed = false;
             UpdateStyle();
             Clicked?.Invoke(this, EventArgs.Empty);
         }
     }
 }
Example #3
0
        //public abstract ControlState GetState();
        #endregion


        #region [ Mouse Down/Up ]
        public virtual void OnMouseDown(MouseEventArgs e)
        {
            if (Enabled && !Pressed)
            {
                if (InteractiveBounds.Contains(e.Position))
                {
                    Pressed = true;
                    UpdateStyle();
                    MouseDown?.Invoke(this, EventArgs.Empty);
                }
            }
        }