It seems when making use of the Selectable class, and assigning a property as the value, this only functions correctly if the property directly comes from an observable or a literal value.
If an Each is used, and a value from the iterated array is passed as the property assigned to Selectable then it does not function correctly (ToggleSelection assigns an empty value to the Selection target instead)
In a current project I have a CustomClass, which contains Text, a Selectable, and a ToggleSelectionTapped event.
If I pass a literal as the property for the Text and Selectable it functions as expected:
<CustomClass Value="value" />
If I pass a property as the property for the Text and Selectable it also functions as expected:
<CustomClass Value="{Property value}" />
If I pass the value of an iterated property as the property for the Text and Selectable it fails:
I need to see more of you code to know why it doesn’t work. I made a test here and using ux:Property and iterating over data from JS works fine. Here is my code, it might point you in the right direction:
Thanks Kristian, this has helped me corner it down
My selection items were wrapped in a WhileTrue and their visibility toggled when something was selected (this was for a dropdown control).
When their Selectable was no longer visible/existed the Selection would get wiped, but only if it was a locally scoped value, so observables and literals were fine (presumably literals lifetimes are global).
Toggling the visibility on them instead seems to solve the problem.