33using System . Threading . Tasks ;
44using System . Windows ;
55using System . Windows . Input ;
6+ using System . Windows . Threading ;
67using Ookii . Dialogs . Wpf ;
78using Solutionizer . Framework ;
89using Solutionizer . Infrastructure ;
910using Solutionizer . Services ;
1011
1112namespace Solutionizer . ViewModels {
12- public sealed class ShellViewModel : PropertyChangedBase , IShell , IOnLoadedHandler {
13+ public sealed class ShellViewModel : PropertyChangedBase , IShell , IOnLoadedHandler , IStatusMessenger {
1314 private readonly ISettings _settings ;
1415 private readonly IDialogManager _dialogManager ;
1516 private readonly IFlyoutManager _flyoutManager ;
@@ -24,6 +25,7 @@ public sealed class ShellViewModel : PropertyChangedBase, IShell, IOnLoadedHandl
2425 private readonly ICommand _showSettingsCommand ;
2526 private readonly ICommand _showAboutCommand ;
2627 private readonly ICommand _selectRootPathCommand ;
28+ private string _statusMessage ;
2729
2830 public ShellViewModel ( ISettings settings , IDialogManager dialogManager , IFlyoutManager flyoutManager , IUpdateManager updateManager , IViewModelFactory viewModelFactory ) {
2931 _settings = settings ;
@@ -143,9 +145,24 @@ private async void LoadProjects(string path) {
143145 _projectRepository . RootPath = path ;
144146 _projectRepository . RootFolder = result . ProjectFolder ;
145147 Solution = _viewModelFactory . CreateSolutionViewModel ( path , result . Projects ) ;
148+ Show ( String . Format ( "{0} projects loaded." , result . Projects . Count ) ) ;
146149 } else {
147150 RootPath = oldRootPath ;
148151 }
149152 }
153+
154+ public void Show ( string status ) {
155+ StatusMessage = status ;
156+ }
157+
158+ public string StatusMessage {
159+ get { return _statusMessage ; }
160+ set {
161+ if ( _statusMessage != value ) {
162+ _statusMessage = value ;
163+ NotifyOfPropertyChange ( ( ) => StatusMessage ) ;
164+ }
165+ }
166+ }
150167 }
151168}
0 commit comments