Data Binding to property with name "Name" does not work.
Posted: 29 Dec 2024, 18:24
Hey!
I have a small element that uses databindings and found something I can't explain.
If I call my bound property "Name" it doesn't evaluate properly. If I call it anything else but "Name" it does.
Is that some kind of hidden protected property name I shouldn't use?
Here an excerpt of my surrounding code:
.h of my UserControl:
Noesis::String Name = "GameMode Name";
.cpp of my UserControl:
NS_IMPLEMENT_REFLECTION(GameModeSelectionElement)
{
//NsProp("Name", &GameModeSelectionElement::Name); --> THIS DOES NOT WORK!
NsProp("GameModeName", &GameModeSelectionElement::Name); --> THIS WORKS?!
}
XAML:
//<Label HorizontalAlignment="Center" FontSize="36" Content="{Binding Name}"/> --> THIS in combination with the commented "Name" property DOES NOT WORK!
<Label HorizontalAlignment="Center" FontSize="36" Content="{Binding GameModeName}"/> --> THIS in combination with the "GameModeName" property DOES WORK!
I have a small element that uses databindings and found something I can't explain.
If I call my bound property "Name" it doesn't evaluate properly. If I call it anything else but "Name" it does.
Is that some kind of hidden protected property name I shouldn't use?
Here an excerpt of my surrounding code:
.h of my UserControl:
Noesis::String Name = "GameMode Name";
.cpp of my UserControl:
NS_IMPLEMENT_REFLECTION(GameModeSelectionElement)
{
//NsProp("Name", &GameModeSelectionElement::Name); --> THIS DOES NOT WORK!
NsProp("GameModeName", &GameModeSelectionElement::Name); --> THIS WORKS?!
}
XAML:
//<Label HorizontalAlignment="Center" FontSize="36" Content="{Binding Name}"/> --> THIS in combination with the commented "Name" property DOES NOT WORK!
<Label HorizontalAlignment="Center" FontSize="36" Content="{Binding GameModeName}"/> --> THIS in combination with the "GameModeName" property DOES WORK!