MenuMotion.xaml.cs 1.89 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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
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)
        {

        }
    }
}