IntToCornerRadius.cs 572 B

123456789101112131415161718192021
  1. using System;
  2. using System.Globalization;
  3. using System.Windows;
  4. using System.Windows.Data;
  5. namespace GeekDesk.Converts
  6. {
  7. class IntToCornerRadius : IValueConverter
  8. {
  9. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  10. {
  11. int val = int.Parse(value.ToString());
  12. return new CornerRadius(val);
  13. }
  14. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  15. {
  16. throw new NotImplementedException();
  17. }
  18. }
  19. }