using System; using System.Globalization; using System.Windows.Data; namespace VideoConcat.Conversions { public class StatusToEnabledConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value is string status) { // 只有状态为"拼接成功"时才启用预览按钮 return status == "拼接成功"; } return false; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } }