コード例 #1
0
        /// <summary>
        /// Raised when the asynchronous call to search for Groups on AGOL has completed.
        /// </summary>
        void GroupsSearchCompleted(object sender, GroupSearchEventArgs e)
        {
            SearchButton.IsEnabled       = true;
            SearchTextBox.IsEnabled      = true;
            ProgressIndicator.Visibility = Visibility.Collapsed;

            if (e.Error != null)
            {
                return;
            }

            Items = new PagedSearchResult(e.Result);
            DataPager.Visibility           = DataPager.PageCount > 1 ? Visibility.Visible : Visibility.Collapsed;
            GroupResultsListBox.Visibility = e.Result.TotalCount > 0 ? Visibility.Visible : Visibility.Collapsed;

            SearchResultsTextBlock.Text = string.Format(ESRI.ArcGIS.Mapping.Controls.ArcGISOnline.Resources.Strings.SearchMapResultsFor, e.Result.TotalCount.ToString(), SearchTextBox.Text);
            SearchTextBox.SelectAll();
            SearchTextBox.Focus();

            //select first item in list and show/hide map details depending on
            //if it was previously visible
            //
            if (e.Result.Items.Length > 0)
            {
                GroupResultsListBox.SelectedItem = e.Result.Items[0];
                GroupResultsListBox.ScrollIntoView(e.Result.Items[0]);
            }
        }
コード例 #2
0
        /// <summary>
        /// Raised when the asynchronous call to search for Groups on AGOL has completed.
        /// </summary>
        void GroupsSearchCompleted(object sender, GroupSearchEventArgs e)
        {
            SearchButton.IsEnabled = true;
            SearchTextBox.IsEnabled = true;
            ProgressIndicator.Visibility = Visibility.Collapsed;

            if (e.Error != null)
                return;

            Items = new PagedSearchResult(e.Result);
            DataPager.Visibility = DataPager.PageCount > 1 ? Visibility.Visible : Visibility.Collapsed;
            GroupResultsListBox.Visibility = e.Result.TotalCount > 0 ? Visibility.Visible : Visibility.Collapsed;

            SearchResultsTextBlock.Text = string.Format(ESRI.ArcGIS.Mapping.Controls.ArcGISOnline.Resources.Strings.SearchMapResultsFor, e.Result.TotalCount.ToString(), SearchTextBox.Text);
            SearchTextBox.SelectAll();
            SearchTextBox.Focus();

            //select first item in list and show/hide map details depending on 
            //if it was previously visible
            //
            if (e.Result.Items.Length > 0)
            {
                GroupResultsListBox.SelectedItem = e.Result.Items[0];
                GroupResultsListBox.ScrollIntoView(e.Result.Items[0]);
            }
        }