mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 20:54:59 +00:00
18 lines
703 B
C#
18 lines
703 B
C#
using Avalonia.Controls;
|
|
using Avalonia.Data.Converters;
|
|
using Avalonia.Media;
|
|
|
|
namespace SourceGit.Converters
|
|
{
|
|
public static class BoolConverters
|
|
{
|
|
public static readonly FuncValueConverter<bool, double> HalfIfFalse =
|
|
new FuncValueConverter<bool, double>(x => x ? 1 : 0.5);
|
|
|
|
public static readonly FuncValueConverter<bool, FontWeight> BoldIfTrue =
|
|
new FuncValueConverter<bool, FontWeight>(x => x ? FontWeight.Bold : FontWeight.Regular);
|
|
|
|
public static readonly FuncValueConverter<bool, GridLength> ToStarOrAutoGridLength =
|
|
new(value => value ? new GridLength(1, GridUnitType.Star) : new GridLength(1, GridUnitType.Auto));
|
|
}
|
|
}
|