public virtual void BindGeneralPreferencesView(IGeneralPreferencesView view) { _generalPreferencesView = view; _generalPreferencesPresenter = Bootstrapper.GetContainer().Resolve<IGeneralPreferencesPresenter>(); _generalPreferencesPresenter.BindView(view); _generalPreferencesView.OnViewDestroy = (view2) => { _generalPreferencesPresenter.ViewDestroyed(); _generalPreferencesPresenter = null; _generalPreferencesView = null; }; }
public virtual IDesktopPreferencesView CreatePreferencesView() { if(_preferencesView != null) { _preferencesView.ShowView(true); return _preferencesView; } Action<IBaseView> onViewReady = (view) => { _audioPreferencesPresenter = Bootstrapper.GetContainer().Resolve<IAudioPreferencesPresenter>(); _audioPreferencesPresenter.BindView((IAudioPreferencesView)view); _cloudPreferencesPresenter = Bootstrapper.GetContainer().Resolve<ICloudPreferencesPresenter>(); _cloudPreferencesPresenter.BindView((ICloudPreferencesView)view); _generalPreferencesPresenter = Bootstrapper.GetContainer().Resolve<IGeneralPreferencesPresenter>(); _generalPreferencesPresenter.BindView((IGeneralPreferencesView)view); _libraryPreferencesPresenter = Bootstrapper.GetContainer().Resolve<ILibraryPreferencesPresenter>(); _libraryPreferencesPresenter.BindView((ILibraryPreferencesView)view); }; _preferencesView = Bootstrapper.GetContainer().Resolve<IDesktopPreferencesView>(new NamedParameterOverloads() { { "onViewReady", onViewReady } }); _preferencesView.OnViewDestroy = (view) => { _preferencesView = null; _audioPreferencesPresenter.ViewDestroyed(); _audioPreferencesPresenter = null; _cloudPreferencesPresenter.ViewDestroyed(); _cloudPreferencesPresenter = null; _generalPreferencesPresenter.ViewDestroyed(); _generalPreferencesPresenter = null; _libraryBrowserPresenter.ViewDestroyed(); _libraryPreferencesPresenter = null; }; return _preferencesView; }