using FLY.Thick.Base.IService;
using MultiLayout.UiModule;
using System.Windows;
using System.Windows.Controls;
using Unity;

namespace FLY.Thick.Base.UI.UiModule
{
    /// <summary>
    /// MenuMotion.xaml 的交互逻辑
    /// </summary>
    public partial class MenuMotion : UserControl
    {
        ITDGageService tDGageService;
        public MenuMotion()
        {
            InitializeComponent();
        }
        [InjectionMethod]
        public void Init(ITDGageService tDGageService)
        {
            this.tDGageService = tDGageService;
        }
        private void btnBackwClick(object sender, RoutedEventArgs e)
        {
            tDGageService.StartP2(Base.Common.STARTP2_MODE.BACKW);

        }

        private void btnForwClick(object sender, RoutedEventArgs e)
        {
            tDGageService.StartP2(Base.Common.STARTP2_MODE.FORW);
        }

        private void btnOrgClick(object sender, RoutedEventArgs e)
        {
            tDGageService.StartP2(Base.Common.STARTP2_MODE.ORG);
        }

        private void btnStopClick(object sender, RoutedEventArgs e)
        {
            tDGageService.StartP2(Base.Common.STARTP2_MODE.STOP);
        }

        private void btnScanClick(object sender, RoutedEventArgs e)
        {
            tDGageService.StartP1();
        }
    }

    public class UiModule2_MenuMotion : IUiModule2
    {
        public string Title => "扫描运行";

        public ComponentType Type => ComponentType.Menu;

        public bool IsUnique => true;

        public FrameworkElement GetComponent(int id, IUnityContainer container)
        {
            MenuMotion menu = new MenuMotion();
            container.BuildUp(menu);
            return menu;
        }

        public FrameworkElement GetThumbnail()
        {
            return new System.Windows.Controls.Grid();
        }

        public void MatchParam(int[] IDs)
        {

        }
    }
}
