Let’s say you are in a situation where you want to show the user the corresponding
image when the user selects a particular option in NativeScript Core.
We’ll use the <Image> widget to display the image, and <SegementedBar> to
display the options.
Note: At the time of writing this article it is not possible to bind
to selectedIndexChange event from the xml file in NativeScript core.
Before you proceed reading this further, try to do this yourself.
Did you manage to do it? If yes, well done! If no, read on!
The intuitive approach here would be to bind the text property to
and bind the `src` property to
However, using multiple variables in an expression like that is not supported
in NativeScript. So the way we bind is by specifying the different variables that
we will be using, before using them in an expression.
So the correct way to bind it is,
text="" for the label src="" for the image
(Note: The order in which you specify the variables does not matter)