简体   繁体   中英

Controlling navigation on tab button press based on conditions in WPF C#

I have few drop downs in my screen and I want to control the navigation from one drop down to another on tab button press if nothing is selected in the drop downs. How I can achieve this.I'm using mvvm pattern wpf application.

If I understand correctly, basically you want a combobox to be a tab stop ONLY if there's nothing selected (perhaps to facilitate form filling?). Would a style like this work?

    <Style TargetType="ComboBox">
        <Setter Property="IsTabStop" Value="False"></Setter>
        <Style.Triggers>
            <Trigger Property="SelectedItem" Value="{x:Null}">
                <Setter Property="IsTabStop" Value="True"/>
            </Trigger>
        </Style.Triggers>
    </Style>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM