private void UpdateFocusedTextBox()
{
//There is an issue when textbox is in focus, it won't update the source.
//This workaround will try to find the currently focusedTextBox and update the source.
object focusedTextBox = Keyboard.FocusedElement;
if (focusedTextBox is RadNumericUpDown)
{
RadNumericUpDown rad = focusedTextBox as RadNumericUpDown;
((RadNumericUpDown)focusedTextBox).GetBindingExpression(RadNumericUpDown.ValueProperty).UpdateSource();
}
else if(focusedTextBox is TextBox)
((TextBox)focusedTextBox).GetBindingExpression(TextBox.TextProperty).UpdateSource();
}
Any suggestions are appreciated.
Thanks,
Joel