0

I am developing a WPF-application using mvvm pattern. And a strange problem occurred to me. There is a form, which contains a devexpress DXGrid control. There is a command binded to double click gesture in presenter. When the command triggers a new window is created and shown through factory class(the Show() method is used).

So, it happens from time to time that the whole application(all application windows) is blocked when this window is shown. This lockup disappears after i focus any other application.

For the first time this problem occurred after updating devexpress version. Then this problem occurred any time new window was shown after double click on grid row. The problem was partially fixed by setting new window`s Owner property.

Now this problem occurs from time to time. It seems as if threads are involved here, but i dont understand how. =(

p.s.: there is one more strange thing, when new window is shown and no lockup-problem occurred, the first window is still focused and i have to click on newly shown window before i can use any controls, placed on it.

I have tried:

  • set ShowActivated property
  • call Activate() after Show()
  • newform.Dispatcher.CheckAccess() to
    determine which thread calls Show()
    method
  • check newform.IsActive property after show (value = true)

Could you tell me how to fix, please? Thank you.

garek
  • 41
  • 5

1 Answers1

0

Well to fix the issue of first window being focused rather than the newly shown window, you need to do the following, after calling the show method for the new window:

Mouse.Capture(null);

Hopefully the issue would be resolved.

Hasan Fahim
  • 3,875
  • 1
  • 30
  • 51
  • Thanks for advice, Hasan, but sadly it didn`t help =( Feels like the issue is caused by some specific DXGrid behavior. – garek Jun 03 '11 at 06:42
  • @garek if this is purely a DevExpress issue then you could post it on their forum. You'll get a more appropriate advise. – Hasan Fahim Jun 03 '11 at 07:27