Skip to main content
Home Forums Silverlight Programming Report a Silverlight Bug Border.Child - System.ArgumentException and System.AccessViolationException
3 replies. Latest Post by jenhansen on June 7, 2009.
(0)
UncleRedz
Member
8 points
7 Posts
03-12-2008 1:41 PM |
Hi,
Using SL2B1 with C# (and IE7), the Border control will throw an exception if the Child property is set to the same object twice.
Example:
UserControl A;UserControl B;
myBorder.Child = A; //OKmyBorder.Child = B; //OKmyBorder.Child = B; //Exception
An exception of type 'System.ArgumentException' occurred in System.Windows.dll but was not handled in user codeAdditional information: Value does not fall within the expected range.
Also along these lines, setting Child to null produces another exception,
myBorder.Child = null;
An exception of type 'System.AccessViolationException' occurred in System.Windows.dll but was not handled in user codeAdditional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Cheers
Pranav G...
26 points
3 Posts
03-14-2008 9:03 PM |
Thank you for reporting this. We have logged it at our end and are investigating it.
BryX
4 points
8 Posts
04-21-2008 4:02 PM |
Is there a workaround yet? or a fix? I have a similar problem adding a new self defined XAML User Control to a Canvas, it gives me:
An exception of type 'System.ArgumentException' occurred in System.Windows.dll but was not handled in user code
Additional information: Value does not fall within the expected range.
{
Course
}
//---- Course.cs ------
using
InitializeComponent();
CourseRec.MouseLeave +=
CourseRec.ReleaseMouseCapture();
CourseRec_Background.Opacity = 1;
CourseRec.CaptureMouse();
CourseRec_Background.Opacity = 0.45;
<
</
jenhansen
2 points
1 Posts
06-07-2009 8:53 PM |
I ran into the same problem. I was getting the ArgumentException error until I named all the elements I was adding with unique names. (Before they didn't have names) This definitely seems like a bug, but at least the work around was easy enough.