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

WinUI3 example: doesn't refresh #156

Closed
adrianhall opened this issue Nov 22, 2024 · 3 comments · Fixed by #157
Closed

WinUI3 example: doesn't refresh #156

adrianhall opened this issue Nov 22, 2024 · 3 comments · Fixed by #157
Assignees
Labels
Bug Something isn't working Client Improvements or additions to the client code Requires Triage This issue has not been checked by the project team.

Comments

@adrianhall
Copy link
Collaborator

Reported by @trydalch

The WinUI3 (and potentially the WPF) version of the TodoApp does not refresh properly.

@adrianhall adrianhall added Bug Something isn't working Client Improvements or additions to the client code Requires Triage This issue has not been checked by the project team. labels Nov 22, 2024
@adrianhall adrianhall self-assigned this Nov 22, 2024
@trydalch
Copy link

trydalch commented Nov 22, 2024

I believe it's just the WinUI, and the issue is related to the bindings. The underlying data is correct, but the UI isn't updated.

I actually added a fix in my PR for the initial Uno Sample (I'm discovering it may need more work for other platforms like iOS and Android) because Uno uses WinUI when targeting windows, so it had the same problem as the WinUI sample app. I fixed it for both WinUI and Uno.

The fix was three-fold:

  1. Create the TodoItemViewModel that is an ObservableObject and change the type of the Items list to that. This properly raises property changed events.
  2. Added Mode=TwoWay,UpdateSourceTrigger=Explicit to the Checkbox bindings.
  3. Sorted the TodoItems. When it was unsorted, WinUI (and Uno) would not refresh the list UI properly and checkboxes would show checked that shouldn't and vice versa.

See: #137

@adrianhall
Copy link
Collaborator Author

Got it - I'm not actually seeing that, but I believe you; especially the sorting issue. I'll check in the fixes for the WinUI3 change soon.

Please remove the WinUI3 and WPF fixes from your PR - let's keep it focused on just the Uno sample.

adrianhall added a commit to adrianhall/CommunityToolkit-Datasync that referenced this issue Nov 22, 2024
@trydalch
Copy link

PR updated and removed all WPF and WinUI3 changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Client Improvements or additions to the client code Requires Triage This issue has not been checked by the project team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants