Timepicker Updatesourcetrigger=propertychanged doesn't change value

后端 未结 2 1851
醉酒成梦
醉酒成梦 2021-01-19 15:34

I\'m hosting a WPF usercontrol in a windows form In the wpf user control I am using a timepicker from wpfToolkit.extended

If I use the up or downkeys or just enter a

2条回答
  •  爱一瞬间的悲伤
    2021-01-19 16:14

    Found a solution for this problem: I've given the TimePicker a name (In this case 'tpFrom') then I've used the TextBoxBase.TextChanged event on the TimePicker. This is what the Xaml looks like now:

    
    

    In the code behind in our eventhandler we'll put the focus on our timepicker.

      private void TimePicker_TextChanged(object sender, TextChangedEventArgs e)
        {
            tpFrom.Focus();            
        }
    

    Now everytime the text changes, the value changes as well and the problem is solved :-)

提交回复
热议问题