I have the following object with a couple of properties:
public class Test : NSObject
{
[Export("formattedFoo")]
public string FormattedFoo { get { return string.Format("Test {0}", Foo); } }
[Export("foo")]
public string Foo { get; set; }
}
In Interface Builder, I have a text field bound to foo
and a label bound to formattedFoo
. Whenever the user types text into the text field, the Foo
property is updated, as intended. However, the label does not get updated.
I suspect there is something I need to implement in order to communicate the dependency relationship between foo
and formattedFoo
to Cocoa, but I am not sure what.
Before anyone jumps in suggesting I use a formatting expression in IB, that's not really an option as the above is a vastly oversimplified example of the real-life scenario.