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);
        }
Beispiel #2
0
        public override EvasObject CreateContent(EvasObject parent)
        {
            Box box = new ColoredBox(parent);

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

            MActivityIndicator determinateAI = new MActivityIndicator(parent)
            {
                Value      = 50,
                AlignmentX = -1,
                AlignmentY = 0.5,
                WeightX    = 1,
                WeightY    = 1,
            };

            determinateAI.Show();

            MActivityIndicator indeterminateAI = new MActivityIndicator(parent)
            {
                Type       = MProgressIndicatorType.Indeterminate,
                AlignmentX = -1,
                AlignmentY = 0.5,
                WeightX    = 1,
                WeightY    = 1,
            };

            indeterminateAI.Show();

            box.PackEnd(determinateAI);
            box.PackEnd(indeterminateAI);

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

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

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

            _animator.Start();

            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 override EvasObject CreateContent(EvasObject parent)
        {
            Box box = new ColoredBox(parent)
            {
                AlignmentX      = -1,
                AlignmentY      = -1,
                WeightX         = 1,
                WeightY         = 1,
                BackgroundColor = Color.Pink
            };

            box.Show();

            var card1 = CreateCard1(parent);
            var card2 = CreateCard2(parent);

            var label1 = new Label(parent)
            {
                Text          = "<span font_size=35>Card 1</span>",
                MinimumWidth  = 500,
                MinimumHeight = 30
            };

            label1.Show();

            var label2 = new Label(parent)
            {
                Text          = "<span font_size=35>Card 2 Layout</span>",
                MinimumWidth  = 500,
                MinimumHeight = 30
            };

            label2.Show();

            box.PackEnd(label1);
            box.PackEnd(card1);
            box.PackEnd(label2);
            box.PackEnd(card2);

            box.SetLayoutCallback(() =>
            {
                var rect        = box.Geometry;
                label1.Geometry = new Rect(rect.X + 50, rect.Y + 50, label1.MinimumWidth, label1.MinimumHeight);
                card1.Geometry  = new Rect(rect.X + 50, rect.Y + 100, card1.MinimumWidth, card1.MinimumHeight);
                label2.Geometry = new Rect(rect.X + 50, card1.Geometry.Y + card1.Geometry.Height + 50, label2.MinimumWidth, label2.MinimumHeight);
                card2.Geometry  = new Rect(rect.X + 50, card1.Geometry.Y + card1.Geometry.Height + 100, card2.MinimumWidth, card2.MinimumHeight);
            });

            return(box);
        }
        public override EvasObject CreateContent(EvasObject parent)
        {
            Box box = new ColoredBox(parent);

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

            var radio = new MRadioButton(parent)
            {
                StateValue = 1,
                WeightY    = 1,
                AlignmentY = 0.5,
                AlignmentX = 0.5,
            };

            box.PackEnd(radio);
            radio.Show();

            var radio2 = new MRadioButton(parent)
            {
                StateValue = 2,
                IsEnabled  = true,
                Color      = Color.FromHex("#E30425"),
                WeightY    = 1,
                AlignmentY = 0.5,
                AlignmentX = 0.5
            };

            box.PackEnd(radio2);
            radio2.SetGroup(radio);
            radio2.Show();

            var radio3 = new MRadioButton(parent)
            {
                StateValue = 3,
                IsEnabled  = false,
                WeightY    = 1,
                AlignmentY = 0.5,
                AlignmentX = 0.5
            };

            box.PackEnd(radio3);
            radio3.SetGroup(radio2);
            radio3.Show();

            radio.GroupValue = 1;

            return(box);
        }
        public override EvasObject CreateContent(EvasObject parent)
        {
            var box = new ColoredBox(parent);

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

            var check = new MCheckBox(parent)
            {
                IsChecked  = true,
                WeightY    = 1,
                WeightX    = 1,
                AlignmentY = 0.5,
                AlignmentX = 0.5
            };

            box.PackEnd(check);
            check.Show();

            var check2 = new MCheckBox(parent)
            {
                IsEnabled  = true,
                Color      = Color.FromHex("#E30425"),
                WeightY    = 1,
                WeightX    = 1,
                AlignmentY = 0.5,
                AlignmentX = 0.5
            };

            box.PackEnd(check2);
            check2.Show();

            var check3 = new MCheckBox(parent)
            {
                IsChecked  = true,
                IsEnabled  = false,
                WeightY    = 1,
                WeightX    = 1,
                AlignmentY = 0.5,
                AlignmentX = 0.5
            };

            box.PackEnd(check3);
            check3.Show();

            return(box);
        }
        public override EvasObject CreateContent(EvasObject window)
        {
            Box box = new ColoredBox(window);

            box.Show();

            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 - 100) + rect.X, (rect.Height / 2 - 50), 200, 50);
                disabledSlider.Geometry = new Rect((rect.Width / 2 - 100) + rect.X, (rect.Height / 2 + 20), 200, 50);
            });

            return(box);
        }
Beispiel #9
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);
        }
        public override EvasObject CreateContent(EvasObject parent)
        {
            Box box = new ColoredBox(parent);

            box.Show();

            MBottomNavigation bn = new MBottomNavigation(parent);

            bn.Show();
            box.PackEnd(bn);
            var IconPath = Path.Combine(MaterialComponents.AppResourcePath, "icon.png");

            for (int i = 0; i < 4; i++)
            {
                var item2 = bn.Append(string.Format("{0} Item", i), IconPath);
            }

            return(box);
        }
Beispiel #11
0
        public override EvasObject CreateContent(EvasObject parent)
        {
            Box box = new ColoredBox(parent);

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

            var switch1 = new MSwitch(parent)
            {
                IsChecked  = true,
                WeightY    = 1,
                AlignmentY = 0.5
            };

            box.PackEnd(switch1);
            switch1.Show();

            var switch2 = new MSwitch(parent)
            {
                IsChecked  = true,
                Color      = Color.FromHex("#E30425"),
                WeightY    = 1,
                AlignmentY = 0.5
            };

            box.PackEnd(switch2);
            switch2.Show();

            var switch3 = new MSwitch(parent)
            {
                IsEnabled  = false,
                IsChecked  = true,
                WeightY    = 1,
                AlignmentY = 0.5
            };

            box.PackEnd(switch3);
            switch3.Show();

            return(box);
        }
Beispiel #12
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);
        }
        public override EvasObject CreateContent(EvasObject parent)
        {
            Box box = new ColoredBox(parent);

            box.Show();

            var textfield = new MTextField(parent)
            {
                Label        = "Label",
                Text         = "Input text",
                AlignmentX   = 0.5,
                AlignmentY   = 0.5,
                WeightX      = 1,
                WeightY      = 1,
                MinimumWidth = 200
            };

            textfield.Show();
            box.PackEnd(textfield);

            return(box);
        }
Beispiel #14
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();
        }
Beispiel #15
0
        public override EvasObject CreateContent(EvasObject parent)
        {
            Box box = new ColoredBox(parent);

            box.Show();

            MProgressIndicator determinatePI = new MProgressIndicator(parent)
            {
                Value        = 0,
                MinimumWidth = 200,
                AlignmentY   = 0.5,
                WeightX      = 1,
                WeightY      = 1
            };

            determinatePI.Show();

            MProgressIndicator indeterminatePI = new MProgressIndicator(parent)
            {
                Type         = MProgressIndicatorType.Indeterminate,
                MinimumWidth = 200,
                AlignmentY   = 0.5,
                WeightX      = 1,
                WeightY      = 1,
            };

            indeterminatePI.Show();

            MProgressIndicator disabledPI = new MProgressIndicator(parent)
            {
                MinimumWidth = 200,
                AlignmentY   = 0.5,
                WeightX      = 1,
                WeightY      = 1,
                IsEnabled    = false,
            };

            disabledPI.Show();

            box.PackEnd(determinatePI);
            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.Start();

            return(box);
        }
Beispiel #16
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);
        }
Beispiel #17
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();
        }
        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);
            }
        }
Beispiel #19
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);
        }
        public override EvasObject CreateContent(EvasObject parent)
        {
            Box box = new ColoredBox(parent);

            box.Show();

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

            list.Show();

            var singleItemClass = new MListSingleLineItemClass
            {
                GetTextHandler = (obj, part) =>
                {
                    return(obj.ToString());
                },
                GetIconHandler = (obj, part) =>
                {
                    var icon = new Image(parent)
                    {
                        MinimumHeight = 80,
                        MinimumWidth  = 80
                    };
                    icon.Load(Path.Combine(MaterialGallery.ResourceDir, "image.png"));
                    return(icon);
                },
                GetMetaControlHandler = (obj, part) =>
                {
                    return(new MCheckBox(parent));
                },
            };

            var doubleItemClass = new MListDoubleLineItemClass
            {
                GetTextHandler = (obj, part) =>
                {
                    return(obj.ToString());
                },
                GetSubTextHandler = (obj, part) =>
                {
                    return("sub text");
                },
                GetIconHandler = (obj, part) =>
                {
                    var icon = new Image(parent)
                    {
                        MinimumHeight = 80,
                        MinimumWidth  = 80
                    };
                    icon.Load(Path.Combine(MaterialGallery.ResourceDir, "image.png"));
                    return(icon);
                },
                GetMetaControlHandler = (obj, part) =>
                {
                    return(new MCheckBox(parent));
                },
            };

            var tripleItemClass = new MListTripleLineItemClass
            {
                GetTextHandler = (obj, part) =>
                {
                    return(obj.ToString());
                },
                GetSubTextHandler = (obj, part) =>
                {
                    return("sub text and a too loooooooooooooooooooooooooooong text");
                },
                GetIconHandler = (obj, part) =>
                {
                    var icon = new Image(parent)
                    {
                        MinimumHeight = 80,
                        MinimumWidth  = 80
                    };
                    icon.Load(Path.Combine(MaterialGallery.ResourceDir, "image.png"));
                    return(icon);
                },
                GetMetaControlHandler = (obj, part) =>
                {
                    return(new MCheckBox(parent));
                },
            };


            for (int i = 0; i < 20; i++)
            {
                if (i % 3 == 0)
                {
                    list.Append(singleItemClass, String.Format("Item_{0}", i));
                }
                else if (i % 3 == 1)
                {
                    list.Append(doubleItemClass, String.Format("Item_{0}", i));
                }
                else if (i % 3 == 2)
                {
                    list.Append(tripleItemClass, String.Format("Item_{0}", i));
                }
            }

            box.PackEnd(list);
            return(box);
        }
Beispiel #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

            //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();
            };
        }
Beispiel #22
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();
        }
Beispiel #23
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);
        }
Beispiel #24
0
        public override EvasObject CreateContent(EvasObject parent)
        {
            if (_conformant == null)
            {
                return(null);
            }

            Box box = new ColoredBox(parent);

            box.Show();

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

            box.PackEnd(rect);

            #region FABs
            MFloatingActionButton fab = new MFloatingActionButton(_conformant);
            fab.Show();
            fab.Resize(180, 176);
            fab.Move(540, 1070);

            Image img = new Image(parent);
            //The source of icon resources is https://materialdesignicons.com/
            img.Load(Path.Combine(MaterialGallery.ResourceDir, "alarm.png"));
            img.Show();
            fab.Icon = img;

            MFloatingActionButton fab2 = new MFloatingActionButton(_conformant);
            fab2.Show();
            fab2.Resize(180, 176);
            fab2.Move(540, 940);

            Image img2 = new Image(parent);
            //The source of icon resources is https://materialdesignicons.com/
            img2.Load(Path.Combine(MaterialGallery.ResourceDir, "airplane.png"));
            img2.Show();
            fab2.Icon = img2;

            MFloatingActionButton fab3 = new MFloatingActionButton(_conformant);
            fab3.Show();
            fab3.Resize(180, 176);
            fab3.Move(540, 810);

            Image img3 = new Image(parent);
            //The source of icon resources is https://materialdesignicons.com/
            img3.Load(Path.Combine(MaterialGallery.ResourceDir, "bluetooth.png"));
            img3.Show();
            fab3.Icon = img3;
            #endregion

            if (Elementary.GetProfile() == "wearable")
            {
                fab.Move(90, 20);
                fab2.Move(90, 200);
                fab3.Move(90, 400);

                fab.Clicked += (s, e) =>
                {
                    parent.Unrealize();
                };
            }
            else if (Elementary.GetProfile() == "tv")
            {
                fab.Move(1340, 870);
                fab2.Move(1340, 740);
                fab3.Move(1340, 610);
            }

            return(box);
        }
Beispiel #25
0
        public override EvasObject CreateContent(EvasObject window)
        {
            Box box = new ColoredBox(window);

            box.Show();

            box.PackEnd(GetTitleLabel(window));
            var slider = new MSlider(window)
            {
                Minimum    = 0,
                Maximum    = 100,
                WeightX    = -1,
                WeightY    = -1,
                AlignmentX = -1,
                AlignmentY = -1,
            };

            slider.Value = 50;
            slider.Show();
            box.PackEnd(slider);

            box.PackEnd(new Button(window)
            {
                Opacity = 0
            });

            var disabledSlider = new MSlider(window)
            {
                Minimum    = 0,
                Maximum    = 100,
                WeightX    = -1,
                WeightY    = -1,
                AlignmentX = -1,
                AlignmentY = -1,
                IsEnabled  = false
            };

            disabledSlider.Value = 50;
            disabledSlider.Show();
            box.PackEnd(disabledSlider);

            box.PackEnd(new Button(window)
            {
                Opacity = 0
            });


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

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

            //inner.PackEnd(GetTitleLabel(window));

            //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 - 100) + rect.X , (rect.Height / 2 - 50), 200, 50);
            //    disabledSlider.Geometry = new Rect((rect.Width / 2 - 100) + rect.X, (rect.Height / 2 + 20), 200, 50);
            //});

            return(box);
        }
Beispiel #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);
            });
        }
        public override EvasObject CreateContent(EvasObject parent)
        {
            Box box = new ColoredBox(parent);

            box.Show();

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

            tabs.Show();

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

            label1.Show();

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

            tabs2.Show();

            Label label2 = new Label(parent)
            {
                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);

            return(box);
        }
Beispiel #28
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);
        }
Beispiel #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
        }
Beispiel #30
0
        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 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(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);
        }