I have a button, When I press 'Enter' Key through Keyboard, the button command executes. When I consecutively press the 'Enter' key, the command also executes multiple times which I don't want.
I want to restrict the behaviour to single execution of command even during multiple 'Enter' key press. Can somebody help ?
View.xaml
<Button x:Name="btnSearch" IsDefault="True" Content="Search" Command="{Binding SearchButtonCommand}">
<Button.InputBindings>
<KeyBinding Command="{Binding Path=SearchButtonCommand}" Key="Return" />
</Button.InputBindings>
</Button>
ViewModel.cs
public ICommand SearchButtonCommand
{
get { return new DelegateCommand(SearchButtonExecutionLogic); }
}