private static void RefreshBinding(DependencyObject target, DependencyProperty property) { BindingExpression binding = target.ReadLocalValue(property) as BindingExpression; if (binding != null && binding.ParentBinding != null) { BindingOperations.SetBinding(target, property, binding.ParentBinding); } }
// Methods public static void EnsureBindingUpToDate(DependencyObject target, DependencyProperty dp) { BindingExpression expression = target.ReadLocalValue(dp) as BindingExpression; if (expression != null) { target.ClearValue(dp); target.SetValue(dp, expression); } }
private static object CacheLocalValueHelper(DependencyObject dependencyObject, DependencyProperty property) { return dependencyObject.ReadLocalValue(property); }