private void BtnEdit_Click(object sender, RoutedEventArgs e)
        {
            //foreach (UdpDevice u in MyUtils.UdpDevices) u.Stop();
            MainWindow mwInstance = Window.GetWindow(this) as MainWindow;

            //DeviceItem.Stop();
            foreach (UdpDevice u in MyUtils.UdpDevices)
            {
                u.Stop();
            }
            ckbEnable.IsChecked = false;
            Window w = new EditDevice(DeviceItem.DeepCopy(), mwInstance);

            w.Show();
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.EditDeviceWindow = ((Analyzer.EditDevice)(target));

            #line 8 "..\..\EditDevice.xaml"
                this.EditDeviceWindow.Closing += new System.ComponentModel.CancelEventHandler(this.Window_Closing);

            #line default
            #line hidden
                return;

            case 2:
                this.grpParams = ((System.Windows.Controls.GroupBox)(target));
                return;

            case 3:
                this.label = ((System.Windows.Controls.Label)(target));
                return;

            case 4:
                this.label2 = ((System.Windows.Controls.Label)(target));
                return;

            case 5:
                this.label3 = ((System.Windows.Controls.Label)(target));
                return;

            case 6:
                this.label4 = ((System.Windows.Controls.Label)(target));
                return;

            case 7:
                this.txtName = ((System.Windows.Controls.TextBox)(target));
                return;

            case 8:
                this.txtIp = ((System.Windows.Controls.TextBox)(target));

            #line 28 "..\..\EditDevice.xaml"
                this.txtIp.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.TxtIp_TextChanged);

            #line default
            #line hidden
                return;

            case 9:
                this.nudLines = ((MahApps.Metro.Controls.NumericUpDown)(target));
                return;

            case 10:
                this.nudPort = ((MahApps.Metro.Controls.NumericUpDown)(target));
                return;

            case 11:
                this.label2_Copy = ((System.Windows.Controls.Label)(target));
                return;

            case 12:
                this.sldSmoothing = ((System.Windows.Controls.Slider)(target));
                return;

            case 13:
                this.lblSmoothing = ((System.Windows.Controls.Label)(target));
                return;

            case 14:
                this.btnDelete = ((System.Windows.Controls.Button)(target));

            #line 40 "..\..\EditDevice.xaml"
                this.btnDelete.Click += new System.Windows.RoutedEventHandler(this.BtnDelete_Click);

            #line default
            #line hidden
                return;

            case 15:
                this.btnRestore = ((System.Windows.Controls.Button)(target));

            #line 41 "..\..\EditDevice.xaml"
                this.btnRestore.Click += new System.Windows.RoutedEventHandler(this.BtnRestore_Click);

            #line default
            #line hidden
                return;

            case 16:
                this.btnSave = ((System.Windows.Controls.Button)(target));

            #line 42 "..\..\EditDevice.xaml"
                this.btnSave.Click += new System.Windows.RoutedEventHandler(this.BtnSave_Click);

            #line default
            #line hidden
                return;

            case 17:
                this.grpTest = ((System.Windows.Controls.GroupBox)(target));
                return;

            case 18:
                this.btnTestConnection = ((System.Windows.Controls.Button)(target));

            #line 59 "..\..\EditDevice.xaml"
                this.btnTestConnection.Click += new System.Windows.RoutedEventHandler(this.BtnTestConnection_Click);

            #line default
            #line hidden
                return;

            case 19:
                this.btnRequest = ((System.Windows.Controls.Button)(target));

            #line 60 "..\..\EditDevice.xaml"
                this.btnRequest.Click += new System.Windows.RoutedEventHandler(this.BtnRequest_Click);

            #line default
            #line hidden
                return;

            case 20:
                this.txtOutput = ((System.Windows.Controls.TextBox)(target));
                return;
            }
            this._contentLoaded = true;
        }