public async void Execute(object parameter) { if (await _repository.DeleteRole(_role)) { var window = parameter as Window; if (window != null) { window.Close(); } } }