mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2025-12-12 09:48:51 +01:00
26 lines
788 B
C#
Executable File
26 lines
788 B
C#
Executable File
using System;
|
|
using System.Windows;
|
|
using System.Windows.Data;
|
|
|
|
namespace Configuration.Converter
|
|
{
|
|
public class NullToVisibilityConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter,
|
|
System.Globalization.CultureInfo culture)
|
|
{
|
|
if (targetType != typeof(Visibility))
|
|
throw new InvalidOperationException("The target is not of type bool");
|
|
|
|
return ((object)value != null) ? Visibility.Visible : Visibility.Collapsed;
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter,
|
|
System.Globalization.CultureInfo culture)
|
|
{
|
|
throw new NotSupportedException();
|
|
}
|
|
|
|
}
|
|
}
|