Skip to content

Instantly share code, notes, and snippets.

@posaunehm
Created November 30, 2011 04:22
Show Gist options
  • Save posaunehm/1408002 to your computer and use it in GitHub Desktop.
Save posaunehm/1408002 to your computer and use it in GitHub Desktop.
Extension method that helps updating binding target.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows.Controls;
using System.Windows;
namespace Infrastructure.Extensions
{
public static class ControlBindingHelper
{
public static void UpdateBindingTarget(this DependencyObject ctrl, params DependencyProperty[] args)
{
foreach (var dp in args)
{
BindingOperations.GetBindingExpression(ctrl, dp).UpdateTarget();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment