public MainWindow() { InitializeComponent(); rootElement = SUIElement.PARSE_XML("../../../example.xml"); rootElement.setStyle(new SUIStyle() { Background = Colors.LightGreen }); rootElement.setMargin(50, 50, 0, 0); rootElement.draw(mCanvas, new Point(0, 0)); }
private void redrawAll() { mCanvas.Children.Clear(); // This is just a white Rect.. Otherwise the Mouse Move // event doesn't get triggered when over "empty" space // on the Canvas.. Ignore it Rectangle styleRect = new Rectangle(); styleRect.Fill = new SolidColorBrush(Colors.White); styleRect.Width = 800; styleRect.Height = 600; Canvas.SetLeft(styleRect, 0); Canvas.SetTop(styleRect, 0); mCanvas.Children.Add(styleRect); rootElement.draw(mCanvas, new Point(0, 0)); }