private void TryRegisterEvent(BindingActionValue bindingActionValue, object newValue, IDataContext context, IBindingPathMembers pathMembers) { if (newValue == null && _closure == null) { return; } if (_closure == null) { Interlocked.CompareExchange(ref _closure, new EventClosure(_bindingSource, _toggleEnabledState && IsTarget, Parameters?.CommandParameterDelegate), null); } _closure.LastContext = context; _closure.SetValue(bindingActionValue, newValue, pathMembers); }
private void TryRegisterEvent(BindingMemberValue bindingMemberValue, object newValue, IDataContext context) { if (newValue == null && _closure == null) { return; } if (_closure == null) { Interlocked.CompareExchange(ref _closure, new EventClosure(ServiceProvider.WeakReferenceFactory(this, true), _toggleEnabledState), null); } _closure.LastContext = context; _closure.SetValue(bindingMemberValue, newValue); }