using System; using System.Globalization; using System.Windows.Data; namespace HME_MoistureLossMeter.Converters { public class BoolToStringConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { return (value is bool b && b) ? "运行中" : "已停止"; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotImplementedException(); } }