The standard means of doing this is to make an IValueConverter
that will invert your boolean values. While creating this class is more difficult than adding a new property, it's completely reusable - so later, you can reuse this in other bindings (without polluting your ViewModel with lots of !Property properties).
This class would look something like:
[ValueConversion(typeof(bool), typeof(bool))]
public class InvertBoolConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
bool booleanValue = (bool)value;
return !booleanValue;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
bool booleanValue = (bool)value;
return !booleanValue;
}
}
Then, you would add it to your resources:
<src:InvertBoolConverter x:Key="invertBoolConverter"/>
Once you have this, you would use it like:
<Button Content="Stop loading"
IsEnabled="{Binding IsLoaded, Converter={StaticResource invertBoolConverter}}"
/>