private void InitializeInputDevices() { // Clear the list before we add new items _outputViewModels.Clear(); for (int i = 0; i < FtInterfaceInstanceProvider.Instance.GetMotorCount(); i++) { // Create a new instance and add it to the list var outputModel = new OutputViewModel(); outputModel.SetIndexes(i * 2, i * 2 + 1, i); _outputViewModels.Add(outputModel); } // When we are already connected we load the configuration if (FtInterfaceInstanceProvider.Instance != null) { if (FtInterfaceInstanceProvider.Instance.Connection == ConnectionStatus.Online) { ConfigureInputPorts(); } } // Update the list on the ui thread Activity?.RunOnUiThread(() => { _listAdapter?.NotifyDataSetChanged(); }); }