This pull request includes changes to two files: src/Controls/src/Core/Picker/Picker.cs and src/Controls/src/Xaml/XamlNode.cs. The changes address the issue where the SelectedIndex attribute of the Picker control is not being respected on page load on Android.
Summary
In src/Controls/src/Core/Picker/Picker.cs:
Modified the CoerceSelectedIndex method to check if the Items property is null or empty before coercing the SelectedIndex value.
In src/Controls/src/Xaml/XamlNode.cs:
Added a new deferredProperties dictionary to store deferred properties.
Added a new method DeferProperty to add properties to the deferredProperties dictionary.
Added a new method ApplyDeferredProperties to apply the deferred properties to the Properties dictionary.
Modified the Accept method to call ApplyDeferredProperties if the visiting mode is TopDown and the node is not skipped.
Modified the Clone method to check if the ItemsSource or Items properties are being set and apply deferred SelectedIndex if any.
Fixes #318.
π Latest improvements to Sweep:
New dashboard launched for real-time tracking of Sweep issues, covering all stages from search to coding.
Integration of OpenAI's latest Assistant API for more efficient and reliable code planning and editing, improving speed by 3x.
PR Feedback (click)
Description
This pull request includes changes to two files:
src/Controls/src/Core/Picker/Picker.cs
andsrc/Controls/src/Xaml/XamlNode.cs
. The changes address the issue where theSelectedIndex
attribute of thePicker
control is not being respected on page load on Android.Summary
src/Controls/src/Core/Picker/Picker.cs
:CoerceSelectedIndex
method to check if theItems
property is null or empty before coercing theSelectedIndex
value.src/Controls/src/Xaml/XamlNode.cs
:deferredProperties
dictionary to store deferred properties.DeferProperty
to add properties to thedeferredProperties
dictionary.ApplyDeferredProperties
to apply the deferred properties to theProperties
dictionary.Accept
method to callApplyDeferredProperties
if the visiting mode isTopDown
and the node is not skipped.Clone
method to check if theItemsSource
orItems
properties are being set and apply deferredSelectedIndex
if any.Fixes #318.
π Latest improvements to Sweep:
π‘ To get Sweep to edit this pull request, you can: