Programming with .NET - Generalhttp://forums.silverlight.net//17.aspx/1?Programming+with+NET+GeneralGeneral discussions around authoring Silverlight .NET applications.Mon, 01 Jan 0001 00:00:00 -05001753217http://forums.silverlight.net//p/16073/53217.aspx/1?Popup+control+and+MouseLeave+eventPopup control and MouseLeave event <p>Hello, i have a Popup control that loads a differenct xaml page.&nbsp; In the main page I create a new popup control and privatly store it for class use.&nbsp; In my button event i get the popup, calculate its location and open it up.&nbsp; In the constructor for the main page i attach the popups MouseLeave event so when they hover out of the popup it will close.&nbsp; This event is never getting fired, i hover over and out while debugging and it just never gets into the event.&nbsp; Is this not functional for popup controls yet?</p> 2008-05-14T13:06:03-04:0053244http://forums.silverlight.net//p/16073/53244.aspx/1?Re+Popup+control+and+MouseLeave+eventRe: Popup control and MouseLeave event <p>This seems like a bug. According to the msdn library(<a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.popup_members(VS.95).aspx">http://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.popup_members(VS.95).aspx</a>)&nbsp;it should be a valid event (popup is derived from UIElement) and should work with the popup.</p> When I use this code it never falls into the events (set a breakpoint on the throw):&nbsp;<font color="#0000ff" size="2"><font color="#0000ff" size="2"></font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2"> public</font></font><font size="2"> Page()<br> {<br> &nbsp;&nbsp;&nbsp; InitializeComponent();<br> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&nbsp;&nbsp;&nbsp; this</font></font><font size="2">.Loaded &#43;= </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">new</font></font><font size="2"> </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">RoutedEventHandler</font></font><font size="2">(Page_Loaded);<br> &nbsp;&nbsp;&nbsp; PopupTest.MouseEnter &#43;= </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">new</font></font><font size="2"> </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">MouseEventHandler</font></font><font size="2">(PopupTest_MouseEnter);<br> &nbsp;&nbsp;&nbsp; PopupTest.MouseLeave &#43;= </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">new</font></font><font size="2"> </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">MouseEventHandler</font></font><font size="2">(PopupTest_MouseLeave);<br> }<br> <br> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">void</font></font><font size="2"> PopupTest_MouseEnter(</font><font color="#0000ff" size="2"><font color="#0000ff" size="2">object</font></font><font size="2"> sender, </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">MouseEventArgs</font></font><font size="2"> e)<br> {<br> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&nbsp;&nbsp;&nbsp; throw</font></font><font size="2"> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">new</font></font><font size="2"> </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">NotImplementedException</font></font><font size="2">();<br> }</font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">void</font></font><font size="2"> PopupTest_MouseLeave(</font><font color="#0000ff" size="2"><font color="#0000ff" size="2">object</font></font><font size="2"> sender, </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">MouseEventArgs</font></font><font size="2"> e)<br> {<br> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&nbsp;&nbsp;&nbsp; throw</font></font><font size="2"> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">new</font></font><font size="2"> </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">NotImplementedException</font></font><font size="2">();<br> }</p> </font> 2008-05-14T14:52:00-04:0053279http://forums.silverlight.net//p/16073/53279.aspx/1?Re+Popup+control+and+MouseLeave+eventRe: Popup control and MouseLeave event <p>Yeah i think its a bug, thanks for confirming for me.</p> 2008-05-14T17:21:00-04:00527495http://forums.silverlight.net//p/16073/527495.aspx/1?Re+Popup+control+and+MouseLeave+eventRe: Popup control and MouseLeave event <p>Any updates on the issue yet? :)</p> 2011-02-23T12:01:11-05:00527621http://forums.silverlight.net//p/16073/527621.aspx/1?Re+Popup+control+and+MouseLeave+eventRe: Popup control and MouseLeave event <p>Maybe the mouse is never over the popup control itself -- it's over one of the controls within the popup.&nbsp; Have you tried putting the Mouse_Leave event on one of them, such as a Border?</p> <p>Would you post your xaml here too?&nbsp; Let's see which controls the mouse is able to move over.</p> 2011-02-23T18:58:00-05:00