The Button.Click event fires too quickly, or out of order, I think.
1. If you're focused on a Textbox or Passwordbox, then click a button, it can invoke the button delegate and the textbox never loses focus, so it never updates it's bindings.
2. Some users can double-click it quickly and invoke 2 commands before the first delegate can disable the CanExecute value, or an eventhandler can disable the button.
I've worked around these issues temporarily, by code-behind.
1.
Code: Select all
App.Current.RootElement.BeginInvoke(async () => {
await Task.Delay(300);
FindFocusableUsercontrol().Focus();
await Task.Delay(300);
await InvokeReal(sender, _param);
}
This fixes the focus/binding issue, but STILL double-clicks get through. Now I have to:
2.
Code: Select all
async Task InvokeReal(object sender, object _param) {
Button _realBtn = ((Button)sender);
lock(_clkLock){
If (IsInvokeEnabled(_realBtn)) {
DisableButtonInvoke(_realBtn);
LockedInvokeRealButton(_realBtn, _param);
}
}
await Task.Delay(500);
EnableInvokedButton(_realBtn);
}
This is all just a bit silly, and slows down my users' experience enormously.
I've tried using
Button.Command
Button.Tapped
Button.Click
I've had some success using the new ClickMode=Release, but now I can't intercept the Mouse DOWN this way.
Any help would be appreciated.