Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows] Notify changes in Picker ItemsSource #9584

Merged
merged 2 commits into from
Aug 23, 2022
Merged

[Windows] Notify changes in Picker ItemsSource #9584

merged 2 commits into from
Aug 23, 2022

Conversation

jsuarezruiz
Copy link
Contributor

@jsuarezruiz jsuarezruiz commented Aug 22, 2022

Description of Change

Notify changes in Picker ItemsSource (without using ObservableCollection). Fix the issue #9239 updating the Picker ItemsSource.

fix-9239

Issues Fixed

Fixes #9239
Fixes #9496

@ghost ghost added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Aug 22, 2022
@@ -318,6 +318,7 @@ void ResetItems()
((LockableObservableListWrapper)Items).InternalClear();
foreach (object item in ItemsSource)
((LockableObservableListWrapper)Items).InternalAdd(GetDisplayMember(item));
Handler?.UpdateValue(nameof(IPicker.Items));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the main change.

@jsuarezruiz jsuarezruiz marked this pull request as ready for review August 23, 2022 08:01
@rmarinho rmarinho merged commit 7689601 into main Aug 23, 2022
@rmarinho rmarinho deleted the fix-9239 branch August 23, 2022 10:52
if (ItemsSource == null)
return;

Items.Clear();
Copy link
Contributor

@mohachouch mohachouch Aug 23, 2022

Choose a reason for hiding this comment

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

@jsuarezruiz @rmarinho I think you have to clear the list before check ItemsSource is null

Copy link
Member

Choose a reason for hiding this comment

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

Look @mohachouch our WPF guru :D

This is just a test so i think is fine.

For when a WPF backend to MAUI @mohachouch ? i can help :P

@tekmun
Copy link

tekmun commented Aug 26, 2022

I downloaded the entire dotnet MAUI zip repo. I run .\build.ps1 and my .nuget and .dotnet directories in my user folder are updated. But after I clean and rebuild, the issue still remains. I suspect I am not using this latest build in my project.
Can someone guide me how I can specify this latest dotnet MAUI in my project instead of using the Nuget version? What must I change in my .csproj file? Is there a documentation? I want to test that the latest fix really solve this issue in my project.
Thanks.

@acrigney
Copy link

Yes this is still a problem for me. The Items is set when my view model is created but the binding doesn't work.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 18, 2023
@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.NET MAUI Picker ItemsSource binding failed ItemsSource cannot be changed on a Picker on Windows
7 participants