ant-design-blazor/components/drawer/DrawerTemplate.razor.cs
TimChen 19f51c87fa fix(module: drawer): close event bug (#599)
* fix: drawer close event bug

* refactor: translate some comments

Co-authored-by: ElderJames <shunjiey@hotmail.com>
2020-09-16 19:42:48 +08:00

30 lines
741 B
C#

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