private void HandleMouseWheel(object sender, HtmlEventArgs args)
            {
                double delta = 0;

                ScriptObject eventObj = args.EventObject;

                if (eventObj.GetProperty("wheelDelta") != null)
                {
                    delta = ((double)eventObj.GetProperty("wheelDelta")) / 120;


                    if (HtmlPage.Window.GetProperty("opera") != null)
                        delta = -delta;
                }
                else if (eventObj.GetProperty("detail") != null)
                {
                    delta = -((double)eventObj.GetProperty("detail")) / 3;

                    if (HtmlPage.BrowserInformation.UserAgent.IndexOf("Macintosh") != -1)
                        delta = delta * 3;
                }

                if (delta != 0 && this.Moved != null)
                {
                    MouseWheelEventArgs wheelArgs = new MouseWheelEventArgs(delta);
                    wheelArgs.IsHorizontal = args.ShiftKey;
                    this.Moved(this, wheelArgs);

                    if (wheelArgs.BrowserEventHandled)
                        args.PreventDefault();
                }
            }
 private void HandleBrowserMouseWheelMoved(object sender, MouseWheelEventArgs e)
 {
     //Only fire the mouse wheel moved event if this is the top-most
     //scrolling element in the UI tree.
     if (IsActiveScrollViewer())
         this.MouseWheelMoved(this, e);
 }