using Caliburn.Micro.Core;
using DocumentFormat.OpenXml.Wordprocessing;
using MECF.Framework.Common.Aitex.Core.RT.EMS;
using MECF.Framework.Common.CommonData;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace MECF.Framework.UI.Client.CenterViews.Maintain
{
    public class MaintainerItemConfigEnableInfo : NotifiableItem
    {
        MaintainerItemConfigInfo _config = new();
        public MaintainerItemConfigInfo Config
        {
            get { return _config; }
            set
            {
                _config = value;
                InvokePropertyChanged(nameof(Config));
            }
        }

        public List<ItemEnablePage> ItemEnableBook { get; set; } = new();

        private ItemEnablePage _selectedPage;

        public ItemEnablePage SelectedPage
        {
            get { return _selectedPage; }
            set { _selectedPage = value; InvokePropertyChanged(nameof(SelectedPage)); }
        }

        public void SelectPage(string type,string name,string module)
        {
            if (SelectedPage != null && SelectedPage.EqualsTypeNameModule(type, name, module))
            {
                return;
            }
            SelectedPage = ItemEnableBook.Find(i=>i.EqualsTypeNameModule(type,name,module));
        }
    }
}
