tags:

views:

20

answers:

0

Hi,

I would like to know how to set focus on a control based on the event of some other control in the same window. I want to do this at the XAML level. Consider the following example.

<Grid Grid.Row="1">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <CheckBox x:Name="titleCheckBox" VerticalAlignment="Center"/>
        <TextBox x:Name="titleTextBox" VerticalAlignment="Center" Grid.Column="1"/>
    </Grid>

I would like to set the focus of titleTextBox whenever titleCheckBox is checked and I want to have a solution at XAML level which is simple. Please suggest a suitable answer.