Trying to include a hoverIntent based on the following code:
private void ViewerTab_MouseLeave(object sender, MouseEventArgs e)
{
_mouseOverTabPanel = false;
ChangeCurrentPanelPosition(TabPanelPosition.Bottom);
}
private void ViewerTab_MouseEnter(object sender, MouseEventArgs e)
开发者_如何学运维 {
_mouseOverTabPanel = true;
}
The ChangeCurrentPanelPosition should ideally only fire after mouseleave for ~1 sec and the timer will clear if mouseEnter again.
This worked for me:
public DispatcherTimer myDispatcherTimer = new DispatcherTimer();
private void ViewerTab_MouseLeave(object sender, MouseEventArgs e)
{
myDispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 1000);
myDispatcherTimer.Tick += new EventHandler(functiontocall);
myDispatcherTimer.Start();
}
public void functiontocall(object o, EventArgs sender)
{
// do something here
myDispatcherTimer.Stop();
}
private void ViewerTab_MouseEnter(object sender, MouseEventArgs e)
{
myDispatcherTimer.Stop();
}
精彩评论