Hello,
I am having 2 textboxes and a checkbox in a window, I am having following scenarios to meet
1. Textbox2 should be enabled when CheckBox is checked
2. If CheckBox is not checked then copy text from Textbox1 to Textbox2 on key press in Textbox1 (i.e. simultaneously on the fly)
I am able to complete the first part by binding IsEnabled property to Checkbox's IsChecked property and it works fine
I am stuck with the second part as there an event trigger (on Textbox1) which should fire based on certain property value of another control (Checkbox) and update Text property of 3rd control (Textbox2). How to achieve this? Any help please
I don't want to use any code behind for this, although I don't even want to use any ViewModel property or ICommand property to handle this either unless otherwise not possible!! Was wondering if there's a simple "XAML way" of doing this.
Below is what the current XAML looks like
<TextBox Name="txt1" HorizontalAlignment="Left" Height="23" Margin="68,73,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="120"/>
<TextBox IsEnabled="{Binding ElementName=chkbx, Path=IsChecked}" Name="txt2" Text="{Binding ElementName=txt1, Path=Text}" HorizontalAlignment="Left" Height="23" Margin="68,155,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="120">
</TextBox>
<CheckBox Content="CheckBox" Name="chkbx" HorizontalAlignment="Left" Margin="68,116,0,0" VerticalAlignment="Top"/>
Regards,
Sujay C.