コード例 #1
0
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            Visibility val = (Visibility)value;

            bool result = val == Visibility.Visible;

            if (ConverterUtility.IsNegate((string)parameter))
            {
                result = !result;
            }
            return(result);
        }
コード例 #2
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            bool val = (bool)value;

            if (ConverterUtility.IsNegate((string)parameter))
            {
                val = !val;
            }

            if (val)
            {
                return(Visibility.Visible);
            }
            else
            {
                return(Visibility.Collapsed);
            }
        }