I have a simple conditional, a textbox named tbDestinationTableName that should only allow user input when any selection is made from the the ComboBox cbConnection. I currently do this in codeBehind. Can some one correct the following code if this can be done in XAML?
<ComboBox x:Name="cbConnection"
ItemsSource="{Binding Source={StaticResource XmlConnectionList}, XPath=//ComboItem}"
DisplayMemberPath="Key"
SelectedValuePath="Value"
SelectedValue="{Binding Path=ConnectionString,ValidatesOnDataErrors=True,UpdateSourceTrigger=PropertyChanged}"
Margin="{StaticResource ConsistentMargins}"
/>
<kit:WatermarkTextBox Name="tbDestinationTableName" Margin="{StaticResource ConsistentMargins}"
TextChanged="tbDestinationTableName_TextChanged"
Text="{Binding Path=DestinationTableName, UpdateSourceTrigger=PropertyChanged,ValidatesOnDataErrors=True}"
Watermark="Destination Table"
IsEnabled="{Binding Path=ValidCreate}"/>
i believe you can do something like this with your custom textbox
If you want to use IsEnabled instead then it should not be set in kit:WatermarkTextBox’s xaml.
Just use another Datatrigger like this: