Method wpfBuilder.AddButton(+ 2 overloads)
Overload
Adds button with System.Windows.Controls.Primitives.ButtonBase.Click event handler.
public wpfBuilder AddButton(out Button variable, object text, Action<WBButtonClickArgs> click, WBBFlags flags = 0)
Parameters
variable (Button)
Receives button's variable. |
text (object)
Text/content (System.Windows.Controls.ContentControl.Content). |
click (Action<WBButtonClickArgs>)
Action to call when the button clicked. Its parameter's property Cancel can be used to prevent closing the window when clicked this OK button. Not called if validation fails. |
flags (WBBFlags) |
Returns
Remarks
If flags contains OK or Apply or Validate and this window contains elements for which was called wpfBuilder.Validation, on click performs validation; if fails, does not call the click action and does not close the window.
Overload(next)
Adds button with System.Windows.Controls.Primitives.ButtonBase.Click event handler.
public wpfBuilder AddButton(object text, Action<WBButtonClickArgs> click, WBBFlags flags = 0)
Parameters
text (object)
Text/content (System.Windows.Controls.ContentControl.Content). |
click (Action<WBButtonClickArgs>)
Action to call when the button clicked. Its parameter's property Cancel can be used to prevent closing the window when clicked this OK button. Not called if validation fails. |
flags (WBBFlags) |
Returns
Remarks
If flags contains OK or Apply or Validate and this window contains elements for which was called wpfBuilder.Validation, on click performs validation; if fails, does not call the click action and does not close the window.
Overload(top)
Adds button that closes the window and sets wpfBuilder.ResultButton.
public wpfBuilder AddButton(object text, int result)
Parameters
text (object)
Text/content (System.Windows.Controls.ContentControl.Content). |
result (int)
wpfBuilder.ResultButton value when clicked this button. |
Returns
Remarks
When clicked, sets wpfBuilder.ResultButton = result, closes the window, and wpfBuilder.ShowDialog returns true
.