Describe the bug
Debounce(immediate: true) does not work with a default timer. When a timer is created, IsRepeating is set to true by default. This breaks the logic of Debounce when immediate: true. Setting IsRepeating to false on the timer fixes this issue.
Steps to reproduce
- Create a
DispatcherQueueTimer using DispatcherQueue.GetForCurrentThread().CreateTimer()
- Use
Debounce() on that timer with immediate: true
- The action is only triggered once and never again.
Expected behavior
Subsequent actions should trigger once the timer expires just like without the immediate flag.
Windows Build Number
App minimum and target SDK version
Visual Studio Version
2022
Help us help you
Yes, I'd like to be assigned to work on this item.
Describe the bug
Debounce(immediate: true)does not work with a default timer. When a timer is created,IsRepeatingis set to true by default. This breaks the logic of Debounce whenimmediate: true. SettingIsRepeatingto false on the timer fixes this issue.Steps to reproduce
DispatcherQueueTimerusingDispatcherQueue.GetForCurrentThread().CreateTimer()Debounce()on that timer withimmediate: trueExpected behavior
Subsequent actions should trigger once the timer expires just like without the
immediateflag.Windows Build Number
App minimum and target SDK version
Visual Studio Version
2022
Help us help you
Yes, I'd like to be assigned to work on this item.