Silverlight 4, Mouse Wheel Events and Windowless Mode
Asked Answered
B

2

11

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.

Benefactor answered 20/4, 2010 at 10:37 Comment(1)
Unfortunately, no. In the end, I implemented some logic in the back-end to do it based on browser. Would still like to find out if there is a "correct" way of doing it.Benefactor
N
2

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.

Newcomer answered 16/3, 2011 at 23:13 Comment(0)
L
0

Maybe you could use your own MouseWehhenManager singleton class that internally considers both DOM and MouseWheelAPI events and provides them in a common way, so your code can use this single interface which works either way?

Lantana answered 4/1, 2011 at 11:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.