Uno: [iOS/Android/WASM] IsChecked value does not behave the same when using a converter

Created on 28 Feb 2020  路  1Comment  路  Source: unoplatform/uno

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

https://github.com/agneszitte-nventive/IsCheckedUnoIssue

Current behavior

IsChecked (RadioButton) value does not behave the same when using a converter

Detailed Logs

syntax: $"FromEqualityToBool.Convert: {value} + {parameter} -> {returnValue}"
syntax: $"FromEqualityToBool.ConvertBack: {value} + {parameter} -> {returnValue ?? "null"}"

UWP

== on-load: this.DataContext = new MainViewModel() { SelectedTab = "TAB1" };
FromEqualityToBool.Convert: TAB1 + TAB1 -> True
FromEqualityToBool.Convert: TAB1 + TAB2 -> False
// TAB1 is selected

== selecting TAB2
FromEqualityToBool.ConvertBack: True + TAB2 -> TAB2
FromEqualityToBool.Convert: TAB2 + TAB1 -> False
// TAB2 is selected

== selecting TAB1
FromEqualityToBool.ConvertBack: True + TAB1 -> TAB1
FromEqualityToBool.Convert: TAB1 + TAB2 -> False
// TAB1 is selected

Android/iOS (and normally similar behavior for the same steps for WASM)

== on-load: this.DataContext = new MainViewModel() { SelectedTab = "TAB1" };
FromEqualityToBool.Convert: TAB1 + TAB1 -> True
FromEqualityToBool.Convert: TAB1 + TAB2 -> False
// TAB1 is SelectedTab

== selecting TAB2
FromEqualityToBool.Convert: + TAB2 -> False // value is null (CallStackValueNull.txt)
FromEqualityToBool.ConvertBack: True + TAB2 -> TAB2
FromEqualityToBool.Convert: TAB2 + TAB1 -> False
// nothing is selected

== selecting TAB2 again
FromEqualityToBool.ConvertBack: True + TAB2 -> TAB2
// TAB2 is selected

== selecting TAB1
FromEqualityToBool.Convert: + TAB1 -> False // value is null (CallStackValueNull.txt)
FromEqualityToBool.ConvertBack: True + TAB1 -> TAB1
FromEqualityToBool.Convert: TAB1 + TAB2 -> False
// nothing is selected

== selecting TAB1 again
FromEqualityToBool.ConvertBack: True + TAB1 -> TAB1
// TAB1 is selected

Expected behavior

IsChecked (RadioButton) value should behave the same when using a converter

Environment

Nuget Package: Uno.UI

Package Version(s): 2.0.532 & 2.1.0-dev.1345

Affected platform(s):

  • [x] iOS
  • [x] Android
  • [x] WebAssembly
  • [ ] WebAssembly renderers for Xamarin.Forms
  • [ ] macOS
  • [ ] Windows
  • [ ] Build tasks
  • [ ] Solution Templates

Visual Studio:

  • [ ] 2017 (version: )
  • [x] 2019 (version: 16.4.1)
  • [ ] for Mac (version: )
kinbug platforandroid platforios platforwasm projecinput

Most helpful comment

Thanks! This should be relatively easy to reproduce in a Unit Test.

>All comments

Thanks! This should be relatively easy to reproduce in a Unit Test.

Was this page helpful?
0 / 5 - 0 ratings