Search code examples
c#wpfdevexpress-wpf

Custom Tab key behavior in WPF DevExpress MessageBox


I am having a attache property, which converts the "+" key press into "Tab" key behavior. This is working fine for all the windows and usercontrol, except for message boxes.

I did go through the following link:

Customize Message Box

and got to know, this behavior change may be costly piece of work. Please help me get to know if this holds good for DevExpress message box as well.

Thanks! Sid


Solution

  • Got to know how to go about resolving it. Here is the solution, hope it will be helpful for someone looking for answer to similar questions:

    We need to define a style for DXMessageBox in App.xaml as below, where in we are setting the attached property:

    <Application.Resources>
        <ResourceDictionary>
            <Style TargetType="{x:Type dxc:DXMessageBox}">
                <Setter Property="local_AP:CustomKeyTraversal.ActionKey" Value="Add" />
            </Style>                  
        </ResourceDictionary>     
    </Application.Resources>
    

    Thanks! Sid