Select to view content in your preferred language

I get error on a SearchTextBox on XAML saying SuggestionSource property not found

694
4
Jump to solution
07-06-2022 08:44 AM
Amadeus111
Occasional Contributor II

I used to run this w/o a problem but now saying there is no SuggestionSource property. I am migrating my AddIn to 3.0/.Net6. I check the documentation. I didn't find any info that says SuggestionSource replaced/removed.

 

https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic15062.html

https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic15120.htmlhttps://pro.arcgis.com/en/...

Does anyone know what might be the issue?

 

 

 

<controls:SearchTextBox x:Name="SearchLayersBox" Height="23" Width="212" Margin="5,5,5,10" Grid.Row="0" Grid.Column="0" 
                                                VerticalAlignment="Top" InfoText="Search layers here"                                               
                                                SearchMode="Auto" ShowHistory="True" SuggestionListMax="15" 
                                                
                                                ToolTip = "{Binding SearchLayersBoxToolTip, UpdateSourceTrigger=PropertyChanged}"
                                                Text="{Binding SearchLayersBoxText, UpdateSourceTrigger=PropertyChanged}"
                                                SuggestionSource="{Binding SearchLayersBoxSuggestionSource, UpdateSourceTrigger=PropertyChanged}"
                                                 
                                                />

 

 

 

0 Kudos
1 Solution

Accepted Solutions
Wolf
by Esri Regular Contributor
Esri Regular Contributor

Using your XAML I made a 2.9 sample and then migrated the sample using the Pro Migration tool vsix: ProConcepts 3.0 Migration Guide · ArcGIS/arcgis-pro-sdk Wiki (github.com)

I attached my sample project for your reference.  The SuggestionSource property still exists, and my 3.0 add-in project compiled without error after the migration.   You can't find the SuggestionSource  property in the API reference guide because it is inherited from the ArcGIS.Desktop.Internal.Framework.Controls.SearchTextBox control and our online API reference guide always excluded such inherited "Internal" properties hence the property was not documented in the 2.x API reference guide.   Such properties can be used in add-ins but are not supported by the Pro API regarding the API's 'forwards compatible across minor releases of Pro' support.

My sample code implements an initial Suggestion list:

Wolf_0-1657297963335.png

and updates that list during runtime by clicking the button that adds feature layer names to the suggestion list.

Wolf_1-1657297989869.png

 

 

View solution in original post

4 Replies
Wolf
by Esri Regular Contributor
Esri Regular Contributor

Using your XAML I made a 2.9 sample and then migrated the sample using the Pro Migration tool vsix: ProConcepts 3.0 Migration Guide · ArcGIS/arcgis-pro-sdk Wiki (github.com)

I attached my sample project for your reference.  The SuggestionSource property still exists, and my 3.0 add-in project compiled without error after the migration.   You can't find the SuggestionSource  property in the API reference guide because it is inherited from the ArcGIS.Desktop.Internal.Framework.Controls.SearchTextBox control and our online API reference guide always excluded such inherited "Internal" properties hence the property was not documented in the 2.x API reference guide.   Such properties can be used in add-ins but are not supported by the Pro API regarding the API's 'forwards compatible across minor releases of Pro' support.

My sample code implements an initial Suggestion list:

Wolf_0-1657297963335.png

and updates that list during runtime by clicking the button that adds feature layer names to the suggestion list.

Wolf_1-1657297989869.png

 

 

Amadeus111
Occasional Contributor II

@Wolf Thanks for the reply. I will check out and let you know. I use SearchBox heavily in my AddIns.  I gotta figure this out

0 Kudos
Amadeus111
Occasional Contributor II

@Wolf I just realized I didn't do Pro Migrate Solution. After the migration 2->3 it works fine. I am sorry! I should have paid more attention. Knowing there is no problem pushed me find my own mistake. Thank you for your support, I appreciate that. 

 

0 Kudos
Wolf
by Esri Regular Contributor
Esri Regular Contributor

Ok, that explains it.   I guess the Migation guide ( ProConcepts-3.0-Migration-Guide  ) in the ArcGIS Pro SDK wiki could be a bit more frontline and center.

0 Kudos