Пример #1
0
        private async void OnOpenOrganizationPopup()
        {
            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 listorgs = await _organizations.GetList(_authentication.GetToken(), (int)_appInfo.GetApp()?.Id);

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

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

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

            IsLoading = false;
        }