diff --git a/src/Components/Components/ref/Microsoft.AspNetCore.Components.netstandard2.0.cs b/src/Components/Components/ref/Microsoft.AspNetCore.Components.netstandard2.0.cs index d917970d51..1221e96b0a 100644 --- a/src/Components/Components/ref/Microsoft.AspNetCore.Components.netstandard2.0.cs +++ b/src/Components/Components/ref/Microsoft.AspNetCore.Components.netstandard2.0.cs @@ -18,10 +18,10 @@ namespace Microsoft.AspNetCore.Components } [Microsoft.AspNetCore.Components.BindElementAttribute("select", null, "value", "onchange")] [Microsoft.AspNetCore.Components.BindElementAttribute("textarea", null, "value", "onchange")] - [Microsoft.AspNetCore.Components.BindInputElementAttribute("checkbox", null, "checked", "onchange")] - [Microsoft.AspNetCore.Components.BindInputElementAttribute("text", null, "value", "onchange")] - [Microsoft.AspNetCore.Components.BindInputElementAttribute(null, "value", "value", "onchange")] - [Microsoft.AspNetCore.Components.BindInputElementAttribute(null, null, "value", "onchange")] + [Microsoft.AspNetCore.Components.BindInputElementAttribute("checkbox", null, "checked", "onchange", false, null)] + [Microsoft.AspNetCore.Components.BindInputElementAttribute("text", null, "value", "onchange", false, null)] + [Microsoft.AspNetCore.Components.BindInputElementAttribute(null, "value", "value", "onchange", false, null)] + [Microsoft.AspNetCore.Components.BindInputElementAttribute(null, null, "value", "onchange", false, null)] public static partial class BindAttributes { } @@ -84,8 +84,10 @@ namespace Microsoft.AspNetCore.Components [System.AttributeUsageAttribute(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)] public sealed partial class BindInputElementAttribute : System.Attribute { - public BindInputElementAttribute(string type, string suffix, string valueAttribute, string changeAttribute) { } + public BindInputElementAttribute(string type, string suffix, string valueAttribute, string changeAttribute, bool isInvariantCulture, string format) { } public string ChangeAttribute { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public string Format { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public bool IsInvariantCulture { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } public string Suffix { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } public string Type { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } public string ValueAttribute { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } diff --git a/src/Components/Components/src/BindAttributes.cs b/src/Components/Components/src/BindAttributes.cs index 258ca0e1f0..7a571e1b0e 100644 --- a/src/Components/Components/src/BindAttributes.cs +++ b/src/Components/Components/src/BindAttributes.cs @@ -13,14 +13,14 @@ namespace Microsoft.AspNetCore.Components // Handles cases like - this is a fallback and will be ignored // when a specific type attribute is applied. - [BindInputElement(null, null, "value", "onchange")] + [BindInputElement(null, null, "value", "onchange", isInvariantCulture: false, format: null)] // Handles cases like - this is a fallback and will be ignored // when a specific type attribute is applied. - [BindInputElement(null, "value", "value", "onchange")] + [BindInputElement(null, "value", "value", "onchange", isInvariantCulture: false, format: null)] - [BindInputElement("checkbox", null, "checked", "onchange")] - [BindInputElement("text", null, "value", "onchange")] + [BindInputElement("checkbox", null, "checked", "onchange", isInvariantCulture: false, format: null)] + [BindInputElement("text", null, "value", "onchange", isInvariantCulture: false, format: null)] [BindElement("select", null, "value", "onchange")] [BindElement("textarea", null, "value", "onchange")] diff --git a/src/Components/Components/src/BindInputElementAttribute.cs b/src/Components/Components/src/BindInputElementAttribute.cs index fe618ca7bb..0cba1a8e84 100644 --- a/src/Components/Components/src/BindInputElementAttribute.cs +++ b/src/Components/Components/src/BindInputElementAttribute.cs @@ -1,7 +1,8 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Globalization; namespace Microsoft.AspNetCore.Components { @@ -18,7 +19,13 @@ namespace Microsoft.AspNetCore.Components /// The suffix value. /// The name of the value attribute to be bound. /// The name of an attribute that will register an associated change event. - public BindInputElementAttribute(string type, string suffix, string valueAttribute, string changeAttribute) + /// + /// Determines whether binding will use or . + /// + /// + /// An optional format to use when converting values. + /// + public BindInputElementAttribute(string type, string suffix, string valueAttribute, string changeAttribute, bool isInvariantCulture, string format) { if (valueAttribute == null) { @@ -34,6 +41,8 @@ namespace Microsoft.AspNetCore.Components Suffix = suffix; ValueAttribute = valueAttribute; ChangeAttribute = changeAttribute; + IsInvariantCulture = isInvariantCulture; + Format = format; } /// @@ -55,5 +64,16 @@ namespace Microsoft.AspNetCore.Components /// Gets the name of an attribute that will register an associated change event. /// public string ChangeAttribute { get; } + + /// + /// Gets a value that determines whether binding will use or + /// . + /// + public bool IsInvariantCulture { get; } + + /// + /// Gets an optional format to use when converting values. + /// + public string Format { get; } } }