示例#1
0
 protected internal virtual bool OnSetValue(object eventSender, XamlMember member, object value)
 {
     if (settings.XamlSetValueHandler != null)
     {
         var args = new XamlSetValueEventArgs(member, value);
         settings.XamlSetValueHandler(eventSender, args);
         return(args.Handled);
     }
     return(false);
 }
示例#2
0
        private static void SetValue(object sender, XamlSetValueEventArgs e)
        {
            BindingBase binding = e.Value as BindingBase;

            if (binding != null)
            {
                DependencyProperty dp = DependencyObject.GetPropertyFromName(
                    e.Member.DeclaringType.UnderlyingType,
                    e.Member.Name);
                ((FrameworkElement)sender).SetBinding(dp, binding);
                e.Handled = true;
            }
        }