예제 #1
0
        protected void ShowSingleChoseDialog(string[] items, Action <int> chosePosition, bool isCanCancel = true, bool isOutSideTouch = true)
        {
            var builder = new AndroidX.AppCompat.App.AlertDialog.Builder(this, Android.Resource.Style.ThemeDeviceDefaultLightDialogNoActionBarMinWidth);

            builder.SetItems(items, (object sender, DialogClickEventArgs e) =>
            {
                chosePosition?.Invoke(e.Which);
            });
            var dialog_Show = builder.Create();

            dialog_Show.SetCancelable(isCanCancel);
            dialog_Show.SetCanceledOnTouchOutside(isOutSideTouch);
            dialog_Show.Show();
        }