728x90
반응형
    public class BooleanToVisibilityConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (true.Equals(value))
            {
                return Visibility.Visible;
            }

            if ("Hidden".Equals((parameter ?? "").ToString()))
            {
                return Visibility.Hidden;
            }

            return Visibility.Collapsed;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
728x90
반응형
Posted by kjun

댓글을 달아 주세요