private void PortSelectionChanged(object sender, SelectionChangedEventArgs e) { EosDirectSerial eosDirectSerial = this.Interface as EosDirectSerial; if (eosDirectSerial == null) { return; } eosDirectSerial.Connect(); }