Exemplo n.º 1
0
        private void ShowDialog(TaskDialog taskDialog)
        {
            taskDialog.Owner = this;

            if (ShowInline.IsChecked == true)
            {
                options.IsEnabled = false;
                taskDialog.ShowInline(this);
                options.IsEnabled = true;
            }
            else
            {
                taskDialog.Show();
            }
        }
Exemplo n.º 2
0
        private static TaskDialogResult ShowCore(DependencyObject owner, string header, string content, string title,
            TaskDialogButtons standardButtons, TaskDialogIcon icon, bool useCommandLinks,
            params TaskDialogButtonData[] buttons)
        {
            var taskDialog = new TaskDialog
            {
                Owner = owner,
                Title = title,
                Header = header,
                Content = content,
                MainIcon = TaskDialogIconConverter.ConvertFrom(icon)
            };

            foreach (TaskDialogButtonData buttonData in TaskDialogButtonData.FromStandardButtons(standardButtons))
            {
                taskDialog.Buttons.Add(buttonData);
            }

            if (useCommandLinks)
            {
                foreach (TaskDialogButtonData buttonData in buttons)
                {
                    taskDialog.CommandLinks.Add(buttonData);
                }
            }
            else
            {
                foreach (TaskDialogButtonData buttonData in buttons)
                {
                    taskDialog.Buttons.Add(buttonData);
                }
            }

            taskDialog.Show();

            return taskDialog.Result;
        }