silverlightsilverlight-4.0mousewheelwindowless

Silverlight 4, Mouse Wheel Events and Windowless Mode


I have a Silverlight 4 application that benefits greatly from having native mouse wheel support for a number of controls. The page that hosts the application has a HTML driven drop-down menu that would normally overlay the Silverlight control.

In IE, I have to enable windowless mode to allow the overlay menu to work correctly (Firefox 3.6 works normally without it). However, enabling windowless mode prevents Firefox from supporting mouse wheel events without additional coding around the HTML DOM bridge.

Is there any way I can tell which browsers will require windowless and which will work without it? Ideally, I'd like to use the HttpBrowserCapabilities information to decide whether or not to set the property to true, rather than hardcoding a list of 'supported' browsers.


Solution

  • Silverlight 4 has support for mouse wheel events, but there are a number of rules to be aware of:

    1. IE is never an issue
    2. Mousewheel events never work on OS X out of browser, and only via the HTML DOM in-browser.
    3. Windowsless in all other browsers is a no-go because they rely on NPAPI to handle events.
    4. You can get the Mousewheel with browser interoperability features to get to the mousewheel from the DOM as you noted.
    5. HTML DOM will never work when full screen

    For a complete breakdown see http://msdn.microsoft.com/en-us/library/dd759034(v=vs.95).aspx.