標準の機能では出来ないはずです。
ConfirmationMessage
を継承してデフォルトフォーカス用のプロパティを増やし、
ConfirmationDialogInteractionMessageAction
を参考に新しいInteractionMessageAction<FrameworkElement>
を継承したTriggerAction
を作ることで実現できます。
実装例としては以下のような形になるかと。
public class FocusableConfirmationMessage : ConfirmationMessage
{
public MessageBoxResult DefaultFocus
{
get { return (MessageBoxResult)GetValue(DefaultFocusProperty); }
set { SetValue(DefaultFocusProperty, value); }
}
// Using a DependencyProperty as the backing store for DefaultFocus. This enables animation, styling, binding, etc...
public static readonly DependencyProperty DefaultFocusProperty =
DependencyProperty.Register("DefaultFocus", typeof(MessageBoxResult), typeof(FocusableConfirmationMessage), new PropertyMetadata(MessageBoxResult.None));
public FocusableConfirmationMessage() : base()
{
}
public FocusableConfirmationMessage(string text, string caption, MessageBoxImage image, MessageBoxButton button, MessageBoxResult defaultFocus, string messageKey)
: base(text,caption,image,button,messageKey)
{
this.DefaultFocus = defaultFocus;
}
}
public class FocusableConfirmationDialogInteractionMessageAction : InteractionMessageAction<FrameworkElement>
{
protected override void InvokeAction(InteractionMessage message)
{
var confirmMessage = message as FocusableConfirmationMessage;
if (confirmMessage != null)
{
var result = MessageBox.Show(
confirmMessage.Text,
confirmMessage.Caption,
confirmMessage.Button,
confirmMessage.Image,
confirmMessage.DefaultFocus
);
if (result == MessageBoxResult.Yes || result == MessageBoxResult.OK)
{
confirmMessage.Response = true;
}
else if (result == MessageBoxResult.Cancel)
{
confirmMessage.Response = null;
}
else
{
confirmMessage.Response = false;
}
}
}
}