private void callAgent_Clicked1(object sender, EventArgs e)
        {
            var mi   = ((MenuItem)sender);
            var item = (DisplayItem)mi.CommandParameter;

            IntentService.Call(item.phoneNumber);
        }
Exemplo n.º 2
0
 async private void ShareButton_Clicked(object sender, EventArgs e)
 {
     try
     {
         var    items = DataService.getDataService().GetBoothInformationDisplayItems(currentBoothNumberDisplayed);
         string str   = "";
         foreach (var item in items)
         {
             str += item.Text + ":" + item.Detail + "\n";
         }
         IntentService.SendData(str);
     }
     catch (Exception ex)
     {
         await DisplayAlert("Error!", ex.Message, "Ok");
     }
 }
Exemplo n.º 3
0
        async private void ListView_ItemTapped(object sender, ItemTappedEventArgs e)
        {
            if (e.Item == null)
            {
                return;
            }
            DisplayItem item = (DisplayItem)e.Item;

            listView.SelectedItem = null;
            string action = await DisplayActionSheet("Actions", "Cancel", null, "Call", "Share", "Info", "BoothInformation");

            switch (action)
            {
            case "Cancel": return;

            case "Call": IntentService.Call(item.phoneNumber); return;

            case "Share":
            {
                var boothInformation = DataService.getDataService().GetBoothInformation(item.boothNumber);
                var details          = item.Detail + "\nBooth Address " + boothInformation.address + "\nPopulation: " + boothInformation.population;
                IntentService.SendData(details); return;
            }

            case "Info":
            {
                var boothInformation = DataService.getDataService().GetBoothInformation(item.boothNumber);
                var details          = item.Detail + "\nBooth Address " + boothInformation.address + "\nPopulation: " + boothInformation.population;
                await DisplayAlert(item.Text, details, "Ok");
            }
                return;

            case "BoothInformation":
            {
                await this.Navigation.PushModalAsync(new BoothInformationPage(item.boothNumber));

                return;
            }

            default:
                return;
            }
        }
Exemplo n.º 4
0
        async private void ListView_ItemSelected(object sender, SelectedItemChangedEventArgs e)
        {
            if (e.SelectedItem == null)
            {
                return;
            }
            var item = (DisplayItem)e.SelectedItem;

            ((ListView)sender).SelectedItem = null;
            if (item.phoneNumber == "")
            {
                await DisplayAlert(item.Text, item.Detail, "Ok");
            }
            else
            {
                var answer = await DisplayAlert(item.Text, item.Detail, "Ok", "Call");

                if (!answer)
                {
                    IntentService.Call(item.phoneNumber);
                }
            }
        }