Associate functions to buttons via parameters

I have a view that I want to use in multiple ways, it's nothing more than a popup with a message and two commands, one that closes the view itself and one that I want to parameterize so that I can use it multiple times.

Thank you i will try it