public void Detach(VMElement eventSubscriber) { for (int i = _modelSubscribers.Count - 1; i >= 0; i--) { if ((_modelSubscribers[i].Target == eventSubscriber) || (_modelSubscribers[i].Target == null)) { _modelSubscribers.RemoveAt(i); } } eventSubscriber.WeakOnPropertyChanged.DetachEvent(_sourceElement); }
public Validator(VMElement elem) { _e = elem; }
internal void DetachEvent(VMElement eventSource) { _handlers.Remove(eventSource); }
internal void AttachEvent(VMElement eventSource, PropertyChangedEventHandler eventHandler) { _handlers[eventSource] = eventHandler; }
public void Attach(VMElement eventSubscriber, PropertyChangedEventHandler eventHandler) { _modelSubscribers.Add(new WeakReference(eventSubscriber)); eventSubscriber.WeakOnPropertyChanged.AttachEvent(_sourceElement, eventHandler); }
public WeakPropertyObserver(VMElement sourceElement) { _sourceElement = sourceElement; }