Prism 5 を使用しており、NotificationRequest を介してモーダル ダイアログを表示します。OK ボタンにフォーカスを設定したいので、ユーザーは Enter キーを押すだけでメッセージをスキップできます (現在は、Tab -> Tab -> Enter で動作します)。私は多くの方法を試しましたが、誰も働いていません:
<i:Interaction.Triggers>
<prism:InteractionRequestTrigger SourceObject="{Binding NotificationRequest, Mode=OneWay}">
<prism:PopupWindowAction IsModal="True" CenterOverAssociatedObject="True" FocusManager.FocusedElement="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.OKButton}"/>
</prism:InteractionRequestTrigger>
</i:Interaction.Triggers>
もちろん、ダイアログは表示されており、エラーはありません。唯一の問題は、ボタンのフォーカスです。
どうすればこの動作を取得できますか? 私が望むのは、ユーザーがEnterキーを押すと、ボタンがクリックされたかのようにPopupWindowが閉じることです。