-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathApp.cs
More file actions
42 lines (41 loc) · 1.53 KB
/
Copy pathApp.cs
File metadata and controls
42 lines (41 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.CompilerServices;
using Microsoft.AspNetCore.Components.Rendering;
using Microsoft.AspNetCore.Components.Routing;
namespace FastControls.TestApp.Browser
{
public class App : ComponentBase
{
protected override void BuildRenderTree(RenderTreeBuilder builder)
{
builder.OpenComponent<Router>(0);
builder.AddAttribute(1, "AppAssembly", RuntimeHelpers.TypeCheck(
typeof(Program).Assembly
));
builder.AddAttribute(2, "PreferExactMatches", RuntimeHelpers.TypeCheck(
true
));
builder.AddAttribute(3, "Found", (RenderFragment<RouteData>)(routeData => builder2 =>
{
builder2.OpenComponent<RouteView>(4);
builder2.AddAttribute(5, "RouteData", RuntimeHelpers.TypeCheck(
routeData
));
builder2.CloseComponent();
}
));
builder.AddAttribute(7, "NotFound", (RenderFragment)(builder2 =>
{
builder2.OpenComponent<LayoutView>(8);
builder2.AddAttribute(9, "ChildContent", (RenderFragment)(builder3 =>
{
builder3.AddMarkupContent(10, "<p>Sorry, there\'s nothing at this address.</p>");
}
));
builder2.CloseComponent();
}
));
builder.CloseComponent();
}
}
}