예제 #1
0
        View body()
        {
            var fingerPaint = new BindableFingerPaint(
                strokeSize: _strokeSize,
                strokeColor: _strokeColor);

            return(new VStack()
            {
                new VStack()
                {
                    new HStack()
                    {
                        new Text("Stroke Width:"),
                        new Slider(_strokeSize, 1, 10, 1)
                    },
                    new HStack()
                    {
                        new Text("Stroke Color:"),
                        new TextField(_strokeColor)
                    },
                    new Button("Reset", () => fingerPaint.Reset()),
                    fingerPaint.ToView().Frame(height: 400)
                },
            });
        }
예제 #2
0
        View body()
        {
            var fingerPaint = new BindableFingerPaint(
                strokeSize: _strokeSize,
                strokeColor: _strokeColor);

            return(new Grid(
                       columns: new object [] { 120, "*" },
                       rows: new object[] { 44, 44, 44, "*" })
            {
                new Text("Stroke Width:").Cell(row: 0, column: 0),
                new Slider(_strokeSize, 1, 10, 1).Cell(row: 0, column: 1),
                new Text("Stroke Color:").Cell(row: 1, column: 0),
                new TextField(_strokeColor).Cell(row: 1, column: 1),
                new Button("Reset", () => fingerPaint.Reset()).Cell(row: 2, column: 0, colSpan: 2),
                fingerPaint.ToView().Cell(row: 3, column: 0, colSpan: 2)
            });
        }