UiModule2_WinderPanel.cs 1.84 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
using FLY.DownBlowing.IService;
using MultiLayout.UiModule;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Unity;

namespace FLY.DownBlowing.UI.Client.UiModule
{
    public class UiModule2_WinderPanel : IUiModule2
    {
        /// <summary>
        /// 控件标题
        /// 它的值取决于culture
        /// </summary>
        public string Title => "下吹.收卷";
        public ComponentType Type => ComponentType.Graph;
        public bool IsUnique => true;

        /// <summary>
        /// 控件
        /// 创建时,需要给它唯一ID,让加载自己的数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public FrameworkElement GetComponent(int id, IUnityContainer container)
        {
31 32 33 34 35 36 37 38 39 40 41 42 43
            var downBlowingSystemService = container.Resolve<IDownBlowingSystemService>();

            string version = downBlowingSystemService.Version;
            if (version == "3")
            {
                return container.Resolve<WinderPanelV3>();
            }
            else// if (version == "4") 
            {
                return container.Resolve<WinderPanelV4>();
            }


44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
        }

        /// <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)
        {
        }
    }
}