private void Close (bool shouldSaveNewOptions)
{
if (shouldSaveNewOptions)
{
IOptionsViewModel firstViewModelWithError;
string errorMessage;
if (!Validate (out errorMessage, out firstViewModelWithError))
{
_uiService.ShowErrorDialog (errorMessage, "Some Options contain invalid Values");
if (firstViewModelWithError != null)
firstViewModelWithError.IsSelected = true;
return;
}
}
CloseRequested?.Invoke (this, new CloseEventArgs (shouldSaveNewOptions));
}