Author: VegetroniX | Posted on: 6/7/2008 4:50:02 PM | Views : 332

I made some code for dynamic drawing of shapes; my problem now is another,
how can i set the layoutRoot into a library?
 
i have a one-file-per-class object library for shapes, and a abstract class in it with a "draw" method. all shapes in the library inherit the abstract class, and i want every of them to draw themselves into my layout by calling the method "draw".
within the Page.xaml.cs the drawing is functioning without problems with:

            LayoutRoot.Children.Add(rectangle);
 but in the library i tried with:
1. LayoutRoot.Children.add(Recta);
2. Page.LayoutRoot.Children.add(Recta);
3. FrameworkElement elem = Page() as FrameworkElement;
            elem.LayoutRoot.Children.add(Recta);
but VS2008 always gives (almost) the same answer: "Error    1& ...

Go to the complete details ...