In the recent update to 14.2, there are now some compiler warnings about UnboundField being deprecated. It says to 'Use Field with BindingType set to Unbound or UseAlternateBinding instead".
I have tried both without success.
My original code had bindings set up like this:
Field field = new UnboundField { BindingMode = BindingMode.TwoWay, BindingPath = new PropertyPath(MyPropertyName) };
What is the new syntax for how my old code works?
From what I see in the compiler warnings, this should be the equivalent:
Field field = new Field { BindingType = BindingType.UseAlternateBinding, AlternateBinding = new Binding(MyPropertyName) };
But it does not function properly.
Thanks,
Jon
I use UnboundField with TwoWay and OneWay modes and BindingPath set (usually to ObjectPath.ObjectProperty). What is an equivalent with AlternateBinding and AlternateBindingRetentionMode as for the performance/ behavior of the old solution? I read that AutoRelease can hit performance when aggregations are performed and Retain will use more memory. That's a question that UnboundField solved for me, because I had no control there :)
Ivan
Well in that case:
<dataPresenter:Field AlternateBinding="{Binding Something.SomethingElse}" BindingType="Unbound" Label="Something else"/>
My understanding was that UnboundField is now deprecated.
Michael,
You can use an UnboundField instead of TextField, like this:
<dataPresenter:UnboundField Binding="{Binding Something.SomethingElse}" Label="Something else"/>
How can I do this in xaml ?
I have the following ...
<dataPresenter:TextField Name="Name"/> //works fine
<dataPresenter:TextField Name="Something.SomethingElse" BindingType="UseAlternateBinding/> //doesn't
My VM looks something like this :
class Thing{
string Name {get;set}
thing Something {get;set;
}
class Something
{
string SomethingElse {get;set;}