I have a OneWayToSource binding that is not behaving as I expected when I set the DataContext of the target control. The property of the source is being set to default inste
Here you will have to UpdateSource like below:
UpdateSource
private void Button1_Click(object sender, RoutedEventArgs e) { Debug.Print("'Set DataContext' button clicked"); tb.DataContext = _vm; var bindingExp = tb.GetBindingExpression(TextBox.TextProperty); bingExp.UpdateSource(); }