Skip to content

About Component parameters #18440

@dubeg

Description

@dubeg

Should we always use @ when referencing the component members (ie. `Parameter="@member"), as in the following example?

<InputText 
  Value="@EmployeeName"
  ValueExpression="@( () => EmployeeName )"
  ValueChanged="@EmployeeName_Changed"
  />

I've noticed that the following works as well:

<InputText 
  Value="@EmployeeName"
  ValueExpression="() => EmployeeName"
  ValueChanged="EmployeeName_Changed"
  />

However, in this example, the Value parameter is set to the string "EmployeeName", instead of the value it contains.

<InputText 
  Value="EmployeeName"
  ValueExpression="() => EmployeeName"
  ValueChanged="EmployeeName_Changed"
  />

Is the reason that setting ValueChanged works without the @, but not Value is because of type inference performed by the parser?


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions