private void SearchButtonClick(object sender, EventArgs e)
        {
            // Get the search text entered.
            string searchText = _searchTextField.Text.Trim();

            // Fire the OnMapInfoEntered event and provide the map item values.
            if (OnSearchMapsTextEntered != null)
            {
                // Create a new MapSavedEventArgs to contain the user's values.
                var mapSaveEventArgs = new SearchMapsEventArgs(searchText);

                // Raise the event.
                OnSearchMapsTextEntered(sender, mapSaveEventArgs);
            }
        }
        // Handle the SearchTextEntered event from the search input UI
        // SearchMapsEventArgs contains the search text that was entered
        private async void SearchTextEntered(object sender, SearchMapsEventArgs e)
        {
            try
            {
                // Get web map portal items from a keyword search
                IEnumerable <PortalItem> mapItems = null;
                ArcGISPortal             portal;

                // Connect to the portal (anonymously)
                portal = await ArcGISPortal.CreateAsync(new Uri(ServerUrl));

                // Create a query expression that will get public items of type 'web map' with the keyword(s) in the items tags
                var queryExpression = string.Format("tags:\"{0}\" access:public type: (\"web map\" NOT \"web mapping application\")", e.SearchText);

                // Create a query parameters object with the expression and a limit of 10 results
                PortalQueryParameters queryParams = new PortalQueryParameters(queryExpression, 10);

                // Search the portal using the query parameters and await the results
                PortalQueryResultSet <PortalItem> findResult = await portal.FindItemsAsync(queryParams);

                // Get the items from the query results
                mapItems = findResult.Results;

                // Show the map results
                ShowMapList(mapItems);
            }
            catch (Exception ex)
            {
                // Report search error
                UIAlertController alert = UIAlertController.Create("Error", ex.Message, UIAlertControllerStyle.Alert);
                alert.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null));
                PresentViewController(alert, true, null);
            }
            finally
            {
                // Get rid of the search input controls
                _searchMapsUI.Hide();
                _searchMapsUI = null;
            }
        }