public void OnViewRemove(IView view) { if (!_mediators.TryGetValue(view, out var mediator)) { throw new MediationException(MediationExceptionType.ViewInstanceNotFoundForRemoval, view.GetType().FullName); } if (mediator != null) { _injectionBinder.Destroy(mediator, true); } _injectionBinder.Destroy(view, true); _mediators.Remove(view); }
public static T Destroy <T>(this T instance, IInjectionBinder injectionBinder, bool triggerPreDestroys) where T : class { injectionBinder.Destroy(instance, triggerPreDestroys); return(null); }