bool ProcessClick(EventBase evt) { if (evt.eventTypeId == MouseUpEvent.TypeId()) { var ce = (IMouseEvent)evt; if (ce.button == (int)MouseButton.LeftMouse) { return(true); } } else if (evt.eventTypeId == PointerUpEvent.TypeId() || evt.eventTypeId == ClickEvent.TypeId()) { var ce = (IPointerEvent)evt; if (ce.button == (int)MouseButton.LeftMouse) { return(true); } } return(false); }
void OnClickEvent(EventBase evt) { if (evt.eventTypeId == MouseUpEvent.TypeId()) { var ce = (IMouseEvent)evt; if (ce.button == (int)MouseButton.LeftMouse) { ToggleValue(); } } else if (evt.eventTypeId == PointerUpEvent.TypeId() || evt.eventTypeId == ClickEvent.TypeId()) { var ce = (IPointerEvent)evt; if (ce.button == (int)MouseButton.LeftMouse) { ToggleValue(); } } }