Guardian’s Home

.NET, Software Developing, Mammuths and various Life Things…

Silverlight 2 RC0 – first problems due to undocumented breaking changes on disabled controls

with 3 comments

Yesterday I was about to use my brand new menu control in a new project, and after having recompiled and run the test with the brand new runtime…well…as usual the first problems arose.

It seems that some undocumented changes were made again to the event bubbling and mechanics…so when I was moving the mouse over some disabled menu items I saw the whole popup disappear.

The problem is caused by the fact that the menu is implemented like a bunch of buttons inside a StackPanel, the popup is closed when the MouseLeave event of the StackPanel is fired; with SL2RC0 when I move the mouse over a disabled button the StackPanel fire an ‘unwanted’ MouseLeave event too…this behaviour wasn’t present in SL2B2.

For some more info look at my post in Silverlight Forum: http://silverlight.net/forums/t/30778.aspx

The ‘Breaking Changes’ document doesn’t mention anything about the ‘new’ event system, so we are left alone and have to experiment a bit.

I have a workaround for this in mind but it will require a complete rework of the Menu Control, stay tuned for updates.



kick it on DotNetKicks.com

Written by Guardian

September 27th, 2008 at 10:43 am

Posted in Freetime talking

Tagged with , ,

3 Responses to 'Silverlight 2 RC0 – first problems due to undocumented breaking changes on disabled controls'

Subscribe to comments with RSS or TrackBack to 'Silverlight 2 RC0 – first problems due to undocumented breaking changes on disabled controls'.

  1. [...] In a previous post I showed how we can build a simple menu control for Silverlight 2 Beta 2 (Silverlight: how to build a simple menu control); then with the release of Silverlight RC0 some things were changed and the menu stopped working, due to how events are handled for disabled controls (Silverlight 2 RC0 – first problems due to undocumented breaking changes on disabled controls). [...]

  2. It is documented as they mention mouse event arguments were changed. eg. they now differentiate between mouse move events and mouse button events. You can ‘handle’ mouse button events.
    This is a good thing because the mechanics were badly broken before. Some mouse events _could_ be handled, depending on the control… anyway, you could only tell at runtime.

    KierenH

    13 Oct 08 at 7:26 pm

  3. Sorry but I don’t get your point, we had different events for mouse movement and buttons even before… and it still seems strange to me that if I have a disabled control inside a container I get mouse leave event from the container too when I move the mouse over the disabled control.
    Anyway RTW is out now..and I’ll test it against this new version.

    Guardian

    14 Oct 08 at 4:29 am

Leave a Reply