public static async Task<CheckedMessageBoxResult> Show(WindowOwner owner, string message, string caption, IEnumerable<DialogButtonInfo> buttons, MessageBoxImage image, string checkedMessage, bool? isChecked)
        {
            var buttonList = buttons.ToList();
            var messageBox = new CheckedMessageBox
            {
                Title = caption,
                Content = message,
                ButtonsSource = buttonList,
                CheckedMessage = checkedMessage,
                IsChecked = isChecked,
            };
            SetImage(messageBox, image);
            SetKeyBindings(messageBox, buttonList);

            var result = (MessageBoxResult)await messageBox.ShowInternal(owner);
            return new CheckedMessageBoxResult(result, messageBox.IsChecked);
        }
Exemplo n.º 2
0
        public static MessageBoxResult Show(Window owner, string message, string caption, IEnumerable<DialogButtonInfo> buttons, MessageBoxImage image, string checkedMessage, ref bool? isChecked)
        {
            var messageBox = new CheckedMessageBox
            {
                Owner = owner,
                WindowStartupLocation = owner != null ? WindowStartupLocation.CenterOwner : WindowStartupLocation.CenterScreen,
                Title = caption,
                Content = message,
                ButtonsSource = buttons.ToList(),
                CheckedMessage = checkedMessage,
                IsChecked = isChecked,
            };
            SetImage(messageBox, image);

            var result = (MessageBoxResult)messageBox.ShowInternal();
            isChecked = messageBox.IsChecked;
            return result;
        }
Exemplo n.º 3
0
        public static async Task <CheckedMessageBoxResult> Show(WindowOwner owner, string message, string caption, [NotNull] IEnumerable <DialogButtonInfo> buttons, MessageBoxImage image, string checkedMessage, bool?isChecked)
        {
            var buttonList = buttons.ToList();
            var messageBox = new CheckedMessageBox
            {
                Title          = caption,
                Content        = message,
                ButtonsSource  = buttonList,
                CheckedMessage = checkedMessage,
                IsChecked      = isChecked,
            };

            SetImage(messageBox, image);
            SetKeyBindings(messageBox, buttonList);

            var result = (MessageBoxResult)await messageBox.ShowInternal(owner);

            return(new CheckedMessageBoxResult(result, messageBox.IsChecked));
        }
Exemplo n.º 4
0
        public static MessageBoxResult Show(Window owner, string message, string caption, IEnumerable <DialogButtonInfo> buttons, MessageBoxImage image, string checkedMessage, ref bool?isChecked)
        {
            var messageBox = new CheckedMessageBox
            {
                Owner = owner,
                WindowStartupLocation = owner != null ? WindowStartupLocation.CenterOwner : WindowStartupLocation.CenterScreen,
                Title          = caption,
                Content        = message,
                ButtonsSource  = buttons.ToList(),
                CheckedMessage = checkedMessage,
                IsChecked      = isChecked,
            };

            SetImage(messageBox, image);

            var result = (MessageBoxResult)messageBox.ShowInternal();

            isChecked = messageBox.IsChecked;
            return(result);
        }