using MultiLayout;
using MultiLayout.UiModule;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Unity;

namespace FLY.FilmCasting.AutoDie.UI.Client.UiModule
{
    /// <summary>
    /// MenuSelect_Main.xaml 的交互逻辑
    /// </summary>
    public partial class MenuSetting : UserControl
    {
        IUnityContainer container;
        public MenuSetting()
        {
            InitializeComponent();
        }

        [InjectionMethod]
        public void Init(IUnityContainer container)
        {
            this.container = container;
        }

        private void btnMenuClick(object sender, RoutedEventArgs e)
        {

                PgMenu p = new PgMenu();
                container.BuildUp(p);
                FlyLayoutManager.NavigationService.Navigate(p);
            
        }

        public void Init(int id)
        {

        }
    }

    public class UiModule2_MenuSetting : IUiModule2
    {
        /// <summary>
        /// 控件标题
        /// 它的值取决于culture
        /// </summary>
        public string Title => "自动模头.菜单";
        public ComponentType Type => ComponentType.Menu;

        public bool IsUnique => true;
        /// <summary>
        /// 控件
        /// 创建时，需要给它唯一ID，让加载自己的数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public FrameworkElement GetComponent(int id, IUnityContainer container)
        {
            MenuSetting menu = new MenuSetting();
            container.BuildUp(menu);
            return menu;
        }

        /// <summary>
        /// 控件缩略图，用于编辑界面时，大致看看
        /// 创建时，需要给它唯一ID，让加载自己的数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public FrameworkElement GetThumbnail()
        {
            return new System.Windows.Controls.Grid();
        }


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