Raising a PropertyChanged event during a Pause in TextBox entry?

后端 未结 5 1470
陌清茗
陌清茗 2020-12-09 23:19

I was wondering if it\'s possible to raise a PropertyChanged event when the user pauses while typing text into a TextBox? Or more specifically, I w

5条回答
  •  有刺的猬
    2020-12-10 00:06

    Set UpdateSourceTrigger=PropertyChanged, and then each time the property changes, kick off a timer for the delay you'd like. If the property is changed again prior to the timer tick, then cancel the old timer and kick off a new one. If the timer does tick, then you know the property hasn't changed in X seconds, and you can kick off the background process.

提交回复
热议问题