internal bool InternalTouchDown(TouchEventArgs args)
{
// Ignorieren, falls nicht im Control-Bereich
Point size = ActualSize;
if (args.LocalPosition.X < 0 || args.LocalPosition.X >= size.X ||
args.LocalPosition.Y < 0 || args.LocalPosition.Y >= size.Y)
return false;
// Ignorieren, falls nicht gehovered
if (!Visible) return false;
// Ignorieren, falls ausgeschaltet
if (!Enabled) return true;
// Fokusieren
Focus();
// Pressed-State aktivieren
Pressed = true;
// Children first (Order by Z-Order)
foreach (var child in Children.InZOrder())
{
args.LocalPosition = CalculateLocalPosition(args.GlobalPosition, child);
args.Bubbled = child.InternalTouchDown(args) || args.Bubbled;
if (args.Handled) break;
}
// Lokales Events
if (!args.Handled)
{
args.LocalPosition = CalculateLocalPosition(args.GlobalPosition, this);
OnTouchDown(args);
if (TouchDown != null)
TouchDown(this, args);
}
return Background != null;
}