[C++] Change datamodel from outside the class
Posted: 12 Jan 2017, 09:43
DataModel component registered from NsRegisterComponent. How can I find this component from outside for calling add_item()? For example, from another component registered with same macro.
Code: Select all
class DataModel : public BaseComponent {
public:
DataModel();
int add_item(const NsString&, NsInt);
private:
Ptr<ObservableCollection<CheckListBoxItem> > mCheckListBoxItems;
NS_IMPLEMENT_INLINE_REFLECTION(DataModel, BaseComponent) {
NsMeta<TypeId>("DataModel");
NsProp("TheList", &DataModel::mCheckListBoxItems);
}
};