private void OnRemove(Object obj) { //sending command to the imageservice client to close the directory handler CommandRecievedEventArgs command = new CommandRecievedEventArgs((int)CommandEnum.CloseCommand, null, chosenDir); settingsModel.CommandToServer(command); settingsModel.RemoveDirectory(chosenDir); }