34 references to SectionContent
Microsoft.AspNetCore.Components (21)
Sections\SectionContent.cs (6)
53
throw new InvalidOperationException($"{nameof(
SectionContent
)} requires that '{nameof(SectionName)}' and '{nameof(SectionId)}' cannot both have non-null values.");
65
throw new InvalidOperationException($"{nameof(
SectionContent
)} requires a non-null value either for '{nameof(SectionName)}' or '{nameof(SectionId)}'.");
91
case nameof(
SectionContent
.SectionName):
94
case nameof(
SectionContent
.SectionId):
97
case nameof(
SectionContent
.IsDefaultContent):
100
case nameof(
SectionContent
.ChildContent):
Sections\SectionOutlet.cs (5)
9
/// Renders content provided by <see cref="
SectionContent
"/> components with matching <see cref="SectionId"/>s.
17
private
SectionContent
? _currentContentProvider;
20
/// Gets or sets the <see cref="string"/> ID that determines which <see cref="
SectionContent
"/> instances will provide
26
/// Gets or sets the <see cref="object"/> ID that determines which <see cref="
SectionContent
"/> instances will provide
78
internal void ContentUpdated(
SectionContent
? provider)
Sections\SectionRegistry.cs (10)
9
private readonly Dictionary<object, List<
SectionContent
>> _providersByIdentifier = new();
11
public void AddProvider(object identifier,
SectionContent
provider, bool isDefaultProvider)
29
public void RemoveProvider(object identifier,
SectionContent
provider)
49
var
contentProvider = GetCurrentProviderContentOrDefault(providers);
62
var
provider = GetCurrentProviderContentOrDefault(identifier);
76
public void NotifyContentProviderChanged(object identifier,
SectionContent
provider)
91
private static
SectionContent
? GetCurrentProviderContentOrDefault(List<
SectionContent
> providers)
96
private
SectionContent
? GetCurrentProviderContentOrDefault(object identifier)
101
private void NotifyContentChangedForSubscriber(object identifier,
SectionContent
? provider)
Microsoft.AspNetCore.Components.Web (10)
Head\HeadContent.cs (3)
23
builder.OpenComponent<
SectionContent
>(0);
24
builder.AddComponentParameter(1, nameof(
SectionContent
.SectionId), HeadOutlet.HeadSectionId);
25
builder.AddComponentParameter(2, nameof(
SectionContent
.ChildContent), ChildContent);
Head\HeadOutlet.cs (4)
46
builder.OpenComponent<
SectionContent
>(2);
47
builder.AddComponentParameter(3, nameof(
SectionContent
.SectionId), TitleSectionId);
48
builder.AddComponentParameter(4, nameof(
SectionContent
.IsDefaultContent), true);
49
builder.AddComponentParameter(5, nameof(
SectionContent
.ChildContent), (RenderFragment)BuildDefaultTitleRenderTree);
Head\PageTitle.cs (3)
23
builder.OpenComponent<
SectionContent
>(0);
24
builder.AddComponentParameter(1, nameof(
SectionContent
.SectionId), HeadOutlet.TitleSectionId);
25
builder.AddComponentParameter(2, nameof(
SectionContent
.ChildContent), (RenderFragment)BuildTitleRenderTree);
Microsoft.AspNetCore.Components.Web.Tests (3)
HtmlRendering\HtmlRendererTest.cs (3)
819
var second = await htmlRenderer.RenderComponentAsync<
SectionContent
>(ParameterView.FromDictionary(new Dictionary<string, object>
821
{ nameof(
SectionContent
.SectionId), "testsection" },
822
{ nameof(
SectionContent
.ChildContent), (RenderFragment)(builder =>