aspnetcore/test/Microsoft.AspNetCore.Blazor...
Ryan Nowak 6f383a0f0f Adds support for 'Context' parameters on components (#1470)
Adds support for 'Context' parameters on components

This change allows you to set the parameter name of a parameterized child content by using the `Context` attribute on the component. The `Context` attribute will be defined (and shown by completion) when the component has one or more declared parameterized (`RenderFragment<>`) child content parameters.

This is nice for cases where you are using implicit child content:

```
<ol>
  <Repeater Items="People" Context="person">
    <li>@person.FirstName</li>
  </Repeater>
</ol>
```

 or, when you have multiple child content elements and want them all to have the same parameter name:

 ```
<MyComponent Items="People" Context="person">
    <ChildContent1><div>@person.FirstName</div></ChildContent1>
    <ChildContent2><div>@person.LastName</div></ChildContent2>
</Repeater>
```

The parameter name can be overridden by using the `Context` parameter on the child content element:

 ```
<MyComponent Items="People" Context="person">
    <ChildContent1 Context="item"><div>@item.FirstName</div></ChildContent1>
    <ChildContent2><div>@person.LastName</div></ChildContent2>
</Repeater>
```

If the component defines a `Context` parameter already then we won't synthesize one - your component's parameter will work exactly as it did before this feature.
2018-09-24 12:22:16 -07:00
..
Razor Add Type Inference for Generic-Typed Components 2018-09-20 12:19:26 -07:00
TestFiles Adds support for 'Context' parameters on components (#1470) 2018-09-24 12:22:16 -07:00
BindRazorIntegrationTest.cs
BootJsonWriterTest.cs
ChildContentRazorIntegrationTest.cs Adds support for 'Context' parameters on components (#1470) 2018-09-24 12:22:16 -07:00
CodeGenerationTestBase.cs Adds support for 'Context' parameters on components (#1470) 2018-09-24 12:22:16 -07:00
ComponentDiscoveryRazorIntegrationTest.cs
ComponentRenderingRazorIntegrationTest.cs
DeclarationRazorIntegrationTest.cs
DesignTimeCodeGenerationTest.cs
DiagnosticRazorIntegrationTest.cs Fix #1399 - crash on start-end syntax for void element 2018-09-21 12:54:44 -07:00
DirectiveRazorIntegrationTest.cs
FilePathRazorIntegrationTest.cs
GenericComponentRazorIntegrationTest.cs Add Type Inference for Generic-Typed Components 2018-09-20 12:19:26 -07:00
Microsoft.AspNetCore.Blazor.Build.Test.csproj
RazorBaselineIntegrationTestBase.cs
RazorIntegrationTestBase.cs
RenderingRazorIntegrationTest.cs
RuntimeCodeGenerationTest.cs
RuntimeDependenciesResolverTest.cs
TemplateRazorIntegrationTest.cs
TypingTest.cs
WorkingDirectoryRazorIntegrationTest.cs