Exemple #1
0
        public void Close()
        {
            // Dialog wird angezeigt?
            if (DialogBaseControl == null)
            {
                return;
            }

            // Callbacks abhängen
            Ok     = null;
            Cancel = null;
            Yes    = null;
            No     = null;

            InvokeUICall(
                () =>
            {
                _dialogHost.HideDialog(DialogBaseControl);
                DialogBaseControl.SetCustomContent(null);
            });
        }
Exemple #2
0
        public void Show()
        {
            if (DialogBaseControl != null)
            {
                throw new Exception("The dialog can only be shown once.");
            }

            InvokeUICall(() =>
            {
                DialogBaseControl = new DialogBaseControl(_dialogHost.GetCurrentContent(), this);
                DialogBaseControl.SetCustomContent(_content);
                if (_verticalDialogAlignment.HasValue)
                {
                    DialogBaseControl.VerticalDialogAlignment = _verticalDialogAlignment.Value;
                }
                if (_horizontalDialogAlignment.HasValue)
                {
                    DialogBaseControl.HorizontalDialogAlignment = _horizontalDialogAlignment.Value;
                }
                _dialogHost.ShowDialog(DialogBaseControl);
            });
        }