EvasObject CreateNewWindow(EvasObject parent, BaseGalleryPage page)
        {
            var box = new ColoredBox(parent)
            {
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX    = 1,
                WeightY    = 1,
            };

            box.Show();

            var titleLabel = new Label(parent)
            {
                AlignmentX    = -1,
                AlignmentY    = 1,
                WeightX       = 1,
                WeightY       = 1,
                LineWrapType  = WrapType.Word,
                LineWrapWidth = 300,
                Text          = $"<span align=center color=#000000>{page.Name}</span > "
            };

            titleLabel.Show();

            var button = new MButton(parent)
            {
                AlignmentX = -1,
                AlignmentY = 0,
                WeightX    = 1,
                WeightY    = 1,
                Text       = "run"
            };

            button.Show();

            button.Clicked += (s, e) =>
            {
                Window window = new Window(page.Name);
                window.Show();
                window.BackButtonPressed += (sender, args) =>
                {
                    page.TearDown();
                    window.Hide();
                    window.Unrealize();
                };
                page.Run(window);
            };

            box.PackEnd(titleLabel);
            box.PackEnd(button);

            return(box);
        }
示例#2
0
        EvasObject CreateNewWindow(EvasObject parent, BaseGalleryPage page)
        {
            var box = new ColoredBox(parent)
            {
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX    = 1,
                WeightY    = 1,
            };

            box.Show();

            var button = new MButton(parent)
            {
                AlignmentX = -1,
                AlignmentY = 0.5,
                WeightX    = 1,
                WeightY    = 1,
                Text       = "click"
            };

            button.Show();

            button.Clicked += (s, e) =>
            {
                Window window = new Window(page.Name);
                window.Show();
                window.BackButtonPressed += (sender, args) =>
                {
                    page.TearDown();
                    window.Hide();
                    window.Unrealize();
                };
                page.Run(window);
            };

            box.PackEnd(button);

            return(box);
        }
示例#3
0
        void RunGalleryPage(BaseGalleryPage page)
        {
            Window window = CreatePageWindow(page);

            page.Run(window);
        }