Skip to main content
Home Forums Silverlight Programming Report a Silverlight Bug Silverlight 2 Crash/Exception in Firefox but not in IE6.0
1 replies. Latest Post by mbrodersen on April 25, 2009.
(0)
mbrodersen
Member
0 points
2 Posts
04-25-2009 2:54 PM |
I am using the following code to change the UI:
void setUI(UIElement ui) { RootVisual.Dispatcher.BeginInvoke ( () => { Grid root = RootVisual as Grid; root.Children.Clear(); root.Children.Add(ui); } ); }
And it works fine in IE6.0 but not in the latest version of Firefox (3.0.9) if I rapidly click buttons to switch between UIElements. It is a bit random when the crash happens in Firefox. The actual exception that happens is:
{System.ArgumentException: Value does not fall within the expected range. at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData) at MS.Internal.XcpImports.MethodPack(IntPtr objectPtr, String methodName, Object[] rawData) at MS.Internal.XcpImports.MouseEventArgs_GetPosition(MouseEventArgs args, UIElement relativeTo) at System.Windows.Input.MouseEventArgs.GetPosition(UIElement relativeTo) at System.Windows.Controls.Primitives.ButtonBase.OnMouseMove(MouseEventArgs e) at System.Windows.Controls.Control.OnMouseMove(Control ctrl, EventArgs e) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)}
The exception might happen after clicking a button a few times but sometimes it takes 10+ clicks to make it happen. The setUI() code is called every time a button is clicked. And again: It works fine in IE6.0 but not in Firefox.
04-25-2009 3:09 PM |
Work around reported here:
http://silverlight.net/forums/t/31071.aspx
But it doesn't fix this problem.