DialogContentMaxWidthValueConverter.cs 778 B

1234567891011121314151617181920212223242526272829
  1. using System;
  2. using System.Globalization;
  3. using Avalonia.Data.Converters;
  4. using Avalonia.Media.Immutable;
  5. namespace SukiUI.Dialogs
  6. {
  7. public class DialogContentMaxWidthValueConverter: IValueConverter
  8. {
  9. public static readonly DialogContentMaxWidthValueConverter Instance = new();
  10. public object? Convert(object? value, Type targetType, object? parameter,
  11. CultureInfo culture)
  12. {
  13. if (value is string)
  14. return 450;
  15. return 2000;
  16. }
  17. public object ConvertBack(object? value, Type targetType,
  18. object? parameter, CultureInfo culture)
  19. {
  20. throw new NotSupportedException();
  21. }
  22. }
  23. }