/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public void Dispose() { if (Interlocked.Exchange(ref _lazyContext, DataContext.Empty) == DataContext.Empty) { return; } OnDispose(); BindingServiceProvider.BindingManager.Unregister(this); BindingUpdated = null; BindingException = null; _behaviors.Clear(); _sourceAccessor.Dispose(); _targetAccessor.Dispose(); }
public void Dispose() { if (Interlocked.Exchange(ref _lazyContext, DataContext.Empty) == DataContext.Empty) { return; } OnDispose(); BindingServiceProvider.BindingManager.Unregister(this); BindingUpdated = null; ((ICollection <IBindingBehavior>) this).Clear(); _sourceAccessor.Dispose(); _targetAccessor.Dispose(); if (_targetAccessor.Source.Path.IsDebuggable) { DebugInfo("Binding disposed"); } }