Пример #1
0
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
            {
                return(string.Empty);
            }

            if (value is Xamarin.Forms.Keyboard == false)
            {
                return(string.Empty);
            }
            else
            {
                Xamarin.Forms.Keyboard keyboard = value as Xamarin.Forms.Keyboard;
                Type   t = keyboard.GetType();
                string r = t.Name.Replace("Keyboard", "");
                return(r);
            }
        }
Пример #2
0
 /// <summary>
 /// Displays a native platform promt, allowing the application user to enter a string.
 /// </summary>
 /// <param name="title">Title to display</param>
 /// <param name="message">Message to display</param>
 /// <param name="accept">Text for the accept button</param>
 /// <param name="cancel">Text for the cancel button</param>
 /// <param name="placeholder">Placeholder text to display in the prompt</param>
 /// <param name="maxLength">Maximum length of the user response</param>
 /// <param name="keyboard">Keyboard type to use for the user response</param>
 /// <param name="initialValue">Pre-defined response that will be displayed, and which can be edited</param>
 /// <returns><c>string</c> entered by the user. <c>null</c> if cancel is pressed</returns>
 public virtual Task <string> DisplayPromptAsync(string title, string message, string accept = "OK", string cancel = "Cancel", string placeholder = default, int maxLength = -1, Xamarin.Forms.Keyboard keyboard = default, string initialValue = "")
 {
     return(_applicationProvider.MainPage.DisplayPromptAsync(title, message, accept, cancel, placeholder, maxLength, keyboard, initialValue));
 }
        public Task <string> DisplayPromptAsync(string title, string message, string accept = "OK", string cancel = "Cancel", string placeholder = null, int maxLength = -1, Keyboard keyboard = default(Keyboard))
        {
            var args = new PromptArguments(title, message, accept, cancel, placeholder, maxLength, keyboard);

            MessagingCenter.Send(this, PromptSignalName, args);
            return(args.Result.Task);
        }