ant-design-blazor/components/drawer/DrawerTemplate.razor.cs
TimChen 7cc424c0f0 fix(module: drawer): OnOpen null check (#295)
* fix: drawer OnOpen bull

* Update DrawerTemplate.razor.cs
2020-07-02 17:36:54 +08:00

32 lines
723 B
C#

using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
namespace AntDesign
{
public class DrawerTemplate<TContentParams, TResult> : TemplateComponentBase<TContentParams>
{
[Parameter]
public DrawerRef<TResult> DrawerRef { get; set; }
/// <summary>
/// 关闭抽屉
/// </summary>
/// <returns></returns>
protected async Task CloseAsync(TResult result)
{
await DrawerRef.CloseAsync(result);
}
protected override void OnInitialized()
{
base.OnInitialized();
DrawerRef.OnOpen?.Invoke();
}
}
}