internal virtual void OnPresenterRemoved(ChartElementPresenter presenter) { if (this.renderSurface == null) { this.unattachedPresenters.Remove(presenter); return; } this.renderSurface.Children.Remove(presenter); presenter.Detach(); this.InvalidateOnPresenterChanged(); }
/// <inheritdoc/> protected override void UnapplyTemplateCore() { base.UnapplyTemplateCore(); foreach (UIElement child in this.renderSurface.Children) { ChartElementPresenter presenter = child as ChartElementPresenter; if (presenter != null) { presenter.Detach(); } this.unattachedPresenters.Add(presenter); } this.renderSurface.Children.Clear(); this.OnUnloadedPartial(); }