private void btn_closeCOM_Click(object sender, RoutedEventArgs e)
 {
     ArduinoConnection.GetInstance().DataReceived -= DataReceivedHandler;
     ArduinoConnection.Close();
     LbxCom.UnselectAll();
     AddLog($"Connection to {ArduinoConnection.GetInstance().PortName} is closed\r\n");
     BtnCloseCom.IsEnabled   = false;
     BtnRefreshCom.IsEnabled = true;
 }
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     ArduinoConnection.GetInstance().DataReceived -= DataReceivedHandler;
     ArduinoConnection.Close();
     TbxLogs.Clear();
 }