Open Soap-141 opened 1 year ago
I took a look at this. Something very weird is going on on UWP.
First, the PropertyChanged event is subscribed twice (one for the TextBlock.Text binding, the other for TabBar.SelectedIndex binding)
Then, out of sudden, UWP decides to unsubscribe the event for TabBar.SelectedIndex.
I don't see why UWP should unsubscribe when TabBar.SelectedIndex setter is called.
@Xiaoy312 Do you have any idea?
Note to save time if someone will look: The project crashed for me with unrelated error, and solved by removing <XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
in App.xaml.
Oh it quite makes sense now. When the property is set explicitly, all OneWay bindings are cleared.
@Youssef1313, so this is a bug in TabBar then right? Not a binding thing in the sample?
@kazo0 The sample looks fine to me. I think yes it's a TabBar bug.
It affects Windows but not Uno targets because Uno doesn't remove the binding (which looks like another bug in Uno)
@Youssef1313 @Xiaoy312 quick question, I tried Uno.Toolkit.UI 3.0.5 and 3.1.0-dev.33 on the sample provided and the behavior is the same as described. Am I testing the right versions? Was the fix merge into Uno.Toolkit.UI 4.0.0-dev?
Got the same issue yesterday with uno 4.10.13
Current behavior
On Windows, we need to set
SelectedIndex
as aTwoWay
binding if we want the selected item visual state to update.Expected behavior
On Windows, we should not need to set
SelectedIndex
as aTwoWay
binding if we want the selected item visual state to update.Please note that I know that if we don't set
SelectedIndex
as aTwoWay
binding the selected index property won't be updated since it's an expected behavior.How to reproduce it (as minimally and precisely as possible)
Nuget Package: Uno.Toolkit.UI
Package Version(s): 2.6.0-dev.40
Affected platform(s):
IDE:
Relevant plugins:
Anything else we need to know?