-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBridgeComponentBase.cs
35 lines (33 loc) · 1.16 KB
/
BridgeComponentBase.cs
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
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Rendering;
using System;
using System.Collections.Generic;
using System.Text;
namespace LivingThing.Core.Frameworks.XamarinRazor
{
public abstract class BridgeComponentBase:ComponentBase
{
[Parameter] public string Property { get; set; }
public abstract object Native { get; }
[Parameter] public RenderFragment ChildContent { get; set; }
protected override void BuildRenderTree(RenderTreeBuilder __builder)
{
if (false)
{
__builder.OpenComponent(1, typeof(CascadingValue<>).MakeGenericType(GetType()));
__builder.AddAttribute(2, "Value", this);
__builder.AddAttribute(3, "IsFixed", true);
__builder.AddAttribute(4, "ChildContent", (RenderFragment)((__builder2) =>
{
ChildContent?.Invoke(__builder2);
}));
__builder.CloseComponent();
}
else
{
ChildContent?.Invoke(__builder);
}
base.BuildRenderTree(__builder);
}
}
}