internal bool InternalRightMouseClick(MouseEventArgs 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;
// Children first (Order by Z-Order)
foreach (var child in Children.InZOrder())
{
args.LocalPosition = CalculateLocalPosition(args.GlobalPosition, child);
args.Bubbled = child.InternalRightMouseClick(args) || args.Bubbled;
if (args.Handled) break;
}
// Lokales Events
if (!args.Handled)
{
args.LocalPosition = CalculateLocalPosition(args.GlobalPosition, this);
OnRightMouseClick(args);
if (RightMouseClick != null)
RightMouseClick(this, args);
}
return Background != null;
}