I've got Button in Windows Phone project written in MVVM. Problem is that when I double press that button I will run my method twice, or more times. How to avoid that?
That's implementation:
XAML View
<Button Command="{Binding MyCommand}" />
ViewModel
private readonly Command myButtonClick;
public ICommand MyCommand{ get { return myButtonClick; } }
{
myButtonClick= new Command(MyMethod);
}
private async void MyMethod()
{
// do work
}