Skip to content

Conversation

prathameshnarkhede
Copy link
Contributor

@prathameshnarkhede prathameshnarkhede commented Jun 6, 2025

  • Add Loaded event handler to SearchView for initialization.
  • Removed calls ConfigureForCurrentConfiguration as it is being called before EnableDefaultWorldGeocode property is assigned.
  • Updated the way default value is set for EnableDefaultWorldGeocode in WPF, UWP and WinUI.

Copy link
Member

@dotMorten dotMorten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this issue only present in .NET MAUI? Will WPF/WinUI/UWP not have the same issue?

Removed the unsubscribe line from `SearchView_Loaded`.
Added a check in `HandleViewpointChanged` to ensure the view is loaded before executing logic.
@prathameshnarkhede prathameshnarkhede changed the title Bugfix: Fixing bug with EnableDefaultWorldGeocode value not being honored Bugfix: Fixing bug with EnableDefaultWorldGeocode value not being honored in MAUI Jun 9, 2025
@prathameshnarkhede
Copy link
Contributor Author

Is this issue only present in .NET MAUI? Will WPF/WinUI/UWP not have the same issue?

I tested the behavior with WinUI, WPF and and UWP and seems that it is working as expected. It is only bug with MAUI.

@dotMorten
Copy link
Member

I tested the behavior with WinUI, WPF and and UWP and seems that it is working as expected. It is only bug with MAUI.

I thought you said it was because WinUI/WPF/UWP test app was using a view model in the sample that avoided hitting the problem, not that it wasn't a problem?

@prathameshnarkhede
Copy link
Contributor Author

I thought you said it was because WinUI/WPF/UWP test app was using a view model in the sample that avoided hitting the problem, not that it wasn't a problem?

I was mentioning about this.

Copy link
Collaborator

@mstefarov mstefarov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to set EnableDefaultWorldGeocoder to "false" in XAML or in code, and the control honored it by not sending any arcgis.com requests 👍

- Changed `_loadTask` in `LocatorSearchSource` to `Lazy<Task>` for lazy initialization.
- Modified `WorldGeocoderSearchSource` to use `Lazy<Task>` for `_additionalLoadTask`.
- Updated LocatorSearchSource to implement INotifyPropertyChanged, introducing a new display name management system. - - Removed the _additionalLoadTask from WorldGeocoderSearchSource, simplifying the loading process to rely only on LoadTask.
- Modified logic to ensure `_displayName` is set to an empty string if both `Name` and `Description` are unavailable, preventing potential null states.
- Added `ProeprtyChanged` Event for DisplayName When Refresh happens.
Copy link
Member

@dotMorten dotMorten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, except the default fallback to string.empty seem wrong?

@prathameshnarkhede prathameshnarkhede merged commit 709176b into main Jun 25, 2025
1 check passed
@prathameshnarkhede prathameshnarkhede deleted the pratham/fix-EnableDefaultWorldGeocode-searchview branch June 25, 2025 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Search View EnableDefaultWorldGeocoder does not seem to be honored
3 participants