public void ConfigureButtons(OptionPane.Buttons buttonStyle) { buttonContainer.Clear(); buttonContainer.ColumnConstraints.Clear(); CreateButtonFor(buttonStyle, OptionPane.Buttons.Ok, Common.OK); CreateButtonFor(buttonStyle, OptionPane.Buttons.Yes, Common.Yes); CreateButtonFor(buttonStyle, OptionPane.Buttons.No, Common.No); CreateButtonFor(buttonStyle, OptionPane.Buttons.Cancel, Common.Cancel); }
void CreateButtonFor(OptionPane.Buttons flags, OptionPane.Buttons bs, string text) { if (!flags.HasFlag(bs)) { return; } var b = new Button(UIStyle); b.Content.Label.Text = text; b.ActionPerformed += (s, o) => actionPerformedSupport.Raise(this, new OptionPaneActionArgs(bs)); buttonContainer.ColumnConstraints.Add(LengthConstraint.Auto); buttonContainer.Add(b, new Point(buttonContainer.Count, 0)); }
public OptionPaneActionArgs(OptionPane.Buttons button) { this.Button = button; }