using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Unity;

namespace MultiLayout.UiModule
{
    public interface IUiModule2
    {
        /// <summary>
        /// 控件标题
        /// 它的值取决于culture
        /// </summary>       
        string Title { get; }

        /// <summary>
        /// 控件类型
        /// </summary>
        ComponentType Type { get; }

        /// <summary>
        /// 只能有一个
        /// </summary>
        bool IsUnique { get; }

        /// <summary>
        /// 控件
        /// 创建时，需要给它唯一ID，让加载自己的数据
        /// </summary>
        /// <param name="id">唯一ID</param>
        /// <returns></returns>
        FrameworkElement GetComponent(int id, IUnityContainer unityContainer);

        /// <summary>
        /// 控件缩略图，用于编辑界面时，大致看看
        /// </summary>
        /// <returns></returns>
        FrameworkElement GetThumbnail();

        /// <summary>
        /// 给出全部控件ID, 控件自行删除没有的参数
        /// </summary>
        /// <param name="IDs"></param>
        void MatchParam(int[] IDs);

    }

    [Flags]
    public enum ComponentType
    {
        /// <summary>
        /// 动态区
        /// </summary>
        DynArea=0x1,
        /// <summary>
        /// 图表区
        /// </summary>
        Graph=0x2,
        /// <summary>
        /// 参数设置页
        /// </summary>
        Menu=0x4
    }
}
