Exemplo n.º 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;
		}
Exemplo n.º 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;
		}
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }