private void SetBinding (Binding binding)
{
DependencyProperty prop = LookupDependencyProperty ();
if (prop == null)
throw Parser.ParseException ("Invalid Binding, can not find DependencyProperty {0}.", Name);
DependencyObject dob = target as DependencyObject;
if (dob == null)
throw Parser.ParseException ("Bindings can not be used on non DependencyObject types.");
BindingOperations.SetBinding (dob, prop, binding);
}