unoplatform / uno

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
https://platform.uno
Apache License 2.0
8.95k stars 726 forks source link

[WPF] Recycled `TextBox` drops binding #13942

Open maaxe opened 1 year ago

maaxe commented 1 year ago

Current behavior

Changing the value in a recycled TextBox do not update the bound property. Changing the value again updates the property.

Not visible when targeting net7. Visible when targeting net6.

Expected behavior

Works on first edit

How to reproduce it (as minimally and precisely as possible)

Uno_binding_test.zip

Workaround

Disable FrameworkTemplatePool

Works on UWP/WinUI

Yes

Environment

Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia

NuGet package version(s)

4.10.26

Affected platforms

Skia (WPF)

IDE

No response

IDE version

17.6.3

Relevant plugins

No response

Anything else we need to know?

No response

Youssef1313 commented 1 year ago

@MartinZikmund

maaxe commented 1 year ago

FYI: On the 4.8.15 release everything seams to be working as expected

jeromelaban commented 1 year ago

@maaxe thanks for the update. Could you validate on the latest 5.0 preview builds? Note that you will need to apply this change to use WPF.

maaxe commented 1 year ago

I tested on the latest 5.0.0-dev.3413. But this requires me to target net7. For some reason the usercontrols are not recycled when i target net7 (i might be missing something obvious.. ). Since the controls are not recycled im not able to reproduce the issue.

jeromelaban commented 1 year ago

Thanks for the update. There's indeed a pooling issue that is being addressed in https://github.com/unoplatform/uno/pull/13958, though it may not be fixing this particular issue.

maaxe commented 1 year ago

@jeromelaban Updated and tested on 5.0.0-dev.3552 (that should include the fix in #13958 ?). The pooling issue is still present, so I can't test if there's still an issue with the recycled TextBox bindings on the latest builds

MartinZikmund commented 1 year ago

This is possibly related to changes here https://github.com/unoplatform/uno/pull/13165, must be some edge case