public virtual void BindLibraryPreferencesView(ILibraryPreferencesView view)
 {
     _libraryPreferencesView = view;
     _libraryPreferencesPresenter = Bootstrapper.GetContainer().Resolve<ILibraryPreferencesPresenter>();
     _libraryPreferencesPresenter.BindView(view);
     _libraryPreferencesView.OnViewDestroy = (view2) =>
     {
         _libraryPreferencesPresenter.ViewDestroyed();
         _libraryPreferencesPresenter = null;
         _libraryPreferencesView = null;
     };            
 }
Beispiel #2
0
 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;
 }