Exemplo n.º 1
0
        public override async Task GetItems(CancellationToken token)
        {
            var result = await RoleService.GetRoles(Criteria);

            if (!CheckForAuthorizationErrors(result.Error))
            {
                return;
            }

            RunOnUiThread(() =>
            {
                if (result.Error.Any())
                {
                    ShowToastMessage(Resource.String.ErrorOccurred);

                    return;
                }

                _adapter.UpdateList(result.Data);

                if (result.Data.Any())
                {
                    SetContent();

                    return;
                }

                SetEmptyContent();
            });
        }