CustomHitTestBorder.cs 412 B

123456789101112131415
  1. using Avalonia.Controls;
  2. using Avalonia.Rendering;
  3. namespace Avalonia.Base.UnitTests.Rendering
  4. {
  5. internal class CustomHitTestBorder : Border, ICustomHitTest
  6. {
  7. public bool HitTest(Point point)
  8. {
  9. // Move hit testing window halfway to the left
  10. return new Rect( -Bounds.Width / 2,0, Bounds.Width, Bounds.Height)
  11. .Contains(point);
  12. }
  13. }
  14. }