55using  System . Windows . Input ; 
66using  Microsoft . Vbe . Interop ; 
77using  Ninject ; 
8+ using  Rubberduck . Parsing . VBA ; 
89using  Rubberduck . Settings ; 
910using  Rubberduck . SourceControl ; 
1011using  Rubberduck . UI . Command ; 
@@ -15,6 +16,7 @@ namespace Rubberduck.UI.SourceControl
1516    public  class  SourceControlViewViewModel  :  ViewModelBase 
1617    { 
1718        private  readonly  VBE  _vbe ; 
19+         private  readonly  RubberduckParserState  _state ; 
1820        private  readonly  ISourceControlProviderFactory  _providerFactory ; 
1921        private  readonly  IFolderBrowserFactory  _folderBrowserFactory ; 
2022        private  readonly  IConfigurationService < SourceControlConfiguration >  _configService ; 
@@ -23,6 +25,7 @@ public class SourceControlViewViewModel : ViewModelBase
2325
2426        public  SourceControlViewViewModel ( 
2527            VBE  vbe , 
28+             RubberduckParserState  state , 
2629            ISourceControlProviderFactory  providerFactory , 
2730            IFolderBrowserFactory  folderBrowserFactory , 
2831            IConfigurationService < SourceControlConfiguration >  configService , 
@@ -33,9 +36,12 @@ public SourceControlViewViewModel(
3336            ICodePaneWrapperFactory  wrapperFactory ) 
3437        { 
3538            _vbe  =  vbe ; 
39+             _state  =  state ; 
3640            _providerFactory  =  providerFactory ; 
3741            _folderBrowserFactory  =  folderBrowserFactory ; 
3842
43+             _state . StateChanged  +=  _state_StateChanged ; 
44+ 
3945            _configService  =  configService ; 
4046            _config  =  _configService . LoadConfiguration ( ) ; 
4147            _wrapperFactory  =  wrapperFactory ; 
@@ -63,6 +69,14 @@ public SourceControlViewViewModel(
6369            ListenForErrors ( ) ; 
6470        } 
6571
72+         private  void  _state_StateChanged ( object  sender ,  ParserStateEventArgs  e ) 
73+         { 
74+             if  ( e . State  ==  ParserState . Parsed ) 
75+             { 
76+                 Refresh ( ) ; 
77+             } 
78+         } 
79+ 
6680        private  ISourceControlProvider  _provider ; 
6781        public  ISourceControlProvider  Provider 
6882        { 
0 commit comments