using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace AxCopilot.Themes;

public class BoolToVisibilityConverter : IValueConverter
{
	public object Convert(object value, Type t, object p, CultureInfo c)
	{
		return (!(value is bool) || !(bool)value) ? Visibility.Collapsed : Visibility.Visible;
	}

	public object ConvertBack(object v, Type t, object p, CultureInfo c)
	{
		return v is Visibility && (Visibility)v == Visibility.Visible;
	}
}
