Refactor GQL code. Auto load and save active shops. Auto start monitors.

This commit is contained in:
Patrick Fic
2020-01-20 15:42:59 -08:00
parent bc5cb13113
commit fa75c58633
11 changed files with 166 additions and 68 deletions

View File

@@ -79,9 +79,9 @@ namespace BodyshopUploader.ViewModels
if (_startFolderMonitorsCommand == null)
{
_startFolderMonitorsCommand = new RelayCommand(
p => MonitoringPaths.Count > 0,
p => MonitoringPaths.Count > 0 && ActiveShop != null,
p => StartAllFolderMonitors()
);
) ;
}
return _startFolderMonitorsCommand;
}
@@ -102,5 +102,24 @@ namespace BodyshopUploader.ViewModels
return _stopFolderMonitorsCommand;
}
}
private ICommand _quitCommand;
public ICommand QuitCommand
{
get
{
if (_quitCommand == null)
{
_quitCommand = new RelayCommand(
p => true,
p =>
{
Properties.Settings.Default.Save(); App.Current.Shutdown(0);
});
}
return _quitCommand;
}
}
}
}