Ejemplo n.º 1
0
        public override EvasObject CreateContent(EvasObject parent)
        {
            Box box = new ColoredBox(parent);

            box.Show();
            box.PackEnd(GetTitleLabel(parent));

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

            button.Show();

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

            button2.Show();

            var button3 = new MButton(parent)
            {
                IsEnabled       = true,
                Text            = "Chage Tooltip Button2",
                WeightX         = 1,
                WeightY         = 1,
                AlignmentX      = -1,
                AlignmentY      = 0.5,
                BackgroundColor = Color.FromHex("#03A9F4"),
            };

            button3.Show();

            button.UseMTooltip();
            button2.UseMTooltip();
            button3.UseMTooltip();

            button.SetTooltipText("Button");

            button2.SetTooltipText("Tooltip Test");

            button3.SetTooltipText("#03A9F4");

            button3.Clicked += (s, e) =>
            {
                button2.SetTooltipText("Chage Tooltip");
            };

            box.PackEnd(button2);
            return(box);
        }
        public override void Run(Window window)
        {
            Conformant conformant = new Conformant(window);

            conformant.Show();
            Box box = new ColoredBox(window);

            conformant.SetContent(box);
            box.Show();

            var button = new MButton(window)
            {
                Text = "Button",
            };

            button.Resize(400, 80);
            button.Move(180, 300);
            button.Show();

            var button2 = new MButton(window)
            {
                Text = "Button2",
            };

            button2.Resize(400, 80);
            button2.Move(180, 600);
            button2.Show();

            var button3 = new MButton(window)
            {
                IsEnabled       = true,
                Text            = "Chage Tooltip Button2",
                BackgroundColor = Color.FromHex("#03A9F4"),
            };

            button3.Resize(600, 80);
            button3.Move(80, 900);
            button3.Show();

            button.UseMTooltip();
            button2.UseMTooltip();
            button3.UseMTooltip();

            button.SetTooltipText("Button");

            button2.SetTooltipText("Tooltip Test");

            button3.SetTooltipText("#03A9F4");

            button3.Clicked += (s, e) =>
            {
                button2.SetTooltipText("Chage Tooltip");
            };
        }
        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);
        }
        public EvasObject CreateThemeButtons(EvasObject parent)
        {
            Box box = new Box(parent)
            {
                IsHorizontal = true,
                WeightX      = 1,
                WeightY      = 0.1,
                AlignmentX   = -1,
                AlignmentY   = 0.5,
            };

            box.Show();

            var defaultColor = new MButton(parent)
            {
                Text         = "default",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            var light = new MButton(parent)
            {
                Text         = "light",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            var dark = new MButton(parent)
            {
                Text         = "Dark",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };

            defaultColor.Show();
            light.Show();
            dark.Show();
            box.PackEnd(defaultColor);
            box.PackEnd(light);
            box.PackEnd(dark);

            defaultColor.Clicked += (s, e) => MColors.Current = MColors.Default;
            light.Clicked        += (s, e) => MColors.Current = MColors.Light;
            dark.Clicked         += (s, e) => MColors.Current = MColors.Dark;

            return(box);
        }
Ejemplo n.º 5
0
        public override EvasObject CreateContent(EvasObject parent)
        {
            var box = new ColoredBox(parent);

            box.Show();
            box.PackEnd(GetTitleLabel(parent));

            var button = new MButton(parent)
            {
                Text         = "Button",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };

            box.PackEnd(button);
            button.Show();

            var button2 = new MButton(parent)
            {
                IsEnabled    = false,
                Text         = "Disabled",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };

            box.PackEnd(button2);
            button2.Show();

            var button3 = new MButton(parent)
            {
                IsEnabled       = true,
                Text            = "Custom Color",
                BackgroundColor = Color.FromHex("#03A9F4"),
                MinimumWidth    = 200,
                WeightY         = 1,
                AlignmentY      = 0.5
            };

            box.PackEnd(button3);
            button3.Show();

            return(box);
        }
Ejemplo n.º 6
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);
        }
Ejemplo n.º 7
0
        public override void Run(Window window)
        {
            Conformant conformant = new Conformant(window);

            conformant.Show();
            Box box = new Box(window)
            {
                BackgroundColor = Color.White,
            };

            conformant.SetContent(box);
            box.Show();

            var button = new MButton(window)
            {
                Text         = "Button",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.9
            };

            box.PackEnd(button);
            button.Show();

            var button2 = new MButton(window)
            {
                IsEnabled    = false,
                Text         = "Button 2",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.1
            };

            box.PackEnd(button2);
            button2.Show();
        }
Ejemplo n.º 8
0
        public override void Run(Window window)
        {
            Conformant conformant = new Conformant(window);

            conformant.Show();
            Box box = new ColoredBox(window);

            conformant.SetContent(box);
            box.Show();

            #region ThemeButton
            Box hbox = new Box(window)
            {
                IsHorizontal = true,
                WeightX      = 1,
                WeightY      = 0.1,
                AlignmentX   = -1,
                AlignmentY   = -1,
            };
            hbox.Show();
            box.PackEnd(hbox);

            var defaultColor = new MButton(window)
            {
                Text         = "default",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            var light = new MButton(window)
            {
                Text         = "light",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            var dark = new MButton(window)
            {
                Text         = "Dark",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            defaultColor.Show();
            light.Show();
            dark.Show();
            hbox.PackEnd(defaultColor);
            hbox.PackEnd(light);
            hbox.PackEnd(dark);

            defaultColor.Clicked += (s, e) => MColors.Current = MColors.Default;
            light.Clicked        += (s, e) => MColors.Current = MColors.Light;
            dark.Clicked         += (s, e) => MColors.Current = MColors.Dark;
            #endregion

            MTabs tabs = new MTabs(window)
            {
                Type       = MTabsType.Scrollable,
                AlignmentX = -1,
                AlignmentY = 0,
                WeightX    = 1,
                WeightY    = 1,
            };
            tabs.Show();

            Label label1 = new Label(window)
            {
                Text       = " Scrollable Tabs",
                AlignmentX = -1,
                AlignmentY = 0,
                WeightX    = 1,
                WeightY    = 1,
            };
            label1.Show();

            MTabs tabs2 = new MTabs(window)
            {
                Type       = MTabsType.Fixed,
                AlignmentX = -1,
                AlignmentY = 0,
                WeightX    = 1,
                WeightY    = 1,
            };
            tabs2.Show();

            Label label2 = new Label(window)
            {
                Text       = " Fixed Tabs",
                AlignmentX = -1,
                AlignmentY = 0,
                WeightX    = 1,
                WeightY    = 1
            };
            label2.Show();

            for (int i = 0; i < 4; i++)
            {
                var item = tabs.Append(string.Format("{0}ht Item", i));
            }

            for (int i = 0; i < 4; i++)
            {
                var item2 = tabs2.Append(string.Format("{0}ht Item", i), "home");
                item2.SetPartColor("bg", backgroudColor);
            }

            box.PackEnd(tabs);
            box.PackEnd(label1);
            box.PackEnd(tabs2);
            box.PackEnd(label2);
        }
Ejemplo n.º 9
0
        public override EvasObject CreateContent(EvasObject parent)
        {
            Box box = new ColoredBox(parent);

            box.Show();

            #region SnackBars
            MSnackBars snackBars = new MSnackBars(parent)
            {
                Text = "It's my favorite"
            };
            snackBars.OutsideClicked += (s, e) => { snackBars.Hide(); };

            MSnackBars snackBars2 = new MSnackBars(parent)
            {
                Text       = "It's my favorite",
                ActionText = "Action"
            };
            snackBars2.OutsideClicked += (s, e) => { snackBars2.Hide(); };
            snackBars2.ActionClicked  += (s, e) => { snackBars2.Hide(); };

            MSnackBars snackBars3 = new MSnackBars(parent)
            {
                Text = "I'm very happy because summer is my favorite season."
            };
            snackBars3.OutsideClicked += (s, e) => { snackBars3.Hide(); };

            MSnackBars snackBars4 = new MSnackBars(parent)
            {
                Text       = "I'm very happy because summer is my favorite season.",
                ActionText = "OK"
            };
            snackBars4.OutsideClicked += (s, e) => { snackBars4.Hide(); };
            snackBars4.ActionClicked  += (s, e) => { snackBars4.Hide(); };
            #endregion

            #region Buttons
            Box btbox = new Box(parent)
            {
                WeightX    = 1,
                WeightY    = 0.3,
                AlignmentX = -1,
                AlignmentY = -1,
            };
            btbox.Show();
            box.PackEnd(btbox);

            MButton button1 = new MButton(parent)
            {
                Text         = "SnackBars",
                MinimumWidth = 300,
                AlignmentY   = 0,
                WeightY      = 0.3,
            };
            button1.Show();
            button1.Clicked += (s, e) =>
            {
                snackBars.Show();
            };

            MButton button2 = new MButton(parent)
            {
                Text         = "SnackBars with Action",
                MinimumWidth = 300,
                AlignmentY   = 0,
                WeightY      = 0.3,
            };
            button2.Show();
            button2.Clicked += (s, e) =>
            {
                snackBars2.Show();
            };

            MButton button3 = new MButton(parent)
            {
                Text         = "SnackBars with long text",
                MinimumWidth = 300,
                AlignmentY   = 0,
                WeightY      = 0.3,
            };
            button3.Show();
            button3.Clicked += (s, e) =>
            {
                snackBars3.Show();
            };

            MButton button4 = new MButton(parent)
            {
                Text         = "SnackBars (long text and action)",
                MinimumWidth = 300,
                AlignmentY   = 0,
                WeightY      = 1,
            };
            button4.Show();
            button4.Clicked += (s, e) =>
            {
                snackBars4.Show();
            };

            btbox.PackEnd(button1);
            btbox.PackEnd(button2);
            btbox.PackEnd(button3);
            btbox.PackEnd(button4);
            #endregion

            return(box);
        }
Ejemplo n.º 10
0
        public override EvasObject CreateContent(EvasObject parent)
        {
            Box box = new ColoredBox(parent);

            box.Show();

            #region Menus
            MMenus menu1 = new MMenus(parent);
            menu1.Append("Undo");
            menu1.Append("Redo");
            var item = menu1.Append("Cut");
            item.InsertDividerAbove();
            menu1.Append("Copy");
            menu1.Append("Paste");

            var img1 = new Image(parent);
            img1.Load(Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "visible.png"));
            var img2 = new Image(parent);
            img2.Load(Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "add-user-male.png"));
            var img3 = new Image(parent);
            img3.Load(Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "link.png"));
            var img4 = new Image(parent);
            img4.Load(Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "copy.png"));
            var img5 = new Image(parent);
            img5.Load(Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "download.png"));

            MMenus menu2 = new MMenus(parent);
            menu2.Append("Preview", img1);
            menu2.Append("Share", img2);
            menu2.Append("Get Link", img3);
            var item2 = menu2.Append("Preview", img4);
            item2.InsertDividerAbove();
            menu2.Append("Download", img5);
            #endregion

            #region Buttons

            MButton button1 = new MButton(parent)
            {
                Text         = "Text list",
                MinimumWidth = 300,
                AlignmentY   = 0,
                WeightY      = 0.3,
            };
            button1.Show();
            button1.Clicked += (s, e) =>
            {
                var g = button1.Geometry;
                menu1.Move(g.X + (g.Width / 2), g.Y);
                menu1.Show();
            };

            MButton button2 = new MButton(parent)
            {
                Text         = "Text and icon list",
                MinimumWidth = 300,
                AlignmentY   = 0,
                WeightY      = 0.3,
            };
            button2.Show();
            button2.Clicked += (s, e) =>
            {
                var g = button2.Geometry;
                menu2.Move(g.X + (g.Width / 2), g.Y);
                menu2.Show();
            };

            box.PackEnd(button1);
            box.PackEnd(button2);
            #endregion

            return(box);
        }
        public override EvasObject CreateContent(EvasObject parent)
        {
            if (_conformant == null)
            {
                return(null);
            }

            Box box = new ColoredBox(parent);

            box.Show();

            #region ModalSheets
            MModalSheets modalSheets = new MModalSheets(_conformant, MModalSheetsDirection.Bottom);
            modalSheets.Show();

            GenList genlist = new GenList(_conformant)
            {
                Homogeneous = true,
                AlignmentX  = -1,
                AlignmentY  = -1,
                WeightX     = 1,
                WeightY     = 1,
            };

            GenItemClass defaultClass = new GenItemClass(Styles.GenListItem.MaterialNavigation)
            {
                GetTextHandler = (obj, part) =>
                {
                    return(((MItem)obj).Title);
                },
                GetContentHandler = (obj, part) =>
                {
                    var icon = ((MItem)obj).Icon;

                    if (icon != null)
                    {
                        var image  = new Image(_conformant);
                        var result = image.Load(Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, icon));
                        return(image);
                    }
                    else
                    {
                        return(null);
                    }
                }
            };

            genlist.Append(defaultClass, new MItem("Share", "share.png"));
            genlist.Append(defaultClass, new MItem("Get link", "insert-link.png"));
            genlist.Append(defaultClass, new MItem("Edit name", "edit.png"));
            genlist.Append(defaultClass, new MItem("Delete collection", "delete.png"));

            modalSheets.SetContent(genlist);
            #endregion

            #region Buttons
            Box btbox = new Box(parent)
            {
                WeightX    = 1,
                WeightY    = 0.3,
                AlignmentX = -1,
                AlignmentY = -1,
            };
            btbox.Show();
            box.PackEnd(btbox);

            MButton button1 = new MButton(parent)
            {
                Text         = "Open MModalBottomSheets",
                MinimumWidth = 600,
                AlignmentY   = 0,
                WeightY      = 0.3,
            };
            button1.Show();
            button1.Clicked += (s, e) =>
            {
                modalSheets.IsOpen = true;
            };

            btbox.PackEnd(button1);
            #endregion

            return(box);
        }
Ejemplo n.º 12
0
        public override void Run(Window window)
        {
            Conformant conformant = new Conformant(window);

            conformant.Show();
            Box box = new ColoredBox(window);

            conformant.SetContent(box);
            box.Show();

            #region ThemeButton
            Box hbox = new Box(window)
            {
                IsHorizontal = true,
                WeightX      = 1,
                WeightY      = 0.2,
                AlignmentX   = -1,
                AlignmentY   = -1,
            };
            hbox.Show();
            box.PackEnd(hbox);

            var defaultColor = new MButton(window)
            {
                Text         = "default",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            var light = new MButton(window)
            {
                Text         = "light",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            var dark = new MButton(window)
            {
                Text         = "Dark",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            defaultColor.Show();
            light.Show();
            dark.Show();
            hbox.PackEnd(defaultColor);
            hbox.PackEnd(light);
            hbox.PackEnd(dark);

            defaultColor.Clicked += (s, e) => MColors.Current = MColors.Default;
            light.Clicked        += (s, e) => MColors.Current = MColors.Light;
            dark.Clicked         += (s, e) => MColors.Current = MColors.Dark;
            #endregion

            //AlertDialog
            var button = new MButton(window)
            {
                Text         = "AlertDialog",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            box.PackEnd(button);
            button.Show();

            var dialog = CreateAlertDialog(window);

            button.Clicked += (s, e) =>
            {
                dialog.Show();
            };

            //SimpleDialog
            var button2 = new MButton(window)
            {
                Text         = "SimpleDialog",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            box.PackEnd(button2);
            button2.Show();

            var dialog2 = CreateSimpleDialog(window);

            button2.Clicked += (s, e) =>
            {
                dialog2.Show();
            };

            //ConfirmationDialog
            var button3 = new MButton(window)
            {
                Text         = "Confirmation(multi)",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            box.PackEnd(button3);
            button3.Show();

            var dialog3 = CreateConfirmationDialog(window);

            button3.Clicked += (s, e) =>
            {
                dialog3.Show();
            };

            //ConfirmationDialog2
            var button5 = new MButton(window)
            {
                Text         = "Confirmation(single)",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            box.PackEnd(button5);
            button5.Show();

            var dialog5 = CreateConfirmationDialog2(window);

            button5.Clicked += (s, e) =>
            {
                dialog5.Show();
            };

            //FullScreenDialog
            var button4 = new MButton(window)
            {
                Text         = "FullScreenDialog",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            box.PackEnd(button4);
            button4.Show();

            var dialog4 = CreateFullScreenDialog(window);

            button4.Clicked += (s, e) =>
            {
                dialog4.Show();
            };
        }
Ejemplo n.º 13
0
        public override void Run(Window window)
        {
            Conformant conformant = new Conformant(window);

            conformant.Show();
            Box box = new ColoredBox(window);

            conformant.SetContent(box);
            box.Show();

            #region ThemeButton
            Box hbox = new Box(window)
            {
                IsHorizontal = true,
                WeightX      = 1,
                WeightY      = 0.5,
                AlignmentX   = -1,
                AlignmentY   = -1,
            };
            hbox.Show();
            box.PackEnd(hbox);

            var defaultColor = new MButton(window)
            {
                Text         = "default",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            var light = new MButton(window)
            {
                Text         = "light",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            var dark = new MButton(window)
            {
                Text         = "Dark",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            defaultColor.Show();
            light.Show();
            dark.Show();
            hbox.PackEnd(defaultColor);
            hbox.PackEnd(light);
            hbox.PackEnd(dark);

            defaultColor.Clicked += (s, e) => MColors.Current = MColors.Default;
            light.Clicked        += (s, e) => MColors.Current = MColors.Light;
            dark.Clicked         += (s, e) => MColors.Current = MColors.Dark;
            #endregion


            MProgressIndicator determinatePI = new MProgressIndicator(window)
            {
                Value      = 0,
                AlignmentX = -1,
                AlignmentY = 0,
                WeightX    = 1,
                WeightY    = 1
            };
            determinatePI.Show();

            MProgressIndicator indeterminatePI = new MProgressIndicator(window)
            {
                Text       = "Linear progress indicator (Indeterminate)",
                Type       = MProgressIndicatorType.Indeterminate,
                AlignmentX = -1,
                AlignmentY = 0,
                WeightX    = 1,
                WeightY    = 1,
            };
            indeterminatePI.Show();

            MProgressIndicator disabledPI = new MProgressIndicator(window)
            {
                Text       = "Disabled",
                AlignmentX = -1,
                AlignmentY = 0,
                WeightX    = 1,
                WeightY    = 1,
                IsEnabled  = false,
            };
            disabledPI.Show();

            Label label1 = new Label(window)
            {
                Text       = "Linear progress indicator (Determinate)",
                AlignmentX = -1,
                AlignmentY = 0,
                WeightX    = 1,
                WeightY    = 1,
            };
            label1.Show();

            Label label2 = new Label(window)
            {
                Text       = "Linear progress indicator (Indeterminate)",
                AlignmentX = -1,
                AlignmentY = 0,
                WeightX    = 1,
                WeightY    = 1
            };
            label2.Show();

            box.PackEnd(label1);
            box.PackEnd(determinatePI);
            box.PackEnd(label2);
            box.PackEnd(indeterminatePI);
            box.PackEnd(disabledPI);

            double max  = 1.0;
            double min  = 0;
            double unit = 0.1;

            if (_animator == null)
            {
                _animator = new EcoreTimelineAnimator(1.0, () =>
                {
                    var val = determinatePI.Value + unit;
                    if (val <= max)
                    {
                        determinatePI.Value = val;
                    }
                });

                _animator.Finished += (s, e) =>
                {
                    determinatePI.Value = min;
                    _animator.Start();
                };
            }

            _animator.Start();
        }
        public override void Run(Window window)
        {
            Conformant conformant = new Conformant(window);

            conformant.Show();
            Box box = new ColoredBox(window);

            conformant.SetContent(box);
            box.Show();

            #region ThemeButton
            Box hbox = new Box(window)
            {
                IsHorizontal = true,
                WeightX      = 1,
                WeightY      = 0.2,
                AlignmentX   = -1,
                AlignmentY   = -1,
            };
            hbox.Show();
            box.PackEnd(hbox);

            var defaultColor = new MButton(window)
            {
                Text         = "default",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            var light = new MButton(window)
            {
                Text         = "light",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            var dark = new MButton(window)
            {
                Text         = "Dark",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            defaultColor.Show();
            light.Show();
            dark.Show();
            hbox.PackEnd(defaultColor);
            hbox.PackEnd(light);
            hbox.PackEnd(dark);

            defaultColor.Clicked += (s, e) => MColors.Current = MColors.Default;
            light.Clicked        += (s, e) => MColors.Current = MColors.Light;
            dark.Clicked         += (s, e) => MColors.Current = MColors.Dark;
            #endregion

            MBottomNavigation bn = new MBottomNavigation(window);
            bn.Show();
            box.PackEnd(bn);
            var IconPath = Path.Combine(ThemeLoader.AppResourcePath, "icon.png");

            for (int i = 0; i < 4; i++)
            {
                var item2 = bn.Append(string.Format("{0} Item", i), IconPath);
            }
        }
        public override void Run(Window window)
        {
            Conformant conformant = new Conformant(window);

            conformant.Show();
            Box box = new Box(window)
            {
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX    = 1,
                WeightY    = 1,
            };

            conformant.SetContent(box);
            box.Show();

            #region ThemeButton
            Box hbox = new Box(window)
            {
                IsHorizontal = true,
                WeightX      = 1,
                WeightY      = 0.1,
                AlignmentX   = -1,
                AlignmentY   = -1,
            };
            hbox.Show();
            box.PackEnd(hbox);

            var defaultColor = new MButton(window)
            {
                Text         = "default",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            var light = new MButton(window)
            {
                Text         = "light",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            var dark = new MButton(window)
            {
                Text         = "Dark",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            defaultColor.Show();
            light.Show();
            dark.Show();
            hbox.PackEnd(defaultColor);
            hbox.PackEnd(light);
            hbox.PackEnd(dark);

            defaultColor.Clicked += (s, e) => MColors.Current = MColors.Default;
            light.Clicked        += (s, e) => MColors.Current = MColors.Light;
            dark.Clicked         += (s, e) => MColors.Current = MColors.Dark;
            #endregion


            MNavigationView nv = new MNavigationView(window)
            {
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX    = 1,
                WeightY    = 1,
            };

            var btn1 = new Button(window)
            {
                Text          = "Chage Header",
                AlignmentX    = -1,
                AlignmentY    = -1,
                WeightX       = 1,
                WeightY       = 1,
                MinimumHeight = 300,
            };
            btn1.Show();

            var btn2 = new Button(window)
            {
                Text            = "Chage Header",
                AlignmentX      = -1,
                AlignmentY      = -1,
                WeightX         = 1,
                WeightY         = 1,
                BackgroundColor = Color.Blue
            };
            btn2.Show();

            var btn3 = new Button(window)
            {
                Text       = "Button",
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX    = 1,
                WeightY    = 1,
            };
            btn3.Show();

            var header = new Box(window)
            {
                AlignmentX      = -1,
                AlignmentY      = -1,
                WeightX         = 1,
                WeightY         = 1,
                BackgroundColor = Color.White
            };

            header.PackEnd(btn2);
            header.PackEnd(btn3);
            header.Show();

            nv.Header = btn1;

            btn1.Clicked += (s, e) =>
            {
                nv.Header = header;
            };

            btn2.Clicked += (s, e) =>
            {
                nv.Header = btn1;
            };

            var items = new List <MItem>();
            items.Add(new MItem("My Files", "icon.png"));
            items.Add(new MItem("Shared with me", "icon.png"));
            items.Add(new MItem("Starred", "icon.png"));
            items.Add(new MItem("Recent", "icon.png"));
            items.Add(new MItem("Offline", "icon.png"));
            items.Add(new MItem("Uploads", "icon.png"));
            items.Add(new MItem("Backup", "icon.png"));
            items.Add(new MItem("Movie", "icon.png"));
            items.Add(new MItem("Music", "icon.png"));
            items.Add(new MItem("Play", "icon.png"));

            var items1 = new List <MItem>();

            for (int i = 0; i < 20; i++)
            {
                items1.Add(new MItem("Change Item", "icon.png"));
            }

            nv.Menu = items;

            var dividers = new List <int>();

            dividers.Add(1);
            dividers.Add(3);
            dividers.Add(5);

            nv.MenuItemSelected += (s, e) =>
            {
                if (nv.Menu == items)
                {
                    nv.Menu = items1;
                }
                else
                {
                    nv.Menu = items;
                }
            };

            nv.Show();

            box.PackEnd(nv);
        }
        public override EvasObject CreateContent(EvasObject parent)
        {
            if (_conformant == null)
            {
                return(null);
            }

            Box box = new ColoredBox(parent);

            box.Show();

            #region ModalSheets
            MModalSheets modalSheets = new MModalSheets(_conformant, MModalSheetsDirection.Side);
            modalSheets.Show();

            Label label1 = new Label(parent)
            {
                Text       = "<span font_size=35 color=#a8a8a8>Labels</span>",
                AlignmentX = 0,
            };
            label1.Show();
            var check1 = new MCheckBox(parent)
            {
                Text         = "Events",
                MinimumWidth = 400,
            };
            check1.Show();
            var check2 = new MCheckBox(parent)
            {
                Text         = "Personal",
                IsChecked    = true,
                MinimumWidth = 400,
            };
            check2.Show();
            var check3 = new MCheckBox(parent)
            {
                Text         = "Project",
                IsChecked    = true,
                MinimumWidth = 400,
            };
            check3.Show();
            var check4 = new MCheckBox(parent)
            {
                Text         = "Reminders",
                MinimumWidth = 400,
            };
            check4.Show();
            var check5 = new MCheckBox(parent)
            {
                Text         = "Work",
                MinimumWidth = 400,
            };
            check5.Show();

            var contents = new Box(_conformant)
            {
                IsHorizontal    = true,
                AlignmentX      = -1,
                AlignmentY      = -1,
                WeightX         = 1,
                WeightY         = 1,
                BackgroundColor = Color.White,
            };
            contents.Show();
            contents.SetPadding(45, 45);

            var contents1 = new Box(_conformant)
            {
                IsHorizontal = true,
            };
            contents1.Show();
            contents1.SetPadding(45, 45);
            contents.PackEnd(contents1);

            var contents2 = new Box(_conformant)
            {
                IsHorizontal = false,
                AlignmentX   = 0,
                AlignmentY   = 0,
                WeightX      = 1,
                WeightY      = 0,
            };
            contents2.Show();
            contents2.SetPadding(45, 45);
            contents.PackEnd(contents2);

            var contents3 = new Box(_conformant)
            {
                IsHorizontal = false,
            };
            contents3.Show();
            contents3.SetPadding(45, 45);
            contents2.PackEnd(contents3);

            contents2.PackEnd(label1);
            contents2.PackEnd(check1);
            contents2.PackEnd(check2);
            contents2.PackEnd(check3);
            contents2.PackEnd(check4);
            contents2.PackEnd(check5);

            modalSheets.SetContent(contents);
            #endregion

            #region Buttons
            Box btbox = new Box(parent)
            {
                WeightX    = 1,
                WeightY    = 0.3,
                AlignmentX = -1,
                AlignmentY = -1,
            };
            btbox.Show();
            box.PackEnd(btbox);

            MButton button1 = new MButton(parent)
            {
                Text         = "Open MModalSideSheets",
                MinimumWidth = 600,
                AlignmentY   = 0,
                WeightY      = 0.3,
            };
            button1.Show();
            button1.Clicked += (s, e) =>
            {
                modalSheets.IsOpen = true;
            };

            btbox.PackEnd(button1);
            #endregion

            return(box);
        }
        EvasObject CreateCard1(Window window)
        {
            //Set Layout
            var card = new MCard(window)
            {
                MinimumWidth  = 344.ToPixel(),
                MinimumHeight = 148.ToPixel(),
            };

            var iconBox = new Box(window)
            {
                MinimumWidth  = 80.ToPixel(),
                MinimumHeight = 80.ToPixel()
            };

            var textBox = new Box(window)
            {
                MinimumWidth  = 216.ToPixel(),
                MinimumHeight = 80.ToPixel()
            };

            textBox.SetPadding(0, 10);


            var actionBox = new Box(window)
            {
                MinimumHeight = 36.ToPixel(),
                IsHorizontal  = true
            };

            actionBox.SetPadding(8, 0);

            card.Show();
            iconBox.Show();
            textBox.Show();
            actionBox.Show();

            card.PackEnd(iconBox);
            card.PackEnd(textBox);
            card.PackEnd(actionBox);

            card.SetLayoutCallback(() =>
            {
                var g = card.Geometry;

                textBox.Geometry = new Rect(
                    g.X + 16.ToPixel(),
                    g.Y + 16.ToPixel(),
                    textBox.MinimumWidth,
                    textBox.MinimumHeight);

                iconBox.Geometry = new Rect(
                    textBox.Geometry.X + textBox.Geometry.Width + 16.ToPixel(),
                    textBox.Geometry.Y,
                    iconBox.MinimumWidth,
                    iconBox.MinimumHeight);

                actionBox.Geometry = new Rect(
                    g.X + 8.ToPixel(),
                    iconBox.Geometry.Y + iconBox.Geometry.Height + 8.ToPixel(),
                    g.Width - 32.ToPixel(),
                    actionBox.MinimumHeight);
            });

            //Fill the contents
            var icon = new Image(window)
            {
                AlignmentX    = -1,
                AlignmentY    = -1,
                WeightX       = 1,
                WeightY       = 1,
                IsFixedAspect = false
            };

            icon.Load(Path.Combine(MaterialGallery.ResourceDir, "image.png"));
            icon.Show();
            iconBox.PackEnd(icon);

            var title = new Label(window)
            {
                Text       = $"<span font_size={25.ToPixel()}>Title goes here</span>",
                AlignmentX = 0,
                AlignmentY = 0
            };
            var sub = new Label(window)
            {
                Text          = $"<span font_size={15.ToPixel()} color=#666666>Secondary line text Lorem ipsum dolor sit amet</span>",
                LineWrapType  = WrapType.Word,
                LineWrapWidth = textBox.MinimumWidth,
                AlignmentX    = 0,
                AlignmentY    = 0,
            };

            title.Show();
            sub.Show();
            textBox.PackEnd(title);
            textBox.PackEnd(sub);

            var action1 = new MButton(window)
            {
                //ButtonStyle = MButtonStyle.TextButton,
                //Text = "Action 1",
                Text            = $"<span font_size={18.ToPixel()} color=#6200ee>Action 1</span>",
                BackgroundColor = Color.White,
                AlignmentX      = 0,
                MinimumWidth    = 100.ToPixel()
            };

            var action2 = new MButton(window)
            {
                //ButtonStyle = MButtonStyle.TextButton,
                //Text = "Action 2",
                Text            = $"<span font_size={18.ToPixel()} color=#6200ee>Action 2</SPAN>",
                BackgroundColor = Color.White,
                AlignmentX      = 0,
                MinimumWidth    = 100.ToPixel()
            };

            var empty = new Label(window)
            {
                AlignmentX = 0,
                WeightX    = 1,
            };

            action1.Show();
            action2.Show();
            empty.Show();

            actionBox.PackEnd(action1);
            actionBox.PackEnd(action2);
            actionBox.PackEnd(empty);

            return(card);
        }
Ejemplo n.º 18
0
        public override void Run(Window window)
        {
            Conformant conformant = new Conformant(window);

            conformant.Show();
            Box box = new ColoredBox(window);

            conformant.SetContent(box);
            box.Show();

            #region ThemeButton
            Box hbox = new Box(window)
            {
                IsHorizontal = true,
                WeightX      = 1,
                WeightY      = 0.2,
                AlignmentX   = -1,
                AlignmentY   = -1,
            };
            hbox.Show();
            box.PackEnd(hbox);

            var defaultColor = new MButton(window)
            {
                Text         = "default",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            var light = new MButton(window)
            {
                Text         = "light",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            var dark = new MButton(window)
            {
                Text         = "Dark",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            defaultColor.Show();
            light.Show();
            dark.Show();
            hbox.PackEnd(defaultColor);
            hbox.PackEnd(light);
            hbox.PackEnd(dark);

            defaultColor.Clicked += (s, e) => MColors.Current = MColors.Default;
            light.Clicked        += (s, e) => MColors.Current = MColors.Light;
            dark.Clicked         += (s, e) => MColors.Current = MColors.Dark;
            #endregion


            var radio = new MRadioButton(window)
            {
                StateValue   = 1,
                Text         = "group1",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            box.PackEnd(radio);
            radio.Show();

            var radio2 = new MRadioButton(window)
            {
                StateValue   = 2,
                Text         = "group1",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            box.PackEnd(radio2);
            radio2.Show();
            radio2.SetGroup(radio);

            var radio3 = new MRadioButton(window)
            {
                StateValue   = 3,
                Text         = "Disabled",
                IsEnabled    = false,
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            box.PackEnd(radio3);
            radio3.Show();

            var radio4 = new MRadioButton(window)
            {
                StateValue   = 4,
                Text         = "Custom Color",
                IsEnabled    = true,
                Color        = Color.FromHex("#E30425"),
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            box.PackEnd(radio4);
            radio4.Show();
        }
Ejemplo n.º 19
0
        public override EvasObject CreateContent(EvasObject parent)
        {
            Box box = new ColoredBox(parent);

            box.Show();

            var naviIconPath = Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "menu.png");

            var appbar = new MBottomAppBar(parent)
            {
                NavigationItem = new MActionItem("naviItem", naviIconPath, () =>
                {
                    Console.WriteLine($"Navigation action item clicked");
                })
            };

            appbar.Show();

            var airplaneIconPath  = Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "airplane.png");
            var alarmIconPath     = Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "alarm.png");
            var bluetoothIconPath = Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "bluetooth.png");

            appbar.ActionItems.Add(new MActionItem("airplane", airplaneIconPath, () => { Console.WriteLine($"ariplane"); }));
            appbar.ActionItems.Add(new MActionItem("alarm", alarmIconPath, () => { Console.WriteLine($"alarm"); }));
            appbar.ActionItems.Add(new MActionItem("bluetooth", bluetoothIconPath, () => { Console.WriteLine($"bluetooth"); }));

            var nButton = new MButton(parent)
            {
                Text         = "add/remove naviitem",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5,
            };

            var item = new MActionItem("new", naviIconPath, () =>
            {
                Console.WriteLine($"new Navigation action item");
            });

            nButton.Clicked += (s, e) =>
            {
                if (appbar.NavigationItem == null)
                {
                    appbar.NavigationItem = item;
                }
                else
                {
                    appbar.NavigationItem = null;
                }
            };
            nButton.Show();

            var addButton = new MButton(parent)
            {
                Text         = "add item",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5,
            };

            int itemNum = 1;

            addButton.Clicked += (s, e) =>
            {
                var iconPath = Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "alarm.png");
                appbar.ActionItems.Add(new MActionItem("new item" + itemNum++, iconPath, () => { Console.WriteLine($"new item{itemNum} clicked!!"); }));;
            };
            addButton.Show();

            var removeButton = new MButton(parent)
            {
                Text         = "remove item",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5,
            };

            removeButton.Clicked += (s, e) =>
            {
                if (appbar.ActionItems.Count > 0)
                {
                    appbar.ActionItems.RemoveAt(appbar.ActionItems.Count - 1);
                }
            };
            removeButton.Show();

            var lbutton = new MButton(parent)
            {
                Text         = "layout",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5,
            };

            int layout = 0;

            lbutton.Clicked += (s, e) =>
            {
                layout++;

                if (layout % 3 == 2)
                {
                    appbar.LayoutOption = BottomAppBarLayoutOption.NoFAB;
                }
                else if (layout % 3 == 1)
                {
                    appbar.LayoutOption = BottomAppBarLayoutOption.EndFAB;
                }
                else
                {
                    appbar.LayoutOption = BottomAppBarLayoutOption.CenteredFAB;
                }
                lbutton.Text         = "layout: " + appbar.LayoutOption.ToString();
                lbutton.MinimumWidth = 400;
            };
            lbutton.Show();

            var entry = new MTextField(parent)
            {
                AlignmentX = -1,
                WeightY    = 1,
                Label      = "textfield",
                Text       = "click here to show virtual keypad"
            };

            entry.Show();

            _conformant.KeyPadOn += (s, e) =>
            {
                box.UnPack(appbar);
            };

            _conformant.KeyPadOff += (s, e) =>
            {
                box.PackEnd(appbar);
            };

            MFloatingActionButton fab = new MFloatingActionButton(_conformant);
            Image img2 = new Image(parent);

            img2.Load(Path.Combine(MaterialGallery.ResourceDir, "airplane.png"));
            fab.Icon = img2;

            appbar.FloatingActionButton = fab;

            box.PackEnd(nButton);
            box.PackEnd(lbutton);
            box.PackEnd(addButton);
            box.PackEnd(removeButton);
            box.PackEnd(entry);

            box.PackEnd(appbar);

            return(box);
        }
Ejemplo n.º 20
0
        public override void Run(Window window)
        {
            Conformant conformant = new Conformant(window);

            conformant.Show();
            Box box = new ColoredBox(window);

            conformant.SetContent(box);
            box.Show();

            #region ThemeButton
            Box hbox = new Box(window)
            {
                IsHorizontal = true,
                WeightX      = 1,
                WeightY      = 0.2,
                AlignmentX   = -1,
                AlignmentY   = -1,
            };
            hbox.Show();
            box.PackEnd(hbox);

            var defaultColor = new MButton(window)
            {
                Text         = "default",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            var light = new MButton(window)
            {
                Text         = "light",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            var dark = new MButton(window)
            {
                Text         = "Dark",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            defaultColor.Show();
            light.Show();
            dark.Show();
            hbox.PackEnd(defaultColor);
            hbox.PackEnd(light);
            hbox.PackEnd(dark);

            defaultColor.Clicked += (s, e) => MColors.Current = MColors.Default;
            light.Clicked        += (s, e) => MColors.Current = MColors.Light;
            dark.Clicked         += (s, e) => MColors.Current = MColors.Dark;
            #endregion


            var button = new MButton(window)
            {
                Text         = "Button",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            box.PackEnd(button);
            button.Show();

            var button2 = new MButton(window)
            {
                IsEnabled    = false,
                Text         = "Disabled",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            box.PackEnd(button2);
            button2.Show();

            var button3 = new MButton(window)
            {
                IsEnabled       = true,
                Text            = "Custom Color",
                BackgroundColor = Color.FromHex("#03A9F4"),
                MinimumWidth    = 400,
                WeightY         = 1,
                AlignmentY      = 0.5
            };
            box.PackEnd(button3);
            button3.Show();
        }
Ejemplo n.º 21
0
        public override void Run(Window window)
        {
            Conformant conformant = new Conformant(window);

            conformant.Show();
            Box box = new ColoredBox(window);

            conformant.SetContent(box);
            box.Show();

            #region ThemeButton
            Box hbox = new Box(window)
            {
                IsHorizontal = true,
                WeightX      = 1,
                WeightY      = 0.2,
                AlignmentX   = -1,
                AlignmentY   = -1,
            };
            hbox.Show();
            box.PackEnd(hbox);

            var defaultColor = new MButton(window)
            {
                Text         = "default",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            var light = new MButton(window)
            {
                Text         = "light",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            var dark = new MButton(window)
            {
                Text         = "Dark",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            defaultColor.Show();
            light.Show();
            dark.Show();
            hbox.PackEnd(defaultColor);
            hbox.PackEnd(light);
            hbox.PackEnd(dark);

            defaultColor.Clicked += (s, e) => MColors.Current = MColors.Default;
            light.Clicked        += (s, e) => MColors.Current = MColors.Light;
            dark.Clicked         += (s, e) => MColors.Current = MColors.Dark;
            #endregion


            var switch1 = new MSwitch(window)
            {
                WeightY    = 1,
                AlignmentY = 0.5
            };
            box.PackEnd(switch1);
            switch1.Show();

            var switch2 = new MSwitch(window)
            {
                WeightY    = 1,
                AlignmentY = 0.5
            };
            box.PackEnd(switch2);
            switch2.Show();

            var switch3 = new MSwitch(window)
            {
                IsEnabled  = false,
                IsChecked  = true,
                Text       = "Disabled",
                WeightY    = 1,
                AlignmentY = 0.5
            };
            box.PackEnd(switch3);
            switch3.Show();

            var switch4 = new MSwitch(window)
            {
                IsEnabled  = true,
                Text       = "Custom Color",
                Color      = Color.FromHex("#E30425"),
                WeightY    = 1,
                AlignmentY = 0.5
            };
            box.PackEnd(switch4);
            switch4.Show();
        }
        public override EvasObject CreateContent(EvasObject parent)
        {
            Box box = new ColoredBox(parent);

            box.Show();

            var button1 = new MButton(parent)
            {
                Text         = "Show Banner: Single",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5
            };

            button1.Clicked += (s, e) =>
            {
                CreateBanner(parent, box);
            };

            box.PackEnd(button1);
            button1.Show();

            var button2 = new MButton(parent)
            {
                Text         = "Show Banner: Single Long",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5
            };

            button2.Clicked += (s, e) =>
            {
                CreateBanner2(parent, box);
            };

            box.PackEnd(button2);
            button2.Show();


            var button3 = new MButton(parent)
            {
                Text         = "Show Banner: Double",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5
            };

            button3.Clicked += (s, e) =>
            {
                CreateBanner3(parent, box);
            };

            box.PackEnd(button3);
            button3.Show();

            var button4 = new MButton(parent)
            {
                Text         = "Show Banner: Double with Icon",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5
            };

            button4.Clicked += (s, e) =>
            {
                CreateBanner4(parent, box);
            };

            box.PackEnd(button4);
            button4.Show();

            return(box);
        }
        public override void Run(Window window)
        {
            Conformant conformant = new Conformant(window);

            conformant.Show();
            Box box = new Box(window)
            {
                BackgroundColor = Color.White,
            };

            conformant.SetContent(box);
            box.Show();

            MNavigationView nv = new MNavigationView(window);

            var paddingbox = new Box(window)
            {
                AlignmentX   = -1,
                AlignmentY   = -1,
                MinimumWidth = 32,
            };

            paddingbox.Show();
            var paddingbox1 = new Box(window)
            {
                AlignmentX   = -1,
                AlignmentY   = -1,
                MinimumWidth = 32,
            };

            paddingbox1.Show();
            var paddingbox2 = new Box(window)
            {
                AlignmentX    = -1,
                AlignmentY    = -1,
                MinimumHeight = 30,
            };

            paddingbox2.Show();
            var paddingbox3 = new Box(window)
            {
                AlignmentX    = -1,
                AlignmentY    = -1,
                MinimumHeight = 10,
            };

            paddingbox3.Show();

            var name = new Label(window)
            {
                AlignmentX    = -1,
                AlignmentY    = -1,
                WeightX       = 1,
                WeightY       = 1,
                Text          = "<span font_weight=bold font_size=50>Tizen</span>",
                MinimumHeight = 80
            };

            name.Show();

            var namebox = new Box(window)
            {
                AlignmentX   = -1,
                AlignmentY   = -1,
                WeightX      = 1,
                WeightY      = 1,
                IsHorizontal = true,
            };

            namebox.Show();
            namebox.PackEnd(paddingbox);
            namebox.PackEnd(name);

            var email = new Label(window)
            {
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX    = 1,
                WeightY    = 1,
                Text       = "<span font_size=35>[email protected]<span>",
            };

            email.Show();

            var emailbox = new Box(window)
            {
                AlignmentX   = -1,
                AlignmentY   = -1,
                WeightX      = 1,
                WeightY      = 1,
                IsHorizontal = true,
            };

            emailbox.Show();
            emailbox.PackEnd(paddingbox1);
            emailbox.PackEnd(email);

            var header = new Box(window)
            {
                MinimumHeight   = 200,
                BackgroundColor = Color.White
            };

            header.PackEnd(paddingbox2);
            header.PackEnd(namebox);
            header.PackEnd(emailbox);
            header.PackEnd(paddingbox3);
            header.Show();

            nv.Header = header;

            var items1 = new List <MItem>();

            items1.Add(new MItem("My Files", "icon.png"));
            items1.Add(new MItem("Shared with me", "icon.png"));
            items1.Add(new MItem("Starred", "icon.png"));
            items1.Add(new MItem("Recent", "icon.png"));
            items1.Add(new MItem("Offline", "icon.png"));

            var items2 = new List <MItem>();

            items2.Add(new MItem("Uploads", "icon.png"));
            items2.Add(new MItem("Backup", "icon.png"));
            items2.Add(new MItem("Movie", "icon.png"));
            items2.Add(new MItem("Music", "icon.png"));
            items2.Add(new MItem("Play", "icon.png"));

            var group1 = new MGroup(items1, "Account");
            var group2 = new MGroup(items2);

            var groups = new List <MGroup>();

            groups.Add(group1);
            groups.Add(group2);

            nv.GroupMenu = groups;

            var main1 = new MButton(window)
            {
                Text          = "Open NavigationView",
                AlignmentX    = 0,
                AlignmentY    = 0,
                MinimumWidth  = 720,
                MinimumHeight = 300
            };

            main1.Show();

            var nd = new MNavigationDrawer(window)
            {
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX    = 1,
                WeightY    = 1,
            };

            nd.Main           = main1;
            nd.NavigationView = nv;

            main1.Clicked += (s, e) =>
            {
                nd.IsOpen = true;
            };

            nd.Show();

            box.PackEnd(nd);
        }
        public override EvasObject CreateContent(EvasObject parent)
        {
            Box box = new ColoredBox(parent);

            box.Show();

            MNavigationView nv = new MNavigationView(parent);

            var paddingbox = new Box(parent)
            {
                AlignmentX   = -1,
                AlignmentY   = -1,
                MinimumWidth = 32,
            };

            paddingbox.Show();
            var paddingbox1 = new Box(parent)
            {
                AlignmentX   = -1,
                AlignmentY   = -1,
                MinimumWidth = 32,
            };

            paddingbox1.Show();
            var paddingbox2 = new Box(parent)
            {
                AlignmentX    = -1,
                AlignmentY    = -1,
                MinimumHeight = 30,
            };

            paddingbox2.Show();
            var paddingbox3 = new Box(parent)
            {
                AlignmentX    = -1,
                AlignmentY    = -1,
                MinimumHeight = 10,
            };

            paddingbox3.Show();

            var name = new Label(parent)
            {
                AlignmentX    = -1,
                AlignmentY    = -1,
                WeightX       = 1,
                WeightY       = 1,
                Text          = "<span font_weight=bold font_size=50>Tizen</span>",
                MinimumHeight = 80
            };

            name.Show();

            var namebox = new Box(parent)
            {
                AlignmentX   = -1,
                AlignmentY   = -1,
                WeightX      = 1,
                WeightY      = 1,
                IsHorizontal = true,
            };

            namebox.Show();
            namebox.PackEnd(paddingbox);
            namebox.PackEnd(name);

            var email = new Label(parent)
            {
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX    = 1,
                WeightY    = 1,
                Text       = "<span font_size=35>[email protected]<span>",
            };

            email.Show();

            var emailbox = new Box(parent)
            {
                AlignmentX   = -1,
                AlignmentY   = -1,
                WeightX      = 1,
                WeightY      = 1,
                IsHorizontal = true,
            };

            emailbox.Show();
            emailbox.PackEnd(paddingbox1);
            emailbox.PackEnd(email);

            var header = new Box(parent)
            {
                MinimumHeight   = 200,
                BackgroundColor = Color.White
            };

            header.PackEnd(paddingbox2);
            header.PackEnd(namebox);
            header.PackEnd(emailbox);
            header.PackEnd(paddingbox3);
            header.Show();

            nv.Header = header;

            var items = new List <MItem>();

            items.Add(new MItem("My Files", "icon.png"));
            items.Add(new MItem("Shared with me", "icon.png"));
            items.Add(new MItem("Starred", "icon.png"));
            items.Add(new MItem("Recent", "icon.png"));
            items.Add(new MItem("Offline", "icon.png"));
            items.Add(new MItem("Uploads", "icon.png"));
            items.Add(new MItem("Backup", "icon.png"));
            items.Add(new MItem("Movie", "icon.png"));
            items.Add(new MItem("Music", "icon.png"));
            items.Add(new MItem("Play", "icon.png"));

            nv.Menu = items;

            var main1 = new MButton(parent)
            {
                Text          = "Open NavigationView",
                AlignmentX    = 0,
                AlignmentY    = 0,
                MinimumWidth  = 720,
                MinimumHeight = 300
            };

            main1.Show();

            var nd = new MNavigationDrawer(parent)
            {
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX    = 1,
                WeightY    = 1,
            };

            nd.Main           = main1;
            nd.NavigationView = nv;

            main1.Clicked += (s, e) =>
            {
                nd.IsOpen = true;
            };

            nd.Show();

            box.PackEnd(nd);

            return(box);
        }
Ejemplo n.º 25
0
        protected override void OnElementChanged(ElementChangedEventArgs <Stepper> e)
        {
            if (Control == null)
            {
                var outter = new EBox(System.Maui.Maui.NativeParent)
                {
                    AlignmentX   = -1,
                    AlignmentY   = -1,
                    WeightX      = 1,
                    WeightY      = 1,
                    IsHorizontal = true,
                };
                outter.SetPadding(horizontalPadding, 0);
                outter.Show();
                outter.SetLayoutCallback(OnLayout);

                _borderL = new BorderRectangle(System.Maui.Maui.NativeParent);
                _borderL.Show();
                _borderL.SetRadius(radius);
                _borderL.BorderWidth = borderWidth;
                _borderL.Color       = defaultColor;

                _buttonL = new MButton(System.Maui.Maui.NativeParent)
                {
                    BackgroundColor = EColor.Transparent,
                    Text            = "<span color='#000000'>-</span>",
                };
                _buttonL.Show();

                _buttonL.Clicked += OnDecrementButtonClicked;

                outter.PackEnd(_borderL);
                outter.PackEnd(_buttonL);

                _borderR = new BorderRectangle(System.Maui.Maui.NativeParent);
                _borderR.Show();
                _borderR.SetRadius(radius);
                _borderR.BorderWidth = borderWidth;
                _borderR.Color       = defaultColor;

                _buttonR = new MButton(System.Maui.Maui.NativeParent)
                {
                    BackgroundColor = EColor.Transparent,
                    Text            = "<span color='#000000'>+</span>",
                };
                _buttonR.Show();

                _buttonR.Clicked += OnIncrementButtonClicked;

                outter.PackEnd(_borderR);
                outter.PackEnd(_buttonR);

                SetNativeView(outter);
            }

            UpdateValue();
            UpdateIncrement();
            UpdateMinimum();
            UpdateMaximum();

            base.OnElementChanged(e);
        }
Ejemplo n.º 26
0
        public override void Run(Window window)
        {
            Conformant conformant = new Conformant(window);

            conformant.Show();
            Box box = new ColoredBox(window);

            box.Show();
            conformant.SetContent(box);

            #region ThemeButton
            Box hbox = new Box(window)
            {
                IsHorizontal = true,
                WeightX      = 1,
                WeightY      = 0.1,
                AlignmentX   = -1,
                AlignmentY   = -1,
            };
            hbox.Show();
            box.PackEnd(hbox);

            var defaultColor = new MButton(window)
            {
                Text         = "default",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            var light = new MButton(window)
            {
                Text         = "light",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            var dark = new MButton(window)
            {
                Text         = "Dark",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            defaultColor.Show();
            light.Show();
            dark.Show();
            hbox.PackEnd(defaultColor);
            hbox.PackEnd(light);
            hbox.PackEnd(dark);

            defaultColor.Clicked += (s, e) => MColors.Current = MColors.Default;
            light.Clicked        += (s, e) => MColors.Current = MColors.Light;
            dark.Clicked         += (s, e) => MColors.Current = MColors.Dark;
            #endregion


            Box inner = new Box(window)
            {
                WeightX    = 1,
                WeightY    = 1,
                AlignmentX = -1,
                AlignmentY = -1,
            };

            box.PackEnd(inner);
            inner.Show();

            var slider = new MSlider(window)
            {
                Minimum = 0,
                Maximum = 100
            };
            slider.Value = 50;
            slider.Show();
            inner.PackEnd(slider);

            var disabledSlider = new MSlider(window)
            {
                Minimum   = 0,
                Maximum   = 100,
                IsEnabled = false
            };
            disabledSlider.Value = 50;
            disabledSlider.Show();
            inner.PackEnd(disabledSlider);

            inner.SetLayoutCallback(() =>
            {
                var rect                = inner.Geometry;
                slider.Geometry         = new Rect((rect.Width / 2) - 250, (rect.Height / 2 - 100), 500, 50);
                disabledSlider.Geometry = new Rect((rect.Width / 2) - 250, (rect.Height / 2), 500, 50);
            });
        }
Ejemplo n.º 27
0
        public override EvasObject CreateContent(EvasObject parent)
        {
            Box box = new ColoredBox(parent);

            box.Show();

            //AlertDialog
            var button = new MButton(parent)
            {
                Text         = "AlertDialog",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5
            };

            box.PackEnd(button);
            button.Show();

            var dialog = CreateAlertDialog(parent);

            button.Clicked += (s, e) =>
            {
                dialog.Show();
            };

            //SimpleDialog
            var button2 = new MButton(parent)
            {
                Text         = "SimpleDialog",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5
            };

            box.PackEnd(button2);
            button2.Show();

            var dialog2 = CreateSimpleDialog(parent);

            button2.Clicked += (s, e) =>
            {
                dialog2.Show();
            };

            //ConfirmationDialog
            var button3 = new MButton(parent)
            {
                Text         = "Confirmation(multi)",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5
            };

            box.PackEnd(button3);
            button3.Show();

            var dialog3 = CreateConfirmationDialog(parent);

            button3.Clicked += (s, e) =>
            {
                dialog3.Show();
            };

            //ConfirmationDialog2
            var button5 = new MButton(parent)
            {
                Text         = "Confirmation(single)",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5
            };

            box.PackEnd(button5);
            button5.Show();

            var dialog5 = CreateConfirmationDialog2(parent);

            button5.Clicked += (s, e) =>
            {
                dialog5.Show();
            };

            //FullScreenDialog
            var button4 = new MButton(parent)
            {
                Text         = "FullScreenDialog",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5
            };

            box.PackEnd(button4);
            button4.Show();

            var dialog4 = CreateFullScreenDialog(parent);

            button4.Clicked += (s, e) =>
            {
                dialog4.Show();
            };

            return(box);
        }
Ejemplo n.º 28
0
        public override void Run(Window window)
        {
            Conformant conformant = new Conformant(window);

            conformant.Show();
            Box box = new ColoredBox(window);

            conformant.SetContent(box);
            box.Show();

            #region ThemeButton
            Box hbox = new Box(window)
            {
                IsHorizontal = true,
                WeightX      = 1,
                WeightY      = 0.1,
                AlignmentX   = -1,
                AlignmentY   = -1,
            };
            hbox.Show();
            box.PackEnd(hbox);

            var defaultColor = new MButton(window)
            {
                Text         = "default",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            var light = new MButton(window)
            {
                Text         = "light",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            var dark = new MButton(window)
            {
                Text         = "Dark",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            defaultColor.Show();
            light.Show();
            dark.Show();
            hbox.PackEnd(defaultColor);
            hbox.PackEnd(light);
            hbox.PackEnd(dark);

            defaultColor.Clicked += (s, e) => MColors.Current = MColors.Default;
            light.Clicked        += (s, e) => MColors.Current = MColors.Light;
            dark.Clicked         += (s, e) => MColors.Current = MColors.Dark;
            #endregion

            #region SnackBars
            MSnackBars snackBars = new MSnackBars(window)
            {
                Text = "It's my favorite"
            };
            snackBars.OutsideClicked += (s, e) => { snackBars.Hide(); };

            MSnackBars snackBars2 = new MSnackBars(window)
            {
                Text       = "It's my favorite",
                ActionText = "Action"
            };
            snackBars2.OutsideClicked += (s, e) => { snackBars2.Hide(); };
            snackBars2.ActionClicked  += (s, e) => { snackBars2.Hide(); };

            MSnackBars snackBars3 = new MSnackBars(window)
            {
                Text = "I'm very happy because summer is my favorite season."
            };
            snackBars3.OutsideClicked += (s, e) => { snackBars3.Hide(); };

            MSnackBars snackBars4 = new MSnackBars(window)
            {
                Text       = "I'm very happy because summer is my favorite season.",
                ActionText = "OK"
            };
            snackBars4.OutsideClicked += (s, e) => { snackBars4.Hide(); };
            snackBars4.ActionClicked  += (s, e) => { snackBars4.Hide(); };
            #endregion

            #region Buttons
            Box btbox = new Box(window)
            {
                WeightX    = 1,
                WeightY    = 0.3,
                AlignmentX = -1,
                AlignmentY = -1,
            };
            btbox.Show();
            box.PackEnd(btbox);

            MButton button1 = new MButton(window)
            {
                Text         = "SnackBars",
                MinimumWidth = 600,
                AlignmentY   = 0,
                WeightY      = 0.3,
            };
            button1.Show();
            button1.Clicked += (s, e) =>
            {
                snackBars.Show();
            };

            MButton button2 = new MButton(window)
            {
                Text         = "SnackBars with Action",
                MinimumWidth = 600,
                AlignmentY   = 0,
                WeightY      = 0.3,
            };
            button2.Show();
            button2.Clicked += (s, e) =>
            {
                snackBars2.Show();
            };

            MButton button3 = new MButton(window)
            {
                Text         = "SnackBars with long text",
                MinimumWidth = 600,
                AlignmentY   = 0,
                WeightY      = 0.3,
            };
            button3.Show();
            button3.Clicked += (s, e) =>
            {
                snackBars3.Show();
            };

            MButton button4 = new MButton(window)
            {
                Text         = "SnackBars (long text and action)",
                MinimumWidth = 600,
                AlignmentY   = 0,
                WeightY      = 1,
            };
            button4.Show();
            button4.Clicked += (s, e) =>
            {
                snackBars4.Show();
            };

            btbox.PackEnd(button1);
            btbox.PackEnd(button2);
            btbox.PackEnd(button3);
            btbox.PackEnd(button4);
            #endregion
        }
Ejemplo n.º 29
0
        public override void Run(Window window)
        {
            MConformant conformant = new MConformant(window);

            conformant.Show();
            Box box = new ColoredBox(window);

            conformant.SetContent(box);
            box.Show();

            #region ThemeButton
            Box hbox = new Box(window)
            {
                IsHorizontal = true,
                WeightX      = 1,
                WeightY      = 0.1,
                AlignmentX   = -1,
                AlignmentY   = -1,
            };
            hbox.Show();
            box.PackEnd(hbox);

            var defaultColor = new MButton(window)
            {
                Text         = "default",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            var light = new MButton(window)
            {
                Text         = "light",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            var dark = new MButton(window)
            {
                Text         = "Dark",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.5
            };
            defaultColor.Show();
            light.Show();
            dark.Show();
            hbox.PackEnd(defaultColor);
            hbox.PackEnd(light);
            hbox.PackEnd(dark);

            defaultColor.Clicked += (s, e) => MColors.Current = MColors.Default;
            light.Clicked        += (s, e) => MColors.Current = MColors.Light;
            dark.Clicked         += (s, e) => MColors.Current = MColors.Dark;
            #endregion

            #region ModalSheets
            MModalSheets modalSheets = new MModalSheets(conformant, MModalSheetsDirection.Side);
            modalSheets.Show();

            Label label1 = new Label(window)
            {
                Text       = "<span font_size=35 color=#a8a8a8>Labels</span>",
                AlignmentX = 0,
            };
            label1.Show();
            var check1 = new MCheckBox(window)
            {
                Text         = "Events",
                MinimumWidth = 400,
            };
            check1.Show();
            var check2 = new MCheckBox(window)
            {
                Text         = "Personal",
                IsChecked    = true,
                MinimumWidth = 400,
            };
            check2.Show();
            var check3 = new MCheckBox(window)
            {
                Text         = "Project",
                IsChecked    = true,
                MinimumWidth = 400,
            };
            check3.Show();
            var check4 = new MCheckBox(window)
            {
                Text         = "Reminders",
                MinimumWidth = 400,
            };
            check4.Show();
            var check5 = new MCheckBox(window)
            {
                Text         = "Work",
                MinimumWidth = 400,
            };
            check5.Show();

            var contents = new Box(conformant)
            {
                IsHorizontal    = true,
                AlignmentX      = -1,
                AlignmentY      = -1,
                WeightX         = 1,
                WeightY         = 1,
                BackgroundColor = Color.White,
            };
            contents.Show();
            contents.SetPadding(45, 45);

            var contents1 = new Box(conformant)
            {
                IsHorizontal = true,
            };
            contents1.Show();
            contents1.SetPadding(45, 45);
            contents.PackEnd(contents1);

            var contents2 = new Box(conformant)
            {
                IsHorizontal = false,
                AlignmentX   = 0,
                AlignmentY   = 0,
                WeightX      = 1,
                WeightY      = 0,
            };
            contents2.Show();
            contents2.SetPadding(45, 45);
            contents.PackEnd(contents2);

            var contents3 = new Box(conformant)
            {
                IsHorizontal = false,
            };
            contents3.Show();
            contents3.SetPadding(45, 45);
            contents2.PackEnd(contents3);

            contents2.PackEnd(label1);
            contents2.PackEnd(check1);
            contents2.PackEnd(check2);
            contents2.PackEnd(check3);
            contents2.PackEnd(check4);
            contents2.PackEnd(check5);

            modalSheets.SetContent(contents);
            #endregion

            #region Buttons
            Box btbox = new Box(window)
            {
                WeightX    = 1,
                WeightY    = 0.3,
                AlignmentX = -1,
                AlignmentY = -1,
            };
            btbox.Show();
            box.PackEnd(btbox);

            MButton button1 = new MButton(window)
            {
                Text         = "Open MModalSideSheets",
                MinimumWidth = 600,
                AlignmentY   = 0,
                WeightY      = 0.3,
            };
            button1.Show();
            button1.Clicked += (s, e) =>
            {
                modalSheets.IsOpen = true;
            };

            btbox.PackEnd(button1);
            #endregion
        }
        public override EvasObject CreateContent(EvasObject parent)
        {
            Box box = new ColoredBox(parent);

            box.Show();

            var naviIconPath = Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "menu.png");

            var appbar = new MTopAppBar(parent)
            {
                Title          = "Page title",
                NavigationItem = new MActionItem("naviItem", naviIconPath, () =>
                {
                    Console.WriteLine($"Navigation action item clicked");
                })
            };

            appbar.Show();
            box.PackStart(appbar);

            var airplaneIconPath  = Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "airplane.png");
            var alarmIconPath     = Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "alarm.png");
            var bluetoothIconPath = Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "bluetooth.png");

            appbar.ActionItems.Add(new MActionItem("airplane", airplaneIconPath, () => { Console.WriteLine($"ariplane"); }));
            appbar.ActionItems.Add(new MActionItem("alarm", alarmIconPath, () => { Console.WriteLine($"alarm"); }));
            appbar.ActionItems.Add(new MActionItem("bluetooth", bluetoothIconPath, () => { Console.WriteLine($"bluetooth"); }));


            var bButton = new MButton(parent)
            {
                Text         = "set/unset bg",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5,
            };

            var bFlag = true;

            bButton.Clicked += (s, e) =>
            {
                if (bFlag)
                {
                    appbar.BackgroundOption    = BackgroundOptions.Center;
                    appbar.BackgroundImageFile = Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "photo.jpg");
                }
                else
                {
                    appbar.BackgroundImageFile = "";
                }
                bFlag = !bFlag;
            };
            bButton.Show();

            var nButton = new MButton(parent)
            {
                Text         = "add/remove naviitem",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5,
            };

            var item = new MActionItem("new", naviIconPath, () =>
            {
                Console.WriteLine($"new Navigation action item");
            });

            nButton.Clicked += (s, e) =>
            {
                if (appbar.NavigationItem == null)
                {
                    appbar.NavigationItem = item;
                }
                else
                {
                    appbar.NavigationItem = null;
                }
            };
            nButton.Show();

            var ltButton = new MButton(parent)
            {
                Text         = "change title",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5,
            };

            bool ltFlag = true;

            ltButton.Clicked += (s, e) =>
            {
                if (ltFlag)
                {
                    appbar.Title = "Page title";
                }
                else
                {
                    appbar.Title = "Page title looooooooooooooooooooong";
                }
                ltFlag = !ltFlag;
            };
            ltButton.Show();

            var tButton = new MButton(parent)
            {
                Text         = "change title color",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5,
            };

            bool tFlag = true;

            tButton.Clicked += (s, e) =>
            {
                if (tFlag)
                {
                    appbar.TitleColor = Color.Red;
                }
                else
                {
                    appbar.TitleColor = Color.Default;
                }
                tFlag = !tFlag;
            };
            tButton.Show();

            var pButton = new MButton(parent)
            {
                Text         = "prominent on/off",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5,
            };

            pButton.Show();

            pButton.Clicked += (s, e) =>
            {
                appbar.Prominent = !appbar.Prominent;
            };

            var addButton = new MButton(parent)
            {
                Text         = "add item",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5,
            };

            addButton.Clicked += (s, e) =>
            {
                var iconPath = Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "image.png");
                appbar.ActionItems.Add(new MActionItem("new item", iconPath, () => { Console.WriteLine($"new item"); }));
            };


            addButton.Show();


            var removeButton = new MButton(parent)
            {
                Text         = "remove item",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5,
            };

            removeButton.Clicked += (s, e) =>
            {
                if (appbar.ActionItems.Count > 0)
                {
                    appbar.ActionItems.RemoveAt(appbar.ActionItems.Count - 1);
                }
            };
            removeButton.Show();

            box.PackEnd(bButton);
            box.PackEnd(pButton);
            box.PackEnd(nButton);
            box.PackEnd(ltButton);
            box.PackEnd(tButton);
            box.PackEnd(addButton);
            box.PackEnd(removeButton);

            return(box);
        }