I have a WrapPanel where I add a bunch of rectangle controls I got everything working, but now I have decided that it would be better to create a class for them and instead of creating rectangles all over the place I'll just instantiate new objects.
I did it but the problem is that now I get an error when I try to add my object as a Child to the WrapPanel or anywhere for that matter.
Error: The best overloaded method match for 'System.Windows.PresentationFrameworkCollection.Add(System.Windows.UIElement)' has some invalid arguments
I tried extending my class with the UIElement class
public class myColor : UIElement {...}
this didn't work either as I'm missing the constructors for the UIElement class Error:
The type 'System.Windows.UIElement' has no constructors defined
I'm still learning Silverlight and c#, any help would be appreciated it, Thanks