1

I have a little problem with my RIA-enabled SL application.

THE BACKGROUND:

The relevant part looks like this:

  • When any data operation (i.e. load, submit, login etc.) is in place, then a BusyOverlay control (which I wrote) disables RootVisual and provides a visual effect. When the operation is finished, then it sets RootVisual.IsEnabled to whatever it was before. It works just like ChildWindow when it comes to interaction with RootVisual (at least as far as I can tell).

  • One of the elements in RootVisual (which itself is a UserControl) is a hiding menu. It is a border which contains the actual menu. It has two storyboards in Resources (which increase and decrease it's width - nothing fancy, they are as simple as you can imagine), and the border itself has MouseEnter and MouseLeave handled. The handlers start one of the storyboards, just one line of code. I don't provide any samples because there is nothing interesting going on, it would just bloat the post. If you think it is necessary, just tell me and I'll post the relevant XAML and C# code.

THE PROBLEM:

When the RootVisual is disabled, then the Border.MouseLeave event does not fire. When user clicks something in the menu that loads initial data, and then moves the mouse outside the menu, it does not hide. Is there any way to elegantly solve this problem? CaptureMouse is out of question (it requires mouse left button to be down). All I can think of is to publish an "OperationFinished" event in my data operation handling static class and handle it in the UserControl which is RootVisual, but I think it's ugly and doesn't fit in my architecture. Is there something I'm missing?

I'll be grateful for any solutions and suggestions.

4

0 回答 0