WPF Binding with a Border

Solution 1:

Use the FrameworkElement.SetBinding method:

myBorder.SetBinding(Border.BackgroundProperty, "CurrentBackground");

or, if you need sources and converters and things:

myBorder.SetBinding(Border.BackgroundProperty,
  new Binding(somePath) {
    Source = something,
    Converter = new WonderConverter()
    // etc.
  });