// Constructor
        public MainPage()
        {
            InitializeComponent();

            // Set the data context of the list box control to the sample data
            _mainViewModel = new MainViewModel();
            _hostApi = string.Format("http://{0}:{1}/api/", Settings.Instance.Host, Settings.Instance.Port);
            _robotApi = new RobotApi(_hostApi);
            DataContext = _mainViewModel;
            Loaded += OnLoaded;
            _isOn = new List<object>();
        }
 private void OnConnectTap(object sender, GestureEventArgs e)
 {
     var robotApi = new RobotApi(string.Format("http://{0}:{1}/api", Host.Text, Port.Text));
     ConnectButton.IsEnabled = false;
     robotApi.Ping().ContinueWith(Result);
 }