public MsgBoxResult ShowTaskDialog(
            IWindow owner,
            string text,
            string caption,
            MsgBoxButton button,
            MsgBoxImage icon,
            Icon custumIcon)
        {
            return ObservableObject.CurrentDispatcher.Invoke(
                () =>
                {
                    var dialog = new TaskDialog
                    {
                        CenterParent = true,
                        Content = text,
                        ExpandFooterArea = false,
                        ExpandedByDefault = false,
                        MinimizeBox = false,
                        ProgressBarStyle =
                            ProgressBarStyle.None,
                        WindowIcon = custumIcon,
                        WindowTitle = caption,
                        MainInstruction = caption,
                        MainIcon = TranslateIcon(icon)
                    };

                    TranslateButtons(button, dialog.Buttons);
                    TaskDialogButton clickedButton =
                        dialog.ShowDialog(owner != null
                                              ? (Window)
                                                owner
                                                    .TranslateForTechnology
                                                    ()
                                              : null);

                    switch (clickedButton.ButtonType)
                    {
                        case ButtonType.Ok:
                            return MsgBoxResult.Ok;
                        case ButtonType.Yes:
                            return MsgBoxResult.Yes;
                        case ButtonType.No:
                            return MsgBoxResult.No;
                        case ButtonType.Cancel:
                            return MsgBoxResult.Cancel;
                        case ButtonType.Close:
                            return MsgBoxResult.Cancel;
                        default:
                            throw new ArgumentOutOfRangeException();
                    }
                });
        }
        public string ShowSaveFileDialog(
            IWindow owner,
            bool addExtension,
            bool checkFileExists,
            bool checkPathExists,
            string defaultExt,
            bool dereferenceLinks,
            string filter,
            bool createPrompt,
            bool overwritePrompt,
            string title,
            string initialDirectory,
            out bool? result)
        {
            bool? tempresult = null;

            try
            {
                return ObservableObject.CurrentDispatcher.Invoke(
                    () =>
                    {
                        var dialog = new VistaSaveFileDialog
                        {
                            AddExtension = addExtension,
                            CheckFileExists = checkFileExists,
                            DefaultExt = defaultExt,
                            DereferenceLinks =
                                dereferenceLinks,
                            Filter = filter,
                            Title = title,
                            CheckPathExists = checkPathExists,
                            CreatePrompt = createPrompt,
                            OverwritePrompt = overwritePrompt,
                            InitialDirectory =
                                initialDirectory
                        };

                        TranslateDefaultExt(dialog);

                        tempresult = owner != null
                                         ? dialog.ShowDialog(
                                             (Window)
                                             owner
                                                 .TranslateForTechnology
                                                 ())
                                         : dialog.ShowDialog();

                        return tempresult == false ? null : dialog.FileName;
                    });
            }
            finally
            {
                result = tempresult;
            }
        }
        public string ShowOpenFolderDialog(
            IWindow owner,
            string description,
            Environment.SpecialFolder rootFolder,
            bool showNewFolderButton,
            bool useDescriptionForTitle,
            out bool? result)
        {
            bool? tempresult = null;

            try
            {
                return ObservableObject.CurrentDispatcher.Invoke(
                    () =>
                    {
                        var dialog = new VistaFolderBrowserDialog
                        {
                            Description = description,
                            RootFolder = rootFolder,
                            ShowNewFolderButton =
                                showNewFolderButton,
                            UseDescriptionForTitle =
                                useDescriptionForTitle
                        };

                        tempresult = owner != null
                                         ? dialog.ShowDialog(
                                             (Window)
                                             owner
                                                 .TranslateForTechnology
                                                 ())
                                         : dialog.ShowDialog();

                        return tempresult == false
                                   ? null
                                   : dialog.SelectedPath;
                    });
            }
            finally
            {
                result = tempresult;
            }
        }
        public IEnumerable<string> ShowOpenFileDialog(
            IWindow owner,
            bool checkFileExists,
            string defaultExt,
            bool dereferenceLinks,
            string filter,
            bool multiSelect,
            string title,
            bool validateNames,
            bool checkPathExists,
            out bool? result)
        {
            bool? tempresult = null;

            try
            {
                return ObservableObject.CurrentDispatcher.Invoke(
                    () =>
                    {
                        var dialog = new VistaOpenFileDialog
                        {
                            CheckFileExists = checkFileExists,
                            DefaultExt = defaultExt,
                            DereferenceLinks =
                                dereferenceLinks,
                            Filter = filter,
                            Multiselect = multiSelect,
                            Title = title,
                            ValidateNames = validateNames,
                            CheckPathExists = checkPathExists
                        };

                        TranslateDefaultExt(dialog);

                        tempresult = owner != null
                                         ? dialog.ShowDialog(
                                             (Window)
                                             owner
                                                 .TranslateForTechnology
                                                 ())
                                         : dialog.ShowDialog();

                        return tempresult == false
                                   ? Enumerable.Empty<string>()
                                   : dialog.FileNames;
                    });
            }
            finally
            {
                result = tempresult;
            }
        }
        public MsgBoxResult ShowMessageBox(
            IWindow owner,
            string text,
            string caption,
            MsgBoxButton button,
            MsgBoxImage icon,
            Icon custumIcon)
        {
            Window realWindow = owner == null ? null : (Window)owner.TranslateForTechnology();

            return
                ObservableObject.CurrentDispatcher.Invoke(
                    () =>
                    !TaskDialog.OSSupportsTaskDialogs
                        ? (MsgBoxResult)
                          MessageBox.Show(
                              realWindow,
                              text,
                              caption,
                              (MessageBoxButton) button,
                              (MessageBoxImage) icon)
                        : ShowTaskDialog(owner, text, caption, button, icon,
                                         custumIcon));
        }
        /// <summary>
        ///     The get text.
        /// </summary>
        /// <param name="owner">
        ///     The owner.
        /// </param>
        /// <param name="instruction">
        ///     The instruction.
        /// </param>
        /// <param name="content">
        ///     The content.
        /// </param>
        /// <param name="caption">
        ///     The caption.
        /// </param>
        /// <param name="allowCancel">
        ///     The allow cancel.
        /// </param>
        /// <param name="defaultValue">
        ///     The default value.
        /// </param>
        /// <returns>
        ///     The <see cref="string" />.
        /// </returns>
        public string GetText(
            IWindow owner,
            string instruction,
            string content,
            string caption,
            bool allowCancel,
            string defaultValue)
        {
            return ObservableObject.CurrentDispatcher.Invoke(
                () =>
                {
                    Window realWindow = owner == null ? null : (Window) owner.TranslateForTechnology();
                    var diag = new InputDialog
                    {
                        Owner = realWindow,
                        MainText = instruction,
                        AllowCancel = allowCancel,
                        Title = caption,
                        InstructionText = content,
                        Result = defaultValue
                    };

                    return diag.ShowDialog() == true ? diag.Result : null;
                });
        }