Files
CliFx/CliFx/Extensibility/BoolBindingConverter.cs
Tyrrrz a62ce71424 asd
2024-09-03 02:03:50 +03:00

14 lines
414 B
C#

using System;
namespace CliFx.Extensibility;
/// <summary>
/// Converter for activating command inputs bound to properties of type <see cref="bool" />.
/// </summary>
public class BoolBindingConverter : BindingConverter<bool>
{
/// <inheritdoc />
public override bool Convert(string? rawValue, IFormatProvider? formatProvider) =>
string.IsNullOrWhiteSpace(rawValue) || bool.Parse(rawValue);
}