Author Topic: "Property Binding" only works for fields and not properties  (Read 1652 times)

Paniku

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
"Property Binding" only works for fields and not properties
« 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.

beermoney

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 80
    • View Profile
Re: "Property Binding" only works for fields and not properties
« Reply #1 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: "Property Binding" only works for fields and not properties
« Reply #2 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.