-
Notifications
You must be signed in to change notification settings - Fork 675
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
ObservableCollection binding not working for UWP #3816
Comments
@stevenbrix or @Scottj1s was this an issue that was fixed through cswinrt with desktop? If so, would this be fixed with UWP being on .net 5? @MikeHillberg FYI |
The UWP support for WinRT in NetCore doesn't know about the new MUX interface IDs for INotifyPropertyChanged, etc. Not sure how this could work without that support. |
Until there's support for .Net5 in UWP, WinUI3 UWP apps need to use the INotifyCollectionChanged and INotifyPropertyChanged from the Microsoft namespace rather than the System namespace, which breaks ObservableCollection. The Xaml Controls Gallery app has an implementation of ObservableCollection that implements the right interfaces for UWP though. You can copy it from there. |
Ok thanks, but I think this should be mentioned somewhere in the documentation as I was going through the documentation for ItemsSource, which points to the INotifyCollectionChanged interface from the System namespace. |
Agreed, sorry it was difficult to find. I created an Issue on the doc page. (There's also info in the release notes.) |
ObservableCollection bound to a ListView does not correctly update the ListView on UWP
When a ListView is bound to an ObservableCollection with
x:bind
, it does not update when the collection is changed.This bug only works for the UWP platform. Creating a Packaged Desktop project works properly.
Steps to reproduce the behavior:
MainPage.xaml
MainPage.xaml.cs
Expected behavior
The list is visibly updated when the button is clicked.
Screenshots
Version Info
NuGet package version:
Microsoft.NETCore.UniversalWindowsPlatform 6.2.10
Microsoft.WinUI 3.0.0-preview3.201113.0
Windows app type:
Additional context
Sorry if this is my error in the code, but I really don't understand why it works on Desktop and not on UWP so I assume it is a bug.
The text was updated successfully, but these errors were encountered: