GeorgeR
Topic Author
Posts: 39
Joined: 15 Mar 2018, 01:06

Custom control with String dependency property

20 Mar 2018, 10:01

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?
 
User avatar
sfernandez
Site Admin
Posts: 1918
Joined: 22 Dec 2011, 19:20

Re: Custom control with String dependency property

20 Mar 2018, 16:44

Try this:
const char* AttributeControlBase::GetLabel() const
{
  return GetValue<NsString>(LabelProperty).c_str();
}
void AttributeControlBase::SetLabel(const char* label)
{
  SetValue<NsString>(LabelProperty, label);
}
 
GeorgeR
Topic Author
Posts: 39
Joined: 15 Mar 2018, 01:06

Re: Custom control with String dependency property

21 Mar 2018, 02:03

Wouldn't it have to be wchar to support localization?
 
User avatar
jsantos
Site Admin
Posts: 2906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Custom control with String dependency property

21 Mar 2018, 06:14

We use UTF8 encoding for everything. So char* is always correct. Please, have a look at our localization sample.

Who is online

Users browsing this forum: No registered users and 1 guest