RaiseChildrenEventsOutsideOfBounds
Introduction
Code Example - Setting RaiseChildrenEventsOutsideOfBounds
var mainPanel = new StackPanel();
var visual = mainPanel.Visual;
mainPanel.Visual.AddToRoot();
var label = new Label();
mainPanel.AddChild(label);
mainPanel.Visual.Width = 100;
mainPanel.Visual.Height = 100;
mainPanel.Visual.WidthUnits = DimensionUnitType.Absolute;
mainPanel.Visual.HeightUnits = DimensionUnitType.Absolute;
// If this is false, then no events are raised when the cursor is
// outside of the bounds of mainPanel
mainPanel.Visual.RaiseChildrenEventsOutsideOfBounds = false;
var button = new Button();
button.Visual.Width = 300;
button.Click += (_, _) => label.Text = $"Clicked at {DateTime.Now}";
mainPanel.AddChild(button);

Last updated
Was this helpful?

