ScanGraph.xaml.cs 1.72 KB
Newer Older
1 2 3 4
using FLY.Thick.Base.UI;
using FLY.Thick.Blowing.Common;
using FLY.Thick.Blowing.IService;
using Misc;
5 6 7 8 9 10 11
using System.Windows;
using System.Windows.Controls;
using Unity;

namespace FLY.Thick.Blowing.UI.Fix.Client.UiModule
{
    /// <summary>
12
    /// ColumnRangeScanGraph.xaml 的交互逻辑
13 14 15
    /// </summary>
    public partial class ScanGraph : UserControl
    {
16
        ScanGraphVm viewModel;
17 18 19 20 21 22 23
        ScanGraphItemParam graphparam;
        public ScanGraph()
        {
            InitializeComponent();
        }

        [InjectionMethod]
24 25
        public void Init(int id, IUnityContainer container,
            IBulkDbService bulkDbService, IBlowingService blowingService, ParamDictionary paramDictionary, IBlowingFixProfileService blowingProfileService)
26 27 28 29 30 31 32 33 34 35
        {
            //查找参数
            graphparam = ScanGraphParams.Current.Items.Find(p => p.ID == id);
            if (graphparam == null)
            {
                graphparam = new ScanGraphItemParam() { ID = id };
                ScanGraphParams.Current.Items.Add(graphparam);
                ScanGraphParams.Current.Save();
            }

36 37
            //获取设备
            viewModel = new ScanGraphVm();
38

39
            viewModel.Init(graphparam, bulkDbService, blowingService, paramDictionary, blowingProfileService.Param);
40

41
            this.DataContext = viewModel;
42 43 44

        }

45
        private void Button_info_click(object sender, RoutedEventArgs e)
46
        {
47 48
            if (!WdPassword.Authorize("GraphConfig"))
                return;
49

50 51 52 53
            WdScanGraphConfig window = new WdScanGraphConfig();
            window.Init(graphparam);
            window.Owner = FLY.ControlLibrary.COMMON.GetWindow(this);
            window.ShowDialog();
54 55 56 57 58 59 60 61 62 63 64 65 66 67
        }
    }











}