예제 #1
0
        private async void OnOpenMerchantPopup()
        {
            if (IsBusy || IsLoading)
            {
                //Message Toast
                ShowSnackBarWithAction(TranslateManagerHelper.Convert("loading_please_wait"), null, TranslateManagerHelper.Convert("ok").ToUpperInvariant());
                return;
            }
            IsLoading = true;

            ObservableCollection <PikerItem> list = new ObservableCollection <PikerItem>();
            var listr = await _applicationsService.GetApplicationMerchants(_authentication.GetToken(), _appInfo.App.Id);

            if (listr?.isuccess == true)
            {
                list = listr.data.Select(x => new PikerItem {
                    Id = x.UserId, Name_1 = x.Fname + " " + x.Lname
                }).ToObservableCollection();
            }


            var parameters = new NavigationParameters
            {
                { Constants.PopupId, "MERCHANT_POPUP" },
                { Constants.PopupTitle, TranslateManagerHelper.Convert("select_merchant").ToUpperInvariant() },
                // {Constants.PopupIcon, "icon-add-user"},
                { Constants.PopupCurrentData, list.FirstOrDefault(x => x.Id == Merchant.Id) },
                { Constants.PopupResquestData, list }
            };

            await NavigationService.NavigateAsync(PopupName.PikerPopup, parameters).ConfigureAwait(false);

            IsLoading = false;
        }