示例#1
0
        public object Convert(object value, Type targetType, object parameter, string language)
		{
			if (targetType == typeof(Visibility))
			{
				var c = new VisibilityConverter();
				var r = c.Convert(value, targetType, parameter, language);
				return ((Visibility)r) == Visibility.Visible
						? Visibility.Collapsed : Visibility.Visible;
			}

			if (targetType == typeof(bool))
			{
				if (value == null)
					return true;
				return !((bool) value);
			}

			return null;
		}
示例#2
0
		public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			if (targetType == typeof(Visibility))
			{
				var c = new VisibilityConverter();
				var r = c.Convert(value, targetType, parameter, culture);
				return ((Visibility)r) == Visibility.Visible
						? Visibility.Collapsed : Visibility.Visible;
			}

			if (targetType == typeof(bool))
			{
				if (value == null)
					return true;
				return !((bool) value);
			}

			return null;
		}
示例#3
0
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            if (targetType == typeof(Visibility))
            {
                var c = new VisibilityConverter();
                var r = c.Convert(value, targetType, parameter, language);
                return(((Visibility)r) == Visibility.Visible
                        ? Visibility.Collapsed : Visibility.Visible);
            }

            if (targetType == typeof(bool))
            {
                if (value == null)
                {
                    return(true);
                }
                return(!((bool)value));
            }

            return(null);
        }
示例#4
0
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (targetType == typeof(Visibility))
            {
                var c = new VisibilityConverter();
                var r = c.Convert(value, targetType, parameter, culture);
                return(((Visibility)r) == Visibility.Visible
                        ? Visibility.Collapsed : Visibility.Visible);
            }

            if (targetType == typeof(bool))
            {
                if (value == null)
                {
                    return(true);
                }
                return(!((bool)value));
            }

            return(null);
        }