Exemple #1
0
        private void OnLoadItems()
        {
            var middlePoint = new Point(EditingContext.SurfaceWidth / 2, EditingContext.SurfaceHeight / 2);

            const int marioWidth  = 200;
            const int marioHeight = 240;

            var mario = new Mario {
                Left = middlePoint.X - marioWidth / 2D, Top = middlePoint.Y - marioHeight / 2D, Width = marioWidth, Height = marioHeight
            };
            var bubble = new Bubble
            {
                Left       = mario.Right - 70,
                Top        = mario.Top - 170,
                Width      = 250,
                Height     = 280,
                Text       = "WOW. Much decoupled. So AOP. Such Patterns.",
                Background = new Color(255, 0, 255, 80),
                TextColor  = new Color(255, 0, 0, 0),
                FontSize   = 16D,
                FontName   = "Comic Sans MS"
            };

            Items.Add(mario);
            Items.Add(bubble);
        }
Exemple #2
0
        private static CanvasDocument CreateSampleItems()
        {
            var items = new CanvasItemCollection();

            items.Add(new Link
            {
                Left   = 0,
                Top    = 40,
                Width  = 200,
                Height = 100,
            });



            items.Add(new Label
            {
                Left   = 400,
                Top    = 40,
                Width  = 250,
                Height = 50,
                Text   = "Hello boys!\nThis is far from perfect, but it works :D"
            });

            //items.Add(new CanvasRectangle
            //{
            //    Left = 200,
            //    Top = 40,
            //    Width = 100,
            //    Height = 100,
            //    FillColor = new Color(0, 0, 255)
            //});

            //items.Add(new Ellipse
            //{
            //    Left = 200,
            //    Top = 200,
            //    Width = 200,
            //    Height = 100,
            //    FillColor = new Color(0, 220, 255)
            //});

            var group = new Group {
                Top = 100, Left = 200, Width = 110, Height = 200
            };

            group.Children.Add(new Mario {
                Left = 15, Top = 0, Width = 80, Height = 100
            });
            group.Children.Add(new Sonic {
                Left = 15, Top = 100, Width = 80, Height = 100
            });

            items.Add(group);


            return(new CanvasDocument(items));
        }
        private static CanvasDocument CreateSampleItems()
        {
            var items = new CanvasItemCollection();
            items.Add(new Link
                      {
                          Left = 0,
                          Top = 40,
                          Width = 200,
                          Height = 100,
                      });

            items.Add(new Label
                      {
                          Left = 400,
                          Top = 40,
                          Width = 250,
                          Height = 50,
                          Text = "Hello boys!\nThis is far from perfect, but it works :D"
                      });

            //items.Add(new CanvasRectangle
            //{
            //    Left = 200,
            //    Top = 40,
            //    Width = 100,
            //    Height = 100,
            //    FillColor = new Color(0, 0, 255)
            //});

            //items.Add(new Ellipse
            //{
            //    Left = 200,
            //    Top = 200,
            //    Width = 200,
            //    Height = 100,
            //    FillColor = new Color(0, 220, 255)
            //});

            var group = new Group { Top = 100, Left = 200, Width = 110, Height = 200 };
            group.Children.Add(new Mario { Left = 15, Top = 0, Width = 80, Height = 100 });
            group.Children.Add(new Sonic { Left = 15, Top = 100, Width = 80, Height = 100 });

            items.Add(group);

            return new CanvasDocument(items);
        }