56 lines
1.2 KiB
C#
56 lines
1.2 KiB
C#
using Prism.Mvvm;
|
|
using Prism.Services.Dialogs;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace OrpaonEMS.Core
|
|
{
|
|
/// <summary>
|
|
/// 弹窗基类
|
|
/// </summary>
|
|
public class DialogViewModel : BindableBase, IDialogAware
|
|
{
|
|
public string Title { get; set; }
|
|
|
|
public event Action<IDialogResult> RequestClose;
|
|
|
|
/// <summary>
|
|
/// 调用RequestClose
|
|
/// </summary>
|
|
/// <param name="dialogResult"></param>
|
|
public void RaiseRequestClose(IDialogResult dialogResult)
|
|
{
|
|
RequestClose?.Invoke(dialogResult);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 是否关闭窗口
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public bool CanCloseDialog()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 关闭时触发
|
|
/// </summary>
|
|
public void OnDialogClosed()
|
|
{
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 打开时触发
|
|
/// </summary>
|
|
/// <param name="parameters"></param>
|
|
public virtual void OnDialogOpened(IDialogParameters parameters)
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|