Button.onClick with custom variables

So I wanted to assign my method to button onClick action, and it is possible only if I have methods like test() or test(ina a), but I have a method that looks like that:

            public void TurnPageOn(PageType _type) {
                if (_type == PageType.None) return;
                if (!PageExists(_type)) {
                    LogWarning("You are trying to turn a page on ["+_type+"] that has not been registered.");
                    return;
                }

                Page _page = GetPage(_type);
                _page.gameObject.SetActive(true);
                _page.Animate(true);
            }

so I just don’t see it on the list of methods to choose for button action, how can I assign it then to button action?

If you dont need see them in inspector

button.onClick.AddListener(() => { Function(param); OtherFunction(param); });

Attached is a basic example of populating a UI with buttons at runtime.

It decides how many buttons to make based on how many Sprites it finds in a given directory via Resources.LoadAll(): put more sprites in that directory, get more UI buttons!

8494565–1130474–DynamicUIDemo.unitypackage (55.7 KB)