Example #1
0
 private void NoButton_Click(object sender, EventArgs e)
 {
     if (NoClicked != null)
     {
         NoClicked.Invoke(this, e);
     }
 }
Example #2
0
        public void Show(string title, string message)
        {
            var builder = new AlertDialog.Builder(_context);

            builder
            .SetMessage(message)
            .SetTitle(title)
            .SetPositiveButton("Ja", (sender, args) => YesClicked?.Invoke(this, EventArgs.Empty))
            .SetNegativeButton("Nein", (sender, args) => NoClicked?.Invoke(this, EventArgs.Empty))
            .Show();
        }
        private void SetDefaultState(bool enabled)
        {
            YesButton.GetComponent <Button>().onClick.RemoveAllListeners();
            NoButton.GetComponent <Button>().onClick.RemoveAllListeners();

            YesButton.SetActive(enabled);
            NoButton.SetActive(enabled);

            if (enabled)
            {
                YesButton.GetComponent <Button>().onClick.AddListener(delegate { YesClicked.Invoke(); });
                NoButton.GetComponent <Button>().onClick.AddListener(delegate { NoClicked.Invoke(); });
            }
        }
Example #4
0
        public YesNoBox(string label) : base()
        {
            X           = Pos.Center();
            Y           = Pos.Center();
            Width       = Dim.Percent(40);
            Height      = Dim.Percent(20);
            ColorScheme = Colors.Error;

            lbl = new(label) {
                Width         = Dim.Fill(),
                Y             = 1,
                TextAlignment = TextAlignment.Centered
            };

            yes = new("Y_es") {
                X = Pos.Percent(30),
                Y = 5
            };

            no = new("N_o") {
                X = Pos.Percent(60),
                Y = 5
            };

            yes.Clicked += () => {
                YesClicked?.Invoke(this, null);
            };

            no.Clicked += () => {
                NoClicked?.Invoke(this, null);
            };

            Add(lbl, yes, no);
        }
    }
}
Example #5
0
 private void BtnNo_LeftClick(object sender, EventArgs e)
 {
     Hide();
     NoClicked?.Invoke(this, EventArgs.Empty);
 }