Hi Menno,
Yeah coming from WPF, Eto.Forms' binding is quite different. However, it is still quite flexible and you can convert your bindings similarly.
Bindings have a Convert() method which can convert any binding to another type using delegates. To create the binding, you use the Eto.Binding.Property or Delegate static methods instead of specifying the binding directly with Bind() or BindDataContext(), which then makes it easy to convert them.
E.g. the following two lines do the same thing:
textBox.BindDataContext(c => c.Text, (Model m) => m.Text);
textBox.BindDataContext(c => c.Text, Binding.Property((Model m) => m.Text));
Taking that to the BackgroundColor property, you can then convert it easily from bool to a Color:
textBox.BindDataContext(c => c.BackgroundColor, Binding.Property((Model m) => m.IsValid).Convert(val => !val ? Colors.Red : defaultColor));
I created a full
sample that shows how you can do what you are trying to achieve.
Hope this helps!
Curtis.