public MainViewModel() { ConnectCommand = ReactiveCommand.CreateFromTask(() => Connect()); DisconnectCommand = ReactiveCommand.CreateFromTask(() => Disconnect()); WriteCommand = ReactiveCommand.Create(() => Write()); ReadCommand = ReactiveCommand.Create(() => Read()); _client = Modbus.CreateClient("127.0.0.1", 502); }