20 lines
684 B
C#
20 lines
684 B
C#
using System;
|
|
using System.Windows;
|
|
using System.Windows.Data;
|
|
|
|
namespace DTS.Common.Converters
|
|
{
|
|
public class EnumVisibilityConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
|
{
|
|
return null != value && value.Equals(parameter) ? Visibility.Visible : Visibility.Hidden;
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
|
{
|
|
return null != value && value.Equals(Visibility.Visible) ? parameter : Binding.DoNothing;
|
|
}
|
|
}
|
|
}
|