public void ToggleRunning() { if (Running) { ToggleRunningButton.Content = "Start"; Running = false; Sniffer.Stop(); Sniffer = null; } else { ToggleRunningButton.Content = "Stop"; Sniffer = new Sniffer((ICaptureDevice)DeviceListComboBox.SelectedValue); Sniffer.Start(); Running = true; } }