wpfmdi icon indicating copy to clipboard operation
wpfmdi copied to clipboard

Flashing window, Focus loop

Open NayaraFJ opened this issue 6 years ago • 1 comments

Hello I used your class in my project, however I have a problem and I can not solve it. I made a program to open the last windows that were open in the last session of the user. But the program loops in the Focus methods, but the downloaded example opens the windows direct and does not loop, I did the test opening empty windows and it worked, this loop is generated only when I put my controls in, I'm not getting to understand, Has anyone had this problem?

NayaraFJ avatar Mar 20 '18 16:03 NayaraFJ

I solved

In method "FocusedValueChanged" I changed this line

mdiChild.Dispatcher.BeginInvoke(new Func<IInputElement, IInputElement>(Keyboard.Focus), System.Windows.Threading.DispatcherPriority.ApplicationIdle, mdiChild.Content);

for this

mdiChild.Dispatcher.BeginInvoke(new Func<IInputElement, IInputElement>(Keyboard.Focus), System.Windows.Threading.DispatcherPriority.ApplicationIdle, mdiChild);

NayaraFJ avatar Mar 20 '18 19:03 NayaraFJ