I have a grid with SAVE button. Then I have a dockmanager which has 2 tabgrouppanes. The first tabgrouppane has a content pane which has a title textbox and few other fields.
Binding for title seems to happen only when we TAB out of the text box. Hitting SAVE without leaving the textbox does not do the binding. How do I get the textbox to receive a "lost focus" when I click on the SAVE button. Attaching sample code.
Thanks.
<Grid> <Grid x:Name="Grid_MenuBar"> <Button x:Name="Save" Grid.Column="1" Grid.Row="0" Margin="5" </Grid>
<igDock:XamDockManager Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <igDock:XamDockManager.Panes> <igDock:SplitPane igDock:XamDockManager.InitialLocation="DockedTop" SplitterOrientation="Horizontal"> <igDock:TabGroupPane> <igDock:ContentPane Header="Primary"> <Grid x:Name="Song"> <TextBlock x:Name="SongTitle_txt" Text="Title" Grid.Row="1" Grid.Column="2" Margin="0,0,5,0" /> <TextBox x:Name="SongTitle_box" BorderThickness="0.5,0.5,0.5,0.5" Grid.Row="1" Grid.Column="3" Text="{Binding Path=Title, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/> </igDock:ContentPane> </igDock:TabGroupPane> </igDock:SplitPane> </igDock:XamDockManager.Panes></Grid>
Ok. Thank you for your help.
I'm guessing that relates more to the Leave event of a WinForms control. I'm not sure how a WindowsFormsHost deals with when it triggers the Enter/Leave events. You may want to check the MS forums or perhaps review the WindowsFormsHost code in Reflector/ILSpy. From MS' documentation on WPF/WinForms integration it seems like they don't raise the Leave events in some scenarios.
As I said in my previous post, the main problem is fixed (the XamNumericEditor send a LostKeyboardFocus when I click in another focus scope).
The other issue I have is not related to a XamNumericEditor. It is related to a Winforms control (a UltraWinGrid) which is not a WPF component but which is hosted in a WPF control. For this specific component, I don't receive the CellChange event when I click outside of the Winforms control. I guess the issue is more related to Winforms integration in WPF and not only related to Infragistics components behavior, but if you have any advice...
I'm not sure what you mean. You originally asked about XamNumericEditor and EditModeEnding. It's a WPF control. I don't think the FocusedElement in WPF has any relation/affect on any HwndHosts that may happen to be within it.
For my Winforms control, resetting the FocusedElement of the container ContentPane doesn't work. Do you have another idea of how I could handle this issue?