protected override void OnMouseEnter(MouseEventArgs e) { if (Interaction.AllowMouseEnter(e)) { Interaction.OnMouseEnterBase(); } }
/// <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); */ }
/// <summary> /// This method is invoked when the mouse enters the rating item. /// </summary> /// <param name="e">Information about the event.</param> protected override void OnMouseEnter(MouseEventArgs e) { if (_interactionHelper.AllowMouseEnter(e)) { _interactionHelper.UpdateVisualStateBase(true); } base.OnMouseEnter(e); }