private void MAdapterOnItemClick(object sender, BlockedUsersAdapterClickEventArgs adapterClickEvents) { try { var position = adapterClickEvents.Position; if (position >= 0) { var item = MAdapter.GetItem(position); if (item != null) { var local = MAdapter?.UserList?.FirstOrDefault(a => a.UserId == item.UserId); if (local != null) { MAdapter?.UserList.Remove(local); MAdapter?.NotifyItemRemoved(MAdapter.UserList.IndexOf(local)); } if (MAdapter?.UserList?.Count == 0) { ShowEmptyPage(); } Toast.MakeText(Application.Context, GetString(Resource.String.Lbl_Unblock_successfully), ToastLength.Short)?.Show(); PollyController.RunRetryPolicyFunction(new List <Func <Task> > { () => RequestsAsync.Global.Block_User(item.UserId, false) }); //false >> "un-block" } } } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
private void MAdapterOnOnItemClick(object sender, BlockedUsersAdapterClickEventArgs e) { try { Position = e.Position; var dialog = new MaterialDialog.Builder(this).Theme(AppSettings.SetTabDarkTheme ? AFollestad.MaterialDialogs.Theme.Dark : AFollestad.MaterialDialogs.Theme.Light); dialog.Title(Resource.String.Lbl_Warning); dialog.Content(GetText(Resource.String.Lbl_DoYouWantUnblock)); dialog.PositiveText(GetText(Resource.String.Lbl_Yes)).OnPositive(this); dialog.NegativeText(GetText(Resource.String.Lbl_No)).OnNegative(this); dialog.AlwaysCallSingleChoiceCallback(); dialog.Build().Show(); } catch (Exception exception) { Console.WriteLine(exception); } }