Ejemplo n.º 1
0
        private DialogButton.ReturnEvent triggerOnClose()
        {
            DialogClickOffCloseHandler handler = OnClickOffClose;

            if (handler != null)
            {
                return(handler());
            }
            return(DialogButton.ReturnEvent.Empty);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }