✅ Avalonia — stop children from triggering parent events
with the following codebehind
makes it so that clicking on the buttons doesn't trigger their commands, but rather the click gets captured by the parent and the window gets dragged
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3"
Orientation="Horizontal"
Background="Black"
Opacity="0.7" PointerPressed="InputElement_OnPointerPressed">
<Button Command="{Binding NewWindowCommand}">S</Button>
<Button Command="{Binding MainViewCommand}">Home</Button>
</StackPanel>private void InputElement_OnPointerPressed(object? sender, PointerPressedEventArgs e)
{
BeginMoveDrag(e);
}