private void ListView_ItemTapped(object sender, ItemTappedEventArgs e) { try { devicesList.IsEnabled = false; connection = DeviceConnection.GetConnection((Model.Device)e.Item); connection.Connect(); } catch (Exception) { throw; } devicesList.SelectedItem = null; }
private void ListView_ItemTapped(object sender, ItemTappedEventArgs e) { try { _connection = DeviceConnection.GetConnection((Model.Device)e.Item); _connection.Connect(); DisconnectButton.IsEnabled = _connection.IsConnected; devicesList.IsEnabled = !_connection.IsConnected; } catch (Exception) { throw; } devicesList.SelectedItem = null; }
public ControlView() { InitializeComponent(); if (_connection == null) { try { _connection = DeviceConnection.GetConnection(); _control = new RobotControl(_connection); } catch (Exception) { CrossToastPopUp.Current.ShowToastMessage("You are not connected to any device"); } } }
private DeviceConfigurationView() { _control = new RobotControl(DeviceConnection.GetConnection()); InitializeComponent(); this.BindingContext = _control; }