Exemple #1
0
        /// <summary>
        /// Overriding the handler for the MouseEnter event.
        /// </summary>
        /// <param name="e">Event arguments</param>
        protected override void OnMouseEnter(MouseEventArgs e)
        {
            if (Interaction.AllowMouseEnter(e))
            {
                Interaction.OnMouseEnterBase();

                if (IsPressed)
                {
                    OnClick();
                    StartTimer();
                }
            }

/* part of the workaround
 *          // this code will cache the mouse position relative to the top level UIElement
 *          // in the Silverlight page.
 *          object parent = this;
 *          while (true)
 *          {
 *              FrameworkElement element = parent as FrameworkElement;
 *              if (element == null)
 *              {
 *                  break;
 *              }
 *              parent = element.Parent;
 *          }
 *          _mousePosition = e.GetPosition(parent as UIElement);
 */
        }
Exemple #2
0
 protected override void OnMouseEnter(MouseEventArgs e)
 {
     if (Interaction.AllowMouseEnter(e))
     {
         Interaction.OnMouseEnterBase();
     }
 }