private async void ListView_ItemClick(object sender, AdapterView.ItemClickEventArgs e) { var client = new RestClient("http://10.0.2.2:60408"); RestReader reader = new RestReader(); Toast.MakeText(this, "Loading. . ." + CurrentUserId, ToastLength.Short).Show(); Prices[] prices = await reader.GetPrices(client, ListedUsers[e.Position].Id); var intent = new Intent(this, typeof(BarContent)); string serializedPrices = JsonConvert.SerializeObject(prices); intent.PutExtra("priceString", serializedPrices); intent.PutExtra("userId", CurrentUserId); StartActivity(intent); }
public async void OptionsList_ItemClick(object sender, AdapterView.ItemClickEventArgs e) { switch (e.Position) { case 0: { //Add product var client = new RestClient("http://10.0.2.2:60408"); RestReader reader = new RestReader(); userPrices = await reader.GetPrices(client); AddProductFrag addFrag = new AddProductFrag(CurrentUserSignedInId); addFrag.ProductHandler += AddFrag_ProductHandler; FragmentTransaction transaction = FragmentManager.BeginTransaction(); addFrag.Show(transaction, "CreateProductFrag"); break; } case 1: { //Delete product var client = new RestClient("http://10.0.2.2:60408"); RestReader reader = new RestReader(); userPrices = await reader.GetPrices(client, CurrentUserSignedInId); EditProductFrag deleteFrag = new EditProductFrag(userPrices); FragmentTransaction transaction = FragmentManager.BeginTransaction(); deleteFrag.Show(transaction, "CreateProductFrag"); break; } case 2: { //Delete profile Toast.MakeText(this.ApplicationContext, "Delete Profile - To be implemented!", ToastLength.Short).Show(); break; } } }