When performing a ShowDialog (and even .Show) of WPF Window within the MouseDoubleClick event of the RadTreeView, mouse events (MouseEnter, Click, etc..) no longer fire in the Dialogue Window. It gives the appearance of hanging, but keyboard nav functions just fine.
Interestingly, by moving focus to a different window and alt-tabbing back to the dialogue, the mouse events are once again detected.
I have only noticed this in the MouseDoubleClick event.
The workaround that I am using to avoid this problem is to set a flag in the MouseDoubleClick event and then check the flag in the MouseLeftButtonUp event. If I fire the .Show or .ShowDialog from the MouseLeftButtonUp event, all is OK and the problem does not appear.
Details
VS 2010 Ultimate
Telerik - WPF 2011 Q2 - SP1
Win 7 - 64
Reproduce
Create WPF Application with two windows (MainWindow and TestDLG)
Build/Run
Double Click on Item 1
Hit Cancel Button
If it doesn't appear to lock on first try, repeat. Always get it to lock before doing this three or four times.
When it locks, just Alt-Tab out and then back to the test application and the mouse lives again.
This sample is as simple as I could make.
<
Window
x:Class
=
"MainWindow"
Title
=
"MainWindow"
Height
=
"280"
Width
=
"400"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
>
<
Grid
>
<
telerik:RadTreeView
Height
=
"128"
HorizontalAlignment
=
"Left"
Margin
=
"160,72,0,0"
Name
=
"RadTreeView1"
VerticalAlignment
=
"Top"
BorderThickness
=
"1"
BorderBrush
=
"Black"
Width
=
"125"
>
<
telerik:RadTreeViewItem
DropPosition
=
"Inside"
Header
=
"Item 1"
/>
</
telerik:RadTreeView
>
</
Grid
>
</
Window
>
MainWindow - Code Behind
Class
MainWindow
Private
Sub
RadTreeView1_MouseDoubleClick(sender
As
Object
, e
As
System.Windows.Input.MouseButtonEventArgs)
Handles
RadTreeView1.MouseDoubleClick
Dim
tw
As
New
TestDLG
tw.ShowDialog()
tw.Close()
End
Sub
End
Class
MainWindow CodeBehind (Workaround)
This is the workaround that allows the ShowDialog to occur on doubleclick event but not lose mouse events.
Class
MainWindow
Private
_DidDoubleClick
As
Boolean
Private
Sub
RadTreeView1_MouseDoubleClick(sender
As
Object
, e
As
System.Windows.Input.MouseButtonEventArgs)
Handles
RadTreeView1.MouseDoubleClick
_DidDoubleClick =
True
End
Sub
Private
Sub
RadTreeView1_MouseLeftButtonUp(sender
As
Object
, e
As
System.Windows.Input.MouseButtonEventArgs)
Handles
RadTreeView1.MouseLeftButtonUp
If
_DidDoubleClick
Then
_DidDoubleClick =
False
Dim
tw
As
New
TestDLG
tw.ShowDialog()
tw.Close()
End
If
End
Sub
End
Class
Dialog Window
<Window x:
Class
=
"TestDLG"
Title=
"TestDLG"
Height=
"300"
Width=
"300"
>
<Grid>
<Button Content=
"Button"
Height=
"29"
HorizontalAlignment=
"Left"
Margin=
"82,204,0,0"
Name=
"Button1"
VerticalAlignment=
"Top"
Width=
"97"
/>
</Grid>
</Window>
Dialog Window CodeBehind
Public
Class
TestDLG
Private
Sub
Button1_Click(sender
As
System.
Object
, e
As
System.Windows.RoutedEventArgs)
Handles
Button1.Click
Me
.Hide()
End
Sub
End
Class