Prevent double-click from double firing a command

前端 未结 14 1687
情书的邮戳
情书的邮戳 2020-12-15 08:34

Given that you have a control that fires a command:

Is there a way to prevent the command from being fired

14条回答
  •  时光说笑
    2020-12-15 09:13

    You could set a flag

    bool boolClicked = false;
    button_OnClick
    {
        if(!boolClicked)
        {
            boolClicked = true;
            //do something
            boolClicked = false;
        }
    }
    

提交回复
热议问题