protected virtual void OnMousePressed(object sender, MousePressedEventArgs e) { if (!Enabled || Texture == null) return; //avoid null value if (mouseInner) { //gui component is clicked ClickEventDispatcher(EventArgs.Empty); if (!focused) { focused = true; //gui component is focused FocusedEventDispatcher(EventArgs.Empty); } } else { if (focused) { focused = false; //gui component lost focus LostFocusEventDispatcher(EventArgs.Empty); } } }
protected override void OnMousePressed(object sender, MousePressedEventArgs e) { base.OnMousePressed(sender, e); }
private void MousePressedEventDispatcher(MousePressedEventArgs e) { var h = Pressed; if (h != null) h(this, e); }
protected virtual void OnMousePressed(object sender, MousePressedEventArgs e) { //add common logic here... }