I wasn't aware that was a signature of AddHandler
that only takes 2 parameters, perhaps its a VB thing that you are getting away with it and its defaulting the third parameter to False
. This parameter is the handledEventsToo parameter which indicates you want your handler to execute even when some other control has handled the event.
I guess the VB would look like this:-
AddHandler App.Current.RootVisual.MouseLeftButtonDown, AddressOf HideMenu, True
Edit
Lets ditch this VB code which is wrong anyway. Here is what the code should look like in C# (you must be fairly familar with translating since the vast majority of code examples on the Web for silverlight will be in C#).
this.AddHandler(UIElement.MouseLeftButtonDownEvent, HideMenu, true);
Where this code is in the code behind of the containing UserControl and HideMenu
has this signature:-
void HideMenu(object sender, MouseEventArgs e)
{
}