From cc1b2941f90fda48b38212b3d402c2869f410756 Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Mon, 25 Mar 2019 18:00:59 -0700 Subject: [PATCH] Fix #8520 - Component parameters not found This resolves the issue blocking use of component parameters from our ref assemblies. Making properties public with private get is our recommended guidance for wanting documentation to work in the IDE. We also now need to manually generate the ref-assembly types for these so they will show up for tooling with setters. I've logged an issue to track whether we want to keep this long term, it seems like a suitable workaround for now. --- eng/GenAPI.exclusions.txt | 18 +- ...etCore.Components.netstandard2.0.Manual.cs | 180 ++++++++++++++++++ ...ft.AspNetCore.Components.netstandard2.0.cs | 106 ----------- .../Components/src/CascadingValue.cs | 8 +- .../Components/src/Forms/EditForm.cs | 12 +- .../src/Forms/InputComponents/InputBase.cs | 10 +- .../src/Forms/InputComponents/InputDate.cs | 5 +- .../src/Forms/InputComponents/InputNumber.cs | 5 +- .../src/Forms/InputComponents/InputSelect.cs | 5 +- .../Components/src/Forms/ValidationMessage.cs | 2 +- .../Components/src/Layouts/LayoutDisplay.cs | 4 +- .../Components/src/Routing/NavLink.cs | 4 +- .../Components/src/Routing/Router.cs | 4 +- 13 files changed, 231 insertions(+), 132 deletions(-) diff --git a/eng/GenAPI.exclusions.txt b/eng/GenAPI.exclusions.txt index ebabc0ac7d..61d8c412b2 100644 --- a/eng/GenAPI.exclusions.txt +++ b/eng/GenAPI.exclusions.txt @@ -2,4 +2,20 @@ T:Microsoft.AspNetCore.Components.RenderTree.RenderTreeFrame # Manually implemented - https://github.com/dotnet/arcade/issues/2066 T:Microsoft.AspNetCore.Mvc.ApplicationModels.PageParameterModel -T:Microsoft.AspNetCore.Mvc.ApplicationModels.PagePropertyModel \ No newline at end of file +T:Microsoft.AspNetCore.Mvc.ApplicationModels.PagePropertyModel +# Manually implemented - https://github.com/aspnet/AspNetCore/issues/8825 +T:Microsoft.AspNetCore.Components.CascadingValue`1 +T:Microsoft.AspNetCore.Components.Forms.DataAnnotationsValidator +T:Microsoft.AspNetCore.Components.Forms.EditForm +T:Microsoft.AspNetCore.Components.Forms.InputBase`1 +T:Microsoft.AspNetCore.Components.Forms.InputCheckbox +T:Microsoft.AspNetCore.Components.Forms.InputDate`1 +T:Microsoft.AspNetCore.Components.Forms.InputNumber`1 +T:Microsoft.AspNetCore.Components.Forms.InputSelect`1 +T:Microsoft.AspNetCore.Components.Forms.InputText +T:Microsoft.AspNetCore.Components.Forms.InputTextArea +T:Microsoft.AspNetCore.Components.Forms.ValidationMessage`1 +T:Microsoft.AspNetCore.Components.Forms.ValidationSummary +T:Microsoft.AspNetCore.Components.Layouts.LayoutDisplay +T:Microsoft.AspNetCore.Components.Routing.NavLink +T:Microsoft.AspNetCore.Components.Routing.Router \ No newline at end of file diff --git a/src/Components/Components/ref/Microsoft.AspNetCore.Components.netstandard2.0.Manual.cs b/src/Components/Components/ref/Microsoft.AspNetCore.Components.netstandard2.0.Manual.cs index 11a3a8ec24..19c9249e47 100644 --- a/src/Components/Components/ref/Microsoft.AspNetCore.Components.netstandard2.0.Manual.cs +++ b/src/Components/Components/ref/Microsoft.AspNetCore.Components.netstandard2.0.Manual.cs @@ -44,4 +44,184 @@ namespace Microsoft.AspNetCore.Components.RenderTree public Microsoft.AspNetCore.Components.IComponent Component { get { throw null; } } public override string ToString() { throw null; } } +} + +// Built-in components: https://github.com/aspnet/AspNetCore/issues/8825 +namespace Microsoft.AspNetCore.Components +{ + public partial class CascadingValue : Microsoft.AspNetCore.Components.IComponent + { + public CascadingValue() { } + [Microsoft.AspNetCore.Components.ParameterAttribute] + public Microsoft.AspNetCore.Components.RenderFragment ChildContent { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + [Microsoft.AspNetCore.Components.ParameterAttribute] + public bool IsFixed { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + [Microsoft.AspNetCore.Components.ParameterAttribute] + public string Name { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + [Microsoft.AspNetCore.Components.ParameterAttribute] + public T Value { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + public void Configure(Microsoft.AspNetCore.Components.RenderHandle renderHandle) { } + public System.Threading.Tasks.Task SetParametersAsync(Microsoft.AspNetCore.Components.ParameterCollection parameters) { throw null; } + } +} + +namespace Microsoft.AspNetCore.Components.Forms +{ + public partial class DataAnnotationsValidator : Microsoft.AspNetCore.Components.ComponentBase + { + public DataAnnotationsValidator() { } + protected override void OnInit() { } + } + + public partial class EditForm : Microsoft.AspNetCore.Components.ComponentBase + { + public EditForm() { } + [Microsoft.AspNetCore.Components.ParameterAttribute] + public Microsoft.AspNetCore.Components.RenderFragment ChildContent { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + [Microsoft.AspNetCore.Components.ParameterAttribute] + public Microsoft.AspNetCore.Components.Forms.EditContext EditContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + [Microsoft.AspNetCore.Components.ParameterAttribute] + public object Model { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + [Microsoft.AspNetCore.Components.ParameterAttribute] + public Microsoft.AspNetCore.Components.EventCallback OnInvalidSubmit { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + [Microsoft.AspNetCore.Components.ParameterAttribute] + public Microsoft.AspNetCore.Components.EventCallback OnSubmit { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + [Microsoft.AspNetCore.Components.ParameterAttribute] + public Microsoft.AspNetCore.Components.EventCallback OnValidSubmit { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder) { } + protected override void OnParametersSet() { } + } + + public abstract partial class InputBase : Microsoft.AspNetCore.Components.ComponentBase + { + protected InputBase() { } + [Microsoft.AspNetCore.Components.ParameterAttribute] + public string Class { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + protected string CssClass { get { throw null; } } + protected T CurrentValue { get { throw null; } set { } } + protected string CurrentValueAsString { get { throw null; } set { } } + protected Microsoft.AspNetCore.Components.Forms.EditContext EditContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + protected string FieldClass { get { throw null; } } + protected Microsoft.AspNetCore.Components.Forms.FieldIdentifier FieldIdentifier { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + [Microsoft.AspNetCore.Components.ParameterAttribute] + public string Id { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + [Microsoft.AspNetCore.Components.ParameterAttribute] + public T Value { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + [Microsoft.AspNetCore.Components.ParameterAttribute] + public Microsoft.AspNetCore.Components.EventCallback ValueChanged { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + [Microsoft.AspNetCore.Components.ParameterAttribute] + public System.Linq.Expressions.Expression> ValueExpression { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + protected virtual string FormatValueAsString(T value) { throw null; } + public override System.Threading.Tasks.Task SetParametersAsync(Microsoft.AspNetCore.Components.ParameterCollection parameters) { throw null; } + protected abstract bool TryParseValueFromString(string value, out T result, out string validationErrorMessage); + } + + public partial class InputCheckbox : Microsoft.AspNetCore.Components.Forms.InputBase + { + public InputCheckbox() { } + protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder) { } + protected override bool TryParseValueFromString(string value, out bool result, out string validationErrorMessage) { throw null; } + } + + public partial class InputDate : Microsoft.AspNetCore.Components.Forms.InputBase + { + public InputDate() { } + [Microsoft.AspNetCore.Components.ParameterAttribute] + public string ParsingErrorMessage { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder) { } + protected override string FormatValueAsString(T value) { throw null; } + protected override bool TryParseValueFromString(string value, out T result, out string validationErrorMessage) { throw null; } + } + + public partial class InputNumber : Microsoft.AspNetCore.Components.Forms.InputBase + { + public InputNumber() { } + [Microsoft.AspNetCore.Components.ParameterAttribute] + public string ParsingErrorMessage { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder) { } + protected override bool TryParseValueFromString(string value, out T result, out string validationErrorMessage) { throw null; } + } + + public partial class InputSelect : Microsoft.AspNetCore.Components.Forms.InputBase + { + public InputSelect() { } + [Microsoft.AspNetCore.Components.ParameterAttribute] + public Microsoft.AspNetCore.Components.RenderFragment ChildContent { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder) { } + protected override bool TryParseValueFromString(string value, out T result, out string validationErrorMessage) { throw null; } + } + + public partial class InputText : Microsoft.AspNetCore.Components.Forms.InputBase + { + public InputText() { } + protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder) { } + protected override bool TryParseValueFromString(string value, out string result, out string validationErrorMessage) { throw null; } + } + + public partial class InputTextArea : Microsoft.AspNetCore.Components.Forms.InputBase + { + public InputTextArea() { } + protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder) { } + protected override bool TryParseValueFromString(string value, out string result, out string validationErrorMessage) { throw null; } + } + + public partial class ValidationMessage : Microsoft.AspNetCore.Components.ComponentBase, System.IDisposable + { + public ValidationMessage() { } + [Microsoft.AspNetCore.Components.ParameterAttribute] + public System.Linq.Expressions.Expression> For { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder) { } + protected override void OnParametersSet() { } + void System.IDisposable.Dispose() { } + } + + public partial class ValidationSummary : Microsoft.AspNetCore.Components.ComponentBase, System.IDisposable + { + public ValidationSummary() { } + protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder) { } + protected override void OnParametersSet() { } + void System.IDisposable.Dispose() { } + } +} + +namespace Microsoft.AspNetCore.Components.Layouts +{ + public partial class LayoutDisplay : Microsoft.AspNetCore.Components.IComponent + { + public LayoutDisplay() { } + [Microsoft.AspNetCore.Components.ParameterAttribute] + public System.Type Page { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + [Microsoft.AspNetCore.Components.ParameterAttribute] + public System.Collections.Generic.IDictionary PageParameters { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + public void Configure(Microsoft.AspNetCore.Components.RenderHandle renderHandle) { } + public System.Threading.Tasks.Task SetParametersAsync(Microsoft.AspNetCore.Components.ParameterCollection parameters) { throw null; } + } +} + +namespace Microsoft.AspNetCore.Components.Routing +{ + public partial class NavLink : Microsoft.AspNetCore.Components.IComponent, System.IDisposable + { + public NavLink() { } + [Microsoft.AspNetCore.Components.ParameterAttribute] + public string ActiveClass { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + [Microsoft.AspNetCore.Components.ParameterAttribute] + public Microsoft.AspNetCore.Components.Routing.NavLinkMatch Match { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + public void Configure(Microsoft.AspNetCore.Components.RenderHandle renderHandle) { } + public void Dispose() { } + public System.Threading.Tasks.Task SetParametersAsync(Microsoft.AspNetCore.Components.ParameterCollection parameters) { throw null; } + } + + public partial class Router : Microsoft.AspNetCore.Components.IComponent, System.IDisposable + { + public Router() { } + [Microsoft.AspNetCore.Components.ParameterAttribute] + public System.Reflection.Assembly AppAssembly { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + [Microsoft.AspNetCore.Components.ParameterAttribute] + public System.Type FallbackComponent { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + public void Configure(Microsoft.AspNetCore.Components.RenderHandle renderHandle) { } + public void Dispose() { } + protected virtual void Render(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder, System.Type handler, System.Collections.Generic.IDictionary parameters) { } + public System.Threading.Tasks.Task SetParametersAsync(Microsoft.AspNetCore.Components.ParameterCollection parameters) { throw null; } + } } \ No newline at end of file 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 961cc46bfc..25e84ceac4 100644 --- a/src/Components/Components/ref/Microsoft.AspNetCore.Components.netstandard2.0.cs +++ b/src/Components/Components/ref/Microsoft.AspNetCore.Components.netstandard2.0.cs @@ -63,12 +63,6 @@ namespace Microsoft.AspNetCore.Components public CascadingParameterAttribute() { } public string Name { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } } - public partial class CascadingValue : Microsoft.AspNetCore.Components.IComponent - { - public CascadingValue() { } - public void Configure(Microsoft.AspNetCore.Components.RenderHandle renderHandle) { } - public System.Threading.Tasks.Task SetParametersAsync(Microsoft.AspNetCore.Components.ParameterCollection parameters) { throw null; } - } public abstract partial class ComponentBase : Microsoft.AspNetCore.Components.IComponent, Microsoft.AspNetCore.Components.IHandleAfterRender, Microsoft.AspNetCore.Components.IHandleEvent { public const string BuildRenderTreeMethodName = "BuildRenderTree"; @@ -617,11 +611,6 @@ namespace Microsoft.AspNetCore.Components } namespace Microsoft.AspNetCore.Components.Forms { - public partial class DataAnnotationsValidator : Microsoft.AspNetCore.Components.ComponentBase - { - public DataAnnotationsValidator() { } - protected override void OnInit() { } - } public sealed partial class EditContext { public EditContext(object model) { } @@ -654,12 +643,6 @@ namespace Microsoft.AspNetCore.Components.Forms public static string FieldClass(this Microsoft.AspNetCore.Components.Forms.EditContext editContext, in Microsoft.AspNetCore.Components.Forms.FieldIdentifier fieldIdentifier) { throw null; } public static string FieldClass(this Microsoft.AspNetCore.Components.Forms.EditContext editContext, System.Linq.Expressions.Expression> accessor) { throw null; } } - public partial class EditForm : Microsoft.AspNetCore.Components.ComponentBase - { - public EditForm() { } - protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder) { } - protected override void OnParametersSet() { } - } public sealed partial class FieldChangedEventArgs { internal FieldChangedEventArgs() { } @@ -676,60 +659,6 @@ namespace Microsoft.AspNetCore.Components.Forms public override bool Equals(object obj) { throw null; } public override int GetHashCode() { throw null; } } - public abstract partial class InputBase : Microsoft.AspNetCore.Components.ComponentBase - { - protected InputBase() { } - [Microsoft.AspNetCore.Components.ParameterAttribute] - protected string Class { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - protected string CssClass { get { throw null; } } - protected T CurrentValue { get { throw null; } set { } } - protected string CurrentValueAsString { get { throw null; } set { } } - protected Microsoft.AspNetCore.Components.Forms.EditContext EditContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - protected string FieldClass { get { throw null; } } - protected Microsoft.AspNetCore.Components.Forms.FieldIdentifier FieldIdentifier { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - [Microsoft.AspNetCore.Components.ParameterAttribute] - protected string Id { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - protected virtual string FormatValueAsString(T value) { throw null; } - public override System.Threading.Tasks.Task SetParametersAsync(Microsoft.AspNetCore.Components.ParameterCollection parameters) { throw null; } - protected abstract bool TryParseValueFromString(string value, out T result, out string validationErrorMessage); - } - public partial class InputCheckbox : Microsoft.AspNetCore.Components.Forms.InputBase - { - public InputCheckbox() { } - protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder) { } - protected override bool TryParseValueFromString(string value, out bool result, out string validationErrorMessage) { throw null; } - } - public partial class InputDate : Microsoft.AspNetCore.Components.Forms.InputBase - { - public InputDate() { } - protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder) { } - protected override string FormatValueAsString(T value) { throw null; } - protected override bool TryParseValueFromString(string value, out T result, out string validationErrorMessage) { throw null; } - } - public partial class InputNumber : Microsoft.AspNetCore.Components.Forms.InputBase - { - public InputNumber() { } - protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder) { } - protected override bool TryParseValueFromString(string value, out T result, out string validationErrorMessage) { throw null; } - } - public partial class InputSelect : Microsoft.AspNetCore.Components.Forms.InputBase - { - public InputSelect() { } - protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder) { } - protected override bool TryParseValueFromString(string value, out T result, out string validationErrorMessage) { throw null; } - } - public partial class InputText : Microsoft.AspNetCore.Components.Forms.InputBase - { - public InputText() { } - protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder) { } - protected override bool TryParseValueFromString(string value, out string result, out string validationErrorMessage) { throw null; } - } - public partial class InputTextArea : Microsoft.AspNetCore.Components.Forms.InputBase - { - public InputTextArea() { } - protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder) { } - protected override bool TryParseValueFromString(string value, out string result, out string validationErrorMessage) { throw null; } - } public sealed partial class ValidationMessageStore { public ValidationMessageStore(Microsoft.AspNetCore.Components.Forms.EditContext editContext) { } @@ -746,13 +675,6 @@ namespace Microsoft.AspNetCore.Components.Forms public static void AddRange(this Microsoft.AspNetCore.Components.Forms.ValidationMessageStore store, System.Linq.Expressions.Expression> accessor, System.Collections.Generic.IEnumerable messages) { } public static void Clear(this Microsoft.AspNetCore.Components.Forms.ValidationMessageStore store, System.Linq.Expressions.Expression> accessor) { } } - public partial class ValidationMessage : Microsoft.AspNetCore.Components.ComponentBase, System.IDisposable - { - public ValidationMessage() { } - protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder) { } - protected override void OnParametersSet() { } - void System.IDisposable.Dispose() { } - } public sealed partial class ValidationRequestedEventArgs { internal ValidationRequestedEventArgs() { } @@ -761,13 +683,6 @@ namespace Microsoft.AspNetCore.Components.Forms { internal ValidationStateChangedEventArgs() { } } - public partial class ValidationSummary : Microsoft.AspNetCore.Components.ComponentBase, System.IDisposable - { - public ValidationSummary() { } - protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder) { } - protected override void OnParametersSet() { } - void System.IDisposable.Dispose() { } - } } namespace Microsoft.AspNetCore.Components.Layouts { @@ -783,12 +698,6 @@ namespace Microsoft.AspNetCore.Components.Layouts [Microsoft.AspNetCore.Components.ParameterAttribute] protected Microsoft.AspNetCore.Components.RenderFragment Body { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } } - public partial class LayoutDisplay : Microsoft.AspNetCore.Components.IComponent - { - public LayoutDisplay() { } - public void Configure(Microsoft.AspNetCore.Components.RenderHandle renderHandle) { } - public System.Threading.Tasks.Task SetParametersAsync(Microsoft.AspNetCore.Components.ParameterCollection parameters) { throw null; } - } } namespace Microsoft.AspNetCore.Components.Rendering { @@ -920,26 +829,11 @@ namespace Microsoft.AspNetCore.Components.RenderTree } namespace Microsoft.AspNetCore.Components.Routing { - public partial class NavLink : Microsoft.AspNetCore.Components.IComponent, System.IDisposable - { - public NavLink() { } - public void Configure(Microsoft.AspNetCore.Components.RenderHandle renderHandle) { } - public void Dispose() { } - public System.Threading.Tasks.Task SetParametersAsync(Microsoft.AspNetCore.Components.ParameterCollection parameters) { throw null; } - } public enum NavLinkMatch { All = 1, Prefix = 0, } - public partial class Router : Microsoft.AspNetCore.Components.IComponent, System.IDisposable - { - public Router() { } - public void Configure(Microsoft.AspNetCore.Components.RenderHandle renderHandle) { } - public void Dispose() { } - protected virtual void Render(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder, System.Type handler, System.Collections.Generic.IDictionary parameters) { } - public System.Threading.Tasks.Task SetParametersAsync(Microsoft.AspNetCore.Components.ParameterCollection parameters) { throw null; } - } } namespace Microsoft.AspNetCore.Components.Services { diff --git a/src/Components/Components/src/CascadingValue.cs b/src/Components/Components/src/CascadingValue.cs index 32323bac3f..07a8e79c31 100644 --- a/src/Components/Components/src/CascadingValue.cs +++ b/src/Components/Components/src/CascadingValue.cs @@ -21,12 +21,12 @@ namespace Microsoft.AspNetCore.Components /// /// The content to which the value should be provided. /// - [Parameter] private RenderFragment ChildContent { get; set; } + [Parameter] public RenderFragment ChildContent { get; private set; } /// /// The value to be provided. /// - [Parameter] private T Value { get; set; } + [Parameter] public T Value { get; private set; } /// /// Optionally gives a name to the provided value. Descendant components @@ -35,7 +35,7 @@ namespace Microsoft.AspNetCore.Components /// If no name is specified, then descendant components will receive the /// value based the type of value they are requesting. /// - [Parameter] private string Name { get; set; } + [Parameter] public string Name { get; private set; } /// /// If true, indicates that will not change. This is a @@ -43,7 +43,7 @@ namespace Microsoft.AspNetCore.Components /// change notifications. Set this flag only if you will not change /// during the component's lifetime. /// - [Parameter] private bool IsFixed { get; set; } + [Parameter] public bool IsFixed { get; private set; } object ICascadingValueComponent.CurrentValue => Value; diff --git a/src/Components/Components/src/Forms/EditForm.cs b/src/Components/Components/src/Forms/EditForm.cs index 9ad279a519..8469896558 100644 --- a/src/Components/Components/src/Forms/EditForm.cs +++ b/src/Components/Components/src/Forms/EditForm.cs @@ -29,19 +29,19 @@ namespace Microsoft.AspNetCore.Components.Forms /// also supply , since the model value will be taken /// from the property. /// - [Parameter] EditContext EditContext { get; set; } + [Parameter] public EditContext EditContext { get; private set; } /// /// Specifies the top-level model object for the form. An edit context will /// be constructed for this model. If using this parameter, do not also supply /// a value for . /// - [Parameter] object Model { get; set; } + [Parameter] public object Model { get; private set; } /// /// Specifies the content to be rendered inside this . /// - [Parameter] RenderFragment ChildContent { get; set; } + [Parameter] public RenderFragment ChildContent { get; private set; } /// /// A callback that will be invoked when the form is submitted. @@ -49,19 +49,19 @@ namespace Microsoft.AspNetCore.Components.Forms /// If using this parameter, you are responsible for triggering any validation /// manually, e.g., by calling . /// - [Parameter] EventCallback OnSubmit { get; set; } + [Parameter] public EventCallback OnSubmit { get; private set; } /// /// A callback that will be invoked when the form is submitted and the /// is determined to be valid. /// - [Parameter] EventCallback OnValidSubmit { get; set; } + [Parameter] public EventCallback OnValidSubmit { get; private set; } /// /// A callback that will be invoked when the form is submitted and the /// is determined to be invalid. /// - [Parameter] EventCallback OnInvalidSubmit { get; set; } + [Parameter] public EventCallback OnInvalidSubmit { get; private set; } /// protected override void OnParametersSet() diff --git a/src/Components/Components/src/Forms/InputComponents/InputBase.cs b/src/Components/Components/src/Forms/InputComponents/InputBase.cs index 4c7f525afd..e8f4c6d756 100644 --- a/src/Components/Components/src/Forms/InputComponents/InputBase.cs +++ b/src/Components/Components/src/Forms/InputComponents/InputBase.cs @@ -24,12 +24,12 @@ namespace Microsoft.AspNetCore.Components.Forms /// /// Gets a value for the component's 'id' attribute. /// - [Parameter] protected string Id { get; private set; } + [Parameter] public string Id { get; private set; } /// /// Gets a value for the component's 'class' attribute. /// - [Parameter] protected string Class { get; private set; } + [Parameter] public string Class { get; private set; } /// /// Gets or sets the value of the input. This should be used with two-way binding. @@ -37,17 +37,17 @@ namespace Microsoft.AspNetCore.Components.Forms /// /// bind-Value="@model.PropertyName" /// - [Parameter] T Value { get; set; } + [Parameter] public T Value { get; private set; } /// /// Gets or sets a callback that updates the bound value. /// - [Parameter] EventCallback ValueChanged { get; set; } + [Parameter] public EventCallback ValueChanged { get; private set; } /// /// Gets or sets an expression that identifies the bound value. /// - [Parameter] Expression> ValueExpression { get; set; } + [Parameter] public Expression> ValueExpression { get; private set; } /// /// Gets the associated . diff --git a/src/Components/Components/src/Forms/InputComponents/InputDate.cs b/src/Components/Components/src/Forms/InputComponents/InputDate.cs index b193f2333e..2c1a162eb9 100644 --- a/src/Components/Components/src/Forms/InputComponents/InputDate.cs +++ b/src/Components/Components/src/Forms/InputComponents/InputDate.cs @@ -14,7 +14,10 @@ namespace Microsoft.AspNetCore.Components.Forms { const string dateFormat = "yyyy-MM-dd"; // Compatible with HTML date inputs - [Parameter] string ParsingErrorMessage { get; set; } = "The {0} field must be a date."; + /// + /// Gets or sets the error message used when displaying an a parsing error. + /// + [Parameter] public string ParsingErrorMessage { get; private set; } = "The {0} field must be a date."; /// protected override void BuildRenderTree(RenderTreeBuilder builder) diff --git a/src/Components/Components/src/Forms/InputComponents/InputNumber.cs b/src/Components/Components/src/Forms/InputComponents/InputNumber.cs index e8394ab6b3..0c4b8c30d4 100644 --- a/src/Components/Components/src/Forms/InputComponents/InputNumber.cs +++ b/src/Components/Components/src/Forms/InputComponents/InputNumber.cs @@ -53,7 +53,10 @@ namespace Microsoft.AspNetCore.Components.Forms } } - [Parameter] string ParsingErrorMessage { get; set; } = "The {0} field must be a number."; + /// + /// Gets or sets the error message used when displaying an a parsing error. + /// + [Parameter] public string ParsingErrorMessage { get; private set; } = "The {0} field must be a number."; /// protected override void BuildRenderTree(RenderTreeBuilder builder) diff --git a/src/Components/Components/src/Forms/InputComponents/InputSelect.cs b/src/Components/Components/src/Forms/InputComponents/InputSelect.cs index c396ba0b99..9fbf3de63a 100644 --- a/src/Components/Components/src/Forms/InputComponents/InputSelect.cs +++ b/src/Components/Components/src/Forms/InputComponents/InputSelect.cs @@ -11,7 +11,10 @@ namespace Microsoft.AspNetCore.Components.Forms /// public class InputSelect : InputBase { - [Parameter] RenderFragment ChildContent { get; set; } + /// + /// Gets or sets the child content to be rendering inside the select element. + /// + [Parameter] public RenderFragment ChildContent { get; private set; } /// protected override void BuildRenderTree(RenderTreeBuilder builder) diff --git a/src/Components/Components/src/Forms/ValidationMessage.cs b/src/Components/Components/src/Forms/ValidationMessage.cs index 176824931d..be026b7f34 100644 --- a/src/Components/Components/src/Forms/ValidationMessage.cs +++ b/src/Components/Components/src/Forms/ValidationMessage.cs @@ -22,7 +22,7 @@ namespace Microsoft.AspNetCore.Components.Forms /// /// Specifies the field for which validation messages should be displayed. /// - [Parameter] Expression> For { get; set; } + [Parameter] public Expression> For { get; private set; } /// ` /// Constructs an instance of . diff --git a/src/Components/Components/src/Layouts/LayoutDisplay.cs b/src/Components/Components/src/Layouts/LayoutDisplay.cs index cd3baaf165..c4ae14ab46 100644 --- a/src/Components/Components/src/Layouts/LayoutDisplay.cs +++ b/src/Components/Components/src/Layouts/LayoutDisplay.cs @@ -26,13 +26,13 @@ namespace Microsoft.AspNetCore.Components.Layouts /// The type must implement . /// [Parameter] - Type Page { get; set; } + public Type Page { get; private set; } /// /// Gets or sets the parameters to pass to the page. /// [Parameter] - IDictionary PageParameters { get; set; } + public IDictionary PageParameters { get; private set; } /// public void Configure(RenderHandle renderHandle) diff --git a/src/Components/Components/src/Routing/NavLink.cs b/src/Components/Components/src/Routing/NavLink.cs index e28fb9456b..280f423a2d 100644 --- a/src/Components/Components/src/Routing/NavLink.cs +++ b/src/Components/Components/src/Routing/NavLink.cs @@ -40,13 +40,13 @@ namespace Microsoft.AspNetCore.Components.Routing /// current route matches the NavLink href. /// [Parameter] - string ActiveClass { get; set; } + public string ActiveClass { get; private set; } /// /// Gets or sets a value representing the URL matching behavior. /// [Parameter] - NavLinkMatch Match { get; set; } + public NavLinkMatch Match { get; private set; } [Inject] private IUriHelper UriHelper { get; set; } diff --git a/src/Components/Components/src/Routing/Router.cs b/src/Components/Components/src/Routing/Router.cs index 751ef8b64b..55a77d71bd 100644 --- a/src/Components/Components/src/Routing/Router.cs +++ b/src/Components/Components/src/Routing/Router.cs @@ -29,12 +29,12 @@ namespace Microsoft.AspNetCore.Components.Routing /// Gets or sets the assembly that should be searched, along with its referenced /// assemblies, for components matching the URI. /// - [Parameter] private Assembly AppAssembly { get; set; } + [Parameter] public Assembly AppAssembly { get; private set; } /// /// Gets or sets the type of the component that should be used as a fallback when no match is found for the requested route. /// - [Parameter] private Type FallbackComponent { get; set; } + [Parameter] public Type FallbackComponent { get; private set; } private RouteTable Routes { get; set; }