문제

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.

도움이 되었습니까?

해결책

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.

다른 팁

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?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top