星火微课系统客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SizeConverter.cs 677B

12345678910111213141516171819202122232425
  1. using System;
  2. using System.Windows.Data;
  3. namespace ComeCapture.Converters
  4. {
  5. public class SizeConverter : IValueConverter
  6. {
  7. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  8. {
  9. return int.Parse(value.ToString()) == int.Parse(parameter.ToString());
  10. }
  11. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  12. {
  13. if ((bool)value)
  14. {
  15. return parameter;
  16. }
  17. else
  18. {
  19. return null;
  20. }
  21. }
  22. }
  23. }