CodebreakerApp / Codebreaker.Xaml

MIT License
0 stars 1 forks source link

Binding Issue #156

Closed szv closed 2 months ago

szv commented 3 months ago

@martinzikmund @morning4coffe-dev As promised... Here is the issue we talked about today :)

https://github.com/CodebreakerApp/Codebreaker.Xaml/blob/2dad6dc23e2bf72c2fdbbaacb09c77ea89bffca5/src/Codebreaker.Uno/CodebreakerUno/Views/Components/PegSelectionComponent.xaml#L26

The above mentioned binding does not work on all platforms. ✅WinUI Head ❌WASM ❌Android ❌Skia/WPF Not tested on other platforms

Youssef1313 commented 3 months ago

Hi @szv

It looks like this is relying on an Azure Container App that's currently off:

image

So, can't get straight to reproducing this inside the app.

If you can get the app up and running again (or get a more simplified repro with a new unoapp), please let me know.

Thank you!

Youssef1313 commented 3 months ago

Also, it could be that the binding is evaluated early at a point where the dictionary or game wasn't yet initialized. If you can try to manually call Bindings.Update in GamePage at a point when you know the dictionary is initialized and let us know if that works, it would help understanding the issue more.

szv commented 2 months ago

Hi @Youssef1313

Yes we had some trouble with the backend. It's now redeployed (with a new Uri). The backend should now be reachable, if you pull the latest changes.

Thanks

Youssef1313 commented 2 months ago

@szv Thanks for the update.

I investigated this, and the root cause is https://github.com/unoplatform/uno/issues/9886.

Specifically, the problematic binding is this one:

https://github.com/CodebreakerApp/Codebreaker.Xaml/blob/b365dd20c604e7e6d645d376cdc7bc862e266373/src/Codebreaker.Uno/CodebreakerUno/Views/Pages/GamePage.xaml#L105-L109

The way this binding works on WinUI is that it calls PegSelectionComponent.ViewModel setter. However, in Uno, it calls SetValue(ViewModelProperty, value) directly, bypassing the following line:

https://github.com/CodebreakerApp/Codebreaker.Xaml/blob/b365dd20c604e7e6d645d376cdc7bc862e266373/src/Codebreaker.WinUI/Views/Components/PegSelectionComponent.xaml.cs#L22

As a workaround, the change in https://github.com/CodebreakerApp/Codebreaker.Xaml/pull/162 should work.