18 lines
668 B
C#
18 lines
668 B
C#
using System.Globalization;
|
|
using System.Windows;
|
|
using System.Windows.Data;
|
|
|
|
namespace TeamsISO.App.Converters;
|
|
|
|
[ValueConversion(typeof(bool), typeof(Visibility))]
|
|
public sealed class BoolToVisibilityConverter : IValueConverter
|
|
{
|
|
public Visibility TrueValue { get; set; } = Visibility.Visible;
|
|
public Visibility FalseValue { get; set; } = Visibility.Collapsed;
|
|
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) =>
|
|
value is true ? TrueValue : FalseValue;
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) =>
|
|
throw new NotSupportedException();
|
|
}
|