Esempio n. 1
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)
        {
            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);
        }
        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);
        }
Esempio n. 4
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.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(window)
            {
                WeightX    = 1,
                WeightY    = 0.3,
                AlignmentX = -1,
                AlignmentY = -1,
            };
            btbox.Show();
            box.PackEnd(btbox);

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

            btbox.PackEnd(button1);
            #endregion
        }