About using static classes:
Maybe it is a matter of taste, but for my understanding static methods are functions that depend on input parameters only. If you have a single object that contains state, it is better to use a singleton or even better to use an DI framework.
So, the main disadvantage are IMHO that other developers may not expect a state behind a static class and it is not possible to mock that class (e.g. for unit testing). See also this discussionthis discussion.
Code review
- The field
DeviceConnectedis not set from outside so it is better to create a property instead:DeviceConnected { get; private set; }. - The class
ComPortis not threadsafe but it is used from different threads. I can not see all usages, but that is generally not a good idea (even if it works, maybe somebody else has to change it some day) - The methods
ComPort.Read,ComPort.WriteandComPort.Closedo not check if the device port is connected and will probably throw an meaningless exception. Maybe it makes sense to handle that or throw a descriptive exception. - Not sure if that is desired, but if the device does not exist, the loop
while (!DeviceConnected) { /* .. */ }will run endlessly. Consider to use a timer instead of the while loop. - If method
SearchCOMtakes longer, it is better to start the task in view model with optionTaskCreationOptions.LongRunning. see also