Пример #1
0
        /// <summary>
        /// Creates the default theme which requires no assets.
        /// </summary>
        /// <returns></returns>
        public static Theme CreateDefaultTheme()
        {
            var data = new ThemeData
            {
                new ThemeStyle
                {
                    Pattern    = "*",
                    Background = new ThemeWidgetBackground {
                        Color = Color.Black,
                    },
                    Font = new FontStyleProperties {
                        Color = Color.White,
                    },
                    Animation = new ThemeWidgetAnimation
                    {
                        TransitionIn  = "fade-in",
                        TransitionOut = "fade-out"
                    }
                },

                new ThemeStyle
                {
                    Pattern = "menu.*",
                    Padding = LayoutBox.SameAllAround(8),
                },

                new ThemeStyle
                {
                    Pattern     = "menu.*",
                    WidgetState = "selected",
                    Padding     = LayoutBox.SameAllAround(8),
                    Background  = new ThemeWidgetBackground {
                        Color = Color.White
                    },
                    Font = new FontStyleProperties {
                        Color = Color.Black
                    }
                }
            };

            return(new Theme {
                Data = data
            });
        }
Пример #2
0
        private ITheme CreateTestTheme()
        {
            var data = new ThemeData
            {
                new ThemeStyle
                {
                    Pattern    = "*",
                    Background = new ThemeWidgetBackground {
                        Color = Color.Blue,
                    },
                    Padding = LayoutBox.SameAllAround(14),
                    Font    = new FontStyleProperties {
                        Color = Color.Yellow,
                    },
                },

                new ThemeStyle
                {
                    Pattern = "menu.*",
                    Padding = LayoutBox.SameAllAround(14),
                },

                new ThemeStyle
                {
                    Pattern     = "menu.*",
                    WidgetState = "selected",
                    Padding     = LayoutBox.SameAllAround(14),
                    Background  = new ThemeWidgetBackground {
                        Color = Color.White
                    },
                    Font = new FontStyleProperties {
                        Color = Color.Black
                    }
                }
            };

            return(new Theme(data));
        }
Пример #3
0
        private ITheme CreateTestTheme()
        {
            var data = new ThemeData
            {
                new ThemeStyle
                {
                    Selector   = "*",
                    Background = new BackgroundStyle {
                        Color = Color.Blue,
                    },
                    Padding = LayoutBox.SameAllAround(14),
                    Font    = new FontStyleProperties {
                        Color = Color.Yellow,
                    },
                },

                new ThemeStyle
                {
                    Selector = "menuitem",
                    Padding  = LayoutBox.SameAllAround(14),
                },

                new ThemeStyle
                {
                    Selector   = "menuitem:selected",
                    Padding    = LayoutBox.SameAllAround(14),
                    Background = new BackgroundStyle {
                        Color = Color.White
                    },
                    Font = new FontStyleProperties {
                        Color = Color.Black
                    }
                }
            };

            return(new Theme(data));
        }
Пример #4
0
        public override IRenderable Render()
        {
            var labelStyle = new InlineElementStyle
            {
                Background = new BackgroundStyle {
                    Color = ColorX.FromArgb("e34234")
                },
                Padding = LayoutBox.SameAllAround(8)
            };

            return(new App(new AppProps
            {
                Children =
                {
                    new Window(new WindowProps
                    {
                        Children =
                        {
                            new Label(new LabelProps                     {
                                Text = "Justify Content Value"
                            }),
                            new RadioMenu(new RadioMenuProps
                            {
                                Buttons =
                                {
                                    new RadioButton(new RadioButtonProps {
                                        Text = "Start", OnAccept = e => Set(JustifyContent.Start), Checked = true,
                                    }),
                                    new RadioButton(new RadioButtonProps {
                                        Text = "End", OnAccept = e => Set(JustifyContent.End)
                                    }),
                                    new RadioButton(new RadioButtonProps {
                                        Text = "Center", OnAccept = e => Set(JustifyContent.Center)
                                    }),
                                    new RadioButton(new RadioButtonProps {
                                        Text = "Space Between", OnAccept = e => Set(JustifyContent.SpaceBetween)
                                    }),
                                    new RadioButton(new RadioButtonProps {
                                        Text = "Space Around", OnAccept = e => Set(JustifyContent.SpaceAround)
                                    }),
                                    new RadioButton(new RadioButtonProps {
                                        Text = "Space Evenly", OnAccept = e => Set(JustifyContent.SpaceEvenly)
                                    }),
                                },
                                OnCancel = Props.OnCancel,
                            })
                        }
                    }),

                    new Window(new WindowProps
                    {
                        Style = new InlineElementStyle
                        {
                            Padding = LayoutBox.SameAllAround(12),
                        },
                        Children =
                        {
                            new Label(new LabelProps                     {
                                Text = "Really long text to setup some horizontal space."
                            }),
                            new Window(new WindowProps
                            {
                                Name = "magic-window",
                                Style = new InlineElementStyle
                                {
                                    Flex = new FlexStyle
                                    {
                                        Direction = FlexDirection.Row,
                                        JustifyContent = State.JustifyContent,
                                    },
                                    Background = new BackgroundStyle     {
                                        Color = Color.DimGray
                                    }
                                },
                                Children =
                                {
                                    new Label(new LabelProps             {
                                        Style = labelStyle, Text = "This",
                                    }),
                                    new Label(new LabelProps             {
                                        Style = labelStyle, Text = "is"
                                    }),
                                    new Label(new LabelProps             {
                                        Style = labelStyle, Text = "an"
                                    }),
                                    new Label(new LabelProps             {
                                        Style = labelStyle, Text = "example"
                                    }),
                                }
                            }),
                        }
                    })
                }
            }));
        }