1、在Common文件夹下新建文件夹Events,新建扩展类UpdateLoadingEvent
public class UpdateModel
{
public bool IsOpen { get; set; }
}
internal class UpdateLoadingEvent : PubSubEvent<UpdateModel>
{
}
2、新建一个静态扩展类DialogExtensions来编写注册和推送等待消息弹框方法
public static class DialogExtensions
{
/// <summary>
/// 推送等待消息
/// </summary>
/// <param name="aggregator"></param>
/// <param name="model"></param>
public static void UpdateLoading(this IEventAggregator aggregator, UpdateModel model)
{
aggregator.GetEvent<UpdateLoadingEvent>().Publish(model);