You need to use what's called a value converter (a class that implements IValueConverter.) A very basic example of such a class is shown below. (Watch for clipping...)
public class NegateConverter : IValueConverter
{
public object Convert( object value, Type targetType, object parameter, CultureInfo culture )
{
if ( value is bool ) {
return !(bool)value;
}
return value;
}
public object ConvertBack( object value, Type targetType, object parameter, CultureInfo culture )
{
if ( value is bool ) {
return !(bool)value;
}
return value;
}
}
Then to include it in your XAML you would do something like:
<UserControl xmlns:local="clr-namespace:MyNamespace">
<UserControl.Resources>
<local:NegateConverter x:Key="negate" />
</UserControl.Resources>
...
<CheckBox IsEnabled="{Binding IsChecked, ElementName=rbBoth, Converter={StaticResource negate}}"
Content="Show all" />
</UserControl>