Ejemplo n.º 1
0
        public static IControl Create(IElement element, IEditorFactory editors)
        {
            var orientation   = element.GetEnum("Orientation", Orientation.Vertical);
            var flowDirection = element.GetEnum("FlowDirection", FlowDirection.LeftToRight);

            return(Layout.StackFromTop(
                       Spacer.Small,

                       Layout.StackFromLeft(
                           editors.RadioButton(orientation)
                           .Option(Orientation.Horizontal, (fg, bg) => StackIcon.Create(Axis2D.Horizontal, fg), "Orientation: Horizontal")
                           .Option(Orientation.Vertical, (fg, bg) => StackIcon.Create(Axis2D.Vertical, fg), "Orientation: Vertical")
                           .Control.WithLabelAbove("Orientation"),
                           Spacer.Medium,
                           editors.Dropdown(flowDirection)
                           .WithLabelAbove("Flow Direction"))
                       .WithInspectorPadding(),

                       Spacer.Medium)
                   .MakeCollapsable(RectangleEdge.Bottom, element.Is("Fuse.Controls.WrapPanel")));
        }
Ejemplo n.º 2
0
        public static IControl Create(IElement element, IEditorFactory editors)
        {
            var orientation = element.GetEnum("Orientation", Orientation.Vertical);
            var itemSpacing = element.GetDouble("ItemSpacing", 0.0);

            return(Layout.StackFromTop(
                       Spacer.Medium,

                       Layout.StackFromLeft(
                           editors.RadioButton(orientation)
                           .Option(Orientation.Horizontal, (fg, bg) => StackIcon.Create(Axis2D.Horizontal, fg), "Orientation: Horizontal")
                           .Option(Orientation.Vertical, (fg, bg) => StackIcon.Create(Axis2D.Vertical, fg), "Orientation: Vertical")
                           .Control.WithLabel("Orientation"),
                           Spacer.Medium,
                           editors.Label("Item Spacing", itemSpacing),
                           editors.Field(itemSpacing)
                           .WithWidth(CellLayout.HalfCellWidth))
                       .WithInspectorPadding(),

                       Spacer.Medium)
                   .MakeCollapsable(RectangleEdge.Bottom, element.Is("Fuse.Controls.StackPanel")));
        }