private DialogButton.ReturnEvent triggerOnClose() { DialogClickOffCloseHandler handler = OnClickOffClose; if (handler != null) { return(handler()); } return(DialogButton.ReturnEvent.Empty); }
public Dialog(Panel parent, UIElement content, bool fillHeight, bool fillWidth, bool allowClickOffClose, DialogClickOffCloseHandler onClickOffHandler, params DialogButton[] buttons) { InitializeComponent(); Card.VerticalAlignment = (fillHeight ? VerticalAlignment.Stretch : VerticalAlignment.Center); Card.HorizontalAlignment = (fillWidth ? HorizontalAlignment.Stretch : HorizontalAlignment.Center); _allowClickOffClose = allowClickOffClose; if(content != null) { content.SetValue(Grid.RowProperty, 0); content.SetValue(Grid.ColumnProperty, 0); content.SetValue(Grid.RowSpanProperty, 1); content.SetValue(Grid.ColumnSpanProperty, 3); ContentHolder.Children.Add(content); } OnClickOffClose += onClickOffHandler; createButtons(buttons); show(parent); }
public Dialog(Panel parent, UIElement content, bool fillHeight, bool fillWidth, bool allowClickOffClose, DialogClickOffCloseHandler onClickOffHandler, params DialogButton[] buttons) { InitializeComponent(); Card.VerticalAlignment = (fillHeight ? VerticalAlignment.Stretch : VerticalAlignment.Center); Card.HorizontalAlignment = (fillWidth ? HorizontalAlignment.Stretch : HorizontalAlignment.Center); _allowClickOffClose = allowClickOffClose; if (content != null) { content.SetValue(Grid.RowProperty, 0); content.SetValue(Grid.ColumnProperty, 0); content.SetValue(Grid.RowSpanProperty, 1); content.SetValue(Grid.ColumnSpanProperty, 3); ContentHolder.Children.Add(content); } OnClickOffClose += onClickOffHandler; createButtons(buttons); show(parent); }