public override void OnMouseClick(UIMouseClickEventArgs args) { if (_backgroundRect.Transform.HitTest(args.X, args.Y)) { var buttonEventArgs = new UIButtonEventArgs(args.X, args.Y, args.X - (int)_backgroundRect.Transform.Position.X, args.Y - (int)_backgroundRect.Transform.Position.Y); var handler = OnClick; handler?.Invoke(this, buttonEventArgs); } }
private void TestButtonOnOnClick(object sender, UIButtonEventArgs e) { Console.WriteLine("Test button clicked. It works!"); }