| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 | using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Data;using System.Windows.Media;namespace Venus_MainPages.Converters{    internal class BoolToHeightConverter : IValueConverter    {        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)        {            if (value == null) return System.Windows.GridLength.Auto;            var item = (bool)value;            if (item == true)            {                return System.Windows.GridLength.Auto;            }            else            {                return new System.Windows.GridLength(0);            }        }        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)        {            return null;        }    }    internal class BoolToHeightConverter2 : IValueConverter    {        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)        {            var item = (bool)value;            if (item == true)            {                return new System.Windows.GridLength();            }            else            {                return new System.Windows.GridLength(0);            }        }        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)        {            return null;        }    }}
 |