You can extend the functionality of the converter by using the converter parameter. Let's modify the Convert method to utilize the parameter named parameter and reverse the visibility based on its value.
To do so, open the BoolToVisibilityConverter.cs and modify the class implementation as shared in the following code snippet:
public class BoolToVisibilityConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var val = (bool) value; if (parameter is string param && param.ToString().Equals("inverse")) { val = !val; } return val ? Visibility.Visible: Visibility.Collapsed; } public object ConvertBack(object value, Type targetType, object parameter, ...