2024-07-06 02:17:41 -07:00
|
|
|
|
using Avalonia;
|
|
|
|
|
using Avalonia.Data.Converters;
|
2024-02-05 23:08:37 -08:00
|
|
|
|
|
2024-03-17 18:37:06 -07:00
|
|
|
|
namespace SourceGit.Converters
|
|
|
|
|
{
|
|
|
|
|
public static class IntConverters
|
|
|
|
|
{
|
2024-03-31 01:54:29 -07:00
|
|
|
|
public static readonly FuncValueConverter<int, bool> IsGreaterThanZero =
|
2024-02-05 23:08:37 -08:00
|
|
|
|
new FuncValueConverter<int, bool>(v => v > 0);
|
|
|
|
|
|
2024-05-26 19:29:15 -07:00
|
|
|
|
public static readonly FuncValueConverter<int, bool> IsGreaterThanFour =
|
|
|
|
|
new FuncValueConverter<int, bool>(v => v > 4);
|
|
|
|
|
|
2024-03-31 01:54:29 -07:00
|
|
|
|
public static readonly FuncValueConverter<int, bool> IsZero =
|
2024-02-05 23:08:37 -08:00
|
|
|
|
new FuncValueConverter<int, bool>(v => v == 0);
|
|
|
|
|
|
2024-03-31 01:54:29 -07:00
|
|
|
|
public static readonly FuncValueConverter<int, bool> IsOne =
|
2024-02-17 23:44:05 -08:00
|
|
|
|
new FuncValueConverter<int, bool>(v => v == 1);
|
2024-04-01 04:59:15 -07:00
|
|
|
|
|
|
|
|
|
public static readonly FuncValueConverter<int, bool> IsNotOne =
|
|
|
|
|
new FuncValueConverter<int, bool>(v => v != 1);
|
2024-06-23 00:45:54 -07:00
|
|
|
|
|
2024-06-23 06:35:28 -07:00
|
|
|
|
public static readonly FuncValueConverter<int, bool> IsSubjectLengthBad =
|
2024-06-23 00:45:54 -07:00
|
|
|
|
new FuncValueConverter<int, bool>(v => v > ViewModels.Preference.Instance.SubjectGuideLength);
|
2024-06-23 06:35:28 -07:00
|
|
|
|
|
|
|
|
|
public static readonly FuncValueConverter<int, bool> IsSubjectLengthGood =
|
|
|
|
|
new FuncValueConverter<int, bool>(v => v <= ViewModels.Preference.Instance.SubjectGuideLength);
|
2024-07-06 02:17:41 -07:00
|
|
|
|
|
|
|
|
|
public static readonly FuncValueConverter<int, Thickness> ToTreeMargin =
|
|
|
|
|
new FuncValueConverter<int, Thickness>(v => new Thickness(v * 16, 0, 0, 0));
|
2024-02-05 23:08:37 -08:00
|
|
|
|
}
|
2024-03-31 01:54:29 -07:00
|
|
|
|
}
|