Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Paniku on August 05, 2014, 10:39:25 PM

Title: "Property Binding" only works for fields and not properties
Post by: Paniku on August 05, 2014, 10:39:25 PM
When attempting to select the source for a Property Binding, my get properties aren't listed. Is this intended? Any way to work around this? Using 3.6.8.
Title: Re: "Property Binding" only works for fields and not properties
Post by: beermoney on August 06, 2014, 12:41:36 AM
I posted about this too, kinda annoying.  Properties require a get and set, ie. if your propperty looked like this  public int SomeValue { get; } you would need to change it to public in SomeValue { get; Set; } to get it to work.  I'm not sure what the rational behind that was, and once the property has been set you can remove the setter and it'll still work, seems broken to me.
Title: Re: "Property Binding" only works for fields and not properties
Post by: ArenMook on August 06, 2014, 11:26:27 PM
The rationale is simple -- property binding expects support for two-way communication, and a getter without a setter is only one way. I'll make it possible to select read-only properties (get, no set) in the next update.