public T ShowDialog <T>(IDialogViewModel <T> viewModel, int?autoHideIntervalSecs)
        {
            Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(() =>
            {
                IDialogView dialog = new Dialog
                {
                    DataContext = viewModel
                };
                viewModel.Dialog = dialog;
                if (autoHideIntervalSecs != null)
                {
                    if (autoHideIntervalSecs < 2)
                    {
                        autoHideIntervalSecs = 2;
                    }

                    viewModel.AutoHideIntervalSecs = autoHideIntervalSecs;
                    viewModel.StartTimer();
                }

                dialog.ShowDialog();
            }));

            return(viewModel.DialogResult);
        }