Search code examples
wpfwpf-controlsxceed

Pause property changed event while typing in Xceed decimal up down control


I have decimal up control in my wpf application. While I am trying to 0.5. When I am type 0 in decinmal up down text box. It will raise property changed event. In that property changed.

My requirement was to raise property change event when I am finish typing.

This decimal up control used lot of places in my application. How to write code in (generic way/ single place) to resolve that issue.


Solution

  • Every Binding has the Property "UpdateSourceTrigger". I would try to set that value to "LostFocus" so PropertyChanged should only be invoked when the control looses focus.

    {Binding value, UpdateSourceTrigger=LostFocus}
    

    A good explanation of UpdateSourceTrigger is at: https://www.codeproject.com/Articles/507883/UpdateSourceTrigger-Property-in-WPF-Binding