我正在使用转换器
<Window.Resources>
<BooleanToVisibilityConverter x:Key="convVisibility"/>
</Window.Resources>
我有 3 个单选按钮:
<RadioButton Content="PRE" GroupName="Env" Height="16" HorizontalAlignment="Left" Margin="492,167,0,0" Name="radioButton4" VerticalAlignment="Top" />
<RadioButton Content="POST" GroupName="Env" Height="16" HorizontalAlignment="Left" Margin="558,167,0,0" Name="radioButton5" VerticalAlignment="Top" />
<RadioButton Content="BOTH" GroupName="Env" Height="16" HorizontalAlignment="Left" Margin="632,167,0,0" Name="radioButton6" VerticalAlignment="Top" />
如果选择了radioButton4 或radioButton6,我将尝试显示一个标签。目前可以使用它与 4 一起使用。
<Label Content="PRE" Visibility="{Binding IsChecked, ElementName=radioButton4, Converter={StaticResource convVisibility}}" Height="28" HorizontalAlignment="Left" Margin="57,262,0,0" Name="label7" VerticalAlignment="Top" />
有没有办法在标签上添加第二个绑定,或者我是 SOL,我在过去一个小时左右尝试过谷歌搜索,并希望它很简单,可行吗?