Beispiel #1
0
    public MainPage(ContexUI context) : base("main", context)
    {
        text       = new Label($"Clicked 0 times!", 400, 200, 24);
        text.Color = SKColors.Blue;



        btn1                 = new Button("Click Me!", 400, 400, 150, 70);
        btn1.Color           = SKColors.CornflowerBlue;
        btn1.Label.FonstSize = 24;
        btn1.Round           = 12;
        btn1.OnClickCallback = (e) =>
        {
            clickCount++;
            text.Text = $"Clicked {clickCount} vezes!";
        };

        btn                 = new Button("Second Page!", 400, 505, 150, 70);
        btn.Color           = SKColors.IndianRed;
        btn.Label.FonstSize = 24;
        btn.OnClickCallback = (e) =>
        {
            context.GotoPage("SecondPage");
        };



        AddComponent(btn1);
        AddComponent(btn);
        AddComponent(text);
    }
Beispiel #2
0
    public SecondPage(ContexUI context) : base("SecondPage", context)
    {
        Label text = new Label("Digitou: ", 400, 250, 24);

        text.Color = SKColors.Blue;

        Label     text1 = new Label("Digite: ", 400, 350, 24);
        TextField tf    = new TextField("Input Text", 400 + text1.Position.W / 2, 350, 20);

        tf.Position.RelativeCenter = RelativePosition.Right;

        tf.OnChangedValue = (v) =>
        {
            text.Text = $"Digitou: {v}";
        };

        Button btn = new Button("Main Page!", 400, 505, 150, 70);

        btn.Color           = SKColors.IndianRed;
        btn.Label.FonstSize = 24;
        btn.OnClickCallback = (e) =>
        {
            context.GotoPage("main");
        };

        Button btnt = new Button("Test!", 570, 505, 150, 70);

        btnt.Color           = SKColors.Indigo;
        btnt.Label.FonstSize = 24;

        AddComponent(text);
        AddComponent(text1);
        AddComponent(tf);
        AddComponent(btn);
        AddComponent(btnt);
    }