51 references to BindConverter
Microsoft.AspNetCore.Components (7)
BindConverter.cs (2)
1984var method = _convertToEnum ??= typeof(BindConverter).GetMethod(nameof(ConvertToEnum), BindingFlags.NonPublic | BindingFlags.Static)!; 1990var method = _convertToNullableEnum ??= typeof(BindConverter).GetMethod(nameof(ConvertToNullableEnum), BindingFlags.NonPublic | BindingFlags.Static)!;
EventCallbackFactoryBinderExtensions.cs (5)
6using static Microsoft.AspNetCore.Components.BindConverter; 1344BindConverter.BindParser<T> converter) 1387BindConverter.BindParser<T> converter) 1431BindConverter.BindParserWithFormat<T> converter) 1475BindConverter.BindParserWithFormat<T> converter)
Microsoft.AspNetCore.Components.Tests (27)
BindConverterTest.cs (25)
25var actual = BindConverter.FormatValue(value); 39var actual = BindConverter.FormatValue<bool>(value); 53var actual = BindConverter.FormatValue(value); 67var actual = BindConverter.FormatValue<bool?>(value); 81var actual = BindConverter.FormatValue(value); 95var actual = BindConverter.FormatValue<bool?>(value); 109var actual = BindConverter.FormatValue(value); 123var actual = BindConverter.FormatValue<int>(value); 137var actual = BindConverter.FormatValue(value); 151var actual = BindConverter.FormatValue<int?>(value); 165var actual = BindConverter.FormatValue(value); 179var actual = BindConverter.FormatValue(value, "MM-yyyy", CultureInfo.InvariantCulture); 193var actual = BindConverter.FormatValue(value); 207var actual = BindConverter.FormatValue(value, "MM-yyyy", CultureInfo.InvariantCulture); 221var actual = BindConverter.FormatValue(value); 235var actual = BindConverter.FormatValue(value, "HH:mm", CultureInfo.InvariantCulture); 249var actual = BindConverter.FormatValue(value); 263var actual = BindConverter.FormatValue(value); 276var actual = BindConverter.FormatValue(value); 295var actual = BindConverter.FormatValue(value); 309var successfullyConverted = BindConverter.TryConvertTo<Guid>(incomingValue, CultureInfo.CurrentCulture, out var actual); 323var successfullyConverted = BindConverter.TryConvertTo<Guid>(incomingValue, CultureInfo.CurrentCulture, out var actual); 338var successfullyConverted = BindConverter.TryConvertTo<Guid?>(incomingValue, CultureInfo.CurrentCulture, out var actual); 351var successfullyConverted = BindConverter.TryConvertTo<Guid?>(incomingValue, CultureInfo.CurrentCulture, out var actual); 365var successfullyConverted = BindConverter.TryConvertTo<Guid?>(value, CultureInfo.CurrentCulture, out var actual);
RendererTest.cs (2)
5488builder.AddAttribute(2, "value", BindConverter.FormatValue(CheckboxEnabled)); 5492builder.AddAttribute(5, "value", BindConverter.FormatValue(SomeStringProperty));
Microsoft.AspNetCore.Components.Web (17)
Forms\InputCheckbox.cs (1)
39builder.AddAttribute(5, "checked", BindConverter.FormatValue(CurrentValue));
Forms\InputDate.cs (5)
102DateTime dateTimeValue => BindConverter.FormatValue(dateTimeValue, _format, CultureInfo.InvariantCulture), 103DateTimeOffset dateTimeOffsetValue => BindConverter.FormatValue(dateTimeOffsetValue, _format, CultureInfo.InvariantCulture), 104DateOnly dateOnlyValue => BindConverter.FormatValue(dateOnlyValue, _format, CultureInfo.InvariantCulture), 105TimeOnly timeOnlyValue => BindConverter.FormatValue(timeOnlyValue, _format, CultureInfo.InvariantCulture), 112if (BindConverter.TryConvertTo(value, CultureInfo.InvariantCulture, out result))
Forms\InputExtensions.cs (1)
35else if (BindConverter.TryConvertTo<TValue>(value, CultureInfo.CurrentCulture, out var parsedValue))
Forms\InputNumber.cs (7)
70if (BindConverter.TryConvertTo<TValue>(value, CultureInfo.InvariantCulture, out result)) 96return BindConverter.FormatValue(@int, CultureInfo.InvariantCulture); 99return BindConverter.FormatValue(@long, CultureInfo.InvariantCulture); 102return BindConverter.FormatValue(@short, CultureInfo.InvariantCulture); 105return BindConverter.FormatValue(@float, CultureInfo.InvariantCulture); 108return BindConverter.FormatValue(@double, CultureInfo.InvariantCulture); 111return BindConverter.FormatValue(@decimal, CultureInfo.InvariantCulture);
Forms\InputRadio.cs (1)
70builder.AddAttribute(5, "value", BindConverter.FormatValue(Value?.ToString()));
Forms\InputSelect.cs (2)
49builder.AddAttribute(5, "value", BindConverter.FormatValue(CurrentValue)?.ToString()); 87CurrentValue = BindConverter.TryConvertTo<TValue>(value, CultureInfo.CurrentCulture, out var result)