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