What is the proper way to do binding on a ux:Name? I get the warning:
'{name}' contains the character '{' which is not a valid Uno identifier character. This may lead to problems when accessing the symbol from Uno code.
this the part of the js code that produces the warning:
<Each Items="{circles}">
<Circle ux:Name="{name}" Fill="#FFFFFF" Width="10"/>
<!-- more code, not relevant -->
</Each/>
What is the correct way to do binding on the ux:Name, to keep the compiler happy?
You can’t define the ux:Name
at runtime, that is done at compile time, only the Name
property can be set at runtime
skezo
March 4, 2016, 5:07am
3
Are there any performance tradeoffs by doing this? Setting it at runtime instead compile time.
Edwin Reynoso wrote:
You can’t define the ux:Name
at runtime, that is done at compile time, only the Name
property can be set at runtime
Ok I got it, I will use ‘Name’ instead og ux:Name, thanks for the help.
Are there any performance tradeoffs by doing this? Setting it at runtime instead compile time.
Not really a performance concern.
Names not known at compile time cannot be referred to at compile time, like in a <Change>
or <Set>
When i try to bind to Name
<Each Items="{questionData.button}"> <Rectangle Height="50" Margin="{margin}" Width="150" Fill="#2D4059" Name="{id}" >
<Tapped>
<Callback Handler="{buttonClick}"/>
</Tapped>
<Text Value="{name}" TextColor="#fff" Alignment="Center" Padding="10,0,10,0" /> <DropShadow Color="#000" Size="10" Distance="2" />
</Rectangle>
</Each>
What i get is this error : The given key was not present in the dictionary.
However app does work on start, but after i press CTRL+S in my editor it crashes with this error.
metallica: That means that the key you are binding to, does not exist in the datacontext. If you have further problems you should open a new thread and show more of your code.