Esempio n. 1
0
        public TextDiagnosticLayout()
        {
            //GridLayout grid0 = GridLayout.New(BoundProperty_List.Uniform(2), BoundProperty_List.Uniform(1), new LayoutScore());
            Editor editor = new Editor();

            editor.TextChanged += Editor_TextChanged;
            //grid0.AddLayout(new TextboxLayout(editor));
            BoundProperty_List heights = new BoundProperty_List(3);

            heights.BindIndices(0, 1);
            heights.BindIndices(0, 2);
            heights.SetPropertyScale(0, 1);
            heights.SetPropertyScale(1, 1);
            heights.SetPropertyScale(2, 12);

            GridLayout grid1      = GridLayout.New(heights, new BoundProperty_List(1), LayoutScore.Zero);
            View       bottomView = new ContentView();

            bottomView.BackgroundColor = Color.DarkGray;

            GridLayout grid2 = GridLayout.New(new BoundProperty_List(1), new BoundProperty_List(2), LayoutScore.Zero);

            this.editorToUpdate = new Editor();
            grid2.AddLayout(new TextboxLayout(this.editorToUpdate));
            View rightView = new ContentView();

            rightView.BackgroundColor = Color.Green;
            grid2.AddLayout(new ImageLayout(rightView, LayoutScore.Get_UsedSpace_LayoutScore(1)));

            grid1.AddLayout(grid2);
            grid1.AddLayout(new TextboxLayout(editor));
            grid1.AddLayout(new ImageLayout(bottomView, LayoutScore.Get_UsedSpace_LayoutScore(1000)));

            this.SubLayout = grid1;
        }
Esempio n. 2
0
 public LayoutStack(bool showBackButtons = true)
 {
     this.showBackButtons = showBackButtons;
     if (showBackButtons)
     {
         BoundProperty_List rowHeights = new BoundProperty_List(3);
         rowHeights.BindIndices(0, 1);
         rowHeights.BindIndices(0, 2);
         rowHeights.SetPropertyScale(0, 28);
         rowHeights.SetPropertyScale(1, 1); // extra unused space for visual separation
         rowHeights.SetPropertyScale(2, 3);
         this.mainGrid  = GridLayout.New(rowHeights, new BoundProperty_List(1), LayoutScore.Zero);
         this.SubLayout = this.mainGrid;
     }
 }
Esempio n. 3
0
        public static BoundProperty_List Uniform(int numProperties)
        {
            BoundProperty_List result = new BoundProperty_List(numProperties);
            int i;

            for (i = 1; i < numProperties; i++)
            {
                result.BindIndices(0, i);
            }
            return(result);
        }
Esempio n. 4
0
        public ReorderableList(IEnumerable <T> items, LayoutProvider <T> layoutProvider)
        {
            // get the items and layouts
            this.Items       = new List <T>(items);
            this.itemLayouts = new List <LayoutChoice_Set>();

            foreach (T item in items)
            {
                LayoutChoice_Set itemLayout = layoutProvider.GetLayout(item);
                this.itemLayouts.Add(itemLayout);
            }

            this.makeArrows();
            BoundProperty_List columnWidths = new BoundProperty_List(2);

            columnWidths.BindIndices(0, 1);
            columnWidths.SetPropertyScale(0, 1);
            columnWidths.SetPropertyScale(1, 7);
            this.mainGrid  = GridLayout.New(BoundProperty_List.Uniform(this.itemLayouts.Count), columnWidths, LayoutScore.Zero);
            this.SubLayout = this.mainGrid;
            this.putLayouts();
        }
Esempio n. 5
0
        private LayoutChoice_Set build()
        {
            GridLayout_Builder mainBuilder = new Vertical_GridLayout_Builder().Uniform();

            this.buttons            = new List <Button>();
            this.subtitles          = new List <TextblockLayout>();
            this.buttonDestinations = new Dictionary <Button, ValueProvider <StackEntry> >();
            for (int i = 0; i < this.buttonNameProviders.Count; i++)
            {
                Button button = new Button();
                button.Clicked += Button_Clicked;
                this.buttons.Add(button);

                ButtonLayout    buttonLayout   = new ButtonLayout(button);
                TextblockLayout subtitleLayout = new TextblockLayout();
                subtitleLayout.AlignHorizontally(TextAlignment.Center);
                subtitleLayout.AlignVertically(TextAlignment.Center);
                subtitleLayout.ScoreIfEmpty = false;
                this.subtitles.Add(subtitleLayout);

                BoundProperty_List columnWidths = new BoundProperty_List(2);
                columnWidths.SetPropertyScale(0, 2);
                columnWidths.SetPropertyScale(1, 1);
                columnWidths.BindIndices(0, 1);
                GridLayout entryGrid = GridLayout.New(new BoundProperty_List(1), columnWidths, LayoutScore.Get_UnCentered_LayoutScore(1));
                entryGrid.AddLayout(buttonLayout);
                entryGrid.AddLayout(subtitleLayout);

                LayoutUnion content = new LayoutUnion(entryGrid, buttonLayout);
                mainBuilder.AddLayout(content);

                ValueProvider <StackEntry> destinationProvider = destinationProviders[i];
                this.buttonDestinations[button] = destinationProvider;
            }
            return(LayoutCache.For(mainBuilder.BuildAnyLayout()));
        }