I have a textbox and a checkbox, i would like to set three properties on the textbox based on whether the checkbox is checked or not.
I can bind the properties to the checkbox but then i need to know what property is being bound in the converter.
For example, when unchecked i would like the textbox properties to be AcceptsReturn="False" TextWrapping="NoWrap" Height="25".
Then checked: AcceptsReturn="True" TextWrapping="Wrap" Height="100".
Will this require 3 converters or can i tell the converter "if checked==true && boundfrom == height, return 100"
Thanks, Kohan
Accepted Solution
<TextBox Name="txtAnswer" Margin="5" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Hidden" >
<TextBox.Style>
<Style>
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=cbMultiLine, Path=IsChecked}" Value="True">
<Setter Property="TextBox.TextWrapping" Value="Wrap" />
<Setter Property="TextBox.Height" Value="100" />
<Setter Property="TextBox.AcceptsReturn" Value="True" />
</DataTrigger>
</Style.Triggers>
</Style>
</TextBox.Style>
</TextBox>