예제 #1
0
 public async Task <int> SelectChoiceAsync(
     string title,
     IList <string> choices,
     string confirmingText = "Ok",
     string dismissiveText = "Cancel",
     MaterialConfirmationDialogConfiguration configuration = null)
 {
     return((int)await MaterialConfirmationDialog.ShowSelectChoiceAsync(title, choices, confirmingText, dismissiveText, configuration));
 }
 public async Task <int> SelectChoiceAsync(
     string title,
     IList <string> choices,
     int selectedIndex,
     string confirmingText = "Ok",
     string dismissiveText = "Cancel",
     MaterialConfirmationDialogConfiguration configuration = null,
     bool closeOnSelection = false)
 {
     return((int)await MaterialConfirmationDialog.ShowSelectChoiceAsync(title, choices, selectedIndex, confirmingText, dismissiveText, configuration, closeOnSelection));
 }
        public async Task <int?> SelectChoiceAsync(
            string title,
            IList choices,
            string choiceBindingName = null,
            string confirmingText    = "Ok",
            string dismissiveText    = "Cancel",
            MaterialConfirmationDialogConfiguration configuration = null)
        {
            var result = await MaterialConfirmationDialog.ShowSelectChoiceAsync(title, choices, choiceBindingName, confirmingText, dismissiveText, configuration);

            if (result != null)
            {
                int[] choice = (int[])result;
                return(choice[0]);
            }
            else
            {
                return(null);
            }
        }
예제 #4
0
 /// <summary>
 /// Shows a confirmation dialog that allows the user to select one of the listed choices. Returns the index of the selected choice. If none was selected, returns -1.
 /// </summary>
 /// <param name="title">The title of the confirmation dialog. This parameter must not be null or empty.</param>
 /// <param name="choices">The list of choices the user will choose from.</param>
 /// <param name="selectedIndex">The currently selected index.</param>
 /// <param name="configuration">The style of the confirmation dialog.</param>
 /// <exception cref="ArgumentNullException" />
 /// <exception cref="IndexOutOfRangeException" />
 public async Task <int> SelectChoiceAsync(string title, IList <string> choices, int selectedIndex, MaterialConfirmationDialogConfiguration configuration = null)
 {
     return((int)await MaterialConfirmationDialog.ShowSelectChoiceAsync(title, choices, selectedIndex, configuration));
 }