using Prism.Events;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PDF_Office.EventAggregators
{
    /// <summary>
    /// 页面编辑 Vm通知View更新页面的事件
    /// </summary>
    public class PageEditNotifyEvent:PubSubEvent<PageEditNotifyEventArgs>
    {

    }

    public class PageEditNotifyEventArgs
    {

        public PageEditNotifyEventArgs(string unicode)
        {
            Unicode = unicode;
            //默认为刷新页面
            Type = NotifyType.RefreshPage;
        }

        public PageEditNotifyEventArgs(string unicode,NotifyType type,List<int> pages)
        {
            Unicode = unicode;
            Type = type;
            PageRange = pages;
        }
        /// <summary>
        /// 避免触发其他页签的识别码
        /// </summary>
        public string Unicode { get; set; }

        /// <summary>
        /// 通知类型
        /// </summary>
        public NotifyType Type { get; set; }


        /// <summary>
        /// 需要选中的页面范围
        /// </summary>
        public List<int> PageRange { get; set; }
    }

    public enum NotifyType
    {
        /// <summary>
        /// 刷新页面范围
        /// </summary>
        RefreshPage,
        /// <summary>
        /// 选中项
        /// 通过绑定Selected属性来设置选中项有更新不准确的问题
        /// </summary>
        SelectItems
    }
}
