laatzen/Common/Ui/Common.UI/Infrastructure/BooleanToVisibilityConverter.cs
2024-12-03 17:03:33 +01:00

17 lines
578 B
C#

namespace Common.UI.Infrastructure
{
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
public class BooleanToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, Object parameter, CultureInfo culture)
=> value is bool visible && visible ? Visibility.Visible : Visibility.Collapsed;
public object ConvertBack(object value, Type targetType, Object parameter, CultureInfo culture)
=> throw new NotImplementedException();
}
}