I'm having an issue when I'm binding a focus property to a Numeric Editor. The issue I'm having is when I click on the control it calls the GotFocus event handler and that changes the property, but the the numeric editor is looping back and forth from GotFocus to LostFocus event handlers multiple times while a regular textbox works just fine. Is there a reason why? Attached is a sample demo to explain.
Hello,
Thank you for your post. I have been looking into it and it seems that the GotFocus event for the XamNumericEditor is firing two times, when you using the IsFocused property. After investigating this behavior, it turns out that the reason for it is that the XamNumericEditor is not in edit mode and when the first time the GotFocus is fired and the XamNumericEditor is focused, the editor is entering edit mode and the event is fire again. What I can suggest in order to avoid this behavior is setting the IsAlwaysInEditMode property of the editor to true. By doing so, when you focus the editor, it will be in edit mode and the event will fire only once. I have modified the sample application that you have attached in order to implement this approach.
Please let me know if you need any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
I am just checking if you require any further assistance on the matter.
In the project you attached how can I force the property binding in the ViewModel to change to true or false when focus is lost or got? When I uncomment((FrameworkElement)sender).SetValue(IsFocusedProperty, true); in your proect and set IsAlwaysInEditMode ="True", it still repeats
Thank you for your reply. I have logged this behavior with our developers in our tracking system, with an issue ID of 139785. I have also created a support ticket on your behalf with number CAS-11-V6C8R0 in order to link the development issue to it so that you are automatically updated when a Service Release containing your fix is available for download.
Infragistics, Inc.