Monday, October 8, 2012

Mouse Leave event is not working many a times in silverlight

Mouse Leave event is not working many a times in silverlight

I am making an application in silver light. In that application i am opening a popup on mouse enter event and trying to close that popup on mouse leave event. But many a times mouse leave event is not working . I am using code as

 private Popup simplePopup = new Popup();   public void showNotes  {   TextBlock t = new TextBlock();   t.Text = "N";    t.MouseEnter += (s, args) =>                             {                                  this.simplePopup.Child = new MyApplication.Views.SimplePopupContent(((ToolTip)ToolTipService.GetToolTip((DependencyObject)s)).Content.ToString());                                             this.simplePopup.Margin = new Thickness(XOffset + objDisplayObjects.FhrGrid.Width / 3, 70, 0, 0);                                                               this.simplePopup.Width = 30;                                 this.simplePopup.Child.MouseLeave += new MouseEventHandler(Child_MouseLeave);                                 this.simplePopup.IsOpen = true;                              };  }  public void Child_MouseLeave(object sender, MouseEventArgs e)         {             this.simplePopup.IsOpen = false;         }       

Answers & Comments...




No comments:

Post a Comment

Send us your comment related to the topic mentioned on the blog