public void Close()
        {
            var result = Result;

            // 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);
                if (DialogClosed != null)
                {
                    DialogClosed(this, new DialogClosedEventArgs(result));
                }
            });
        }
 public void HideDialog(DialogBaseControl dialog)
 {
     if (_parent.Content == dialog)
     {
         var oldContent = _layerStack.Last();
         _layerStack.Remove(oldContent);
         _parent.Content = oldContent;
     }
     else
         _layerStack.Remove(dialog);
 }
 public void HideDialog(DialogBaseControl dialog)
 {
     _parent.Children.Remove(dialog);
     //if (_parent.Content == dialog)
     //{
     //	var oldContent = _layerStack.Last();
     //	_layerStack.Remove(oldContent);
     //	_parent.Content = oldContent;
     //}
     //else
     //	_layerStack.Remove(dialog);
 }
Example #4
0
 public void HideDialog(DialogBaseControl dialog)
 {
     if (_parent.Content == dialog)
     {
         var oldContent = _layerStack.Last();
         _layerStack.Remove(oldContent);
         _parent.Content = oldContent;
     }
     else
     {
         _layerStack.Remove(dialog);
     }
 }
Example #5
0
        public void Show(Action workerMethod)
        {
            ThreadPool.QueueUserWorkItem(o =>
            {
                try
                {
                    _beginWork.WaitOne(-1);

                    workerMethod();

                    InvokeUICall(() =>
                    {
                        _isReady = true;

                        if (WorkerReady != null)
                        {
                            WorkerReady();
                        }

                        if (CloseWhenWorkerFinished)
                        {
                            Close();
                            return;
                        }

                        _waitProgressDialogControl.DisplayText = ReadyMessage;
                        _waitProgressDialogControl.Finish();

                        DialogBaseControl.RemoveButtons();
                        DialogBaseControl.AddOkButton();
                    });
                }
                catch (Exception ex)
                {
                    InvokeUICall(() =>
                    {
                        Close();
                        throw ex;
                    });
                }
            });

            Show();

            _beginWork.Set();
        }
Example #6
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);
            });
        }
        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);
            });
        }
Example #8
0
        public void Show()
        {
            if (DialogBaseControl != null)
            {
                throw new Exception("The dialog can only be shown once.");
            }

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

                //_dialogHost.ShowDialog(DialogBaseControl);
                _overviewViewModel.DialogPlaceholder = DialogBaseControl;
            });
        }
 public void ShowDialog(DialogBaseControl dialog)
 {
     //			_layerStack.Add(_parent.Content);
     //            _parent.Content = dialog;
     _parent.Children.Add(dialog);
 }
 public void ShowDialog(DialogBaseControl dialog)
 {
     _layerStack.Add(_parent.Content);
     _parent.Content = dialog;
 }
Example #11
0
 public void ShowDialog(DialogBaseControl dialog)
 {
     _layerStack.Add(_parent.Content);
     _parent.Content = dialog;
 }
Example #12
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);
				});
		}