-
-
Notifications
You must be signed in to change notification settings - Fork 380
Expand file tree
/
Copy pathBaseBlazorFiddle.cs
More file actions
35 lines (32 loc) · 876 Bytes
/
BaseBlazorFiddle.cs
File metadata and controls
35 lines (32 loc) · 876 Bytes
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 System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
namespace MatBlazor.Demo.BlazorFiddle
{
public class BaseBlazorFiddle : BaseMatDomComponent
{
[Parameter]
public string Code { get; set; }
[Parameter]
public string Template { get; set; } = null;
protected async override Task OnFirstAfterRenderAsync()
{
await base.OnFirstAfterRenderAsync();
try
{
await JsInvokeAsync<object>("blazorFiddle.create", Ref, new
{
Text = Code,
Template = Template,
});
}
catch (Exception e)
{
// Console.WriteLine(e);
// throw;
}
}
}
}