ant-design-blazor/components/modal/modalDialog/ModalFooter.razor.cs
zxyao 31aac9f914 refactor: unified use of FeedbackComponent for modal comfirm and drawer (#1263)
* refactor: support to use the same template for confirm and modal

* refactor: support to use the same template for drawer

* refactor: separate interface IOkCancelRef

* chore: modify EventUtil class summary

Co-authored-by: James Yeung <shunjiey@hotmail.com>
2021-04-04 15:40:54 +08:00

41 lines
950 B
C#

using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
namespace AntDesign
{
/// <summary>
/// modal footer Component
/// </summary>
public partial class ModalFooter
{
/// <summary>
///
/// </summary>
[CascadingParameter]
public DialogOptions ModalProps { get; set; }
private async Task HandleCancel(MouseEventArgs e)
{
var onCancel = ModalProps.OnCancel;
if (onCancel != null)
{
await onCancel.Invoke(e);
}
}
private async Task HandleOk(MouseEventArgs e)
{
Console.WriteLine("HandleOk");
var onOk = ModalProps.OnOk;
if (onOk != null)
{
await onOk.Invoke(e);
}
}
}
}