public static IAttachedBindingMemberInfo <TTarget, TType> CreateMember <TTarget, TType>(BindingMemberDescriptor <TTarget, TType> path, [CanBeNull] Func <IBindingMemberInfo, TTarget, object[], TType> getValueEx, [CanBeNull] Func <IBindingMemberInfo, TTarget, object[], object> setValue = null, [CanBeNull] Func <IBindingMemberInfo, TTarget, IEventListener, IDisposable> observeMemberDelegate = null, Action <TTarget, MemberAttachedEventArgs> memberAttachedHandler = null, object member = null, BindingMemberType memberType = null) where TTarget : class { return(new AttachedBindingMemberInfo <TTarget, TType>(path, typeof(TType), memberAttachedHandler, observeMemberDelegate, getValueEx, null, setValue, null, member, memberType)); }
public static INotifiableAttachedBindingMemberInfo <TTarget, TType> CreateNotifiableMember <TTarget, TType>(BindingMemberDescriptor <TTarget, TType> path, [CanBeNull] Func <IBindingMemberInfo, TTarget, TType> getValue, [NotNull] Func <IBindingMemberInfo, TTarget, TType, bool> setValue, Action <TTarget, MemberAttachedEventArgs> memberAttachedHandler = null, object member = null) where TTarget : class { var observableProperty = new ObservableProperty <TTarget, TType>(setValue); return(new AttachedBindingMemberInfo <TTarget, TType>(path, typeof(TType), memberAttachedHandler, observableProperty.ObserveMember, null, getValue, null, observableProperty.SetValue, member) { RaiseAction = ObservableProperty <TTarget, object> .Raise }); }
public static IAttachedBindingMemberInfo <TTarget, TType> CreateMember <TTarget, TType>(BindingMemberDescriptor <TTarget, TType> path, [CanBeNull] Func <IBindingMemberInfo, TTarget, TType> getValue, [CanBeNull] Action <IBindingMemberInfo, TTarget, TType> setValue, string memberChangeEventName = null, Action <TTarget, MemberAttachedEventArgs> memberAttachedHandler = null, object member = null) where TTarget : class { Func <IBindingMemberInfo, TTarget, IEventListener, IDisposable> observeMember = null; if (!string.IsNullOrEmpty(memberChangeEventName)) { observeMember = ObserveMemberChangeEvent; } return(CreateMember(path, getValue, setValue, observeMember, memberAttachedHandler, member).SetEventName(memberChangeEventName)); }
public static INotifiableAttachedBindingMemberInfo <TTarget, TType> CreateAutoProperty <TTarget, TType>(BindingMemberDescriptor <TTarget, TType> path, TType defaultValue, Action <TTarget, AttachedMemberChangedEventArgs <TType> > memberChangedHandler = null, Action <TTarget, MemberAttachedEventArgs> memberAttachedHandler = null) where TTarget : class { return(new AttachedBindingMemberInfo <TTarget, TType>(path, typeof(TType), memberAttachedHandler, memberChangedHandler, null, defaultValue)); }
public static IAttachedBindingMemberInfo <TTarget, object> CreateEvent <TTarget>(BindingMemberDescriptor <TTarget, IEventListener> path, Func <IBindingMemberInfo, TTarget, IEventListener, IDisposable> setValue, Action <TTarget, MemberAttachedEventArgs> memberAttachedHandler = null) where TTarget : class { return(new AttachedBindingMemberInfo <TTarget, object>(path, typeof(Delegate), memberAttachedHandler, null, null, GetBindingMemberValue, (info, o, arg3) => setValue(info, o, (IEventListener)arg3[0]), null, null, BindingMemberType.Event)); }
public static INotifiableAttachedBindingMemberInfo <TTarget, object> CreateEvent <TTarget>(BindingMemberDescriptor <TTarget, IEventListener> path, Action <TTarget, MemberAttachedEventArgs> memberAttachedHandler = null) where TTarget : class { var eventMember = new AttachedBindingMemberInfo <TTarget, object>(path, typeof(Delegate), memberAttachedHandler, null, null, GetBindingMemberValue, (info, target, arg3) => { return(EventListenerList.GetOrAdd(target, ((IAttachedBindingMemberInternal)info).Id).AddWithUnsubscriber((IEventListener)arg3[0])); }, null, null, BindingMemberType.Event); eventMember.RaiseAction = (m, target, arg3) => EventListenerList.Raise(target, ((IAttachedBindingMemberInternal)m).Id, arg3); return(eventMember); }