using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Data; namespace 垂直剖面动态观测系统.Converter { //bool到箭头的转换器 public class BoolToArrowConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { //如果值为正返回一个向上的箭头 if (value != null && bool.Parse(value.ToString())) { return "⬆"; } return "⬇"; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } }