public void RefreshDetails(bool connected = false)
        {
            if (selectedDeviceIndex >= 0 && _peers.Count > selectedDeviceIndex)
            {
                _device = _peers[selectedDeviceIndex];
            }
            RunOnUiThread(() =>
            {
                ListAdapter  = new BluetoothPeerListAdapter(this, Resource.Layout.WiFi_row_devices, _peers);
                list.Adapter = ListAdapter;
            });

            //RunOnUiThread(() =>
            //{
            //    _device = (BTPeer)ListAdapter.GetItem(selectedDeviceIndex);
            //    ListAdapter.NotifyDataSetChanged();
            //    ShowDetails(_device);
            //    UpdateThisDevice(MyDevice);


            //    if (!connected)
            //    {
            //        FindViewById(Resource.Id.btn_connect).Visibility = ViewStates.Visible;
            //        FindViewById(Resource.Id.btn_disconnect).Visibility = ViewStates.Gone;
            //        FindViewById(Resource.Id.btn_test).Visibility = ViewStates.Gone;
            //    }
            //    else
            //    {
            //        FindViewById(Resource.Id.btn_connect).Visibility = ViewStates.Gone;
            //        FindViewById(Resource.Id.btn_disconnect).Visibility = ViewStates.Visible;
            //        FindViewById(Resource.Id.btn_test).Visibility = ViewStates.Visible;
            //    }
            //});
        }
 private void SetUpListView()
 {
     //_peers.Add(new WifiP2pDevice() { DeviceName = "TestDevice", Status = WifiP2pDeviceState.Available });
     _currentActivity = this;
     list             = FindViewById <ListView>(Resource.Id.bluetooth_peerslist);
     ListAdapter      = new BluetoothPeerListAdapter(this, Resource.Layout.WiFi_row_devices, _peers);
     list.Adapter     = ListAdapter;
     //list.DisableScrolling();
     list.ItemClick += OnListItemClick;
 }