public abstract Task <string> ShowTextInputBoxAsync( string title, string content, string hint, string positiveText, string neutralText, INativeDialogStyle nativeDialogStyle = null);
public async Task <int?> ShowItemsPicker( IEnumerable <string> items, int selectedIndex, string title, string cancelText, string okText, INativeDialogStyle dialogStyle = null) { var semaphore = new SemaphoreSlim(0); int?returnValue = null; var alert = UIAlertController.Create(title, string.Empty, UIAlertControllerStyle.ActionSheet); foreach (var item in items) { alert.AddAction(UIAlertAction.Create(item, UIAlertActionStyle.Default, (x) => { returnValue = Array.IndexOf(alert.Actions, x); semaphore.Release(); })); } alert.AddAction(UIAlertAction.Create(cancelText, UIAlertActionStyle.Cancel, x => { semaphore.Release(); })); UIApplication.SharedApplication.KeyWindow.RootViewController.PresentViewController(alert, true, null); await semaphore.WaitAsync(); return(returnValue); }
public async Task <int?> ShowItemsPicker( IEnumerable <string> items, int selectedIndex, string title, string cancelText, string okText, INativeDialogStyle dialogStyle = null) { var style = (INativeAndroidDialogStyle)dialogStyle; var semaphore = new SemaphoreSlim(0); var builder = style is null || style.ThemeResourceId == default ? new AlertDialog.Builder(_contextProvider.CurrentContext) : new AlertDialog.Builder(_contextProvider.CurrentContext, style.ThemeResourceId); int?selectedItem = selectedIndex; builder.SetTitle(title); builder.SetSingleChoiceItems(items.ToArray(), selectedIndex, (sender, args) => { selectedItem = args.Which; }); builder.SetNegativeButton(cancelText, (sender, args) => { selectedItem = null; semaphore.Release(); }); builder.SetPositiveButton(okText, (sender, args) => semaphore.Release()); style?.SetStyle(builder); var dialog = builder.Create(); dialog.SetCanceledOnTouchOutside(false); dialog.SetCancelable(false); style?.SetStyle(dialog); await semaphore.WaitAsync(); dialog.Dismiss(); return(selectedItem); }
public Task <int?> ShowItemsPicker(IEnumerable <string> items, int selectedIndex, string title, string cancelText, string okText, INativeDialogStyle dialogStyle = null) { throw new NotImplementedException(); }
public IDisposable ObtainLoaderLifetime(string title, string content, INativeDialogStyle nativeDialogStyle) => new LoaderLifetimeManager(this, title, content);
public abstract void ShowLoadingPopup( string title = null, string content = null, INativeDialogStyle nativeDialogStyle = null);
public abstract Task ShowMessageBoxOkAsync( string title, string content, string neutralText, INativeDialogStyle nativeDialogStyle = null);
public abstract Task <bool> ShowMessageBoxWithInputAsync( string title, string content, string positiveText, string negativeText, INativeDialogStyle nativeDialogStyle = null);