<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Why PRO SDK SearchTextBox Suggestions Display Slow? in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/why-pro-sdk-searchtextbox-suggestions-display-slow/m-p/804159#M2119</link>
    <description>&lt;P&gt;The major problem was assignment of the collection right after initialization and assigning again when it is updated. One assignment was enough as far as it is Observable Collection.&amp;nbsp;&lt;/P&gt;&lt;P&gt;SearchLayersBox.SuggestionSource = SearchSuggestCollection;&lt;/P&gt;&lt;P&gt;Then I also add a requirement to enter 3 characters before firing up the autosuggestions. However, this is not proper MVVM model. If somebody can explain a proper structure for MVVM model for ArcGIS Pro SDK framework, it would be very useful.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Dec 2020 18:18:20 GMT</pubDate>
    <dc:creator>Amadeus111</dc:creator>
    <dc:date>2020-12-29T18:18:20Z</dc:date>
    <item>
      <title>Why PRO SDK SearchTextBox Suggestions Display Slow?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/why-pro-sdk-searchtextbox-suggestions-display-slow/m-p/804158#M2118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I implemented a PRO SDK &lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Framework#search-textbox" rel="nofollow noopener noreferrer" target="_blank"&gt;SearchTextBox &lt;/A&gt;however it works pretty slow. I read from a CSV file and create an object type Observable Collection and dump that into SuggestionSource then filter the results as SearchBox text change. Do you have any idea what I am doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;XAML :&lt;/P&gt;&lt;P&gt;&amp;lt;!-- Inserting&amp;nbsp;inside user control --&amp;gt;&lt;/P&gt;&lt;P&gt;xmlns:controls="clr-namespace:ArcGIS.Desktop.Framework.Controls;assembly=ArcGIS.Desktop.Framework"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;!-- Inserting&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;inside&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;a stack panel&lt;/SPAN&gt;--&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;controls:SearchTextBox x:Name="SearchLayersBox" Height="23" Margin="5,5,10,10" VerticalAlignment="Top" InfoText="Search" SearchMode="Auto" ShowHistory="True" Search="SearchTextBox_Search" Initialized="SearchLayersBox_Initialized" TextChanged="SearchLayersBox_TextChanged" SuggestionListMax="15" /&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C#&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN class="" style="color: #6a737d;"&gt;&lt;SPAN class="" style="color: #6a737d;"&gt;
&lt;/SPAN&gt;&lt;/SPAN&gt;
public void LayersListSearchBox()
{
 &amp;nbsp;&amp;nbsp;&amp;nbsp;LayerDict.Clear();
 &amp;nbsp;&amp;nbsp;&amp;nbsp;DataListBoxSource.Clear();
 &amp;nbsp;&amp;nbsp;&amp;nbsp;var path = @"\\nrdsmnt6\mine maps\DMP_Database\Layer_Properties_spc_CSV.csv";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;using (TextFieldParser csvParser = new TextFieldParser(path))
 &amp;nbsp;&amp;nbsp;&amp;nbsp;{
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;csvParser.SetDelimiters(new string[] { "*%&amp;amp;" });
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;csvParser.HasFieldsEnclosedInQuotes = false;
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//Skip the row with the column names
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;csvParser.ReadLine();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (!csvParser.EndOfData)
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;string[] fields = csvParser.ReadFields();
 
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;string LayerDisplayName = fields[3].Substring(1);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SearchSuggestCollection.Add(LayerDisplayName);
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
 &amp;nbsp;&amp;nbsp;&amp;nbsp;}
 
 &amp;nbsp;&amp;nbsp;&amp;nbsp;SearchLayersBox.SuggestionSource = SearchSuggestCollection;
 }

private void SearchLayersBox_TextChanged(object sender, TextChangedEventArgs e)
{
 &amp;nbsp;&amp;nbsp;&amp;nbsp;string searchString = SearchLayersBox.Text;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ObservableCollection&amp;lt;object&amp;gt; filteredCollection = new ObservableCollection&amp;lt;object&amp;gt;(from objectL in SearchSuggestCollection where objectL.ToString().Contains(searchString) select objectL);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SearchLayersBox.SuggestionSource = filteredCollection;
}

private void SearchLayersBox_Initialized(object sender, EventArgs e)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp;LayersListSearchBox();
}


&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:21:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/why-pro-sdk-searchtextbox-suggestions-display-slow/m-p/804158#M2118</guid>
      <dc:creator>Amadeus111</dc:creator>
      <dc:date>2021-12-12T09:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: Why PRO SDK SearchTextBox Suggestions Display Slow?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/why-pro-sdk-searchtextbox-suggestions-display-slow/m-p/804159#M2119</link>
      <description>&lt;P&gt;The major problem was assignment of the collection right after initialization and assigning again when it is updated. One assignment was enough as far as it is Observable Collection.&amp;nbsp;&lt;/P&gt;&lt;P&gt;SearchLayersBox.SuggestionSource = SearchSuggestCollection;&lt;/P&gt;&lt;P&gt;Then I also add a requirement to enter 3 characters before firing up the autosuggestions. However, this is not proper MVVM model. If somebody can explain a proper structure for MVVM model for ArcGIS Pro SDK framework, it would be very useful.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2020 18:18:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/why-pro-sdk-searchtextbox-suggestions-display-slow/m-p/804159#M2119</guid>
      <dc:creator>Amadeus111</dc:creator>
      <dc:date>2020-12-29T18:18:20Z</dc:date>
    </item>
  </channel>
</rss>

