Page 1 of 1
Custom control with String dependency property
Posted: 20 Mar 2018, 10:01
by GeorgeR
void SetLabel(const NsString& label);
void AttributeControlBase::SetLabel(const NsString& label)
{
Noesis::ContentControl::SetValue<NsString>(LabelProperty, label);
}
throws an error, is that the right signature?
Re: Custom control with String dependency property
Posted: 20 Mar 2018, 16:44
by sfernandez
Try this:
const char* AttributeControlBase::GetLabel() const
{
return GetValue<NsString>(LabelProperty).c_str();
}
void AttributeControlBase::SetLabel(const char* label)
{
SetValue<NsString>(LabelProperty, label);
}
Re: Custom control with String dependency property
Posted: 21 Mar 2018, 02:03
by GeorgeR
Wouldn't it have to be wchar to support localization?
Re: Custom control with String dependency property
Posted: 21 Mar 2018, 06:14
by jsantos
We use UTF8 encoding for everything. So
char* is always correct. Please, have a look at our
localization sample.