public void Handle(InvokeContext ctx) { FailIfXamlNotAFrameworkElement(ctx); var propertyName = ctx.Name.Replace("OneWayBind", "").Replace("Bind", ""); var depProp = ctx.XamlType .FindDependencyProperty(propertyName) .MustHaveValue(new ArgumentException("No DependencyProperty '{0}' found on type '{1}'".Fmt(propertyName, ctx.XamlType.Name))); ctx.AddSetterWith(ctx.NewBindSetterContext(depProp)); }
public void Handle(InvokeContext ctx) { GuardAgainstSignatureFailures(ctx); var attachProp = (DependencyProperty)ctx.Values[0]; if (ctx.IsArgumentNameSpecified("path")) ctx.AddSetterWith(ctx.NewBindSetterContext(attachProp)); else { var value = ctx.Values[1]; ctx.AddSetterWith<DependencyObject>(xaml => xaml.SetValue(attachProp, value)); } }
public void Handle(InvokeContext ctx) { GuardAgainstSignatureFailures(ctx); var attachProp = (DependencyProperty)ctx.Values[0]; if (ctx.IsArgumentNameSpecified("path")) { ctx.AddSetterWith(ctx.NewBindSetterContext(attachProp)); } else { var value = ctx.Values[1]; ctx.AddSetterWith <DependencyObject>(xaml => xaml.SetValue(attachProp, value)); } }