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