feat: 更新

This commit is contained in:
GukSang.Jin
2026-02-27 16:56:18 +08:00
parent c7d107c2f1
commit fe0aee16ad
5 changed files with 237 additions and 15 deletions

View File

@@ -71,19 +71,19 @@ public class InverseBoolToVisibilityConverter : IValueConverter
}
}
public class ProgressToWidthConverter : IValueConverter
public class ProgressToWidthConverter : IMultiValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
if (value is int progress)
if (values.Length == 2 && values[0] is int progress && values[1] is double containerWidth)
{
// 假设进度条容器宽度为300根据百分比计算实际宽度
return progress * 3.0; // 300px * (progress/100)
// 根据进度百分比计算实际宽度
return containerWidth * progress / 100.0;
}
return 0.0;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}