Вы имеете право на MultiBinding. Ваш Xaml должен выглядеть следующим образом:
<Window.Resources>
<local:MultiBoolToVisibilityConverter x:Key="MultiBoolToVisibilityConverter"/>
</Window.Resources>
<DockPanel>
<StackPanel DockPanel.Dock="Top">
<RadioButton Name="rb1" Content="1"/>
<RadioButton Name="rb2" Content="2"/>
<RadioButton Name="rb3" Content="3"/>
</StackPanel>
<CheckBox DockPanel.Dock="Bottom" Content="Visible when 1 or 2 is checked.">
<CheckBox.Visibility>
<MultiBinding Converter="{StaticResource MultiBoolToVisibilityConverter}">
<Binding Path="IsChecked" ElementName="rb1" />
<Binding Path="IsChecked" ElementName="rb2" />
<Binding Path="IsChecked" ElementName="rb3" />
</MultiBinding>
</CheckBox.Visibility>
</CheckBox>
</DockPanel>
MultiBoolToVisibilityConverter
в преобразователе должны быть определены в коде позади, реализации IMultiValueConverter
public class MultiBoolToVisibilityConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
bool? firstRadioButtonIsChecked = values[0] as bool?;
bool? secondRadioButtonIsChecked = values[1] as bool?;
bool? thirdRadioButtonIsChecked = values[2] as bool?;
//set your logic. this is just an example:
if (firstRadioButtonIsChecked == true || secondRadioButtonIsChecked == true)
return Visibility.Visible;
return Visibility.Collapsed;
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
для дальнейших вопросов, вы можете увидеть this post on MultiBinding and IMultiValueConverter среди других предложений Google.