I'm trying to bind a TextBox
text on a RadioButton
check event:
[
What I want to do is: Ehen the "SAV" or "HORS CIRCUIT" or "AUCUNE" radiobutton are checked, then the "Adr Mac" textbox becomes empty, with this Xaml code:
<TextBox x:Name="AdrMac_TxtBox">
<TextBox.Style>
<Style TargetType="{x:Type TextBox}">
<Setter Property="BorderBrush" Value="Black"/>
<Setter Property="Width" Value="100"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="5"/>
<Setter Property="Margin" Value="5"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="LightGray"/>
<Setter Property="Opacity" Value="0.5"/>
</Trigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Path=IsChecked,ElementName=None_Imprim_Rb}"
Value="True"/>
<Condition Binding="{Binding Path=IsChecked,ElementName=Sav_Rb_Checked}"
Value="True"/>
<Condition Binding="{Binding Path=IsChecked,ElementName=HC_Rb_Checked}"
Value="True"/>
</MultiDataTrigger.Conditions>
<Setter Property="Text" Value="{x:Static sys:String.Empty}"/>
</MultiDataTrigger>
</Style.Triggers>
</Style>
</TextBox.Style>
</TextBox>
Can you tell me what is wrong with this code ?