0

I'm using ReactiveUI for Winforms 6.5. I'm trying to bind dynamically created textbox to a ViewModel property. Bind method doesnt allow to create such a binding.Is there any way to create binding in runtime?

wchtej
  • 15
  • 1
  • 4

1 Answers1

1

If you need one-way binding (view model to view) only, you can use BindTo method:

TextBox textBox = new TextBox();
ViewModel.WhenAnyValue(model => model.PropertyToBind)
         .BindTo(textBox, t => t.Text);
ds-b
  • 361
  • 1
  • 5