What is the command property of a button used for?

Platform: .NET MAUI|Category: Controls

The command property is used to bind a command to a button, enabling more complex interactions and separating UI logic from the code behind.

XAML:

<Button x:Name="button" Command="{Binding ButtonCommand}"/>